Machsupport Forum

Mach Discussion => General Mach Discussion => Topic started by: golash on April 17, 2008, 08:15:24 PM

Title: How to link three G320 for fault protection
Post by: golash on April 17, 2008, 08:15:24 PM
I would like to wire all of my geckos so if one faults the motors must be re-set. Does anyone
have advice on setting up the wiring for this feature.

Title: Re: How to link three G320 for fault protection
Post by: Hood on April 17, 2008, 08:53:45 PM
Not sure how the geckos signal is configured but if its not possible to daisy chain them to Input 1 then you could  use three relays linked so that their outputs are daisy chained to Input 1.
Title: Re: How to link three G320 for fault protection
Post by: jimpinder on April 18, 2008, 03:19:53 AM
Are you following the wiring diagram shown on the Gecko website - in respect to pin 5 output from the drive.

This, it would seem, is multi functional and has to have a sprung switch so that it can be triggered to +5v  to reset the drive if a fault osccurs. It would then seem that the output from that pin stays at 5v, until a fault occurs - at which time it reverts to 0v.

I would suggest that all you need is a connection from the 3 drives to a Mach3 input. This could be to a limit switch input, or to the E-stop input, which would stop Mach 3. The connection should be made from pin 5 of the drives in parrallel via a diode to the input, so that any one of the drives switching to 0v passes the signal to the computer input. Because of the diodes, there is no feedback to the other drives. Any signal diode would do.

If you have the Geckos wired up via their enable switch, then Mach 3 could "disable" these lines to stop all movement. It stops "step" and "dir" signals anyway.
Title: Re: How to link three G320 for fault protection
Post by: armac on April 19, 2008, 04:47:45 AM
All the Gecko G320 reset pins (pin 5) can be tied together, so that one faulting driver will shut down the others.

  My Campbell breakout board has no provisions to utilize the fault/reset outputs from the Gecko drivers, so Mach does not know when an error occurs.  As a result, the machine was delivered with no fault detection and the fault-reset pins were tied to +5V permanently for automatic start-up.  Since the fault pins are tied high to +5V, the Gecko does automatically reset after a few seconds, but Mach does not know and continues milling with the machine now offset from where it should be.   (It caused my milling machine to eat up a tailstock and milling bit, and me to nearly have heart failure).  According to the Gecko engineers, leaving the fault tied high is a really bad idea (duh).

  I have been struggling with the Gecko G320 drivers to automatically start up when powering up the machine, and also to provide a fault condition when milling so that an ESTOP can shut down the machine.  The trouble is that when the Gecko G320 is powered up, it immediately "Faults" and must be enabled by momentarily placing +5V on the fault pin 5 for a few seconds (reset function).  This has the unfortunate result that when the fault is wired to a limit function, you can not power up the machine since it triggers a shut-down as soon as the RESET is pressed and power comes up.  The Gecko people can only suggest a center-position manual switch to toggle the drive units on or off, but does not prevent the fault-startup problem from occurring when sensing pin 5.  They ran short of pins and doubled up the reset and fault functions (unfortunate choice).

  I am sure that others have solved this problem since Gecko drivers are in wide use, so if anyone has a solution to this problem, please post it.

 :P  In the mean time ...

  In order to get around the problem, I just purchased some photo-darlington transistors (Fairchild L14F1) that are sensitive enough to sense the fault LED on the Gecko drive modules when glued or placed above, which then can activate the Limit pins on my Campbell break-out board (it works).  I still need a delay to prevent the fault start-up from killing power-up.  I intend to place a N-FET (at least 15 mA capable) with its SOURCE tied to GROUND and the DRAIN being common to all photo-darlington EMITTERS, and with a simple RC delay on the N-FET GATE (CAP to ground, resistor to +5V with the common connection tied to the GATE) to hold off activation of the fault until 10 seconds have passed when powered up.  Each photo-darlington COLLECTOR is wired to a limit pin on the breakout board.  This way, each Gecko can have its own fault sensed, hopefully reporting which one faulted and having the message displayed on the screen in a status window (needs some programming to monitor the LEDs).  Alternately, a 555 timer could be used as the delay element in place of the FET, but is harder to wire without a small circuit board for the IC pins.

  If all goes well, I can hit the RESET button to power up the machine, Geckos fault for several seconds (with pin 5 tied to +5V for automatic reset) but fault reporting to MACH will be delayed by the FET until the Geckos clear their fault conditions.  Now the machine should run normally until a limit switch or a Gecko fault lights its LED and activates a photo-darlington which pulls a limit pin to GROUND and triggers an ESTOP shutdown, and hopefully reports the offending error condition.
