Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: mc on September 22, 2013, 04:28:52 PM

Title: How to handle servo faults
Post by: mc on September 22, 2013, 04:28:52 PM
Originally I had planned to link the servo driver fault output into the e-stop circuit, so that if a driver faults out for any reason, the main power to all the drivers/spindle gets cut.
However, the issue with that is the drivers logic which is on a permanent 24V supply, would flag up a fault due to low voltage, meaning that to get them out of fault and power up the e-stop circuit, the drivers fault outputs would have to be bypassed, and a driver reset signal sent to all the drivers. Which although doable, would involve a few relays and a couple outputs.

To simplify things, I was thinking instead, just rely on the driver ready signal fed into the controller (I'm using a KFlop, so the controller itself can handle this and then report to Mach there's an issue) and halting motion if a drive enable signal fails.
I know it's not ideal, but then there are still limit switches to trigger an e-stop things if anything major goes wrong.

Does this sound feasible?

Also, I'd be interested to hear how others have servos wired up to deal with faults.
Title: Re: How to handle servo faults
Post by: Hood on September 23, 2013, 02:11:17 PM
I use the emergency style relay, as per pic below, on the Chiron, it removes the enables from the other drives. In addition the CSMIO gets the fault signal from the drives so it will halt motion and also inform Mach and then of course as it has encoder feedback even if things get missed the CSMIO should see the position is wrong and fault out and halt all drives and call an E-Stop.

Did similar kind of things on other machines but just had to use different methods, all of which were different depending on controller and drives used.

Hood
Title: Re: How to handle servo faults
Post by: mc on September 23, 2013, 04:16:42 PM
Thanks for that.
I never thought about just killing the enable signals to the drives.
If I use a double pole relay, one pole can cut enables and the other cut the spindle VFD, then Mach/Kflop can also trigger an e-stop, and I can wire the fault output to the relay and the kflop.

What's so special about that emergency relay?
Title: Re: How to handle servo faults
Post by: Hood on September 23, 2013, 04:38:22 PM
The emergency relay I am using is a timer relay (in addition to the other relays) I use this because I have a class 2 E-Stop set up and what happens is before the Enabels are taken away from my drives they get a fault signal which tells them to stop under power. This means they stop almost instantly and there is no chance of them coasting. Once stopped the enables are taken away, all under 0.5 seconds if I recall.

Hood
Title: Re: How to handle servo faults
Post by: mc on September 23, 2013, 04:51:38 PM
I think I'll survive without adding any time delays for now.
Title: Re: How to handle servo faults
Post by: Hood on September 23, 2013, 05:00:22 PM
Unless your drives support that feature then you would have to anyway ;D

Hood
Title: Re: How to handle servo faults
Post by: mc on September 23, 2013, 06:22:53 PM
Just had to check the manual, but there is an option to set an input to perform a quick stop. But I'm not even going to think about that until I have the basics working!

These are the latest Kinco CD422 drives, and have lots of features, however I was reliably informed for CNC use they don't really offer anything beneficial over the CD420, it's just there was no CD420 in stock.
The biggest downside to the CD422 are all the optional inputs/outputs are via a connector that needs soldered up, which is why I'm trying to figure out exactly what I need to connect to avoid having to change wiring later. As it stands I've got one 6 core cable for the encoder outputs, another 6-core for what connects to the KFlop/Kanalog which did stand at 1 output (ready signal - outs require 2 terminals), and 3 inputs (Enable, Fault Reset and one spare), the analogue signal will be on it's own two core, and the fault output on another two core. However given the fault/enabling handling, I may swap that about a bit.
Title: Re: How to handle servo faults
Post by: Hood on September 24, 2013, 03:05:19 AM
Most of my servo setups I use 25 core for the I/O, dont always use it all but I always wire and take it out to a breakout.
Hood
Title: Re: How to handle servo faults
Post by: simpson36 on September 24, 2013, 03:19:36 AM
The emergency relay I am using is a timer relay (in addition to the other relays) I use this because I have a class 2 E-Stop set up and what happens is before the Enabels are taken away from my drives they get a fault signal which tells them to stop under power. This means they stop almost instantly and there is no chance of them coasting. Once stopped the enables are taken away, all under 0.5 seconds if I recall.

Hood

I agree with this method.


NOTES FOR NEWBEES:

Servo drives stop the motor by powering then in the opposite direction. Absent that power, the drive has no way to quickly stop the motor and the result is 'coasting'. If you are very lucky, there will be enough energy in the caps to stop the motor. If not, then you will have made a bad situation much worse by removing the power from the drives, in my opinion.

On first encounter with higher level drives it seems logical to assume that all of the features are there because you need to use them, but that is not the case. in any given application, most of the features will not be used. Only the handfull needed for that particular application. For example, it may seem logical that the drives own built in E-stop would be useful with a Mach setup, but it would be redundant at best and most likely counter productive.

If the drive is set up in a mode where you give it coordinate or vector and it proceedes on its own to the commanded location, then you need some way to 'break in' to that process if something goes wrong. Hence, the drives built in EMG (emergency stop) or equiv. This has no useful purpose in a MACH setup if you already have the drive error lines connected to MACH. On E-stop, MACH simply stops sending pulses to the drives and they will consequently 'stop instantly under power' which is what you want to happenn.

