Page 1 of 2
Global emergency stop via interrupt
Posted: Sun May 20, 2018 10:17 am
by Monie Jacobsen
Is there anyone here who will help with an emergency stop with an inductive sensor?
Uses PIC MIAC...
Want the following action:
With an inductive sensor like stop for engine run.
Want to use interrupt to stop the engine when the Inductive sensor is activated.
And miac :: RelayOFF (1) is set OFF
Like a code example
Have tried the following below!
But without luck;-)

- Interrupt.JPG (11.73 KiB) Viewed 15928 times

- OK Edit Macro.JPG (40.64 KiB) Viewed 15928 times

- Properties Interrupt.JPG (26.9 KiB) Viewed 15928 times
Or do you have another code example suggestion.
Yours sincerely
Monie
Re: Global emergency stop via interrupt
Posted: Sun May 20, 2018 1:18 pm
by Steve001
Hi Monie
I do not wish to dampen your project - but you cannot use software to control Emergency stop functions. They have to be "Hard Wired"
You can used the Push button to disconnect the power to the relay outputs then a secondary contact to let the MAIC know that the push button has been operated then the MAIC de energise the relay(s)
I can do a drawing later for you.
see
ISO 13850:2015 Safety of machinery — Emergency stop function — Principles for design
https://www.iso.org/obp/ui/#iso:std:iso ... ed-3:v1:en
and
https://global.ihs.com/doc_detail.cfm%3 ... 52060204-1
Steve
Re: Global emergency stop via interrupt
Posted: Sun May 20, 2018 1:52 pm
by EtsDriver
Here are some things about it too:
http://machinerysafety101.com/2009/03/0 ... bout-that/
And if you ever wondered, by EU directive reset button is now required before machine can start again operating after emg stop was released. And i think US have their own requirement too on that.
https://www.controldesign.com/articles/ ... nt-enough/
Re: Global emergency stop via interrupt
Posted: Sun May 20, 2018 5:31 pm
by Monie Jacobsen
Thank you very much for the answers
But I need a code exemple or drawing
I have a 1 inductive sensor.
However, wish No. 2 inductive sensor as final end stop via final interrup function.
Yours sincerely
Monie
Re: Global emergency stop via interrupt
Posted: Sun May 20, 2018 5:34 pm
by Monie Jacobsen
Re: Global emergency stop via interrupt
Posted: Sun May 20, 2018 7:22 pm
by Steve001
Hi Monie,
I can do you a drawing tomorrow as ETS Driver has said the machine cannot restart when the stop is released.
You will have to do a "reset"
What is the inductive sensor used for ?
can you supply a drawing ?
Steve
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 7:57 am
by Monie Jacobsen
Hi Steve
I use the inductive sensor to stop a solar-tracker in east end and west end.
But want a final stop when the solo rack reaches one of the ends. The function here must be a global stop and a final stop on the solar-tracker.
I would like to welcome you with a suggestion.
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 11:41 am
by Monie Jacobsen
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 12:42 pm
by Steve001
Hi Monie,
Monie
I use the inductive sensor to stop a solar-tracker in east end and west end.
But want a final stop when the solo rack reaches one of the ends. The function here must be a global stop and a final stop on the solar-tracker.
I would like to welcome you with a suggestion.
so this is a end of travel limit not an emergency stop ?
Steve
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 2:07 pm
by Monie Jacobsen
Hi Steve
Emergency stop function
Emergency stop should stop contact with SolarTracker.
In principle, it is on / off by contact.
In case of contact with Emergency stop, LED I7 turns on
And here miac RelayOFF (1) and miac RelayOFF (2) must be OFF.
When driving away from Emergency Stop, Miac RelayON (1) and Miac RelayON (2)
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 7:31 pm
by Steve001
Hi Monie,
Monie
Emergency stop function
Emergency stop should stop contact with SolarTracker.
In principle, it is on / off by contact.
In case of contact with Emergency stop, LED I7 turns on
And here miac RelayOFF (1) and miac RelayOFF (2) must be OFF.
When driving away from Emergency Stop, Miac RelayON (1) and Miac RelayON (2)
This sounds like end of track limits and not an emergency stop function.
Is this correct for what you want to to ?
a inductive sensor at each end of the track, (East & West) this then stops the solar tracker from going beyond the track limits ?
Steve
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 7:33 pm
by Steve001
Hi Monie,
Monie
Emergency stop function
Emergency stop should stop contact with SolarTracker.
In principle, it is on / off by contact.
In case of contact with Emergency stop, LED I7 turns on
And here miac RelayOFF (1) and miac RelayOFF (2) must be OFF.
When driving away from Emergency Stop, Miac RelayON (1) and Miac RelayON (2)
This sounds like end of track limits and not an emergency stop function.
If this was an "Emergency Stop" and activated then EVERYTHING would stop working and then you would have to go and reset things.
Is this correct for what you want to to ?
a inductive sensor at each end of the track, (East & West) this then stops the solar tracker from going beyond the track limits ?
Steve
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 7:55 pm
by Monie Jacobsen
Hi Steve
It's the end of track limits and not an emergency stop feature.
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 8:47 pm
by Steve001
Hi Monie,
i will sort you a drawing tomorrow, What inductive sensor are you using can you upload a data sheet or post a link
Steve
Re: Global emergency stop via interrupt
Posted: Mon May 21, 2018 8:47 pm
by Steve001
Hi Monie,
i will sort you a drawing tomorrow, What inductive sensor are you using can you upload a data sheet or post a link
Steve
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 7:49 am
by Monie Jacobsen
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 12:38 pm
by Steve001
Hi Monie
That unit is a micro switch not an inductive sensor
Terminals 1 & 2 open when the plunger is operated
Terminals 3 & 4 close when the plunger is operated
Steve
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 2:26 pm
by Monie Jacobsen
Hi Steve
Forget the device above

