Pushbutton To Relay Control

More
30 Sep 2011 11:55 #13551 by NICKKINSMAN
Does anyone have experience using relays tied to EMC to replace pushbutton control?

I have the electrical connections all figured out and also type and size of relays needed at the connection points.

I am trying to figure out how to integrate this into EMC through a MESA 7I33. Also how you would architect the relay setup.

The stop circuit is Normally Closed (NC).

The FWD/REV are separate circuits with common, Normally Open (NO).

Certainly simple to get the FWD and REV signals from the Mesa 7i33 via relay. However, all they need is momentary (push) contact, not sure how to tell EMC to do that.

Then, how to seutp EMC to send a signal to another NC relay when it is ready to stop? Or, go with an enable singnal to a NO relay for the stop?

Thanks!

Nick

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

More
30 Sep 2011 13:56 #13554 by andypugh
NICKKINSMAN wrote:

However, all they need is momentary (push) contact, not sure how to tell EMC to do that.

Sounds like a job for the HAL "Oneshot" function:
www.linuxcnc.org/docview/html/man/man9/oneshot.9.html

Then, how to seutp EMC to send a signal to another NC relay when it is ready to stop? Or, go with an enable singnal to a NO relay for the stop?

You are probably going to need a network of HAL logic (And2, Or2) and possibly edge detectors, toggles and oneshots.

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

More
30 Sep 2011 14:46 #13555 by BigJohnT
So is this an existing circuit with latching built in? In other words your just paralleling a start stop circuit?

The oneshot component would be too fast to pull in a latching relay I think as it is only on for one scan iirc.

You might need to use a classicladder timer to hold the circuit in long enough for your latching relay to close.

John

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

More
30 Sep 2011 15:10 #13558 by Rick G
I believe you can program the output length of the oneshot, perhaps to make it long enough to latch the relay.

Rick G

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

More
30 Sep 2011 17:38 #13566 by BigJohnT
Yep, I missed that... good to know.

oneshot.N.width float in (default: 0) Pulse width in seconds

John

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

More
05 Oct 2011 12:23 #13678 by NICKKINSMAN
Thanks everyone!

So, I get the theory here, but I am brand-new when it comes to setting up the hal programming - how would that look in HAL?

Does it matter what section of HAL to put the threads in?
Do I have to put the thread in to load the oneshot somewhere in HAL too?

Somthing like this?
loadrt oneshot
oneshot.2.width float in => Obit? (for 2 seconds)

How do you marry this up with the spindle start command in EMC? Do you just assign the start command to the same Obit and go from there (I have it assigned to an out on the 7I33 now via PnCConf).

Thanks, sorry I am new to setting up HAL and still trying to learn how it works in my spare time. I understand the assigning of EMC function in HAL to i/o bits, but not sure on the details.

Thanks!
Nick

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

More
05 Oct 2011 20:58 #13688 by BigJohnT
The loadrt are loaded in order, I generally load mine near the top. You also have to add the component to a thread. If it uses floating point you have to add it to the servo-thread.

You should read this a couple of times.

www.linuxcnc.org/docview/html/hal_basic_hal.html

John

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

More
06 Oct 2011 17:34 #13713 by NICKKINSMAN
OK, I will read it over and see if I can figure it out!

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

Time to create page: 0.140 seconds
Powered by Kunena Forum