Title: Re: How to link three G320 for fault protection
Post by: jimpinder on April 19, 2008, 05:25:02 AM
I cannot understand say your Campbell breakout board has no provision to take signals from the Geckos. It must have some input lines to the computer - pins 10,11,12,13 and 15 - unless you are already using them all. Al you need is one of these and configure it on Config/Ports and Pins/Input. It doesn't matter what Mr Campbell says the inputs are for, you can use them for anything.

I do not think the Gecko pins should be tied high. The Gecko spec shows a neat way of using a sprung loaded switch, to momemtarily switch 0v or 5v to the inputs, which I though would be ideal and keep you in control of the situation. I would install this, even if it means manually enabling the axis before you start. - At least the Geckos would not reset themselves automatically.

Whilst I understand the photodarlington system you are proposing, is there not a spare input line, or can you re-arrange your limits onto one line, so that you can trip the E-stop input on Mach3 - this would be much better than artificially triggering a limit, becasue you can reset immediately.

Yes - you will need some sort of delay on start-up - which, I assume requires a 5v signal onto pin 5  - to switch the drives on. You could, of course drive this from the computer, using a brain, or vis basic script to an output pin. I don't know if the Campbell boards provide isolation and a bit of applification on the output pins, but that seems the simplest way to me.
Title: Re: How to link three G320 for fault protection
Post by: Hood on April 19, 2008, 09:34:24 AM
Seems I missread the question, I was thinking it was a fault signal from the drive and you were wanting Mach to know a drive has faulted and to stop movement.
 I dont see why if one drive faults you would want the rest to fault, I think thats why I thought you were just wanting Mach to know a fault had ocurred.
What exactly is this connection on the G320?
is it an enable?
is it a reset?
Is it a fault signal?
Is it a combination of two or more of the above?

Title: Re: How to link three G320 for fault protection
Post by: DennisF on April 19, 2008, 12:29:54 PM
Hi Guys
 I am going through the exact same question and have e-mailed Gecko on the subject looking at the schematic it reads if i understand it correctly that the same +5v can be used to trigger a fault by putting it to ground my question is if the +5v is coming from the computer will this take out the power supply for the computer i have my geckos set up where after the machine has booted up i can reset the Geckos by pressing a momentary switch and off we go but what i want now is an E-stop, so can i take the +5V and set it to ground with out damaging the computer in any way the machine is almost finished and i don't want to screw it up now.

Title: Re: How to link three G320 for fault protection
Post by: armac on April 19, 2008, 12:33:21 PM
re: jimpinder
Yes, there are inputs available on the breakout board.  The problem is the Gecko fault occurring on power-up.   If I am going to use the Gecko fault for an ESTOP function, simply connecting a fault from the Gecko to an input on the breakout board will not allow me to power up the system.  As soon as the RESET button is pressed, power goes to the Gecko drivers and they immediately shut the system back down.  It seems silly that the breakout board removes power to the Gecko drives as well as step and direction shutdown.  Perhaps if the 5V were to remain on from the breakout, all would be well.

