Control feed with poti

More
23 Dec 2021 09:43 #229801 by meandreas72
Control feed with poti was created by meandreas72
Hi there,
i'm new to linuxcnc. I have already built an operational milling machine.
With mesa 7i76e and Linuxcnc 2.8
I don't know how to control the feed with an external potentiometer. I don't know what the HAL should look like.
Can someone help me?
Greetings Andreas

Please Log in or Create an account to join the conversation.

More
24 Dec 2021 18:12 #229912 by Michael
Replied by Michael on topic Control feed with poti
I have seen 2 different ways to do this using HALUI component. If you are using Axis as your GUI then it is a bit limited in its interaction with external controls but other GUI's have more options. The below options work for any GUI as it uses HALUI.
linuxcnc.org/docs/2.8/html/man/man1/halui.1.html

You can use a potentiometer to change the feedrate override by connecting it to an analog input then converting that float value to an S32 and feeding it into halui.feed-override.counts This post details more information about the hal setup for that.
162.243.45.186/38-general-linuxcnc-quest...1-poti-for-overrides

The draw back is that upon restart linuxcnc sets the slider value on screen at 100% and you would need to move the pot to change the value if the knob displays something other than 100%


The other option is to use a simple encoder to manipulate the feed rate override displayed in the GUI. When the knob is moved it will scale the feedrate based off your HAL settings. Since the encoder is not high speed it can be wired into any 2 simple input channels. and use a simulated encoder to convert the values.
forum.linuxcnc.org/27-driver-boards/3401...pe-for-7i77?start=10

Here is my HAL for a simple encoder:
# --- Feed Override ---

loadrt encoder    num_chan=4

addf encoder.update-counters    servo-thread
addf encoder.capture-position    servo-thread

setp encoder.0.x4-mode 1

net feed-chA        <=  hm2_7i92.0.7i84.0.2.input-24
net feed-chA        =>  encoder.0.phase-A

net feed-chB        <=  hm2_7i92.0.7i84.0.2.input-25
net feed-chB        =>  encoder.0.phase-B

net feed-output        <=  encoder.0.counts
net feed-output        =>  halui.feed-override.counts

setp halui.feed-override.count-enable 1
setp halui.feed-override.scale .1
 

Please Log in or Create an account to join the conversation.

More
25 Dec 2021 10:36 #229952 by meandreas72
Replied by meandreas72 on topic Control feed with poti
Hi Michael,
Thanks for your help. I will try that.
Greetings Andreas

Please Log in or Create an account to join the conversation.

More
01 Feb 2022 18:16 #233725 by meandreas72
Replied by meandreas72 on topic Control feed with poti
Hello Michael, what does the circuitry for the inputs look like? A normal pulse generator outputs a minus signal.How do I control the inputs? Dear Andreas

Please Log in or Create an account to join the conversation.

Time to create page: 0.059 seconds
Powered by Kunena Forum