Integrating Joystick Control (Logitech Wireless Gmpd F710) with axis selection

More
18 Jul 2024 12:44 #305572 by mighty_mick
 
 
Hello folks.
In these days, i am trying to integrate joystick control to my system. My machine has 5 axises. (3 linear + 2 angular). Since the joystick control has limited controls, i wanna use it efficient. This is my method,

The right joystick will control Z axis in horizontal direction(I've already done it, you can check it on uploaded hal file.) But vertical direction will be different. I wanna be able to jog any axis except Z axis with this joystick. The joystick contains 4 buttons named X,Y,A,B and they are my axises. The thing i wanna do is, jogging the selected axis by horizontal direction(gonna be determined by whichever button pressed last). I've figured it out about homing axises in the same way, but jogging seemed different to me. I've tried to connect joystick signal to 'halui.jog.selected.increment' pin but it didn't work. 

Here is my questions:
1. Is there any way to do it without developing extra hal components? I can figure it out via a component which acts as an intermediate component, but i would appreciate any solution without develooping an extra component.

2. What does halui.jog.selected.increment pin actually do? Is it appropriate for my purpose, should i use it or check another way to do it?

I am uploading my hal file to attachments, thank you for your time.


My hal file looks like this:


loadusr -W hal_input -KRAL F710
loadrt joyhandle names=joyZ,joyY

# ...

loadrt oneshot names=estopTriggeredFromJoystick.oneshot,estopResetFromJoystick.oneshot

# ...

# JOYSTICK
addf joyZ servo-thread
addf joyY servo-thread

# ...

addf estopTriggeredFromJoystick.oneshot servo-thread
addf estopResetFromJoystick.oneshot servo-thread

# ...

# ...

# ...

# ...

# ...

# ...

# ...

setp halui.jog-deadband 0.0
setp halui.jog-speed 700

setp joyZ.power 3.0
setp joyY.power 3.0

setp joyZ.deadband 0.1
setp joyY.deadband 0.1

setp joyZ.scale 1.0
setp joyY.scale -1.0

# Connect joypad sticks to joyhandles
net velX input.0.abs-rx-position => joyZ.in
net velY input.0.abs-ry-position => joyY.in


# Z axis jog (gonna be strict)
net jog-z-analog <= joyZ.out => halui.jog.2.analog


# Other axises jog(gonna be dynamic, halui.jog.selected.increment could be used)
net jog-y-analog <= joyY.out => halui.jog.1.analog

net joyButtonX <= input.0.btn-x => halui.joint.0.select
net joyButtonY <= input.0.btn-y => halui.joint.1.select
net joyButtonA <= input.0.btn-a => halui.joint.3.select
net joyButtonB <= input.0.btn-b => halui.joint.4.select


# Home last selected axis
net joyHome <= input.0.btn-tl => halui.joint.selected.home 


# Set Estop on
net estopTriggeredFromJoystick <= input.0.btn-tr => estopTriggeredFromJoystick.oneshot.in
net estopTriggerJoystick <= estopTriggeredFromJoystick.oneshot.out => triggerEstopFromUserspace.or.in0

# Set estop off
net estopPulseJoystick <= input.0.abs-rz-is-pos => estopResetFromJoystick.oneshot.in
net estopResetJoystick <= estopResetFromJoystick.oneshot.out => halui.estop.reset


# ...
# ...

# Home all axises
net joystickHomeAll <= input.0.btn-thumbl => halui.home-all

 

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

More
21 Jul 2024 11:16 #305775 by andypugh
You can link the jog-velocity from the joystick to every axis, and then just enable jogging on the one you want to jog.

Maybe you haven't found the axis pins in motion that also exist in addition to tha HALUI ones?
linuxcnc.org/docs/stable/html/man/man9/m...n.9.html#AXIS%20PINS
net jog-z-analog <= joyZ.out => halui.jog.2.analog
net jog-y-analog <= joyY.out => halui.jog.0.analog, halui.jog.1.analog. halui.jog.4.analog

net joyButtonX <= input.0.btn-x => axis.x.jog-enable joint.0.jog-enable
net joyButtonY <= input.0.btn-y => axis.y.jog-enable joint.1.jog-enable
net joyButtonA <= input.0.btn-a => axis.a.jog-enable joint.3.jog-enable
net joyButtonB <= input.0.btn-b => axis.b.jog-enable joint.4.jog-enable

This is untested, and intended as a pointer. Possibly you need to use axis.L.jog-velocity instead.
The following user(s) said Thank You: mighty_mick

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

More
22 Jul 2024 12:49 - 22 Jul 2024 14:54 #305854 by mighty_mick
Thank you for your answer Andy. I thought i can not link single pin to multiple pins. Sometimes i am doing it unaware and getting the error which says you can't link one pin which is already linked to another pin. I am gonna try your solution, and share results with you.

Before your answer, i've solved the problem by an intermediate component which acts as a switcher. It is also a solution but yours is more appropriate. Appreciated.
 
Last edit: 22 Jul 2024 14:54 by mighty_mick.

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

Time to create page: 0.154 seconds
Powered by Kunena Forum