KmotionCNC and the Emergency Stop circuit.

Moderators: TomKerekes, dynomotion

Post Reply
RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

KmotionCNC and the Emergency Stop circuit.

Post by RogerFroud » Wed May 05, 2021 8:23 am

I can't find anything on the Forum that relates to how KMotionCNC can be informed of an Emergency Stop condition, or when the Safety Circuit is complete and safe.

My system has a Safety Contactor that operates when the Emergency Stop button is pressed. The circuit is energised by the usual 'Machine On' button arrangement that latches the Safety Relay if the Emergency Stop button is released and the circuit is complete. The SureServo amplifiers retain logic power during E-Stop, but the motor drive power, which is separate, is disconnected by the Safety Contactor. The same thing goes for the Spindle power.

It seems sensible to me that the Safety Circuit should be connected to the control system so that it can't enable the drives until the circuit is complete and the machine is safe. The same input should surely inform KMotionCNC that this event has occurred so that it halts the system. Without these things, there's nothing to stop the machine moving off after an Emergency Stop as soon as the Safety Circuit is restored.

What inputs are normally used for this? Presumably there's a formal way to dealing with these eventualities?

User avatar
TomKerekes
Posts: 2677
Joined: Mon Dec 04, 2017 1:49 am

Re: KmotionCNC and the Emergency Stop circuit.

Post by TomKerekes » Wed May 05, 2021 3:10 pm

Hi Roger,

Its up to you to determine how EStop is to be handled. Normally if any motion is in progress while an EStop occurs or if any motion is attempted while not enabled then because the motors won't move correctly a following error/axis disable occurs which is then detected by KMotionCNC.

But it is normally a good idea to interface the EStop condition to some input, monitor the input, and when detected disable things such as KFLOP Axes or whatever else appropriate in your system. See the EStopDisablesALL.c example.
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: KmotionCNC and the Emergency Stop circuit.

Post by RogerFroud » Wed May 05, 2021 6:59 pm

Ok, I can see that code example. I see there's a YouTube video called 'KMotionCNC Screen Editor', does that explain how to embed this example, or is there another one for that?

Ideally, I'd just want to simulate pressing the Stop button, to abort execution of the program so it makes an orderly exit. Just disabling the axes is surely going to leave the control trying to carry out a move which will result in an error. That seems clumsy and unsatisfactory to me. Is there a way to simulate button press like that?

User avatar
TomKerekes
Posts: 2677
Joined: Mon Dec 04, 2017 1:49 am

Re: KmotionCNC and the Emergency Stop circuit.

Post by TomKerekes » Wed May 05, 2021 11:32 pm

Ok, I can see that code example. I see there's a YouTube video called 'KMotionCNC Screen Editor', does that explain how to embed this example, or is there another one for that?
No, KMotionCNC Screen editing has nothing to do with "embedding" C Programs. Normally servicing/monitoring code is added to a forever loop added to the end of your Initialization C Program. See here.
Ideally, I'd just want to simulate pressing the Stop button, to abort execution of the program so it makes an orderly exit. Just disabling the axes is surely going to leave the control trying to carry out a move which will result in an error. That seems clumsy and unsatisfactory to me. Is there a way to simulate button press like that?
Well no, disabling an Axis will abort execution of a program and not leave the control trying to carry out any motion.

But if you want to "push" the KMotionCNC Stop Button see the ExternalButtons.c example
Regards,

Tom Kerekes
Dynomotion, Inc.

RogerFroud
Posts: 78
Joined: Tue Mar 30, 2021 8:07 am

Re: KmotionCNC and the Emergency Stop circuit.

Post by RogerFroud » Thu May 06, 2021 7:12 am

Thanks, that's great. I'm sure I can figure it out now.

Post Reply