I need an output that sets to Miac: RelayOFF (1) and RelayOFF (1) via Interrup when device is enabled.
Switch ON and OFF function.
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 6:05 pm
by LeighM
Hi Monie
This should be possible using interrupt RB2/INT2 which is connected to MIAC input I8
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 6:26 pm
by Monie Jacobsen
Hi LeighM
Thank you very much for the answer.
I am trying to interrupt RB2 / INT2.
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 8:13 pm
by Steve001
Hi Monie
How It works.
Limit Switches are installed at the Extents of travel East & West
If the end of travel is reached then a signal is sent to the MAIC and stops the motor circuit from working.
the MAIC can signal east or west travel - but this is interlocked so both cannot happen together
The diodes around the relay coils are for DC only !
You don't really need an interrupt for this as the motor just will not drive when told to move if it is at the end of travel.
PDF & capture are the same
:Edit Sorry Leigh Just seen your post
Steve
Re: Global emergency stop via interrupt
Posted: Tue May 22, 2018 8:31 pm
by Monie Jacobsen
Hi Steve001
Thank you very much for your fine work

Re: Global emergency stop via interrupt
Posted: Wed May 23, 2018 8:17 am
by Monie Jacobsen
Hi LeighM
User interrupt RB2/INT 2 which is connected to MIC input I8
Miac Interrupt Emergency Stop:
Have tried interrupt many times to work. But without luck;-)
Would you be helpful in correcting the codes so interrupt by pressing the button can stop run East or West.
Re: Global emergency stop via interrupt
Posted: Wed May 23, 2018 9:17 am
by LeighM
Hi Monie,
The interrupt and code is working and displaying the emergency text and changing the relays,
the problem could be that the main loop is then changing it back.
Interrupts are designed to run a very small amount of code then return to the main loop.
You likely need a global state variable, that is changed in the interrupt and then the main loop changes its action based on the state.
This would be fairly similar to just doing a polling test of the stop input in the main loop,
you would just need to ensure that the time around the loop is as short as possible.
For a more fail-safe operation you need Steve’s wired approach, with feedback to the MIAC.
Hope that helps,
Leigh
Re: Global emergency stop via interrupt
Posted: Wed May 23, 2018 11:07 am
by Monie Jacobsen
Hi LeighM
I use Steve's wired approach, with feedback to the MIAC.
How to make:
a global state variable, that is changed in the interrupt and then the main loop changes its action based on the state.
How is a global state variable made, which is changed in the interrupt and then the main loop changes its action based on the state.