Trying to get analog joystick to control jogging

  • peterdownunder
  • Away
  • Junior Member
  • Junior Member
More
05 May 2026 01:42 #346164 by peterdownunder
Trying to get analog joystick to control jogging was created by peterdownunder
Trying to get analog jogging working on gmoccapy, linuxcnc 2.9.3 with mesa card.
Have followed a few separate threads and have com up with the following .starting with just the x-axis. The analog out from the mesa is approx 0 to 5v

 loadrt mux2 names=mux2_x,mux2_y,mux2_z
addf mux2_x servo-thread
addf mux2_y servo-thread
addf mux2_z servo-thread

loadrt and2 names=and-jog
addf and-jog servo-thread

loadrt deadzone names=deadzone-x
addf deadzone-x servo-thread

loadrt scale names=scale.x
addf scale.x servo-thread

setp scale.x.offset -1.00
setp scale.x.gain .416
net x-scale <= hm2_7i76e.0.7i76.0.0.analogin0 => scale.x.in
net gate-x-scale <= scale.x.out => mux2_x.in1 
net x-is-homed <= halui.joint.0.is-homed

net machine-is-on <= halui.machine.is-on => and-jog.in0
net x-is-homed => and-jog.in1 
net jog-allowed <= and-jog.out => mux2_x.sel

setp deadzone-x.threshold 0.1
net mux-x mux2_x.out => deadzone-x.in

net jog-x-analog deadzone-x.out => halui.joint.0.analog halui.axis.x.analog
setp halui.mode.manual 1
setp halui.joint.0.select 1

Am getting halui.joint.0.analog going from +1 to -1 ok and seems to be gated correctly if I unhome X.
Was getting
error: command [EMC_JOG_STOP] cannot be executed until the machine is out of E-Stop and turned on
when I didn't have the gating correct so it appears to be getting through to some extent 

I also seem to have a problem wit deadzone as configured above. It is letting through values like .006 when threshold is .1. If I change it to .2 it seems to behave better

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

Time to create page: 0.053 seconds
Powered by Kunena Forum