Joystick not working after all axis are homed [FIXED]

More
08 May 2019 14:02 #133142 by paulctan
Joystick implemented using wiki.linuxcnc.org/cgi-bin/wiki.pl?Simple_Remote_Pendant . Joystick was working on previous Linuxcnc 2.7 setup. Rebuilt new machine and moved the joystick over and modified code to work with Linuxcnc 2.8.

Joystick works fine in new setup, except when all Axis are homed! Joystick works when I home Z (X & Y not homed). Joystick works when I home Z & X (Y not homed). Joystick stops working when Z & X & Y are all homed. Joystick works again when I press the unhomed button.

Halmeter show the joystick signal joy-x-jog, joy-y-jog, joy-z-jog to be working even when fully homed, but the table is not moving.


Can someone help? Thanks!

Paul Tan.


cnc@cnc1:~/linuxcnc/configs/Taig$ cat custom_postgui.hal
# Include your custom_postgui HAL commands here
# This file will not be overwritten when you run PNCconf again



loadrt or2 count=2
loadrt mux4 count=1
addf or2.0 servo-thread
addf or2.1 servo-thread
addf mux4.0 servo-thread

# set the jog speed for the joypad again use numbers that make sense for your machine
setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
setp mux4.0.in1 1
setp mux4.0.in2 20
setp mux4.0.in3 40

# the following does the magic of setting the jog speeds
net remote-speed-slow or2.0.in0 input.0.btn-joystick
net remote-speed-medium or2.1.in0 input.0.btn-thumb
net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
net joy-speed-1 mux4.0.sel0 <= or2.0.out
net joy-speed-2 mux4.0.sel1 <= or2.1.out
net joy-speed-final halui.joint.jog-speed <= mux4.0.out

setp input.0.abs-x-scale -127.5
setp input.0.abs-rz-scale -127.5

net joy-x-jog halui.joint.0.analog <= input.0.abs-x-position
net joy-y-jog halui.joint.1.analog <= input.0.abs-y-position
net joy-z-jog halui.joint.2.analog <= input.0.abs-rz-position

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

More
08 May 2019 15:46 - 08 May 2019 15:46 #133158 by andypugh
This is a surprisingly easy fix :-)

As well as linking your joystick jog signals to the _joint_ jogging pins, you also need to connect them to the _axis_ jogging pins.

something like
net jog-x-analogue halui.joint.0.analog  halui.axis.x.analog
Last edit: 08 May 2019 15:46 by andypugh.

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

More
08 May 2019 15:48 - 08 May 2019 15:48 #133159 by PCW
You need to jog axis after homing, not joints so you probably need to drive the
appropriate halui axis jog pins from your input.0.abs-N-position pins in addition to the joint jog pins
Last edit: 08 May 2019 15:48 by PCW. Reason: spell a little better

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

More
08 May 2019 16:36 #133165 by paulctan
Tried it, it didn't work. Same behavior - Joystick works before homing all the axis, stops working after all axis are homed. Jog button on gmoccapy screen still works after homing. I did the following change:

setp input.0.abs-x-scale -127.5
setp input.0.abs-rz-scale -127.5

#net joy-x-jog halui.joint.0.analog <= input.0.abs-x-position
#net joy-y-jog halui.joint.1.analog <= input.0.abs-y-position
#net joy-z-jog halui.joint.2.analog <= input.0.abs-rz-position

net jog-x-analog halui.joint.0.analog halui.axis.x.analog input.0.abs-x-position
net jog-y-analog halui.joint.1.analog halui.axis.y.analog input.0.abs-y-position
net jog-z-analog halui.joint.2.analog halui.axis.z.analog input.0.abs-rz-position

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

More
08 May 2019 16:39 #133166 by PCW
is " axis.L.jog-enable" true?

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

More
08 May 2019 16:52 #133170 by paulctan
Didn't check " axis.L.jog-enable", but this FINALLY worked:
#net joy-speed-final halui.joint.jog-speed <= mux4.0.out
net jog-speed halui.joint.jog-speed halui.axis.jog-speed <= mux4.0.out

I joined halui.joint.jog-speed to halui.axis.jog-speed.

For anyone needing this again, here's the full file that works:
loadrt or2 count=2
loadrt mux4 count=1
addf or2.0 servo-thread
addf or2.1 servo-thread
addf mux4.0 servo-thread

# set the jog speed for the joypad again use numbers that make sense for your machine
setp mux4.0.in0 0 # this one must be 0 to prevent motion unless a button is pressed
setp mux4.0.in1 1
setp mux4.0.in2 20
setp mux4.0.in3 40

# the following does the magic of setting the jog speeds
net remote-speed-slow or2.0.in0 input.0.btn-joystick
net remote-speed-medium or2.1.in0 input.0.btn-thumb
net remote-speed-fast or2.0.in1 or2.1.in1 input.0.btn-thumb2
net joy-speed-1 mux4.0.sel0 <= or2.0.out
net joy-speed-2 mux4.0.sel1 <= or2.1.out
#net joy-speed-final halui.joint.jog-speed <= mux4.0.out
net jog-speed halui.joint.jog-speed halui.axis.jog-speed <= mux4.0.out

setp input.0.abs-x-scale -127.5
setp input.0.abs-rz-scale -127.5

#net joy-x-jog halui.joint.0.analog <= input.0.abs-x-position
#net joy-y-jog halui.joint.1.analog <= input.0.abs-y-position
#net joy-z-jog halui.joint.2.analog <= input.0.abs-rz-position

net jog-x-analog halui.joint.0.analog halui.axis.x.analog input.0.abs-x-position
net jog-y-analog halui.joint.1.analog halui.axis.y.analog input.0.abs-y-position
net jog-z-analog halui.joint.2.analog halui.axis.z.analog input.0.abs-rz-position

Thanks everyone for helping!

One more quick question though - where's the best place to find the up to date documentation on LinuxCNC 2.8? I'm finding the docs still reference the old 2.7 HAL.
The following user(s) said Thank You: fredo550

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

More
Time to create page: 0.111 seconds
Powered by Kunena Forum