Recovering from E-Stop automatically from PC program

  • Hi all,

    I'm here again for help from this awesome community.

    I'm trying to write an automatic recovery procedure for a Kawasaki RS013N robot. When a user presses the emergency stop, a PC program checks if the same is released and if so, it executes a routine to turn on the motors again and start the cycle.

    WARNING: Automatically turning on the motor in an industrial robotics setting should be done with all due safety and after ensuring safe working conditions, especially for the human operators that might be in the robotic cell: e.g., no human operator should be in the workspace of the robot when the motor is turned on!

    I have been looking at the manuals for a day now and cannot find a proper way to do it. I found the SWITCH command to see if the motor power is off with POWER or if an ERROR is ongoing... Also, the ZPOWER command to turn on/off the motors. Even though I am not able to use ZPOWER in my robot programs. It gives the errors "Cannot use in current mode." or "Cannot use in Robot Program.".

    I'm very confused and it is tiring to look at the manuals without proper explanations. I would be grateful if someone could explain to me the suggested procedures for the following:

    - How to catch from a program, if E-Stop is pressed or released.

    - How to restart automatically a program that has been stopped... Hence, switch on the motors and restart the cycle.

    Thank you so much in advance.

    Edited once, last by dhindhimathai: Added safety warning. ().

  • Place your Ad here!
  • Hi!

    First of all, I wanna say that automatic recovery after Emergency stop release may be not very safety, so keep in mind all possible consequences.

    Now about your question.


    - How to catch from a program, if E-Stop is pressed or released.

    You can use SWITCH(EMERGENCY) for checking the emergency state. Or, you can set a dedicated output signal "Emergency stop" to some internal signal i.e. 2001 and check it.


    How to restart automatically a program that has been stopped... Hence, switch on the motors and restart the cycle.

    To turn on the motor, you shoud write MC ZPOWER ON. And after that add a little delay (about 0.2 s will be fine). Another way is set dedicated input signal "Ext. motor on" to some internal i.e. 2002 and then use SOUT 2002 = TRUE (SIGNAL instruction will not work for dedicated input internal signals)

    Same for cycle start. Use MC EXECUTE or "Ext. Cycle Start" dedicated input signal i.e. 2003.

    So, your autostart should be something like this:

    1 way

    .PROGRAM autostart.pc
        IF SIGNAL(-2001) THEN
            SOUT 2002 = TRUE
            TWAIT 0.2
            SOUT 2003 = TRUE

    2 way

    .PROGRAM autostart.pc
            MC ZPOWER ON
            TWAIT 0.2
            MC EXECUTE program
  • dhindhimathai

    I am very disappointed to read this post, especially as today there has been sad news in the industrial robotics sector of reports of a gentleman losing his life due to being crushed and in which the details of cause have not been clearly identified or publicly released, but safety will be a factor.

    Please think about what you are asking and consider an alternative method to restart a system where an emergency stop has been activated as opposed to automating this.

    Other conditions may exist, which you haven't mentioned, so could you be more specific in your intentions and not just summarizing it?

  • kwakisaki

    I apologize for carelessly phrasing the question. It is indeed important to be careful when discussing safety.

    It's of paramount importance, in industrial robotics, to never turn on motor power (especially automatically) when this might be the reason for danger, especially to humans. For example, it's a good practice to perform such an automatic "motor on" only when all safety checks have been passed and after ensuring that the robot is in a predictable initial condition to start operation from and only if all human operators are outside the robotic self and at a safety distance.

    Thank you so much for pointing out this issue.

    • Helpful


    It is not any issue to turn on motor power automatically either via a PLC or via PC Task from a programmatical perspective as this is how it can be done and is 100% acceptable.

    Just like what dm.bogachev has kindly provided some examples.

    These are just examples.........not necessarily something that can just be copy and pasted and integrated universally as each cell in totality is likely to be different.

    Something to add here with the examples is to look into RGSO dedicated signal.

    This dedicated signal can be used as a check/confirmation that the robot is indeed live.

    So this check can replace the TWAIT dm.bogachev has in one of his examples.

    What should be considered is exactly from what circumstance you are going to deploy such methods.

    Motor power is a request not a result of safety checks.

    Motors will not energise period, if the safety circuit is not consistent.

    The Kawasaki safety circuit consists of components that serve teach and repeat modes.

    Kawasaki have provided a very good representation of this which can be viewed via the teach pendant on E and F controllers.

    To view this on the teach pendant you can access the 24. DIAG Monitor area and specifically look at Safe Cir Monitor 1 and Safe Cir Monitor2.

    These 2 windows show the safety circuit in a ladder format (like a PLC) where it starts from Safe Cir Monitor 1 and flows into Safe Cir Monitor 2.

    Safe Cir Monitor 1 shows the external safety coming into the controller and flows between the teach and repeat key, which in turn either flows through ext trigger and trigger for teach or the safety fence for repeat.

    Safe Cir Monitor 2 shows the path it takes internally via the hardware.

    You cannot see ANY program linked to this at it is all hardware driven, irrespective of how your program or PLC maybe requesting it and that is key to remember.

    I would familiarise yourself with this area and view the ladders operation in teach and repeat modes and see just how this operates.

    Again, motor power is a request.

    If the safety circuit is not consistent, motors will always be de-energised.

    If you apply automatic motor power and cycle start, then as soon as the safety circuit is consistent, the robot will be live and executing whatever program is in it's current stack or the current step it was executing or a step which has been changed by a human so you need to ensure conditions are suitable before deploying such methods.

    Hope this helps a little............. :top:

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account
Sign up for a new account in our community. It's easy!
Register a new account
Sign in
Already have an account? Sign in here.
Sign in Now

Advertising from our partners