External Power On/Off + Estop

More
14 Mar 2022 01:07 #237178 by re_relentlessly
@spumco

I was hoping to avoid classic ladder, someone linked to a thread the mentioned it, but Classic ladder looks like a whole another ball game.

In my case, both my power on/off momentary button and my estop and just wired to digital inputs on my mesa 7i76e board.

I do have a unused relay (6a 24v - should be enough for some buttons) that i could wire in. So maybe i will do that.

if i understand correctly, the estop would be wired to the coil of the relay, with the relay output side connected to the power on/off button. so closing (pushing in) estop would disconnect the power on/off button from the mesa board input (pushing the button does nothing since it is disconnected).

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

More
14 Mar 2022 04:49 - 14 Mar 2022 16:07 #237185 by spumco
[EDIT - see below]

It's completely different than what I was contemplating, but your plan should work fine to keep the power/estop from getting out of sync.

As you say, the power button is only possible if the estop relay is active/closed.

Forgive me if this is obvious to you...

The estop should get 24v to one switch terminal
The other switch terminal should go to one mesa input and the relay coil and one relay contact.
The other relay contact goes to one momentary terminal, and the other momentary terminal to the other mesa input.

Hope it works out!


 
EDIT
It just occurred to me that this probably isn't going to work, because halui.machine.on needs a continuous signal (not just a blip).  And leaving the momentary connected to a toggle function (to make sure it stays on) will get it out of sync. Consider the sequence:
  • Estop pushed in
    • estop signal asserted (no signal to mesa)
    • Relay de-energized
    • Momentary not capable of power signal
    • Machine state: Estop On, Power Off
  • Estop unlatched
    • estop signal de-asserted (signal to mesa now present)
    • Relay energized, contacts closed
    • Momentary capable of power signal
    • Machine State: Estop Off, Power Off
  • Momentary Pressed
    • toggle.N.in triggered
    • toggle.N.out goes ON
    • Power On signal to halui.whatever.machine-on (or whatever)
    • Machine State: Estop Off, Power On
  • Estop pushed in
    • Machine state: Estop On, Power Off - but toggle.N.in/out has not changed state
  • Estop unlatched
    • Machine state: Estop Off, Power Off - toggle.N.in/out still not changed state (toggle.N.out is still high)
  • Momentary Pressed
    • toggle.N.in triggered
    • toggle.N.out goes OFF
    • Machine state: Estop Off, Power Off - momentary power button is now out of sync with desired state
Make sense?
I think you need to use a different relay connection scheme or embrace the joys of Classic Ladder.

Here's a very simple DPDT relay circuit to accomplish what you want.  The relay will provide the "machine-on" signal, not the momentary button directly.

Again, forgive me if I'm being Captain Obvious but I could see the toggle function causing some head-scratching and troubleshooting.

-Ralph

 
Attachments:
Last edit: 14 Mar 2022 16:07 by spumco. Reason: Brainwave

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

More
14 Mar 2022 16:22 #237211 by spumco
And another thing...

If you like free instead of a DPDT relay, someone rather smart cooked this up for Classic Ladder newbies:

gnipsel.com/linuxcnc/ladder/latch.html
The following user(s) said Thank You: tommylight

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

More
15 Mar 2022 23:42 #237410 by re_relentlessly
So a DPDT relay is not something i have, so I tried the classicladder.
I got the module loaded and even drew something (based on the tutorials linked), but I cannot figure out how to connect the classic ladder inputs and output to the actual inputs in the HAL.
<code>
net estop-ext <= hm2_7i76e.0.7i76.0.0.input-04-not
net external-machine-on toggle.0.in <= hm2_7i76e.0.7i76.0.0.input-21
</code>
I have inputs as above, but cannot figure how to connect to some classicladder variable like %I2 or %B2

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

More
16 Mar 2022 16:06 #237475 by spumco
Classicladder input and output pins are named something like this in HAL:

classicladder.0.in-00

So connecting a physical input pin to classic ladder input pin "%I0" would be something like this in HAL:

net estop-btn <= hm2_7i76e.0.7i76.0.0.input-04-not
net estop-btn => classicladder.0.in-00

And for CL output "%Q0" to HAL it's similar:
net estop-signal <= classicladder.0.out-00
net estop-signal => iocontrol.0.emc-enable-in

A useful tool to check connections is halshow.  Open halshow, then open the classicladder section under PINS and you should be able to see the exact pin names which correspond with your ladder program.

My workflow - based on extremely limited experience - is to set up the configuration in classic ladder, then do the same in HAL... but comment out the connection to machine actions in HAL during testing.  This usually lets me open halshow, save a watchlist of all the ladder & hal pins/signals to watch,  then trigger the classic ladder functions/logic without the machine/Lcnc doing anything.

An example from my HAL used during testing:

net btn-stop            <=  [HMOT](CARD0).7i84.0.1.input-22 #cyclestop
net btn-stop            =>  classicladder.0.in-05
net auto-mode-select    <=  classicladder.0.out-00
#net auto-mode-select    =>  halui.mode.auto
net cycle-start         <=  classicladder.0.out-01
#net cycle-start         =>  halui.program.run