The bottom line is that you should choose ONE method. Internal to MACH as descreibed above, or external to Mach as described by Hood, or any number of other ways. The important thing is to pick ONE way and not have redundancy. Otherwise you will be pulling your hair out trying to track down false E-stops.
Title: Re: How to handle servo faults
Post by: mc on September 24, 2013, 02:32:18 PM
Some wise words there Simpson.

Hood, any chance of some details for that relay?

Killing the enables and issuing a drive stop signal seems the best option, however I'm now thinking that killing all power is not essential.
Should something fault, using a couple relays, all the drives should stop by killing the enables and issuing a stop signal. Power would still remain, but motion should stop.
The existing e-stop circuit is active all the time with no controller input, so I'm unsure whether to link the e-stop circuit into the KFlop enable circuit.
If I do tie it in, then it ensures things stop everything if the KFlop detects something wrong, and could use it to provide a time delay, however the KFlop can just as easily kill the enables with a similar result, unless a drive fails to stop when the enable is removed.
If I don't tie it in, then it would take a servo drive to fail to stop despite being commanded to for anything serious to happen, which given I'm using AC servos isn't likely to happen unless something happens to the KFlop, in which case there's a risk the KFlop is not likely to kill the e-stop circuit or kill the enables, so you're back to relying on something hitting a limit switch.

I'll have another think, as I need to do a few sketches of possible solutions to check on how the inputs/outputs would work under various scenarios.
Title: Re: How to handle servo faults
Post by: simpson36 on September 25, 2013, 05:56:00 AM
There is a lot to consider when setting up an E-stop scheme. I would advise that before copying an existing scheme, make sure that whatever hardware you are using has the same features and behavior as the setup you are copying or you may get a very different result.

A well designed E-stop setup will stop the motors as fast as possible, but also retain the machine coordinates, otherwise every E-stop is going to require rehoming the machine.

I make a 4th axis product and often put customer's motors (and drives) on them, so I have exposure to a lot of different stuff and have read a lot of manuals and had conversations with manuf reps and engineers to the point where it all starts to blend together so I try not to quote specifics on a particular brand. That being said, IF my memory serves, the Allan Bradley drives that Hood uses will retain their location and continue to track the encoders while disabled. My Mitsubishi drives and I think also Yaskawa and some others do not.

So, to use Mistubishi as the example, when the drive receives ENABLE, it considers whatever the actual position is  . .  to be the current commanded position. Depending on the conditions present when the drive was disabled, the difference between where the drive IS and where it should be will vary from a lot to a tiny bit, but the error will be there.

Before I became aware of this phenomena, I was using disable/enable to avoid faulting when the 4th axis spindle was locked while cutting a gear or pulley tooth. The error was tiny per tooth, but after 360 degrees and 72 teeth, the error has acculated to a few degrees. Not even visible to the naked eye sometimes, but enough to ruin a gear if more than one pass is required to cut the teeth.

This took a long time, a lot of ruined parts and a lot of phone time with Mitsubishi engineers to finally figure out what was hapenning, so I just pass it along FWIW.  I use ENABLE/DISABLE all the time on the spindle and the 4th axis (when it is in LATHE mode), but there can be pitfalls to using ENABLE/DISABLE on an axis drive, depending on how the feature is implemented on your hardware.

Speaking of FWIW, for my E-stop setup, I have the error lines from each drive 'daisy chained' thru a bank of opto isolators  and then a single wire from the end of the chain to the Kflop E-stop input. This arrangment takes care of the voltage difference, the isolation, and multiplexing the inputs in one step in one device. If any drive faults, it breaks the chain and the Kflop gets the E-stop (think christmas tree lights). It is set up active OFF so a broken wire or power problem will also cause the E-stop.

Also consider recovery from the E-stop. Make sure that unexpected instant restarts are supressed (spindle primarily). Another difference between drives comes into play here again. My Mistubishi axis drives require a reset after a fault whereas my Copley Controls spindle drive need only a disable/enable cycle and they are ready to rock again.
Title: Re: How to handle servo faults
Post by: mc on September 25, 2013, 02:38:03 PM
I'm going to be using the analogue inputs on the drive via a Kanalog, so all the position control is going to be handled by the KFlop. Having a scan of the manual, the drive simply passes through the encoder signals from the motor, and provided the drive logic power remains, the encoder signals should remain.

I think I'm going to opt to keeping the e-stop circuit seperate.
Each drive fault output will control a seperate DPDT relay.
So if I connect all the stop signals through one of the NO in each relay to a 24V source, then should a drive fault then the stop signal gets triggered on all drives, and then use the other contacts to control a notifier to the KFlop to let it know a drive has faulted. I could probably just use a SPST relay, as the drive outputs are open collector so can be linked direct to the Kanalog optos without interfering with each other.
By cutting the stop signal, the drives require re-enabling to exit the stop, so there's no need to kill the enables as well, so I can programme a delay into the KFlop to kill the enable, even if the KFlop doesn't respond for whatever reason the drives will stay stopped.
Then I can connect the Enable and Reset direct from the Kanalog to the drives, and the Ready and Faults direct to the Kanalog.

That way I only need 2 to 4 inputs (depending on if I join the ready/faults on each drive or keep them seperate), and 2 outputs (enable is shared, and issuing a fault reset just clears any faults so no need to trigger drives seperately).

The only issue outstanding, is how to tie in the VFD, however I'll probably just link another relay into the VFD direction signals.