XHC-HB04 wireless MPG pendant HAL module

More
17 May 2014 14:14 - 17 May 2014 15:53 #47010 by ericg
Hi,
I am running kernel 2.6.32-122-rtai on linux 10.04 and using a newly arrived HB04 pendant.

the code appeared to compile OK.

but like other's I am having difficulty in running linuxcnc with the error from the debug file saying xhc-hb04.hal:20 Pin 'axis.0.jog-enable' does not exist.

commenting that out just gets me an error on the next line for axis.1. etc

I do not appear to have any axis visible, so I'm not sure where to go from here, I suspect I've missed something.

Also which file do these lines go in, I don't seem to have them anywhere, perhaps that is the issue.

[HALUI]
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=...
MDI_COMMAND=G10 L20 P1 X0
MDI_COMMAND=G10 L20 P1 Y0
MDI_COMMAND=G10 L20 P1 Z0
MDI_COMMAND=G0 X0 Y0 Z0

I have a standard 3 axis DIY CNC machine and using the joystick version of a pendant, it works fine but I'm keen to get this one going , so any help appreciated.

I also read through all previous post, but most of it was over my head.

thanks for any help you can give

Eric

Edit.....

found the main problem, I added the halfile before the main halfile, when I moved it to last position in [HAL] it started working (with axis 3 errors, but that was easily fixed.)

still not sure anout those other lines though and what they do.

Eric
Last edit: 17 May 2014 15:53 by ericg. Reason: found problem

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

More
17 May 2014 22:24 #47015 by andypugh

I am having difficulty in running linuxcnc with the error from the debug file saying xhc-hb04.hal:20 Pin 'axis.0.jog-enable' does not exist.


This can happen if you try to set up the pendant before the motion module is loaded. Your INI file should reference the pendant hal file last in the list.

Also which file do these lines go in, I don't seem to have them anywhere, perhaps that is the issue.

[HALUI]
MDI_COMMAND=...
MDI_COMMAND=...


Not the first issue you have but it will cause an issue later. You need to add those lines, though you do not need to define the G-codes associated with them yet.

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

More
21 May 2014 06:57 #47130 by vgraves
I have the 18 button wireless version of the pendant, and I'm trying to get it working with my gantry router. The wiki page is somewhat dated, as it doesn't discuss the different layout files and world mode file that are in the download.

Anyway, after reading through this thread a few times, I can now jog my machine in world mode, which is great. And I've been able to get the "=0" button working, but when I use it, LinuxCNC switches back into joint mode, which is annoying. It does this after the Home and Origin buttons as well. Any way to prevent this?

So I'm trying to understand which buttons should be functional and which require additional modification of the hal file because not all of the buttons seem to work. From what I can tell, the C program creates pins, and the hal file ties some of them to signals but relies on MDI commands for the rest. Is this basically correct, and if so, which ones am I supposed to complete?

Hope this makes sense.

Van

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

More
21 May 2014 07:14 #47131 by andypugh

And I've been able to get the "=0" button working, but when I use it, LinuxCNC switches back into joint mode, which is annoying. It does this after the Home and Origin buttons as well. Any way to prevent this?

This is (or was, it might be fixed) a bug in Halui. One solution was to not load Halui, but the pendant relies on it, so that isn't an option here.
There is an unconfirmed report that the issue no longer exists in the 2.6 pre-release. You could try using that (it also has the pendant driver built in, as a bonus).
buildbot.linuxcnc.org

From what I can tell, the C program creates pins, and the hal file ties some of them to signals but relies on MDI commands for the rest. Is this basically correct, and if so, which ones am I supposed to complete?

Largely correct, yes. You need to connect the button hal pins to mdi-command HAL pins to run MDI commands. You can also connect buttons to HAL pins such as spindle-on and coolant.

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

More
23 May 2014 06:05 #47215 by vgraves
Thanks for the confirmation. I'll see what I can get working. For the 18-button layout pendants, what's the intended purpose of the "1/2" button?

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

More
23 May 2014 07:42 #47216 by cncnoel
I use the 1/2 to center the controlled point on my work.

