G320 REV-7

G320 REV-7
Click here to download this manual (PDF)

G320 Revision 7 Manual
Last Update: July 15, 2010

Thank you for purchasing the G320 drive. The G320 DC servo drive is warranted to be free of manufacturing defects for 1 year from the date of purchase. Any customer who is dissatisfied with it or is unable to make it work will be cheerfully refunded the purchase price if the G320 is returned within 15 days of the purchase date.


If you are not familiar with DC servo drives please do the following setup instructions with the motor on the bench before mounting it on the mechanism it will eventually run. This will allow you to get a baseline motor behavior of what to expect.

Before you start, you must have a suitable encoder mounted and properly aligned on the motor. Follow the manufacturer’s instructions on mounting and aligning the encoder if the motor doesn’t already come with one.

Next you must have a DC power supply suitable for the motor. The power supply current rating must equal the maximum current you expect to run the motor at.

Finally, have a STEP and DIRECTION pulse source available.

Before going on, turn the current LIMIT trimpot a quarter to half of full scale. Turn the GAIN trimpot fully off and turn the DAMP trimpot to a quarter of full scale. The trimpots are single-turn so be careful not to over-torque them.


TERMINAL 1 Power Ground
Connect the negative (black) lead of your power supply to this terminal.

TERMINAL 2 Power (+)
Connect the positive (red) lead of your power supply to this terminal. It must be between +18VDC to +80VDC.

TERMINAL 3 Armature (-)
Connect the black lead of your motor to this terminal.

TERMINAL 4 Armature (+)
Connect the red lead of your motor to this terminal.

This is the ERROR and RESET pin. For a full explanation read the section titled “ERROR/RESET PIN” on page 5.

TERMINAL 6 Encoder Ground
Connect the encoder power supply ground to this terminal.

TERMINAL 7 Encoder +5VDC
Connect the encoder +5VDC pin to this terminal.

TERMINAL 8 Channel A
Connect the Channel A pin of your encoder to this terminal.

TERMINAL 9 Channel B
Connect the Channel B pin of your encoder to this terminal.

TERMINAL 10 Direction
Connect the DIRECTION signal to this terminal.

Connect the STEP signal to this terminal.

TERMINAL 12 S/D Common
Connect this terminal to +5VDC.

IMPORTANT: When first testing the G320, connect ERR/RES (term. 5) to ENC+ (term. 7). Please follow the next steps in the sequence they are given.


The encoder must be a digital quadrature TTL output type that operates on a single +5VDC power supply and the power supply current rating must be less than 50 mA if it is being powered by the G320. It should be at least a 200 line encoder. If the encoder supply current is more than 50 mA, use an external +5VDC supply. IMPORTANT: Connect a 470 ohm resistor from TERMINAL 6 to TERMINAL 7 if an external power supply is used for the encoder.

Connect the encoder power supply ground to this terminal.

Connect the encoder +5VDC to this terminal

Connect the encoder phase “A” to this terminal

Connect the encoder phase “B” to this terminal

To determine the optimal encoder line count, please follow the instructions below.

