Viper DC servomotor drive Manual V2.0.1

Viper DC servomotor drive Manual V2.0.1
Last edited Feb 15 2011
Full featured Industrial quality DC servodrive
Viper 75 25-75 Volt @ 10 amp model
Viper 95 25-95 Volt @ 12 amp model
Viper 100B 25-100 Volt @ 20 amp model
Viper 200B 50-170 Volt @ 20amp model
Viper 100F 25-100 Volt @ 30 amp model
Viper 200F 50-170 Volt @ 30 amp model
32 bit PID control with 16 bit RISC processor
300Khz Step rate on new F series
Step / Direction Control
Feed forward com m and
W arning output signals excessive m otor load (slow down)
Trip output signals drive has tripped
Opto isolated power and control sections
Onboard fuse (protect m otor and for safety)
4X or 1X quadrature encoder counting
Separate voltage regulator for encoder power
1,2,4,8 step m ultiplier (or any size)
Settings are program m able by RS232
Replaceable Power Mos-Fets and drivers
Large m ain capacitor.
Very efficient cool running drive.
Stack-able card-type m ounting
Up to 4 m otor configurations can be stored
Jum per selectable m otor rotation direction.
Larken Automation assumes no responsibility for any
personal injury or damage caused by use of its products.
Only electrically qualified personal should attempt to
install the Viper drive.
High voltage can be lethal and proper safety procedures
must be followed. Motors and drives should be properly
grounded to prevent electrical shock.
Safety glasses should be worn ,since electrical
components can explode causing injury or blindness
Copyright Notice
No part of this publication may be reproduced mechanically or electronically in any
form without the prior written permission of Larken Automation Inc.
Firmware on the Viper drive is property of Larken Automation and reverse engineering
or disassembly of the code is strictly forbidden.
The information in this manual is for informational use only, is subject to change
without notice and should not be construed as a commitment by Larken. Larken
assumes no responsibility or liability for any errors or inaccuracies that may appear in
this document. Viper,Starcam and Starcnc are registered trademarks of Larken
Automation Inc.
© 2006, Larken Automation Inc.
Tech support
Larken Automation Inc.
5350 Canotek Unit 13
Ottawa, Ontario
Canada, K1J 9E1
Ph: (613) 746-5685
Fax: (613) 746-6451
DC Servo Motor Basics
The DC servo motor has an optical encoder that provides feedback to the controller.
This typically can have from 100-5000 counts per turn.
The most popular type of encoder is the optical
encoder, which consists of a rotating disk, a light
source, and a 2 photodetectors (light sensor).
The disk, which is mounted on the rotating shaft,
has many slots in it. As the disk rotates, these
slots interrupt the light emitted onto the
photodetector, generating a digital or pulse train.
The encoder has 2 square wave outputs. They
are staggered at 90 deg. This way one is leading
the other when turning CW and then trailing the
other when turning CCW.
These are Channel A and B. The controller can
tell which way the motor is turning by the A-B sequence
There may be an optional Index output also. (The index is
not used by the Viper)
A differential encoder has 2 outputs for A channel and 2
outputs for B channel. The second output is an inverted
version of the origional and is designed to drive a twisted
pair cable to cancel noise. Differential encoders are
recommended for motors with cables longer than 4-6 feet.
Encoder Line count is the number of lines per turn. With-in the viper drive the line
count is decoded 4 times finer(quadrature), so with a 1000 line encoder, the viper drive
sees 4000 counts/turn. This is not to increase machine resolution, but to give the drive
more counts to reduce error.
The Step Multiplier setting in the viper sets the ratio of incoming Step/direction pulses
from the control software to the 4X encoder counts.
So with a 1000 line encoder and a step-multiplier of 4 you would have 1000 steps/turn.
With a step multiplier of 8 you would have 500 steps/turn.
With a step multiplier of 1 you would have 4000 steps/turn, but don’t be fooled thinking
your machine will be more accurate. A servo system always runs with a error of at least
a few encoder counts. Also it would require a very high input step rate to make the
motor spin fast.
We recommend a 1000 line differential encoder for most applications. Encoders with
less than 400 counts/turn should be avoided. The viper can handle up to 625Khz
encoder frequency (assuming good cableing )
A good source for encoders is
Page 3
The DC servo motor has a Permanent Magnet outside (stator) and a wire wound
armature. Carbon brushes connect the electrical power to the rotating armature. They
can either have 2 or 4 brushes. A motor with 4 brushes gives a smoother motion.
The motor also acts as a generator while spinning and under deceleration can force
power back into the drive . A fast decelerating motor or a load pushing the motor can
increase the power-supply voltage. Viper drives have at least a 25% voltage headroom
and can handle moderate over voltage.
The Viper drive uses a
Mos-Fet or an IGBT
bridge to drive the servo
The signal is Pulse Width
Modulation or PWM with a
frequency of 20,000 HZ
Viper 75 /95 Drive Connections
Viper 100/200 Drive Connectors
Page 5
Viper 100F /200F Drive Connectors
Differences between Viper 100/200 A and Viper 100/200F (after 2011 )
- The older Viper drives couldn’t read actual Current. They used a set value set by a
trim pot and could only see if the motor current was above or below that. The F series
Viper 95 and 100/200 can read current and the max motor current is now a software
- The F series drives can run up to 300Khz step input vs 125 khz for the older drives.
Page 6
Differences Viper 100/200 A vs Viper 100/200F continued
- The baudrate for the serial connection is now 38400 baud vs the previous drive which
were 9600 baud.
- Low voltage detection is a new feature that detects whether main power on the V100F
/200F is turned off and disables the drive until it comes back on. It then soft starts after
a 2 seconds. Note position is cleared so the motor doesn’t jump.
- The viper 95 low voltage detection disables and locks drive when voltage dips. This
brownout detection protects the drive since the CPU can be unpredictable during low
voltage situations.
- On the V100F /200F power and motor connectors are moved to one side for easier
mounting in cabinets.
Page 7
Selecting a Powersupply Voltage
Motors typically specify a maximum DC voltage and maximum RPM. EG: and MCG
ID34002 servo motor has a max DC voltage of 90 volts and runs 5000 rpm at 90 volts.
These are maximum ratings, however you can set the powersupply lower than this to
run the motor slower.
In a motor, the voltage determines the RPM and the current determines the Torque
When the motor is running with no load, the current is small. As the load increases the
motor draws more current from the power supply.
Current in motors are rated by Continuous stall current. This is the maximum
current the motor can take continuously without overheating. You probably won’t be
running the motor this hard all the time, so the power supply can be rated at a lower
current, maybe 60% of this value.
Most power-supplys can output 1.5 times there rated power for a short time, and since
the average power used by the servo system is usually low, you can usually use a
power supply with a lower VA rating than total calculated power.
The Fuse in the Viper drive should be the value of the continuous stall current or
slightly above to protect the motor.
The other current-rating of the motor is the pulsed peak current. This is the current
that motor damage can occur if exceeded.
The Viper drives can output peak currents at 200% of their rated current for less than 1
Setting a Safe Maximum RPM
You must decide what is the maximum RPM that you want the motor to run on your
machine, incase of a possible drive failure. (This may put full power supply voltage to
the motor and case a dangerous situation)
As a rule, set your power-supply voltage to only about 10-20% higher than what you
would need for your maximum rapid feed rate.
Running the motors at a lower voltage also reduces heat in the motor and drive and
increases motor and brush life.
Viper 100/200 Power supply recommended layout
The viper 200 uses Isolated Power and small signal sections to eliminate ground
problems associated with high power controls. This increases reliability and reduces
ground and noise problems.
- The main transformer voltage is to match motor voltage requirements.
( DC volts= AC voltage x 1.414 )
- Keep the main DC power wires short, typically 8" (20cm) or less. This is necessary
because the drive is switching a 20 Khz power signal to the motor. This frequence is
present on the incoming power wires and the longer they are the more inductance there
is. This can cause voltage spikes to exceed ratings of the mosfets and capacitors
reducing component life.
Page 9
Viper 100/200 Power supply recommended layout (continued)
- Do not put a breaker or disconnect between main capacitor and drive. This can
cause a extremely high in-rush current to the drive when the contact is closed ! This is
because the energized main capacitor will discharge into the unpowered drive and can
damage connectors and PCB traces.
Put your disconnects before the transformer to give a softer powerup. Also the
disconnect should shut down both 12volt and motor power together, to prevent the
motor from jumping back to position if the 12 volt encoder and control power was kept
-The 12volt can be disconnected while leaving the main power on however. This can be
used to reset the drive.
- The 12volt may be powered from the main transformer as a 2nd winding, but must be
isolated .
- The high power side of the viper is isolated from ground and small signal side. It is
best to keep this side isolated
- The heatsink is isolated from the viper circuit.
- The ‘side mount’ Viper drive is designed to be mounted vertically with its encoder and
motor connectors through the bach of the cabinet. The mounting screws are 8-32
The size of the Fuse should be slightly above the motors continuous current rating.
The fuse is to protect the motor from burnout !
Note: The small signal side will be grounded the to chassis ground by encoder
connector (9 pin D-type) when mounted to a case.
Warning Voltages over 80 volts can be lethal. Be sure to ground the motor frame when
testing and have viper drive mounted in grounded chassis when testing.
Viper 75/95 Power supply recommended layout
The viper 75 uses a single supply voltage. The drive uses a voltage stepdown
regulator to get its +5 voltage for cpu and encoder. This can generate a lot of heat so
the drive should be well heat sinked.
- The main transformer voltage is to match motor voltage requirements.
( DC volts= AC voltage x 1.414 )
- Keep the main DC power wires short, typically 8" (20cm) or less. This is necessary
because the drive is switching a 20 Khz power signal to the motor. This frequence is
present on the incoming power wires and the longer they are the more inductance there
is. This can cause voltage spikes to exceed ratings of the mosfets and capacitors
reducing component life.
The Viper 75 CPU will stay active until its voltage goes below 3.5 volts. This means
that when you turn off the power supply and turn it back on before the voltage has
decayed below 2-3 volts the viper may not have reset.
The Discharge Resistor is required to drain the power supply faster to allow the Viper
75 to get below its 2 volt reset voltage.
Also the Viper 75 has a Brown-out Voltage Fault to protect the mosfets incase the
power supply goes below 15 volts. This causes the error light to go on steady.
Note: The viper 75 will be grounded the to chassis ground by encoder connector (9 pin
D-type) when mounted to a case. This is recommended to reduce noise in the
encoder cables. The negative power supply input is common to the encoder connector
case as well.
Page 11
Viper Interface connections
The RS232 programming cable is available from Larken Automation
Page 13
Note : Diagram shown for a differential encoder. For a single ended encoder, use just
one connection per channel. Use (stranded) twisted pair cable for encoder wire.
Use shielded wire if available. Connect the shield on one end only to avoid current
flowing in shield.
Encoder Current
Note: Encoder current is limited to 75ma on the Viper 75 / 95 due to the internal
voltage regulator dropping the Main voltage down to 5 volts
Viper 100 / 200 maximum encoder current is 250 ma
Viper 75/ 95
maximum encoder current is 75 ma
Encoder connections
Pin 1
+5 volts out for encoder power
Pin 2
Channel B input (inverted)
Pin 3
Channel B input
Pin 4
Channel A input (inverted)
Pin 5
Channel A input
Pin 6
Pin 7
Pin 8
Pin 9
Single Ended encoders
When connecting a single ended encoder, the unused input should be pulled to ground
with a 2K ohm resistor (2000 ohm 1/4 watt).
Terminating long cables
A differential encoder is recommended for any cable longer than 6 feet (2 meters). For
very long cables it is sometimes necessary to put a terminator resistor across the
differential pairs . The resistor value is usually 150 ohms (1/4 watt), A 0.05uF capacitor
may be put in series with the resistor to reduce power consumption..
Page 15
Understanding PID control
PID stands for Proportional-Integral-Derivative These are the 3 adjustable factors
that make the controller able to keep the motor stable in the servo loop. All factors are
adjustable in magnitude by the user. A servo works by constantly correcting the position
error. The error is the difference between the encoder position and the step/dir
The Proportional term (KP) directly outputs voltage to the motor in opposite proportion
to the error. By its self though, the motor will just bounce back and forth in oscillation as
this is factor increased.
The Derivative term (KD) keeps the loop stable by comparing the latest error amount
to the last error amount. If it sees the error getting worse (over the last 2 loops), then it
increases the power in the opposite direction to correct. If it sees the error getting less,
then it reduces the correcting power to the motor.
The Integral term (K I) is a correcting factor that helps correct a positioning error by
increasing the correction higher as time goes by. EG if a load was hard to move one
way and caused a steady error to the left, the Integral would push harder and harder to
the right on each loop of the servo timing, building up as time goes by. As the load
corrected, the servo would reduce pushing to the right.
Servo Loop
The controller runs a software loop which reads the encoder and calculates a new
output power and polarity to the motors thousands of times a second.
Read encoder (motor position)
Read commanded position ( from step and direction input)
Subtract the two to get the error.
Calculate KP * error
= proportional result
Calculate KI * Integral error sum = Integral result
Calculate KD * error(T)-error(T-1) = Derivative result
Add all 3 results to create the output correction value
Convert to a PWM duty cycle and output to motor
The loops per second is an other programable setting in the Viper drive. This has a big
effect in matching the mechanical reaction time of the motor. Generally the heavier the
motor armature, the slower the loop timing needed.
Note: a motor can only respond so fast to changes in position correction.
Some drive manufacturers claim very high loop times of millions of loops per second.
A typical motor can only change its acceleration/ deceleration velocity at a rate of a few
hundreds of a second. Also if the PWM frequency is 20,000 cycles per second. The
loop time has to be slower than the PWM.
Programming the Viper Drive
The Viper is programmed by connecting to a PC using the serial RS232 port. A cable can be
made as described above. More info and the viper command set is at the end of this
Run the windows Hyper Terminal program from the Accessories group. Create a New
session using Comm1, 9600 baud, 8,1,N.
(Note: on software version 3.0 or greater Baudrate is 38400 baud. This is on drives that flash
errors as a count (not by speed) ) All new Fseries drives run at 38400 baud (after Jan 2011)
All commands are entered in lowercase and followed by a ‘carriage return’ <cr>.
Note: The viper command set is at the end of this document.
When you apply power to the viper, the letters LKR should appear on the PC screen.
Pressing <enter> should return a : prompt
Initial programming and testing can be done with the drive just connected to Control
power as shown below (use main power on V75/V95). The serial cable needs to be
connected for tuning using a windows PC running Hyperterm.
Use this setup to test the encoder using the M command. When power is first applied
the m000 s0000 will display. (m=Motor position, s=Step position) .
Turning the motor one way should increase the encoder counter and the other way
should decrease it into negative values. Note: this register is displayed in 16 bit Hex, so
negative starts from FFFF and gets smaller.
Also you can set the range command ( r ) to the number of motor counts of error
before the drive faults and flashes the LED. You can also set up a number of other
parameters without having the motor power connected.
Get familiar with the drive before connecting the main motor power.
Tuning the PID loop
Note: Be sure to have the motor mounted or clamp the motor to a table before tuning!
The motor can react very violently and cause damage or personal injury.
Note: Remove the bank jumpers (Bank 0) so the drive runs in current limited mode
when checking the wiring on a motor for the first time.
Start with KP =100 , KI =0, KD=200 and Loop=4
1) Adjust the Loop Time parameter one unit at a time either way until the motor
reduces its oscillation and disturbed responce becomes most dampened. (The range or
the loop parameter is 1-8 )
Disturb the motor with an abrupt jog or bumping a pulley
After this is set you shouldn’t need to change this parameter.
The Loop parameter matches the response to the mass of the motor and load.
EG: Very small motors may use a L setting of 1-2 ,
-Size 23 motors may use 2,3 or 4.
-Size 34 motors may use 3,4 or 5.
-Size 42 motors may use 4 -8 etc.
The length (mass) of the lead screw of size of a pulley will effect the L setting as well.
2) Increase KP, 50 points at a time until the motor gets stiffer.
3) Keep increasing KP until the motor starts to oscillate when disturbed (bump the shaft
or accelerate back and forth).
4) Then increase KD until the motor is stable. KD usually ends up about 2 times KP.
5) The KI term is usually a very small value (2-20) since it adds to its self rapidly. The
KI should be set to zero until KP and KD have been adjusted.
6) Save the parameters by using the ‘s’ command. (Saving is disabled in bank0,
Parameters in banks 1,2 and 3 can be saved)
Note: The power supply voltage also plays a part to the tuning. For any given motor,
KP and KD will need to be less when the power-supply voltage is high, compared to if
the voltage was lower. This is because a certain gain produces a duty cycle, and the
actual voltage to the motor is the power-supply voltage * duty cycle.
Tuning Summary
- KP Sets the stiffness of the motor.
- KD settles the oscillation and overshoot.
- The Loop time needs to be matched to the motor and load early in the tuning when
the KP and KD are at lower values, but can be re-adjusted at final tuning.
- KI can be added at the end to improve low-speed holding error.
- The L setting should be set early on in tuning and matches the motors mass.
Other settings include Range, Trip, Feed-Forward
Encoder Limit settings
There are 2 settings to signal that the following error is out of range.
The Range setting can be set to output a error warning to stop the cnc controller if the
following error is to high. This will hold down the Estop signal, but not disable the Viper
The Trip setting will disable the drive if exceeded, and hold down the Estop to the cnc
Both Trip and Range are in quadrature counts (lines x 4) so to set the Trip command to
3/4 of a turn of a 500 line encoder, the setting would be 1500
This setting is designed to protect the drive and motor when an extreme out of range
is detected. The max setting allowed for the Trip command is 4000.
Feed_Forward parameter
With a Stepservo drive, the faster the input step rate, the larger the following error.
This is because the motor is ‘pulled’ along by the incoming pulse train.
The Feedforward parameter can reduce high-speed following error by adding a push
that is proporional to the speed of the incoming step pulses.
Leave the ‘f’ command to zero until you get the drive tuned with the PID and L
While running the motor, read the error with the ‘e’ command. Increase the ‘f’
command until the error becomes close to zero. Start off slow and increase the speed
while increasing the ‘f’ command.
Too much Feedforward will create a leading following error.
Typically the F parameter may end up being close to the P parameter.
Using Banks for storing multiple configurations
The Viper drive allows you to setup 3 different preset configurations. This allows the
drive to be Jumper selectable in the field for your most common motors.
(See jumper settings at the end of this manual)
When you power-up the drive the current bank selected will be the one you are tuning
in this session. When done tuning that bank, Save the parameters to the EEprom with
the ‘s’ command and then you can turn the drive off.
Testing a new motor for the first time (Bank 0)
When Bank 0 (no jumpers) is selected the Viper will limit the power to the motor by
60% to protect the drive from over-current when setting up a new motor.
It’s a good idea to put a 5-10 ohm 10 watt resistor in series with the motor power (when
testing only) since if an encoder is not wired correctly the motor can violently oscillate
possibly causing drive damage by excessive current. Remove the resistor after the
wiring is confirmed correct.
You can also
set the PWM Clip
limit command ‘c’ to 200 to limit the maximum power to the motor. Its range is 100-450
(450 = 90% PWM).
You can use Bank 0 to test and program parameters for the motor, then write them
down and enter them in an other bank.
Only Bank 0 is current limited. The default KP,KI and KD are set to low values in this
bank for testing motors.
Note: The motor should ‘hold’ when power is applied if correctly wired.
Page 21
If the Motor runs away when turned on
If when setting up the motor for the 1st time and it runs on when power is applied,
Reverse the power connections to the motor. (Or reverse encoder channels A-B)
Note: The limit resistor needs to only be there for setup and should be removed before
final tuning . Use the Clip command to limit power to the motor while tuning.
Page 22
Setting Motor Current
( on New Viper F series with advanced current control )
The Viper can control the current to the motor to protect it from burnout. Motors are
rates with 2 ratings Continuous Stall current and Peak Current. The peak current is
the absolte maximum momentary amount of current the motor can take for before
damage to brushes or windings occur.
The rating thats important is the Continuous stall current. This is the maximum
continuous current the motor can take before windings overheat and destroy them
selves. The drive needs to know this rating to be able to protect the motor against
heavy overloads. If the drive sees this cuurent exceeded for more than 2-3 seconds, it
will shut down the drive and cause a overcurrent error( error 6)
When the drive see’s very high current, it automatically reduces the current to the
continuous rating. If this current stays for 2-3 seconds, the drive shuts down. It allows
peak currents up to 45 amps under accelleration/ decel but reduces it quickly to the
safe limit and holds it there.
To set the current first you need to know the Continuous Current rating (stall) of the
motor. The drive can’t accept the actual number, but you enter a lookup value from the
table below. EG to set the Viper 200 to 12 amps, enter the command a61
Use the table below to get the correct value to enter in the Viper and enter it using the
‘a’ command. (This value is used by the ADC converter on the PIC chip.).
Viper 100/200F
‘a’ value for
Viper 95F
‘a’ value for
Page 23
(To reset the drive ,disconnect the 12volt to the control side to Reset power to the drive
to reset the trip fault).
Adjusting the Current Warning pot
The adjustable trim pot on the drive allows you to set a ‘Warning current’ level that is
less than the max motor current . This can be set to indicate the machine is under
excessive load cause by a dull cutter, or jamming condition etc.
The warn doesn’t trip the drive, but flashes the Fault light ( 3 flashes) and holds down
the ‘Stop’ output if the current stays high for more than 2 seconds. When the load
reduces, the error goes away.
The Viper has 2 output signals. One is to power a flashing LED on the front panel of the
controller, and the other should be connected to your Estop signal to stop the motion
commands. These are open collector outputs and can be parallel connected to multiple
Viper drives.
Note : Its important to connect the error outputs back to the breakout board to stop the
control software.
Viper Error Indicator LED
(F series)
When an error is flashed, the Viper will hold down the Estop signal until the error is
removed. You can add a Fault override switch (normally closed) in this estop line to
allow the operator to jog the machine while holding the switch to recover from a
warning error.
It will flash the RED led a count indicating the error number
LED error count
( Version 3.0 + firmware )
Encoder Range warning (r command)
Current warn (Pot adjustment)
Under voltage on main power
Encoder Trip (t setting)
Current Trip ( exceeded motor current)
Encoder fail (no pulses)
Short circuit protection
Errors can be reset by turning off the power (12volts on V200) or using the ‘x’ command
through the terminal.
The Under voltage error will stop when the viper 200 sees the power come back on.
The drive will soft start after a few seconds. But the Error value ‘64' is kept stored in the
error register in the drive. This alows you to poll the drive to see if an under voltage
happened while the drive was running
In parameter display 2 ( seen by pressing 2<cr> in terminal) the Er line has 2
The first parameter is the error register which holds a code the same as the flash count.
The second number is the Bit Coded Live Error Flags . This is a binary number showing
current read errors. This can show more than one error. EG Encoder trip and under
Bit 0 Trip current
Bit 1 warn current
Bit 2 Encoder range
Bit 3 Encoder Trip
Bit 4 Under voltage
Bit 5 Encoder fail
Bit 6 ---Bit 7 Short circuit failt
EG: Er 04,11
04= Under voltage 11=current trip and undervolts
Page 25
Adjusting Current limit and Current warning
(For older Viper A &B series with trim pots)
There are two trim pots on the Viper. The one closest to the edge of the board is the
Current Trip setting, and the other is the Current Warning setting.
Turning these pots (potentiometers) CW increases the amount of current allowed to
the motor, and turning them CCW makes them trip at a lower current.
NOTE : use a plastic or non metallic screw driver to adjust these pots, to prevent shorts
or electrical shock if the screwdriver touches the PCB board.
Adjusting the Current Limit and Trip
To start adjust the both pots at about midpoint. With the motor holding, apply a
twisting to the shaft to simulate an excessive load of the amount that you want to trip
the drive.
Note: Be careful not to cause excessive high current and damage motor or drive.
While holding the motor in this position, adjust the trip pot CCW until the red LED lights.
The motor shaft may cycle slightly as the CPU reduces and holds the PWM cycle
indicating current limiting.
Holding the red light on for 2 seconds will make the drive cut the power to the motor
and flash the Fault light rapidly. This is a fault trip condition.
(To reset the drive ,disconnect the 12volt to the control side to Reset power to the drive
to reset the trip fault).
Adjusting the Current Warning pot
Do the same to adjust the Warning limit pot with less of a load on the motor. The
yellow LED is used to set this current. Use a small load to activate the Warn setting.
The warn doesn’t trip the drive, but flashes slowly the Fault light and holds down the
‘Stop’ output if the current stays high for more than 2 seconds. When the load reduces,
the error goes away. Set the Yellow LED to come on at a lower load than the red.
This can be set to indicate the machine is under excessive load cause by a dull cutter,
or jamming condition etc.
The Software error range setting causes the Fault light to flash very slowly and holds
down the ‘Stop’ output as well if the motor goes out of range for more that 2 seconds.
When the motor error is less than the range setting the error goes away.
The Viper has 2 output signals. One is to power a flashing LED on the front panel of the
controller, and the other should be connected to your Estop signal to stop the motion
commands. These are open collector outputs and can be parallel connected to multiple
Viper drives.
Page 26
When an error is flashed, the Viper will hold down the Estop signal until the error is
removed. You can add a Fault override switch (normally closed) in this estop line to
allow the operator to jog the machine while holding the switch to recover from a
warning error.
LED flashing errors (Older Viper A&B series)
Slow flash
Medium flash
Fast flash
Very fast
- Motor is out of position range (motor power still enabled)
- Warn current reached (motor power still enabled)
- Current trip reached and Output power has been disabled
- Encoder trip (Exceeded T setting)
Page 27
Adjusting Balance or Motor Offset
If the motor has a constant load in one direction such as lifting a load then there may be
more of an error in one direction than the other.
The balance command lets you preset a PWM value other than Zero as its neutral, so
even with zero error the motor will be applying torque in that direction.
To adjust this setting , disconnect the encoder and step inputs.
Without the encoder connected and with no step input there will be no error . This will
make the drive output a zero PWM value (50% effective at the motor).
Change the ‘b’ command until the load is neutralized and the motor stops turning under
load. Values of up to + - 100 are allowed, but shouldnt be exceeded since the motor is
always under load and may overheat. Use the ‘s’ command to save the setting
A mechanical counter-balance to the machine should be added if the offset is high to
prevent motor heating.
Friction Compensation
On systems where there is a lot of friction (or stiction) the motor may no start to turn at
all until it hits certain level of power. So the motor may not start the load until the PWM
is al least 10.
The ‘h’ command allows you to set the lowest PWM value (which is normally zero).
To tune this command, connect the drive with the encoder disconnected.
You will need to have a Step/dir source that can output 1 pulse at a time to create
an error which causes the PWM to gradually increase.
First, lower the ‘p’ setting to 50 and set ‘I’ to zero and ‘d’ to zero . Set the ‘h’ command
to zero also.
Slowly apply step pulses one at a time and the motor should start to turn.
Use the ? Command to see what the drives output PWM value is currently at.
Apply step pulses in the opposite direction and until the motor just stops turning. Read
the drives PWM value and write it down. This is the value the h command needs to
overcome the friction in the system. Enter it and use the ‘s’ command to save the
Viper command set
Command Description
Data entry
p nnnn
Enter Proportional term
i nnnn
Enter Integral term
d nnnn
Enter Derivative term
Enter step size (jump)
Enter Loop term
n nn
Enter number of bank
r nnnn
Enter error range limit
c nn
Enter pwm Clip limit (100-450)
h nn
Enter hysterisis (friction) compensation
b nn
Enter Balance control (motor offset)
f nnnn
Enter Feed_Forward term
t nnnn
Enter encoder Trip limit
a nn
Enter current parameter
Read settings group 1
1<cr> Returns N, P, I, D, L, data
Read settings group 2
2<cr> Returns F, T, (PWM) data
Read settings group 3
?<cr> Returns A,Real_current,pot
Get servo error in Hex
e<cr> -00A1
Get software version
v<cr> V2
Get motor encoder and step position
m<cr> m00F0 s00F1 (hex result)
Disable power to motor
Enable motor power
Set defaults and save to EEprom
Read data
Save settings to EEprom
Notes <cr> = enter. Only change Bank# if you are entering data for banks other than the bank
selected by the jumper (for saving).
Page 30
Run the windows Hyper Terminal program from the Accessories group. Create a New session
using Comm1, 9600 baud, 8,1,N. In the advanced tab, set Flowcontrol to ‘None’
If Hyper-term isn’t on your system then it can be installed from your windows cd rom or
downloaded from the internet.
All commands are entered in lowercase and followed by a ‘carriage return’ <cr>.
Example screen shot of Hyperterm.
- The ? Command shows the current settings. The Kp is 575
- A new Kp of 600 is programmed using the command p650
- The bank is saved.
- Power is disconnected and the drive reset which shows LK R
- The ? Command shows the Kp was changed to 650 and stored in EEprom.
Page 31
Selecting Jumpers
Component Data
Parts supply
( Available from Digikey 1-800-344-4539 )
Fuse 5, 7.5, 10, 15 or 20 amp automotive type. Select the fuse amperage to protect motor
winding or machine from damage incase of drive failure.
Power Mosfets for Viper 100 / 200 IRFB 4232 PBF 56 amp 250volt mosfet
Mosfet driver chips
IR 2104
8 pin dip
Output and motor power (Viper 100s)
Digikey Part #
Pheonix 2 pin plug green power 10 amp
Output and motor power (Viper 200)
Pheonix 2 pin plug green power 20 amp
Small connectors
Digikey Part #
tiny Crimp term .1" for block
Housing 2 Pin .1" (for 15 volt power)
Housing 3 Pin .1" (for fault output)
Housing 4 Pin .1" (for step/ direction)
Housing 5 Pin .1" (for RS232 )
A Crimping tool for .1" block connectors is highly recommended
For a professional job, use a crimp tool such as this one from