Configuring hardware jog buttons

More
19 Nov 2024 14:35 - 19 Nov 2024 14:44 #314848 by nigelh
Not sure if this is the right sub forum...

I'm trying to make buttons move things. My build now homes (!!) but I was hoping to set up the buttons on the stepper boxes to trim things up without reaching for the Gmoccapy screen. Gmoccapy jogs nicely both in steps and continuous mode. I want continuous mode on the switches.

I've worked through the manual and so I wrote my postgui.hal
# Put HAL commands in this file that you want to run after the GUI loads

loadrt debounce cfg=6
addf debounce.0 servo-thread
setp debounce.0.delay 15
setp halui.joint.jog-speed 10

net jog-x-plus-raw debounce.0.0.in <= hm2_7i95.0.inmux.00.input-08
net jog-x-plus debounce.0.0.out => halui.joint.0.plus
net jog-x-minus-raw debounce.0.1.in <= hm2_7i95.0.inmux.00.input-09
net jog-x-minus debounce.0.1.out => halui.joint.0.minus
net jog-y-plus-raw debounce.0.2.in <= hm2_7i95.0.inmux.00.input-11
net jog-y-plus debounce.0.2.out => halui.joint.1.plus
net jog-y-minus-raw debounce.0.3.in <= hm2_7i95.0.inmux.00.input-12
net jog-y-minus debounce.0.3.out => halui.joint.1.minus
net jog-z-plus-raw debounce.0.4.in <= hm2_7i95.0.inmux.00.input-14
net jog-z-plus debounce.0.4.out => halui.joint.2.plus
net jog-z-minus-raw debounce.0.5.in <= hm2_7i95.0.inmux.00.input-15
net jog-z-minus debounce.0.5.out => halui.joint.2.minus

and check everything

File Attachment:


I hit the buttons and see the bits pass throught to the halui but nothing moves.
I'm reading the manuals but they're a bit big when you aren't sure what you're loking for and google doesn't
have a fix.
SO I'm using a Mesa 7i95t set up with mesact.
I am using joint rather than axis as I would like the buttons to be available for 'sort it out'
moments when homing might not be an option.
I'm probably doing something dumb but humour me.
Last edit: 19 Nov 2024 14:44 by nigelh.

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

More
19 Nov 2024 21:29 #314875 by Unlogic
Make sure that you have a jog speed set, for example:

setp halui.axis.jog-speed 100

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

More
19 Nov 2024 22:52 #314879 by PCW
Also, not related to the jog question but you can avoid the debounce
by setting the "slow" parameter for the assosciated inmux  pins.
The following user(s) said Thank You: nigelh

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

More
20 Nov 2024 15:36 #314918 by nigelh
Thanks to all
Final working version attached including debounce mods suggested because I hate googling for a fix that ends 'thank you' but keeps the fix secret.
Quite what is different I'm not sure but it works before you home stuff which is what I wanted.
Now I can get on with making the Pendant actually move things rather than move and then jump back to the start position
but that would be another thread I guess.
##  Jog Switches
##  ============

# NB this only works PRIOR to homing. After that use the MPG
setp halui.joint.jog-speed 100

# Use the Mesa driver built in debounce (25mS rather than 25uS)
setp hm2_7i95.0.inmux.00.input-08-slow true
setp hm2_7i95.0.inmux.00.input-09-slow true
setp hm2_7i95.0.inmux.00.input-11-slow true
setp hm2_7i95.0.inmux.00.input-12-slow true
setp hm2_7i95.0.inmux.00.input-14-slow true
setp hm2_7i95.0.inmux.00.input-15-slow true

# Copy the switches to the joint inputs
net jsw-xp hm2_7i95.0.inmux.00.input-08 => halui.joint.0.plus
net jsw-xm hm2_7i95.0.inmux.00.input-09 => halui.joint.0.minus
net jsw-yp hm2_7i95.0.inmux.00.input-11 => halui.joint.1.plus
net jsw-ym hm2_7i95.0.inmux.00.input-12 => halui.joint.1.minus
net jsw-zp hm2_7i95.0.inmux.00.input-14 => halui.joint.2.plus
net jsw-zm hm2_7i95.0.inmux.00.input-15 => halui.joint.2.minus
 

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

Time to create page: 0.131 seconds
Powered by Kunena Forum