- Posts: 8
- Thank you received: 0
Unable to resolve coolant momentary switch issue
I'd like the coolant to turn on or off using either the Axis checkbox or an external momentary switch.
What's the best way?
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Please Log in to join the conversation.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
The idea being a button press and the coolant on pin true, sends a pulse to the coolant off pin, and Similarly a button press and a coolant-on-not pin true would send a pulse to the coolant on pin.
When ever I try, this sort of hal logic, it always seems to end up much more complicated than it appears at first glance on the surface.
Please Log in to join the conversation.
Todd Zuercher wrote: When ever I try, this sort of hal logic, it always seems to end up much more complicated than it appears at first glance on the surface.
Thats why I think that making a custom component is often so much easier. What you can do in 2-3 lines in C can take half a page in hal.
This is probably LinuxCNC's best kept secret.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Please Log in to join the conversation.
Please Log in to join the conversation.
IIOII wrote: I've written some similar logic in Lua for a previous Mach4 build, so the logic and code should be somewhat similar in C. What's the process for creating and compiling a custom C component? Alternatively, does anyone have some hal logic they could share to achieve the required result?
If you drop in on the plasma and laser section on this forum, there are several components I've written. Use them as an example.
This is a simple one. forum.linuxcnc.org/plasma-laser/32657-th...-indicator-component
Then its just as simple as typing "halcompile --install mycomponent.comp"
And the component is compiled and installed for you.
Just remember your component is being called every time the servo loop is called. Don't do any loops, just wait until the next pass through.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Please Log in to join the conversation.
IIOII wrote: What's the process for creating and compiling a custom C component?
linuxcnc.org/docs/2.7/html/hal/comp.html
For fun you could use LUT5, with inputs from the button, halui.coolant.is-on and the iocontrol coolant pins.
LUT5 is especially good fun when you feed its own output back as an input. But it does tend to make for rather "write once" HAL code.
Please Log in to join the conversation.
