XHC-HB04 wireless MPG pendant HAL module

More
10 years 4 months ago #76325 by pommen
Looks just as the one that I have. Works a treat.

/Peter

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

More
10 years 4 months ago #76613 by Gasman
Was the spindle toggle problem ever resolved? I would like to do the same - I have the HB04 working well but would like to free up the 'half' button. I have got the mode button to toggle between auto and MDI but can't figure out how to get the spindle switching on and off with the spindle button only. I think I have managed to get it to switch on with

(in my CUSTOM_POSTGUI.HAL file)
loadrt toggle count=3
addf toggle.0 servo-thread
net spindle-toggle toggle.0.in <= xhc-hb04.button-spindle
net spindle-control toggle.0.out => halui.spindle.start

but I am confused as to how I now get it to stop as nothing I tried seemed to work.

Figuring out the configs is made more complicated by the fact that the mill is in the workshop and I am in the house running linuxcnc under emulation on a Mac.

Wanted to do the same for toggling functions for 'mist' on macro 6 and 'flood' on macro 7, so that I can use buttons Macro 1-3 for some probing/edge finding routines.

Feel I am nearly there as have jogging, zeroing and probing all working but when I start looking at hal files my eyes start to glaze over. :)

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

More
10 years 4 months ago - 10 years 4 months ago #76621 by dannym
Yeah, the spindle button can work fine! Press it once it starts. press it again, it stops

This is what I did in my .hal file:
Code:
#SPINDLE button addf and2.0 servo-thread addf and2.1 servo-thread addf not.0 servo-thread net spindleOn halui.spindle.is-on not.0.in and2.1.in1 net spindleXHCButton edge.1.out and2.0.in0 and2.1.in0 net spindleOnB not.0.out and2.0.in1 net spindleTurnOn halui.spindle.start and2.0.out net spindleTurnOff halui.spindle.stop and2.1.out

The MPG and RF link and LinuxCNC polling loop already perform suitable debouncing. There will be only one edge per button press. And the spindle.is-on won't be true until at least one polling cycle after halui.spindle.start is strobed.
Last edit: 10 years 4 months ago by dannym.

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

More
10 years 4 months ago #76687 by Gasman
Hi Danny -thanks for the quick response but I still can't get this to function as expected - the spindle now seems to start when the program starts but the spindle button on the pendant does nothing - nor does the button on the Axis GUI. I will have another play with Hal Command when I get a chance to get to the workshop to see what it thinks is connected where.

I tried it in my postgui.hal file (and put loadrt and2 count=2 , loadrt not count=1, loadrt edge count=1 into my custom.hal.) Is that correct or should it go in my main hal file?

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

More
10 years 4 months ago #76695 by cncbasher
Gasman:
untill you have everything working in axis , then it wont work
you should be able to stop and start the spindle from axis , after you have homed ,
this would suggest either the spindle output is not as you think it is , so what interface are you using ? vfd etc
and how do you have this wired

also it may help posting your full config as an archive to you post so it can be checked
The following user(s) said Thank You: Gasman

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

More
10 years 4 months ago #76773 by Gasman
Now got it working thanks - can toggle on/off the spindle, mist and flood as well as use the Mode button to switch between manual and MDI. My problem was I had forgotten that I had changed some things in the main hal file for my machine whilst i was trying to get this working in in sim on my laptop. Now all fixed. Just working on adding a camera next..

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

Time to create page: 0.268 seconds
Powered by Kunena Forum