Joypad Reverse Jog Direction

More
25 May 2024 18:22 #301429 by Project_Hopeless
I have an Axis sim running for a 5-DOF robot and a Logitech F310 Joypad.  It works well except the jog directions are backwards. 

So following this wiki,
wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant

I added the instruction...
setp input.0.abs-hat0y-scale -127.5 

Now when I hold in the jog speed buttons the machine immediately moves without me touching the X, Y, or Z joysticks.

I'm running Linux CNC-Robot 6.1.0-18-rt-amd64 #1 SMP PREEMPT_RT Debian 6.1.76-1 (2024-02-01) x86_64 GNU/Linux on Bookworm

Any ideas what might be wrong?
# names moved to moveo_cmd.hal  
##loadrt mux2 names=mux2_x,mux2_y,mux2_z
 
addf mux2_x servo-thread
addf mux2_y servo-thread
addf mux2_z servo-thread
 
#
# Use a mux as a sample hold so analog jogs don't change when machine is off.
#
net machine-is-on <= halui.machine.is-on => mux2_x.sel mux2_y.sel mux2_z.sel  # Control the mux with the machine on/off state.
 
net jog-x-pre <= input.0.abs-hat0y-position => mux2_x.in1    # left joystick
net jog-y-pre <= input.0.abs-hat0x-position => mux2_y.in1    # left joystick
##net jog-z-pre <= input.0.abs-rz-position => mux2_z.in1     # rz feels more natural.
net jog-z-pre <= input.0.abs-ry-position => mux2_z.in1        # right joystick
 
net jog-x-analog <= mux2_x.out => mux2_x.in0 halui.joint.0.analog halui.axis.x.analog  
net jog-y-analog <= mux2_y.out => mux2_y.in0 halui.joint.1.analog halui.axis.y.analog  
net jog-z-analog <= mux2_z.out => mux2_z.in0 halui.joint.2.analog halui.axis.z.analog  
 
setp input.0.abs-hat0y-scale -127.5        # reverse jog direction
setp input.0.abs-hat0x-scale -127.5        # reverse jog direction
setp input.0.abs-ry-scale -127.5        # reverse jog direction

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

More
25 May 2024 18:52 #301434 by andypugh
Try monitoring the pins in the halshow watch window to see whether they are permanently at some non-zero value.

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

More
25 May 2024 22:16 - 25 May 2024 22:17 #301447 by Project_Hopeless
Hal watch with standard joypad assignments.

 

Hal watch with the statements to reverse X, Y, Z (hat.0.x, hat.0.y, abs.ry)

 

Is the scale value applied wrong perhaps?
Attachments:
Last edit: 25 May 2024 22:17 by Project_Hopeless.

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

More
25 May 2024 23:39 #301453 by andypugh
Well, you have changed the sign, which is good, but it looks like the scale is much too high.

Just change it to the negative of what it was before. If it was 1, make it -1.

If you don't know, then try -1, and increase from there as needed.

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

More
27 May 2024 01:00 #301537 by Project_Hopeless
I'm good now, it was the number of bits, I found the answer in another post. 

forum.linuxcnc.org/24-hal-components/419...-x-and-y-axis#203090

Apparently the problem was in the number of bits of the number. I've gone from 8 bits to 16.
So
- setp input.0.abs-y-scale -32767.5
- setp input.0.abs-ry-scale -32767.5

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

Time to create page: 0.150 seconds
Powered by Kunena Forum