I could press the input-22 button, watch classic ladder in the ladder GUI, and also watch HAL pins/signals in halshow to see if everything is working as intended - and without actually triggering a machine action (i.e. cycle start in this case).

-R

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

More
16 Mar 2022 23:33 #237511 by re_relentlessly
Thank you @spumco, based on your help i was able to get a partially working classic ladder.
The power on/off button turns the machine on, and the estop works, but I cannot turn the machine back off with the on/off button.
The basic latch example latches but I cannot figure out how to configure it to have the same button also unlatch.

I thought hal was confusing, boy is classic ladder a mind bender.

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

More
17 Mar 2022 14:00 #237531 by spumco
Sorry, I think I overlooked your desire to use the power button to accomplish both an on & off function.  Right now you have, basically, a 'reset' button.

Do you really need to turn the machine off with this button, or can you use a screen/GUI button to turn off the machine?  What scenario do you envision where you want the machine to be in an OFF state but with the estop cleared?

Personally, I find the separate "machine on" and "estop" functions to be pointless in Lcnc; I've set mine up so that if estop is cleared (de-asserted), the machine is ON (and vise-versa).  I don't use the power OFF function - the machine is either ON, or machine is OFF with estop asserted.  If I'm going to be working on the machine (hands/face/whatever in line of fire) I don't trust Lcnc's machine power OFF function to protect me.  In those cases the estop is asserted - drive contactors are de-powered, output relays de-energized... only logic power to the Mesa is present.  In my case both the user and Lcnc can assert an estop, but only the user can de-assert an estop through a physical reset button and latching relay.

But I'm not so arrogant as to think I know everyone's use-case so there is probably a good reason to have the functions separated.

Back you your situation...If you want a system set up like mine (machine ON and estop OFF connected) we can do that.  On the other hand, if you really want a way to turn machine power OFF without asserting the estop (and don't want to use the GUI input), my first thought is to suggest the HAL multiclick function.

Multiclick is pretty cool - I just used it to sort out my air blast function.  Briefly, if you press a momentary button once (quickly), Lcnc does one thing.  Press it twice, it does another thing.  And the time required for Lcnc to determine what you want (how short of a press, time between presses, etc) is adjustable.

Perhaps passing your power button input to multiclick so that one quick press powers the machine ON (as you have it now), and a double-click powers the machine OFF but does not assert the estop.  Or you could have it so that a single-click (quick) powers ON, and a long hold powers OFF.  Lcnc can be programmed so that multiclick 'ignores' button presses longer than a certain duration - it considers a press longer than "X" time to not be part of multiclick function.

Having a single-click on (or long-press) and a double-click power OFF would have the benefit of not powering the machine OFF during a program if the button is accidentally bumped.  You would have to deliberately click it twice in a short period to turn the machine off.  And, of course, the estop function is unchanged from its current configuration for true emergencies.

The only downside I can think of with multiclick is that there is a slight delay - depending on programmed timing - between button presses and machine response.  This is necessary, of course, because Lcnc has to see a press of a certain duration, followed by another click (or not) within a certain time, to work out the logic.  But power ON and OFF should not be time-critical functions...

If this sounds useful but you want some help getting started, let me know and we'll get a bare-bones power/estop/multiclick scheme set up for you to fiddle with.

-Ralph

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

More
17 Mar 2022 19:15 #237556 by rodw
Replied by rodw on topic External Power On/Off + Estop
I think what you have now is expected use with standards compliant estop circuits and reset buttons.
To turn my safety relay off at my HMI, I must hit estop,
to turn it on, I must reset the estop button and then press the reset button.
I still have to press the linuxcnc machine on button so I need to look a bit further. When I did this using the estop-latch and the GUI estop reset button instead of the external button without estop-latch, I did not have to do this.

I will revisit this with estop-latch to see if it can be improved.

It is legal to use the GUI to trigger the reset function

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

More
17 Mar 2022 23:49 #237589 by re_relentlessly
I have managed to solve my problem with the simplest of solutions
net external-machine-on <= hm2_7i76e.0.7i76.0.0.input-21 => and2.0.in0
net estop-ext <= hm2_7i76e.0.7i76.0.0.input-04 => and2.0.in1

net stuff toggle.0.in <= and2.0.out
net pwr-btn toggle2nist.0.in <= toggle.0.out
net tog-on toggle2nist.0.is-on <= halui.machine.is-on
net pwr-on halui.machine.on <= toggle2nist.0.on
net pwr-off halui.machine.off <= toggle2nist.0.off

The combination of a "and" and a "toggle". by feeding both the momentary and the estop into the toggle i fix the problem.
Thank you everyone for your suggestions and assistance
The following user(s) said Thank You: tommylight, spumco

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

More
18 Mar 2022 23:58 #237694 by spumco
and2 in to a toggle? That's really, really clever - I'll have to remember that trick.

Thanks for the update and sharing.

-R

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

Time to create page: 0.115 seconds
Powered by Kunena Forum