Jogwheels won´t jog
- Onkelmat
-
Topic Author
- Offline
- Premium Member
-
Less
More
- Posts: 92
- Thank you received: 4
19 Jul 2026 14:37 #347841
by Onkelmat
Jogwheels won´t jog was created by Onkelmat
It´s a me again.
So far I got the Gildemeister NEF 500 Plus Lathe running again, with the keyboard i was even able to make some chips. Homing now works since the updated version of Pncconfig wizard seems to have a few bugs left for the 7i97T. On bug for example is, inputs that are "inmux.00" are named "in.00" in the .ini or .hal, not sure right now but that occured every single time i changed something with the wizard.
But let´s get back to the problem I´m facing now. Trust me, searched two whole days to find a solution bymyselfe.
Here´s the physical setup where i´m coming from:
i have two Handwheels on my machine, they have A /A b /B signals, and are wired to encoder 03 and encoder 04. In Halshow i can see the hm2_7i797.0.encoder.03.count corresponding to each wheel. That worked right away.
The wheels should be always enabled, except when running a command or a programm. The wheels are fixed to their axis. 03 is for Z axis and 04 is for X Axis.
I copied and wrote tons of .hal lines but nothing seems to get the axis moving when i´m turning the wheels. I tried to set all enables that are somehow related to axis jogging to true in Halshow. nothing worked. In the documentation the link is broken to that one site for hooking a jogwheel. And every code i copied was obsolote, since the names of the pins and this has changed. I end up with "pin doesn´t exsist" all the time. You don´t have to tell me the whole solution, but i´d like to understand the mechanics behind Jogwheels and Axis jogging, how do i link the jogwheel count to the axis count so it moves ?
So far I got the Gildemeister NEF 500 Plus Lathe running again, with the keyboard i was even able to make some chips. Homing now works since the updated version of Pncconfig wizard seems to have a few bugs left for the 7i97T. On bug for example is, inputs that are "inmux.00" are named "in.00" in the .ini or .hal, not sure right now but that occured every single time i changed something with the wizard.
But let´s get back to the problem I´m facing now. Trust me, searched two whole days to find a solution bymyselfe.
Here´s the physical setup where i´m coming from:
i have two Handwheels on my machine, they have A /A b /B signals, and are wired to encoder 03 and encoder 04. In Halshow i can see the hm2_7i797.0.encoder.03.count corresponding to each wheel. That worked right away.
The wheels should be always enabled, except when running a command or a programm. The wheels are fixed to their axis. 03 is for Z axis and 04 is for X Axis.
I copied and wrote tons of .hal lines but nothing seems to get the axis moving when i´m turning the wheels. I tried to set all enables that are somehow related to axis jogging to true in Halshow. nothing worked. In the documentation the link is broken to that one site for hooking a jogwheel. And every code i copied was obsolote, since the names of the pins and this has changed. I end up with "pin doesn´t exsist" all the time. You don´t have to tell me the whole solution, but i´d like to understand the mechanics behind Jogwheels and Axis jogging, how do i link the jogwheel count to the axis count so it moves ?
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 199
- Thank you received: 33
19 Jul 2026 18:36 #347845
by tuxcnc
Replied by tuxcnc on topic Jogwheels won´t jog
Thank you very much.
I have been planning to add encoder support as mpg for a long time, but it was not my priority because I do not have the appropriate equipment.
But today you gave me an opportunity, so I connected a regular encoder to 7i92 and performed tests.
In the condition as below, you can move the X axis by turning the encoder, but only after the axis has been referenced.
I haven't tested any more because I don't want to look for and solder switches right now, but judging by the code it must work.
(The setp axis.x.jog-enable 1 line is for testing only and should be removed afterwards.)
I have been planning to add encoder support as mpg for a long time, but it was not my priority because I do not have the appropriate equipment.
But today you gave me an opportunity, so I connected a regular encoder to 7i92 and performed tests.
In the condition as below, you can move the X axis by turning the encoder, but only after the axis has been referenced.
I haven't tested any more because I don't want to look for and solder switches right now, but judging by the code it must work.
(The setp axis.x.jog-enable 1 line is for testing only and should be removed afterwards.)
loadrt mux4
addf mux4.0 servo-thread
# For velocity mode, set to 1
# In velocity mode the axis stops when the dial is stopped
# even if that means the commanded motion is not completed,
# For position mode (the default), set to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.x.jog-vel-mode 1
setp axis.y.jog-vel-mode 1
setp axis.z.jog-vel-mode 0
# The Axis select inputs
# Line bellow is for testing only. For normal use remove it and uncomment next.
setp axis.x.jog-enable 1
#net mpg-x axis.x.jog-enable <= hm2_7i92.0.gpio.026.in_not
net mpg-y axis.y.jog-enable <= hm2_7i92.0.gpio.030.in_not
net mpg-z axis.z.jog-enable <= hm2_7i92.0.gpio.031.in_not
# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= hm2_7i92.0.gpio.016.in_not
net scale2 mux4.0.sel1 <= hm2_7i92.0.gpio.015.in_not
# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.025
setp mux4.0.in1 0.0025
setp mux4.0.in2 0.00025
# The output from the mux4 is sent to each axis jog scale
net mpg-scale mux4.0.out => axis.x.jog-scale axis.y.jog-scale axis.z.jog-scale
# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts hm2_7i92.0.encoder.00.count => axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts
The following user(s) said Thank You: Onkelmat
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18006
- Thank you received: 5289
19 Jul 2026 23:22 #347854
by PCW
Replied by PCW on topic Jogwheels won´t jog
To jog before homing you need to connect the joint jog pins the same as the axis jog pins
That is for example if X is joint 0, you would connect these pins
to the same sources as the X jog pins:
joint.0.jog-counts
joint.0.jog-scale
joint.0.jog-enable
joint.0.jog-vel-mode
That is for example if X is joint 0, you would connect these pins
to the same sources as the X jog pins:
joint.0.jog-counts
joint.0.jog-scale
joint.0.jog-enable
joint.0.jog-vel-mode
The following user(s) said Thank You: tuxcnc
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 199
- Thank you received: 33
20 Jul 2026 16:26 - 20 Jul 2026 16:34 #347879
by tuxcnc
Replied by tuxcnc on topic Jogwheels won´t jog
I corrected and tested it. A few words of explanation:
The 7i92 inputs are controlled by a short to ground. If none of the axis selection inputs is shorted to ground, then none of the axis moves, if one or several, the selected axes move.
I added the line "setp mux4.0.in3 0"
If both coefficient selection signals are shorted to ground, the axis will move, but at zero speed, so the effect will be the same as if no axis was selected. (You can change it to "setp mux4.0.in0 0", then there will be no movement when no selection input is shorted to ground).
I did this to have a wider selection of supported switches. It is possible that someone will have, for example, four axes and a four-position switch, then they would not be able to select the "no axis" option, which is necessary.
It is also worth mentioning how to control two inputs with a single-section switch.
You need to use diodes (anode for the input of the mesa, cathode for the switch). Then, a short circuit to ground of one input does not affect the status of the other inputs. I won't describe it in detail, if someone needs it, they will find it.
The 7i92 inputs are controlled by a short to ground. If none of the axis selection inputs is shorted to ground, then none of the axis moves, if one or several, the selected axes move.
I added the line "setp mux4.0.in3 0"
If both coefficient selection signals are shorted to ground, the axis will move, but at zero speed, so the effect will be the same as if no axis was selected. (You can change it to "setp mux4.0.in0 0", then there will be no movement when no selection input is shorted to ground).
I did this to have a wider selection of supported switches. It is possible that someone will have, for example, four axes and a four-position switch, then they would not be able to select the "no axis" option, which is necessary.
It is also worth mentioning how to control two inputs with a single-section switch.
You need to use diodes (anode for the input of the mesa, cathode for the switch). Then, a short circuit to ground of one input does not affect the status of the other inputs. I won't describe it in detail, if someone needs it, they will find it.
loadrt mux4
addf mux4.0 servo-thread
# For velocity mode, set to 1
# In velocity mode the axis stops when the dial is stopped
# even if that means the commanded motion is not completed,
# For position mode (the default), set to 0
# In position mode the axis will move exactly jog-scale
# units for each count, regardless of how long that might take,
setp axis.x.jog-vel-mode 1
setp axis.y.jog-vel-mode 1
setp axis.z.jog-vel-mode 0
setp joint.0.jog-vel-mode 1
setp joint.1.jog-vel-mode 1
setp joint.2.jog-vel-mode 0
# The Axis select inputs
net mpg-x joint.0.jog-enable axis.x.jog-enable <= hm2_7i92.0.gpio.033.in_not
net mpg-y joint.1.jog-enable axis.y.jog-enable <= hm2_7i92.0.gpio.032.in_not
net mpg-z joint.2.jog-enable axis.z.jog-enable <= hm2_7i92.0.gpio.031.in_not
# The inputs to the mux4 component
net scale1 mux4.0.sel0 <= hm2_7i92.0.gpio.030.in_not
net scale2 mux4.0.sel1 <= hm2_7i92.0.gpio.029.in_not
# This sets the scale that will be used based on the input to the mux4
setp mux4.0.in0 0.025
setp mux4.0.in1 0.0025
setp mux4.0.in2 0.00025
setp mux4.0.in3 0
# The output from the mux4 is sent to each axis jog scale
net mpg-scale mux4.0.out => axis.x.jog-scale axis.y.jog-scale axis.z.jog-scale
net mpg-scale => joint.0.jog-scale joint.1.jog-scale joint.2.jog-scale
# The encoder output counts to the axis. Only the selected axis will move.
net encoder-counts hm2_7i92.0.encoder.00.count => axis.x.jog-counts axis.y.jog-counts axis.z.jog-counts
net encoder-counts => joint.0.jog-counts joint.1.jog-counts joint.2.jog-counts
Last edit: 20 Jul 2026 16:34 by tuxcnc. Reason: typo
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 12054
- Thank you received: 4114
20 Jul 2026 20:33 #347889
by rodw
Replied by rodw on topic Jogwheels won´t jog
There is also a good MPG example in the docs except in Mesa land, you don't use the encoder component
linuxcnc.org/docs/stable/html/examples/mpg.html
Not sure on the 7i97 but there are some dedicated MPG pins on the Mesa 7i76e (and for the 7i96 if you use the right bit file and give up some pins.
linuxcnc.org/docs/stable/html/examples/mpg.html
Not sure on the 7i97 but there are some dedicated MPG pins on the Mesa 7i76e (and for the 7i96 if you use the right bit file and give up some pins.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18006
- Thank you received: 5289
20 Jul 2026 20:42 #347890
by PCW
Replied by PCW on topic Jogwheels won´t jog
Yes, the 7I97/7I97T have 8 dedicated MPG pins on the isolated inputs (inputs 0 ..7)
The four MPG counter names are:
hm2_7i97.0.inmux.00.enc0-count
hm2_7i97.0.inmux.00.enc1-count
hm2_7i97.0.inmux.00.enc2-count
hm2_7i97.0.inmux.00.enc3-count
One advantage of the MPG encoders over the normal high speed encoders
is that the MPG encoders support the 1X mode, which means you get one increment
per click on standard 100 PPR MPG dials.
The four MPG counter names are:
hm2_7i97.0.inmux.00.enc0-count
hm2_7i97.0.inmux.00.enc1-count
hm2_7i97.0.inmux.00.enc2-count
hm2_7i97.0.inmux.00.enc3-count
One advantage of the MPG encoders over the normal high speed encoders
is that the MPG encoders support the 1X mode, which means you get one increment
per click on standard 100 PPR MPG dials.
The following user(s) said Thank You: rodw
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 199
- Thank you received: 33
21 Jul 2026 03:43 #347902
by tuxcnc
Standard encoders have no clicks...
In mpg encoder's count is scaled and can be divided by four...
Replied by tuxcnc on topic Jogwheels won´t jog
One advantage of the 1X mode is lack of direction information...One advantage of the MPG encoders over the normal high speed encoders
is that the MPG encoders support the 1X mode, which means you get one increment
per click on standard 100 PPR MPG dials.
Standard encoders have no clicks...
In mpg encoder's count is scaled and can be divided by four...
Please Log in or Create an account to join the conversation.
Time to create page: 0.586 seconds