Here is the subroutine (LinuxCNC format) that I use to touch-off in the X axis & then center the controlled point.
Attachments:

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

More
23 May 2014 08:03 #47217 by cncnoel
Also...
snip from the "my-mill.ini" file for you to dissect.
[HAL]
HALUI                         = halui
HALFILE                     = my-mill.hal
HALFILE                     = custom.hal
HALFILE                     = xhc-hb04-noel.hal
POSTGUI_HALFILE = custom_postgui.hal

[HALUI]
# add halui MDI commands here (max 64)
MDI_COMMAND = o<probez> call	           ;#0
MDI_COMMAND = G1 X0 F1200	           ;#1
MDI_COMMAND = G1 Y0 F1200	           ;#2
MDI_COMMAND = G1 Z0 F1200	           ;#3
MDI_COMMAND = o<x-half> call	           ;#4
MDI_COMMAND = o<y-half> call	           ;#5
MDI_COMMAND = o<z-half> call	           ;#6
MDI_COMMAND = G10 L20 P[#5220] X0 ;#7
MDI_COMMAND = G10 L20 P[#5220] Y0 ;#8
MDI_COMMAND = G10 L20 P[#5220] Z0 ;#9
MDI_COMMAND = G1 Z50 F1200	           ;#10
MDI_COMMAND = G10 L20 P1 x0	           ;#11
MDI_COMMAND = G10 L20 P1 y0	           ;#12
MDI_COMMAND = G10 L20 P1 z0	           ;#13

And some snips from the all- important XHX-04 hal-file!!
# GOTO ZERO button #################################################
net go0 xhc-hb04.button-goto-zero => and2.5.in0 and2.6.in0  and2.7.in0
net jog-x and2.5.in1
net jog-y and2.6.in1
net jog-z and2.7.in1
# MDI_COMMAND = G00 (X0,Y0,Z0)
net go-x0 halui.mdi-command-01  <= and2.5.out
net go-y0 halui.mdi-command-02  <= and2.6.out
net go-z0 halui.mdi-command-03  <= and2.7.out

# =HALF button #####################################################
net half0 xhc-hb04.button-half => and2.8.in0 and2.9.in0  and2.10.in0
net jog-x and2.8.in1
net jog-y and2.9.in1
net jog-z and2.10.in1

The MDI commands specified in lines similar to net go-x0 halui.mdi-command-01 must exist first!!

I hope this helps you in your journey!
I have my system beaten into shape now, and this is a fantastic pendant for CNC.
Though I still use the good ol' gamepad for large - distance jogging!

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

More
23 May 2014 08:47 #47219 by Muzzer
I've put this lower down on my priorities list, given that I still haven't got the basic XYZ machine running yet and should focus on that first. However, it's something I need to tackle sooner or later so I'd like to keep banging away at it in the background. This kind of reference point is dead helpful - would you mind posting the XHX-04 hal-file in its entirety? Can't pretend I'd be able to generate this kind of content currently - understanding it would be a useful start though and this looks pretty interesting!

Looks as if you have the 14 button version. I have the 18 button.

Thx!

Murray

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

More
23 May 2014 10:48 #47225 by cncnoel
My pendant is the 18 button wireless USB version.
I fluked it and got it working almost right away.
The only mods to the original code was to delete any reference to the A axis.
Then it was a simple matter of pulling out the correct amount of hair to
make my customized buttons work :pinch:

Next time I have my machine turned on I will attach my files here in the hopes someone
will find them useful.

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

More
30 May 2014 08:17 #47532 by vgraves
I am now running LinuxCNC 2.6.0-pre3. The issue with automatically switching to joint mode after an MDI command seems to have been corrected.

But now the Step button on the pendant doesn't work, even though my XHC hal file hasn't changed. So the jog wheel still functions, but the jog multiplier shown on the pendant stays at 1.

How can I tell which version of the C code is included in the 2.6 release? Is there something else I can do to debug this issue?

Van

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

Time to create page: 0.104 seconds
Powered by Kunena Forum