Halt program after emergency stop / detect that program has been paused

Hi all

I need the UR3e robot to halt it’s program after en emergency stop event. At the moment the program i only paused and when the e-stop has been cleared the program resumes it’s operation which is not desirable for my use case since I need to run som initialization scripts before the program can resume after e-stop.

Alternatively:
Is there a way for my program to at least have any knowledge about that it has been paused? It seems like the program has zero knowledge about it being paused to such an extend that even timers are not running. I tried starting a timer, then pausing the program for a while and resuming the program and the time did not seem run while the program was paused.

If my program could have knowledge about the pause event, that being safeguard or e-stop event i could use that to correctly resume my program and handle anything that might need it.

At the very least can i have the program just simply halt and restart if the e-stop event happens? resume on safeguard is still necessary.

Hi @htnl,

You can use I/O Setup to set one of your output as “high when running, low when stopped” which can be your information about program status.
If you would know about program stop only when the protective stops occur, in newest e-series software you can map output as “HIGH when unscheduled stop” which will do exactly what you want to do - putting output on HIGH when something happen add f.ex. protective stop occurs.

It cannot be done in the standard way so that after the emergency stop, you shut down the program, run some script and then start the program again at the place where it stopped but tip with proper configure output should help in your case. :slight_smile:

Hope it helps,
WG

Hi @wojciech.goral

unless I’m misunderstanding something I don’t see this as a solution. The “high when running, low when stopped” option is reset as soon as the program resumes, so my running program will still have no idea if the emergency stop was pushed. Also i only want the program to halt on e-stop and not on safeguard. This output is triggered on safeguard as well.

Besides I have had issues with “high/low when unscheduled stop” output option since it does in fact not trigger on e-stop. I have no idea when it is actually supposed to trigger.

The only option i see myself would be a simple UR-cap that monitors the state and can halt the program on e-stop. But this is outside my skill level at the moment, but i can only imagine that to be a fairly simple task for the UR team to add.

To get signals Hi/Lo only on e-stop you can configure the configurble I/O as safety ones in safety settings in installation. Then if you assign “emergency stop” for pair of outputs you will receive the signal only on e-stop. (high without e-stop, low when e-stop occurs). Neverthless this also do not halt your program.

Instead of urcaps, you can use an external controller (if you have one) and control the status of the robot remotely (the dashboard allows you to check the status of safety as well as control the program, which can be stopped with a command). This solution, however, requires the robot to go into remote control mode so you need to find out that this is possible in your case.

I don’t know of “the right way” to do this, since I doubt there is one. :slight_smile:

A URCap is definitely a way to achieve it. Or installing some sort of relay that “remembers” the emergency stop after it’s cleared.

However. I think you should be able to use the “High when not running” on a digital output. You’re saying it should happen as well, if the robot is just paused.
Pick a digial output which is not in use in your setup, and set it for “High when not running”. Then make a thread in your program that checks the output (should be possible just as inputs): If DO[7] is High → Halt program (or whatever else you want to).
And then in the beginning of your program in the BeforeStart, you set DO[7] to Low again. Threads are not running while the robot is executing BeforeStart. :slight_smile:
This is not limited to a Halt of the robot. You can also execute some code in the thread and then reset DO[7].

This should work as far as I can tell. But it will, of course, register all “stops” of the program execution - pause, emergency, safeguard.

@efn
No this does not work sadly.
as soon as the program resumes the “high when not running” is reset back to low. There is literally no way that the program itself can detect any of these outputs. To my knowledge and according to all my testing, the program is run in total isolation and has zero knowledge about I/O’s status when the program is paused.

Also i do want to resume as normal when just using safeguard. The safeguard is connected to the doors of the setup and can be opened many times durring a run.

I only want tohalt and restart the program on e-stop or other category 1 and category 0 events.

@wojciech.goral
I’m sadly too far into the building of the machine so adding a PLC or similar is not an option anymore. This issue was discovered durring acceptance testing of the machine since it causes an infinite wait in the program because some external motorcontroller is not reset properly after an e-stop when the program just continues. I can only safely reset the motorcontroller when i know for sure that the robot is in a safe position and away from the motor.
Adding more controllers at the moment would significantly delay the project that is close to being finished.

Well. I just tested “High when not running” here, and it does not reset back to low when resuming for me.

But if you don’t want the signal on a safeguard stop, then it won’t be any good for you, no.
So no other choice than a custom URCap, PLC or a latching relay connected to the emergency outputs. :slight_smile:

@htnl
We think about your problem with my collegue and it looks like there is some “simple” sollution. What if you will use configurable output set as “emergency stop” so you will reach a 24v on your outputs when e-stop are not pressed, and connect it to the NC relay which is open with these 24V and connect it to digital input in controller - and then map this input as “halt progam” in I/O setup ?

In this sollution when you don’t have an e-stop your outputs have 24v so the relay is on and the digital input is off so your program is running. When e-stop are pressed, you don’t have 24V on output so the relay are off and you have digital input on so the program will halt.

This sollution require to plug the e-stop wires in emergency stop inputs in controller - not to configurable ones. We don’t tested that, so let us know if you will. :wink:

For closure on this topic:
At the moment it seems like there is no software only solution for this issue. It will require some relays and extra hardware to work

I ended up solving the underlying issue i had with external devices needing separate initialization after an e-stop event. I found a way for the devices to automatically restart and enable. However this was a much harder problem to solve than just halting and restarting the robot program.