- Posts: 19311
- Thank you received: 4655
XHC-HB04 wireless MPG pendant HAL module
dannym wrote: I WISH being a coder would help. The HAL's concept of making gate primitives is more like VHDL for silicon than programming, only made exceptionally difficult. I mean I can't just say "A=(B | C) & (!D & !E) on servo_thread". Nooo... though this unambiguously could be interpreted into HAL literally, you need to add numbered/named NOT, AND, and OR gates, add to a thread, create nets and tie all this together into an unreadable, error-prone mess.
If you are a coder then it actually gets a lot easier. A lot of the HAL components are there so that users can do what they want without having to compile anything. If you consider that Linux requires any kernel module to be written in C, and that the realtime components are kernel modules, then HAL starts to look quite clever.
Your sample problem, as it happens, is easily handled by LUT5LUT5 though I am not a fan of the docs of that function. LUT5 basically takes the 5 input bits as a binary index into to the bits of the function parameter and returns that bit.
If you are happy with C, then it is very easy to create your own HAL components. In fact a few minutes of reading up on C syntax is enough for very simple components: linuxcnc.org/docs/2.7/html/hal/comp.html
Please Log in or Create an account to join the conversation.
Well this is very interesting. Today I did a test file with different drill holes over a block at specific distances and places. I loaded it today and ran the machine. It was perfect in all dimensions and also the origin setting. There must be something wacky I did with the file I posted above. I will redo it and see. I am not using the MPG HAL and INI files at the moment I have dropped back to my standard file as I was having all this trouble. I found the tool offset issue and the RPM I am sure now I know what it is. I will do another Savblock file and try it as it has more operations than just drilling although it was the drilling that went haywire. If it all turns out ok then I will re enable the MPG files and see what else I can stuff up. Thankyou for your help Danny and also Andy on this. I just hope the more I work on this LCNC the easier it gets.
Mark
Please Log in or Create an account to join the conversation.
I need to find somewhere on this forum to discuss the tool table and how to use it properly. Pathpilot videos are fantastic on it and how they have done it..makes it really easy.
Also I tried to rest the tool height manually during each stage and I cant find how to do it properly. I looked for some info on it but to date I havent found it
Please Log in or Create an account to join the conversation.
I'm using a LHB04 pendant (5m with usb cable). Its installed but I can only jog with MPG 0.001mm per pulse. Pressing step++ button don't result in a scale increment.
By searching on the module code:
Its what I expected. The xhc-hb04.button-step its working and I can see it changing on halshow, the xhc.button_code is the value set on the layout file?
can the code be different in this version? or anything its else?
João
Please Log in or Create an account to join the conversation.
What I did
used the files from the sample config and copied them to my config
I copied 'xhc-hb04.tcl' to my config folder
Edited my .ini file:
HALFILE = xhc-hb04.tcl
[XHC_HB04_CONFIG]
layout = 2
coords = x y z
coefs = 1 1 1 1
scales = 1 -1 1 1
jogmode = normal
sequence = 1
require_pendant = no
inch_or_mm = mm
mpg_accels = 50 50 500 600
When I start it now it complains it's missing the buttons stanza...makes sense. But the first step works.
And beneath I added (copy from the xhc-hb04-layout2.ini)
[XHC_HB04_BUTTONS]
# use button names according to layout file LIB:xhc-hb04-layout{n}.cfg
# note: "start-pause" is connected for standard behavior
# controlling halui.pause/halui.resume/halui.run
# these are examples, edit as required:
goto-zero = halui.mdi-command-00
# synthesized per-axis buttons for goto-zero button:
goto-zero-x = ""
goto-zero-y = ""
goto-zero-z = ""
goto-zero-a = ""
start-pause = std_start_pause
rewind = halui.program.step
# probe-input for simulating a probe:
probe-z = motion.probe-input
macro-3 = halui.mdi-command-03
half = halui.spindle.stop
# synthesized per-axis buttons for half button:
half-x = ""
half-y = ""
half-z = ""
half-a = ""
zero = ""
# synthesized per-axis buttons for zero button:
zero-x = halui.mdi-command-12
zero-y = halui.mdi-command-13
zero-z = halui.mdi-command-14
zero-a = halui.mdi-command-15
safe-z = halui.mdi-command-10
# in this sim, home-all only works first time, hold down till finished:
home = halui.home-all
macro-1 = halui.mdi-command-01
macro-2 = halui.mdi-command-02
spindle = halui.spindle.start
step = xhc-hb04.stepsize-up
mode = ""
macro-6 = halui.mdi-command-06
macro-7 = halui.mdi-command-07
stop = halui.program.stop
reset = halui.estop.activate
[HALUI]
# these are examples, edit as required:
# a halui hal pin is created for each MDI_COMMAND below
# halui.mdi-command-00, halui.mdi-command-01,... etc
MDI_COMMAND=G0 X0 Y0 Z0
MDI_COMMAND=(debug, example: mdi-01)
MDI_COMMAND=(debug, example: mdi-02)
#03 M110: clears notifications
MDI_COMMAND=M110
MDI_COMMAND=(debug, example: mdi-04)
MDI_COMMAND=(debug, example: mdi-05)
MDI_COMMAND=(debug, example: mdi-06)
#07 M101: example print to stdout
MDI_COMMAND=M101
MDI_COMMAND=(debug, example: mdi-08)
MDI_COMMAND=(debug, example: mdi-09)
MDI_COMMAND=(debug, example: mdi-10)
MDI_COMMAND=(debug, example: mdi-11)
#12
MDI_COMMAND= G10 L20 P0 X0
#13
MDI_COMMAND= G10 L20 P0 Y0
#14
MDI_COMMAND= G10 L20 P0 Z0
#15
MDI_COMMAND= G10 L20 P0 C0
#*** End #INCLUDE file: layout2.inc
I should use layout2 because I have the 17 button pendant.
But when I start LinuxCNC it says: "pin 'halui.spindle.stop' was already linked to signal 'spindle-manual-stop' "
And I have no clue what to change
Any ideas?
Please Log in or Create an account to join the conversation.
Says he who found out the hard way after cutting the end of a 5.0m long USB cable to get it through a vehicle firewall only to find it would not work. I had to cut it off again, shorten the cable add a hub and resolder it all again!
Please Log in or Create an account to join the conversation.