re: Hood
The original question was to kill all drivers if one faults so that all must be reset.  That can easily be done by wiring all pin 5 resets together and using a momentary switch to pull all to +5V for reset.  If one drive faults and there is no feedback to Mach, you do not want the system to keep running on the other drivers.  Thus one faulting Gecko can also shut down all other Gecko drivers.  Obviously, the better solution is to notify Mach that there is a problem and shut down the machining process completely.  The connection on the G320 is pin 5, which doubles as a reset and a fault.  On power-up, this pin is pulled low through an internal resistor (impedance about 235 Ohms) indicating a fault condition, and must be hard-pulled up for several seconds to reset the Gecko.  Why they thought that a fault should occur on power-up, I can only guess that it is a safety measure.  It is a headache to use this signal for fault detection/ESTOP and be able to power up the machine as well.
Title: Re: How to link three G320 for fault protection
Post by: armac on April 19, 2008, 12:59:36 PM
re: DennisF
The fault/reset pin 5 will be pulled to ground on a fault condition through an internal resister by the Gecko, or you can manually pull it to ground to kill the Gecko. or you can manually pull it to +5V to reset the Gecko  (It is current limited by the 470 Ohm resistor in the Gecko and will not kill your computer power supply)  You only need to pull this pin to +5v for reset (which you are already doing), and alternately pull it to ground to force the Gecko drivers to fault if you wish.  You can tie this pin to an input to the computer for fault detection, usually through an optical isolator built in to a breakout board to protect the computer parallel port.  You can also tie several of the Gecko pin 5 resets together and use a single switch to control all simultaneously.  Your computer power supply should have no problem as long as you don't short the +5 volt supply to ground directly.
Title: Re: How to link three G320 for fault protection
Post by: DennisF on April 19, 2008, 01:37:15 PM
 Yes i am doing just that by taking all 3 termanial 5's and tieing them together then using a momentary switch and giving the geckos a +5v to rest them so if understand this correctly i can take the same number 5 termanial and using an E-stop switch set it to ground stopping the drives i can see this in the schematic now thanks.

Title: Re: How to link three G320 for fault protection
Post by: DennisF on April 19, 2008, 02:06:18 PM
I just finished installing the E-stop switch so simply put the same termanial 5 either by putting +5v to it reset's it and grounding it fault's it out works perfect now i feel comfortable in running the machine on it's first test g-codes thanks guy's.

Title: Re: How to link three G320 for fault protection
Post by: Hood on April 19, 2008, 04:34:43 PM
 Thanks for the clarification, I dont know anything about the G320's so was presuming when the title was asking about a fault protection I presumed this was a signal from the Gecko that indicated the drive had faulted.
Title: Re: How to link three G320 for fault protection
Post by: jimpinder on April 20, 2008, 05:28:49 AM
Yes - pin 5 is normally at 5v for normal running. If it is taken to 0v then it shuts down the drive. If a fault occurs on the drive, it goes to 0v.

The problem is Mach 3 has no "two way" pins - i.e. those that work as inputs and outputs. So therefore you must wire all three Geckos together so that they shut each other down - with a lead , via a diode, to the input pin of Mach3, to tell the computer.

The problem is, is you have Mach 3 shutting down the drives, then it will also put a 0v signal into the input to Mach 3 telling it there is a fault - and, therefore, you will need some complicated logic to sort out the timing of the signals.

Let the Geckos look after themselves, I think.

As far as the 5v reset signal is concerned, the easiest way is to drive a small relay from one of the output pins - and have this put a 5v signal into the Gecko. This can be software driven from your reset button - or perhaps cycle start button -  on a Macro. It can be timed to put a 5 sec pulse, or whatever is required. At the end of the pulse, you can check the "fault" input pin and see if it has reset,(it will, whilst the 5v from the relay is present, not show a fault, but revert to 0v if there is still a fault on the Geckos)  and then return.
Title: Re: How to link three G320 for fault protection
Post by: armac on April 22, 2008, 03:29:07 AM
I have created a circuit to deal with Gecko G320 power-up faults and reset requirements.  It solves all my problems by allowing the Campbell breakout board to power-down the Gecko power supply on an ESTOP condition, and it provides automatic Gecko start-up when the Mach3 RESET is pressed as well as servo fault detection using a Limit sense input.

The advantage of powering down the Gecko drives is a safety issue in case a Gecko fails and kicks on a servo motor when in an ESTOP condition.  I know, not likely, but I can imagine pawing around an ESTOPed machine and suddenly having a motor kick on, pinning me or worse.  With this circuit, you can kill the Gecko power supply when in ESTOP mode by breakout board relays, and automatically initiate Gecko servo driver power-up when the Mach3 RESET button is pressed.  Fault detection is then automatically enabled after start-up Gecko faults are removed.

I have attached a .PDF file with the circuit diagram and explanation.   :o

Happy and safe machining!
Title: Re: How to link three G320 for fault protection
Post by: NCNcnc on September 23, 2021, 10:37:38 AM
Hi.I see that this is an old topic but just what I need. For the Geckodrive g320x I can link all term 5s together. Do I also have to link all term 6 grounds?
Title: Re: How to link three G320 for fault protection
Post by: Graham Waterworth on September 23, 2021, 03:46:23 PM
It may be worth looking at this thread (