1.) Determine motors no load RPM
2.) Calculate rated RPM as 80% of no load RPM
3.) Divide (#2) by 60 to get revolutions per second
4.) Determine the CNC program’s maximum step pulse frequency (in Hz)
5.) Divide (#4) by (#3), which will give you the maximum counts per revolution
6.) Divide (#5) by 4, which will give you the max line count
7.) Pick the first standard line count below (#6)

An example of using that formula with a 45kHz step pulse frequency and a maximum motor RPM of 3000:

(45kHz / 40) / 4 = 281.25


CAUTION! Never put a switch on the DC side of the power supply! This will damage, if not destroy, your drive!

Keep the power supply leads short and use the largest wire gauge that will fit in the terminals. If the lead length is more than 18” use a 1000 uF capacitor across the G320 power supply terminals. Make sure your power supply can provide the peak current the motor may draw. The power supply voltage must be between 18 VDC and 80 VDC. The actual voltage should not be more than 5 volts higher than the motor’s rated voltage.

TERMINAL 1 Power Ground
Connect the negative (black) lead of your power supply to this terminal.

TERMINAL 2 Power (+)
Connect the positive (red) lead of your power supply to this terminal. It must be between +18VDC to +80VDC.


At this point the encoder should be tested for functionality. If you wish to monitor the POSITION ERROR test point with a voltmeter or oscilloscope, then remove the cover of the drive now. If you have a choice, pick the oscilloscope.

The POSITION ERROR test point shows the difference between the command position and the actual motor position. When both are the same, the voltage will be +5VDC. For every count the motor is clockwise of the command position, the voltage will decrease by 0.04 volts. When it drops to 0.4 volts, the protection circuit takes over and resets the drive for 3 seconds. While in reset mode, the FAULT light is on.

For counter-clockwise position errors the voltage will increase by 0.04 volts for every count until it reaches 9.6 volts when again the protection circuit takes over as before.

VOLTMETER MONITORING: Place the red lead on the test point and the black lead on the large blue capacitor lead (GND) furthest from the main connector. Turn on the power supply. The FAULT light should be on for 3 seconds and then turn off. The voltmeter should read +5VDC. Turn the motor shaft clockwise VERY slowly. The voltmeter reading should decrease 0.04 volts for every encoder count. When the reading reaches 0.4 volts, the red light will turn on and the voltage will jump back to +5VDC. After 3 seconds the light will turn off. You may turn the motor shaft counter-clockwise as well. The voltage will increase then by 0.04 volts per count until it reaches 9.6 volts and trips the protection circuit.

OSCILLOSCPE MONITORING: Set the scope to 2 volts / cm vertical and about 1 millisecond per cm horizontal. Zero the trace to the bottom line on the screen. DC couple the input. Place the probe on the test point and the ground clip to the blue capacitor ground lead. Follow the steps in VOLTMETER TESTING above.


The control input group is the standard step motor drive STEP, DIRECTION and +5VDC lines. The STEP and DIRECTION signal drivers must be TTL compatible and have edge transition times of 100 ns or faster. The +5VDC is the opto-isolator common anode line and must be returned to the pulse source +5VDC supply.

TERMINAL 10 Direction
Connect the DIRECTION line to this terminal.

Connect the STEP line to this terminal.

TERMINAL 12 Common
Connect this terminal to the controller +5VDC power supply


You may wish to test the functionality of these inputs. If you used an oscilloscope in the previous section, leave it connected to the test point. If you used a voltmeter, then remove it from the drive.

Set the STEP pulse generator to about 40 pulses per second and set the DIRECTION output to clockwise (logical “1”). Turn on the power supply. After the power-on reset period of 5 seconds the FAULT light will turn off.

If you are using an oscilloscope, then the test point voltage will begin to increase until 3 seconds later it trips the protection circuit at 9.6 volts. The FAULT light will turn on for 5 seconds and voltage will snap back to +5VDC. After the FAULT turns off, the sequence will repeat again.

If you are not using an oscilloscope, just see if the FAULT light turns on and off every three seconds.


Make sure the power is off and the STEP pulse source is set to zero pulses per second. Check to see if the trimpot settings are set according to the instructions on page 2. You may wish to secure the motor so it can’t jump off the bench.

TERMINAL 3 Armature (-)
Connect the BLACK motor lead to this terminal.

TERMINAL 4 Armature (+)
Connect the RED motor lead to this terminal.


Turn on the power supply. The FAULT light should turn off after 3 seconds. If everything is correct there should be an audible “singing” noise coming from your motor. This is normal. The motor is dithering or bouncing between adjacent encoder counts. The integral term in a PID loop has infinite DC gain over time and will amplify even the smallest position error. Because encoder feedback can only occur on count edges, the loop is “blind” until it encounters an encoder count edge. It then reverses the motor direction until another edge is found, then the process repeats.

If the motor jumps slightly and the FAULT light immediately turns back on, then either the motor is wired backwards or the trimpots are misadjusted. Check the trimpot settings. If they seem right then switch the motor leads and try again. If it still doesn’t work and all the previous steps have been followed, call Geckodrive Support at the number at the end of this document.

Now turn on your STEP pulse source and ramp the speed up to see if the motor turns. It should turn clockwise with a logical “1” on the DIRECTION input.

The optimum way to tune the servo is to induce an impulse load on the motor while watching an oscilloscope to see how the motor behaves in response, then adjusting the PID co-efficient for optimal behavior.

In all cases the motor must return to the command position, what matters is how it does it. The manner in which the motor returns to its command position is called damping. At one extreme, called over damped response, the motor returns to position after a long, drawn out delay. At the other extreme, called under damped response, the motor returns to its position too rapidly, overshoots, returns and undershoots and so on until it finally settles at its command position. This is also called ringing; when extreme, the over/undershoot builds in amplitude until the motor enters violent oscillation. Between the two extremes is the optimal response called critical damping. Here the motor rapidly returns to its position with little or no overshoot in the minimal amount of time.


Don’t confuse the POSITION ERROR with the motor or machine position. The signal is actually the differential position error between the command speed and the motor speed. As noted above, sending clockwise STEP pulses moves the POSITION ERROR voltage more positive while turning the motor clockwise moves the POSITION ERROR voltage more negative.

When the motor encoder counts match the number of STEP pulses being sent one for one, the POSITION ERROR voltage stays at +5VDC. If the motor gets ahead of the STEP pulses such as during very rapid deceleration, the voltage will decrease by 0.04 volts for every encoder count the motor is ahead of the STEP pulses sent. The PID algorithm will force the motor to match the STEP input over time and restore the POSITION ERROR voltage back to +5 VDC.


GAIN and DAMPING settings generally track each other. If you increase GAIN (greater stiffness), then increased DAMPING is needed as well to restore critical damping. Be careful, increasing GAIN without increasing DAMPING may cause the motor to break out into violent oscillation.

The higher GAIN is set, the noisier the motor will be when stopped. This is because higher gain causes more vigorous dithering between encoder counts at rest. There is a trade-off between high gain (high stiffness) on one hand and excessive dithering (noise and motor heating) on the other. Use your best judgment here.

To see how your servo is compensated, it is first necessary to induce a disturbance. The easiest way is to switch the DIRECTION input while commanding a constant speed via the STEP input. The abrupt direction change puts just the momentary load needed on the motor while you watch how it responds.

If you are using an oscilloscope, use channel 1 on the test point and channel 2 on the DIRECTION input. Set the trigger to “normal”, trigger source to channel 2 and trigger edge to “+”. You should see a single sweep for every clockwise change in direction.

Slowly increase STEP speed until you get a picture similar to one of the three above, and then do the following:

1) OVERDAMPED: Decrease DAMPING or increase GAIN
2) CRITICALLY DAMPED: Do nothing; you’re there
3) UNDERDAMPED: Decrease GAIN or increase DAMPING


