Global emergency stop via interrupt

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 7.

Moderator: Benj

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Global emergency stop via interrupt

Post 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
Interrupt.JPG (11.73 KiB) Viewed 11522 times
OK Edit Macro.JPG
OK Edit Macro.JPG (40.64 KiB) Viewed 11522 times
Properties Interrupt.JPG
Properties Interrupt.JPG (26.9 KiB) Viewed 11522 times
Or do you have another code example suggestion.


Yours sincerely
Monie
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

EtsDriver
Posts: 444
Joined: Tue Apr 15, 2014 4:19 pm
Location: Kajaani, Finland
Has thanked: 345 times
Been thanked: 227 times
Contact:

Re: Global emergency stop via interrupt

Post 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/
Ill just keep the good work up!

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Here are my codes:
SolarTracker-Test.fcfx
(131.99 KiB) Downloaded 283 times
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post 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.
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Simplified Code:
Miac Interrupt Emergency Stop.fcfx
(37.03 KiB) Downloaded 273 times
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post 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)
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Hi Steve
It's the end of track limits and not an emergency stop feature.
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Attachments
Capture.JPG
Capture.JPG (30.78 KiB) Viewed 11381 times
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post 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.
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Global emergency stop via interrupt

Post by LeighM »

Hi Monie
This should be possible using interrupt RB2/INT2 which is connected to MIAC input I8

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Hi LeighM
Thank you very much for the answer.
I am trying to interrupt RB2 / INT2.
Best Regard
Monie

User avatar
Steve001
Valued Contributor
Valued Contributor
Posts: 1189
Joined: Wed Dec 31, 2008 3:37 pm
Has thanked: 460 times
Been thanked: 523 times
Contact:

Re: Global emergency stop via interrupt

Post 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
Attachments
DRAWING.pdf
(6.67 KiB) Downloaded 113 times
Capture.JPG
Capture.JPG (37.98 KiB) Viewed 11348 times
Success always occurs in private and failure in full view.

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Hi Steve001
Thank you very much for your fine work :-)
Best Regard
Monie

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post by Monie Jacobsen »

Hi LeighM
User interrupt RB2/INT 2 which is connected to MIC input I8

Miac Interrupt Emergency Stop:
Miac Interrupt Emergency Stop-003.fcfx
(32.36 KiB) Downloaded 159 times
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.
Best Regard
Monie

User avatar
LeighM
Matrix Staff
Posts: 2178
Joined: Tue Jan 17, 2012 10:07 am
Has thanked: 481 times
Been thanked: 699 times
Contact:

Re: Global emergency stop via interrupt

Post 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

Monie Jacobsen
Posts: 484
Joined: Mon Jul 30, 2012 3:39 pm
Has thanked: 17 times
Been thanked: 46 times
Contact:

Re: Global emergency stop via interrupt

Post 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.
Best Regard
Monie

Post Reply