Unable to resolve coolant momentary switch issue

More
9 years 2 months ago #97028 by IIOII
I'm new to LinuxCNC and I'm having difficulty getting the following setup to work.
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 or Create an account to join the conversation.

More
9 years 2 months ago #97059 by Todd Zuercher
There are halui pins for controlling coolant (flood and mist). They are separate three separate pins for both, on, off, and a status pin. You can use some hal logic to control them using a single momentary input,.

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

More
9 years 2 months ago #97066 by IIOII
I've been troubleshooting the below code without success. When the momentary switch is pressed, the coolant is turned on, but unable to turn off again. Any suggestions on how to rectify?
Code:
loadrt toggle2nist count=1 addf toggle2nist.0 servo-thread #Seems these need to be here to keep check boxes visible net coolant-flood <= iocontrol.0.coolant-flood # Coolant switch net flood-toggle toggle2nist.0.in <= hm2_7i76e.0.7i76.0.0.input-27 net flood-on toggle2nist.0.on => halui.flood.on net flood-off toggle2nist.0.off => halui.flood.off # Coolant LED control net flood-control halui.flood.is-on => hm2_7i76e.0.7i76.0.0.output-14

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

More
9 years 2 months ago #97090 by Todd Zuercher
I'm not sure that the Toggle2NIST component is the right tool for the job. (at least by it's self.) Toggle2NIST holds it's output pins true between button presses. What might be a better option is to just use a couple of and2 comps, a not, and maybe a oneshot (or edge).

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 or Create an account to join the conversation.

More
9 years 2 months ago #97093 by rodw

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 or Create an account to join the conversation.

More
9 years 2 months ago #97104 by Todd Zuercher
Easy peasy, if your fluent in C. I'm not, so I just muddle along stringing together hal commands.

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

Time to create page: 0.057 seconds
Powered by Kunena Forum