The current LIMIT trimpot sets maximum current the motor is permitted to have. It is adjustable from 0 amps to 20 amps. Normally the LIMIT trimpot is set to maximum (20 amps) unless you want to limit motor torque to a lower value.

Motor speed and position is unaffected by the current LIMIT setting unless the torque demand due to load exceeds this setting, then the motor position will fall behind the command position because of insufficient torque.


The FAULT indicator is on while the drive is in power-on reset, the DISABLE input is held “low” or if the protection circuit is tripped due to a fault condition. All power MOSFETs are turned off and all internal counters are reset. The FAULT condition lasts for 3 seconds, and then self-resets to try again. If the protection circuit tripped it and the cause is not cleared, then it will immediately re-enter the FAULT state again and repeat the cycle.

There are two conditions that will trip the protection circuit. One condition is if a short-circuit occurs and current exceeds 20 amps.

The other condition is if the POSITION ERROR exceeds +/- 128 counts causing a break of the servo-lock. This condition can have several causes:

1) The loop settings are severely under-damped and the motor breaks out into oscillation.
2) Excessive motor load due to acceleration or workload.
3) The speed command in excess of what the motor can deliver.
4) The current LIMIT is set too low.
5) The power supply current is insufficient for the demand.
6) The motor is wired backwards, is broken or disconnected.
7) Encoder failure.


The G320 will turn the motor in the CW direction when the DIRECTION input is “high” (logical “1”, or +5VDC). If instead CCW is preferred, then:

1) Reverse the motor “+” and “-“ leads (TERMINAL 3 with TERMINAL 4)
2) Reverse the encoder “channel A” and “channel B” leads (TERMINAL 8 with TERMINAL 9)


This terminal functions as an ERROR output and as a RESET input. Because this terminal functions as both an input and an output, some detailed description is necessary.

When first testing the G320, ERR/RES (term. 5) was connected to ENC+ (term. 7). It can be left that way if it is not necessary to read the state of the ERROR output. Otherwise, the following details are important.

The ERROR output is latched in the “ERROR” state (term. 5 = “0”) by the power-on reset circuitry in the G320. It will stay in this state indefinitely until it is cleared by applying +5V to this terminal for at least 5 seconds.

The voltage on this terminal is +5VDC when the G320 is functioning normally. The voltage on this terminal goes to 0VDC whenever the FAULT indicator is lit. This output can be used to signal your controller that an error has occurred.

The above circuit shows how to implement an external switch to clear an ERROR condition and RESET the G320, while still being able to read the state of the drive. It also includes an optional FAULT LED circuit if a remote indication of the state of the G320 is desired.

Normally when the G320 is first powered up, it will be necessary to push the momentary switch to START for 5 seconds. This will clear the power-on reset condition and extinguish the FAULT LED. The motor will then be enabled and the drive will begin to operate.

If at anytime after that a condition occurs that causes the G320 to “fault out”, such as not being able to complete a step command, the ERR/RES terminal will go to “0”, signaling the computer an error has occurred. This will require the operator to correct the problem that caused the fault and then push the switch to “START” for 5 seconds to re-enable the G320.

At anytime the operator can push the switch to the “STOP” position to immediately halt the G320 drive. Anytime the G320 is in the “FAULT” state (FAULT LED lit), all switching action stops and the motor freewheels and is unpowered. This will light the “FAULT” light.


Power Supply:                                  18 to 80 VDC
Motor Current:                                   0 to 20 Amps
Lock Range:                                      +/- 128 count following error
Feedback:                                          Quadrature TTL Encoder
Feedback Resolution:                     X4 Encoder Line Count
Switching Frequency:                      25 kHz
Current Limit:                                    0 to 20 Amp, Trimpot Adjustable
Analog PID:                                       Damping and Gain Trimpots
Step Pulse Frequency:                   0 to 250 kHz
Step Pulse “0” Time:                       0.5 Microseconds Min.
Step Pulse “1” Time:                       3.5 Microseconds Min.
Temperature Range:                      0 to 70C
Humidity:                                           Up to 95% (non condensing)
Size:                                                   2.5" X 2.5” X 0.825"
Weight:                                              3.6 oz weight
Encoder Supply:                             +5VDC, 50 mA max