Servo Tuning: C H A P T E R
Servo Tuning: C H A P T E R
Servo Tuning: C H A P T E R
Servo Tuning
In a Hurry?
You should tune the 6270 before attempting to execute any
motion functions. At a minimum, complete this chapter's Tuning Setup
Procedure and Controller Tuning Procedures until you have found a
proportional feedback gain that can give a stable response for your system.
(The Drive Tuning Procedure below is for use with velocity drive systems
only, not for servo valve systems.) Then you can proceed to execute your
motion functions. To gain a full understanding of tuning, you should read
through this entire chapter and follow its procedures to ensure your system
is properly tuned.
➃ Servo Tuning 29
Servo System Terminology
This section gives you with an overall understanding of the principles and
the terminology used in tuning the 6270.
Offset
Ope n Loop Sys tem SOFFS Servo Hydraulic
Offset Drive Command = Offset Valve Cylinder,
or Motor, Load
Drive etc.
Feedback Device
(LDT, Encoder, or AN Input)
The 6270 has the capability of providing an analog voltage output of ±10V or a
current of ±20mA, ±50mA, ±60mA, ±80mA, ±100mA, or ±150mA for
commanding the valve or drive. After the digital control algorithm has
calculated the digital control signal, this digital value is sent out from the DSP
(digital signal processor) to the Digital-to-Analog converter (DAC). The DAC
has an analog output range of -10V to +10V or maximum current. It is often
possible that the digital control signal calculated by the control algorithm can
exceed this limit. When this happens, the analog output would just stay, or
saturate, at the maximum limit until the position error changes such that the
control algorithm would calculate a control signal less than the limit. This
phenomenon of reaching the output limit is called controller output
saturation. When saturation occurs, increasing the gains does not help
improve performance since the DAC is already operating at its maximum level.
➃ Servo Tuning 31
Position Variable Terminology
In a servo system, there are two types of time-varying (value changes with
time) position information used by the controller for control purposes:
commanded position and actual position. You can use this information to
determine if the system is positioning as you expect.
Commanded The commanded position is calculated by the motion profile routine
Position based on the acceleration (A, AA), deceleration (AD, ADA), velocity (V) and
distance (D) command values and it is updated every servo sampling period.
Therefore, the commanded position is the intended position at any given
point of time. To view the commanded position, use the TPC (Transfer
Commanded Position) command; the response represents the commanded
position at the instant the command is received.
When this user guide refers to the commanded position, it means this calculated
time-varying commanded position, not the distance (D) command. Conversely,
when this user guide refers to the position setpoint, it means the final
intended distance specified with the distance (D) command. The following plot
is a typical profile of the commanded position in preset (MCØ) mode.
Setpoint
Profile
Complete
Commanded
Position
Position
Distance
(D)
Constant
Acceleration Deceleration
Velocity
Time
➃ Servo Tuning 33
Servo Response Terminology
Stability The first objective of tuning is to stabilize the system. The formal definition
of system stability is that when a bounded input is introduced to the
system, the output of the system is also bounded. What this means to a
motion control system is that if the system is stable, then when the
position setpoint is a finite value, the final actual position of the system is
also a finite value.
On the other hand, if the system is unstable, then no matter how small the
position setpoint or how little a disturbance (motor torque variation, load
change, noise from the feedback device, etc.) the system receives, the position
error will increase continuously, and exponentially in almost all cases. In
practice, when the system experiences instability, the actual position will
oscillate in an exponentially diverging fashion as shown in the drawing
below. The definition here might contradict what some might perceive. One
common perception shared by many is that whenever there is oscillation,
the system is unstable. However, if the oscillation finally diminishes
(damps out), even if it takes a long time, the system is still considered stable.
The reason for this clarification is to avoid misinterpretation of what this
user guide describes in the following sections.
Position The following table lists, describes, and illustrates the six basic types of
Response Types position responses. The primary difference among these responses is due to
damping, which is the suppression (or cancellation) of oscillation.
Position
oscillate in an exponentially diverging
fashion.
Time
These three measurements are made before or shortly after the hydraulic
cylinder (or motor, etc.) stops moving. When it is moving to reach and settle
to the setpoint, we call such period of time the transient. When it is not
moving, it is defined as in steady-state.
A typical stable position response plot in preset mode (MCØ) is shown below.
Settling Time
Target Zone Mode
Settling Band
Setpoint Setpoint
Commanded
Position Overshoot Steady State
Position Error
Position
Actual
Position
Rise Time
Time
➃ Servo Tuning 35
6000 Series Servo Commands
NOTE
The following list briefly describes each servo-related 6000 Series command. More
detailed information can be found in the rest of this chapter and within each command's
description in the 6000 Series Software Reference Guide .
* The negative gain commands (SGAFN, SGIN, SGPN, SGVN, and SGVFN) allow you to establish gains to be used when the
position error is negative. The negative gain value will track the positive gain value until a separate negative gain value is
entered. To re-establish the default mode where the negative gain tracks the positive gain, issue the negative gain
command with a minus sign (-) in the command field for the affected axis (e.g., SGPN,- restores axis 2 to the default mode).
➃ Servo Tuning 37
Servo Control Techniques
To ensure that you are tuning your servo system properly, you should
understand the tuning techniques described in this section.
The 6270 employs a PIV&F servo control algorithm. The control techniques
available in this system are as follows:
P .....Proportional Feedback (controlled with the SGP and SGPN commands)
I ......Integral Feedback (controlled with the SGI and SGIN commands)
V.....Velocity Feedback (controlled with the SGV and SGVN commands)
F .....Velocity and Acceleration Feedforward (controlled by the SGVF and SGAF
and SGVFN and SGAFN commands, respectively)
The block diagram below shows these control techniques in relation to the
servo control algorithm configuration. The following table presents a
condensed summary of each control's effect on the servo system.
Position
Position Error at T1
Time Time
Integral
Windup wd Windup Limit wd
Duration (SGILIM)
(wd)
0V 0V
T1
wd
➃ Servo Tuning 39
Velocity Feedback Control (SGV)
When velocity feedback control is used, the control signal is proportional to
the feedback device's velocity (rate of change of the actual position). The Servo
Gain Velocity (SGV) command sets the gain, which is in turn multiplied by the
feedback device's velocity to produce the control signal. Since the velocity
feedback acts upon the feedback device's velocity, its control action essentially
anticipates the position error and corrects it before it becomes too large. Such
control tends to increase damping and improve the stability of the system.
A high velocity feedback gain (SGV) can also increase the position tracking
error when traveling at constant velocity. In addition, setting the velocity
feedback gain too high tends to slow down (overdamp) the response to a
commanded position change. If a high velocity feedback gain is needed for
adequate damping, you can balance the tracking error by applying velocity
feedforward control (increasing the SGVF value—discussed below).
Since the feedback device's velocity is derived by differentiating the feedback
device's position with a finite resolution, the finite word truncation effect
and any fluctuation of the feedback device's position would be highly
magnified in the velocity value, and even more so when multiplied by a high
velocity feedback gain. When the value of the velocity feedback gain has
reached such a limit, the motor (or hydraulic cylinder, etc.) will chatter
(high-frequency, low-amplitude oscillation) at steady state.
Negative Gains
The negative gain commands (see list below) allow you to establish gains to
be used when the position error is negative.
SGPN ........Proportional Gain Negative
SGVN ........Velocity Gain Negative
SGIN ........Integral Gain Negative
SGVFN ......Velocity Feedforward Gain Negative
SGAFN ......Acceleration Feedforward Gain Negative
SGP
SGV
Positive Position Error
SGI
Actual (positive gains used)
Position SGVF
SGAF
Time
The 6270 automatically switches between the positive and negative gains to
correlate with the positive or negative position error. This is particularly
useful when controlling hydraulic cylinders in which the different surface
areas on each side of the piston react differently with the same gain settings.
Each negative gain changes with (tracks) the corresponding positive gain
value until a negative gain command is executed. For example, the SGPN
value automatically tracks the SGP value until an SGPN command is executed
with a value other than the current SGP command value. After the negative
gain command is executed, separate positive and negative gain commands
must be used.
To re-establish the default mode where the negative gain tracks the positive
gain, issue the negative gain command with a minus sign (-) in the command
field for the affected axis (e.g., SGPN,- restores axis 2 to the default mode).
Gain Sets
An added dimension to the control techniques discussed in the previous
section is to group the gains into “gains sets” that can be invoked to affect
motion under certain conditions. Gain sets may be useful for applications in
which you would like to invoke different gains a different portions of a move
profile, or at rest, or based on an external process, etc.
The SGSET command allows you to save the currently active gains, control
signal offsets (SOFFS and SOFFSN), and maximum position error (SMPER)
setting, to a specified gain set (see list below).
SGPN ........Proportional Gain Negative
SGVN ........Velocity Gain Negative
➃ Servo Tuning 41
SGIN ....... Integral Gain Negative
SGVFN...... Velocity Feedforward Gain Negative
SGAFN...... Acceleration Feedforward Gain Negative
SGILIM .... Integral Windup Limit
SOFFS...... Servo Control Signal Offset
SOFFSN .... Servo Control Signal Offset Negative
SMPER...... Maximum Allowable Position Error
The gain set saved with the SGSET command can be enabled/recalled later
with the SGENB command or the SSWG command. Using the SGENB command,
the gains can be enabled during motion at any specified point in the profile,
or when not in motion (see programming example below). If using the SSWG
command, the gain set is referred to as the “setpoint window gain set” and is
invoked after the commanded profile is complete (see Setpoint Window
Gains below for details).
NOTE
The tuning gains saved to a given gain are specific to the current feedback source (selected
with the last SFB command) at the time the gains were saved with the SGSET command.
Later, when you enable the saved gain set, make sure that the gain set you enable
is appropriate to the feedback source you are using at the time.
To display the gain values currently in effect, use the TGAIN command. To
display the contents of a particular gain set, use the TSGSET command.
DACLIM
SSWD SSWD
Setpoint Window
Hysteresis (25%)
Setpoint Window
SOFFS Gainset (SSWG)
Setpoint Window
DACMIN
DAC
Normal Gainset Output
(-)
The diagram above makes two assumptions. First, for simplicity, only a proportional gain is being used. Second,
related to the SSWG gain set, the proportional gains (SGP and SGPN) are lower than those used in the normal gain
set and the offsets (SOFFS and SOFFSN) are set to zero.
The arrows on the above diagram illustrate the hysteresis loop. The SSWG gains are used until the position error
increases to a value of 25% greater than the number specified in the SSWD command. At this point, the normal
gain set is automatically substituted until the position error falls below the value in the SSWD command when the
SSWG gains are returned.
Finally, the maximum positive DAC voltage is determined by the value in the DACLIM command and the
maximum negative value is determined by the DACMIN command.
➃ Servo Tuning 43
Open Loop Operation
When the control algorithm is used, the whole servo system is a closed-loop
system (see diagram below). It is called closed loop because the control
algorithm accounts for both the command (position, velocity, tension, etc.)
and the feedback data (from the LDT, encoder, or ANI input); therefore, it
forms a closed loop of information flow.
Closed Lo op System
Offset
Control Drive Command = Servo Hydraulic
Command Digital Signal Control Signal + Offset Valve Cylinder,
Control or Motor, Load
Algorithm Drive etc.
When all gains are set to zero, the digital control algorithm is essentially
disabled and the system becomes an open loop system (see diagram below).
Open loop operation could be used during system setup or troubleshooting so
that you can independently test the drive/motor or valve operation (the
Tuning Setup Procedure below demonstrates open-loop operation).
Offset
Open Loop System SOFFS Servo Hydraulic
Offset Drive Command = Offset Valve Cylinder,
or Motor, Load
Drive etc.
Feedback Device
(LDT, Encoder, or AN Input)
WARNING
The tuning process requires operation of your system's electrical and mechanical
components. Therefore, you should test your system for safety under all potential conditions.
Failure to do so can result in damage to equipment and/or serious injury to personnel.
E M E R G E N C Y S H U T D O W N : You should be prepared to shut down the valve or drive
during the tuning process (for instance, if the system becomes unstable or experiences a
runaway). You can use the E N B L input (disconnect it from ground) to disable the 6270's
analog output signal. An alternative is to issue the @DRIVEØ command to the 6270 over the
communication interface, but this requires connecting a shutdown output to the drive. If the
drive does not have a shutdown input, use a manual emergency stop switch to disable the
valve's/drive's power supply.
Step 1 Drive Users Only: If you are using a rotary drive, make sure the power to
the drive is off.
Step 2 Apply power to the 6270 only and issue the DRIVE11 command. Measure the
6270's analog output between the CM D + and CM D - terminals on the D R IVE
connector with both an oscilloscope to check for noise and a digital volt-meter
(DVM) to monitor the analog output. Both readings should be very close to
zero. If an offset exists, ignore it for now; it will be taken care of later in step 8.
Step 3 If your system has mechanical stops, manually move the load to a position
mid-way between them.
Step 4 Enter these commands to zero all the gains and run the system in open loop:
Open-Loop Operation ☞ C o m m an d D escr ip t io n
> SGPØ,Ø Set the proportional feedback gain to zero
> SGVØ,Ø Set the velocity feedback gain to zero
> SGIØ,Ø Set the integral feedback gain to zero
> SGVFØ,Ø Set the velocity feedforward gain to zero
> SGAFØ,Ø Set the acceleration feedforward gain to zero
Step 5 Drive Users Only: Apply power to the drive. The motor shaft should be
stationary or perhaps turning very slowly (velocity drives only). A small
voltage to a torque drive, with little or no load attached, will cause it to
accelerate to its maximum velocity. Since the torque demand at such a low
voltage is very small, you can prevent the shaft from moving by holding it.
➃ Servo Tuning 45
Step 6 Observe the 6270's analog output noise level on the oscilloscope. Typically, the
ideal noise level should be below 3.0mV, but inevitably you must determine the
☞ acceptable noise level for your application.
The control method (voltage
or current output) is selected If the noise level is acceptable, proceed to Step 7. If the noise level is too high:
with internal jumpers. The
default is voltage output. If
you required current output, a . Turn all the power off and tie the earth grounds of all the electrical
refer to the instructions in components of your system to a single common earth ground point.
Chapter 6 to change the
appropriate jumpers. b. Shield the drive or valves properly and shield all the wiring that
interconnect the components.
c. After you have completed a and b above, turn on the controller only and
start over from Step 2. If the noise level is still unacceptable, consult the
noise suppression techniques described in Appendix A.
Step 7 The purpose of this step is to ensure that a positive voltage on the 6270's
analog control signal output (from the CM D + and CM D - terminals) results in
the feedback device counting in the positive direction.
a . Using the SMPER command, set the maximum allowable position error to 1
inch by entering the SMPER1,1 command. This assumes the default scaling
factor (1 distance value = 432 counts, or 1 inch) is still in effect.
b. Enter the TFB command to check the current position of the feedback
devices. Record this number for later use.
c. CAUTION
The offset introduced in this step may cause an acceleration to a high speed, if there is
little or no load.
NOTE
Be sure to complete the Tuning Setup Procedure before proceeding with the following drive
tuning procedure. Unlike the Tuning Setup Procedure, you must tune one axis at a time.
Step 1 Tune the drive to output the desired velocity at a given voltage from the 6270:
a . If your system has mechanical stops, manually move the load to a
position mid-way between them.
b. Enter the SOFFS command to set the 6270's output voltage to its maximum
level, 10.0 volts (SOFFS1Ø for axis 1, or SOFFS,1Ø for axis 2).
c. Adjust the drive gain factor (sometimes called the tach gain) such that when
the 6270's command output is 10V, the velocity just reaches its maximum
value (check the velocity with the TVELA command). Refer to your drive's
user documentation if necessary.
EXAMPLE
Suppose your drive can run at a max. velocity of 7000 rpm (or 116.67 rps). If the drive
gain factor is 20 rps/V, then the drive will reach the maximum velocity (116.67 rps) when
the 6270's command output is only 5.833V. This means the full range of ±10V is not fully
usable. To use the full range of ±10V, the gain factor has to be adjusted to 11.667 rps/V.
Drive manufactures usually provide a potentiometer for adjusting this gain factor. Some
manufacturers provide a few preset values selectable with jumpers or DIP switches.
➃ Servo Tuning 47
b. Observe the plot of the commanded velocity versus the actual velocity on
the oscilloscope.
Using the tuning methods specified in the drive's user documentation,
tune the drive to achieve a first-order response (no overshoot) as
illustrated below—repeat Steps 2.a. and 3.b. as necessary.
Command Velocity
VELOCITY
Actual Velocity
TIME
Step 3 Proceed to the Controller Tuning Procedure section to tune the 6270.
NOTE
The SSFR setting affects the dither frequency ratio (SDTFR setting) and the LDT position update
rate (LDTUPD setting). If the sampling rate is too fast for the LDT, position errors or bad LDT
reads will occur. The occurrence of read errors can be monitored with the TAS and [ AS ]
command bit #27. Refer to the SSFR, SDTFR, and LDTUPD command descriptions in the 6000
Series Software Reference Guide for more details.
NOTE
Changing the active axes with the INDAX command will change the SSFR ratio.
# of Axes SSFR Servo Sampling Update Motion Trajectory Update System Update
Active Command Frequency Period Frequency Period Frequency Period
(INDAX) Setting (samples/sec.) (µsec) (samples/sec.) (µsec) (samples/sec.) (µsec)
INDAX1 SSFR1 3030 330 3030 330 757 1320
INDAX1 SSFR2 4000 250 2000 500 500 2000
INDAX1 SSFR4 4651 215 1163 860 581 1720
INDAX1 SSFR8 4878 205 610 1640 610 1640
INDAX2 SSFR1 1667 600 1667 600 417 2400
INDAX2 SSFR2 2272 440 1136 880 568 1760
Default → INDAX2 SSFR4 2500 400 625 1600 625 1600
INDAX2 SSFR8 2667 375 333 3000 333 3000
The general rule to determining the proper SSFR value is to first select the
slowest servo sampling frequency that is able to give a satisfactory response.
This can be done by experiment or based on the closed-loop bandwidth
requirement for your application. (Keep in mind that increasing the SSFR
value allows for higher bandwidths, but produces a rougher motion profile;
conversely, decreasing the SSFR value provides a smoother profile, but makes
the servo system less stable and slower to respond.)
As an example, if your application requires a closed-loop bandwidth of
300 Hz, you can determine the minimum servo sampling frequency by using
the rule of thumb—setting the servo sampling frequency at least 8 times
higher than the bandwidth frequency—the required minimum servo
sampling frequency would be 2400 Hz. If two axes are running (INDAX2), then
you should try using the SSFR4 setting.
The table below provides guidelines for various application requirements.
Application Requirement SSFR1 SSFR2 SSFR4 SSFR8
XY Linear Interpolation ✔ ✔
Fast point-to-point motion ✔ ✔
Regulation (speed, torque, etc.) ✔ ✔
High natural frequency system ✔
➃ Servo Tuning 49
Step 3 Set the Maximum Position Error (SMPER):
The SMPER command allows you to set the maximum position error allowed
before an error condition occurs. The position error, monitored once per
system update period, is the difference between the commanded position and
the actual position as read by the feedback device selected with the last SFB
command. Larger values allow greater oscillations/motion when unstable;
therefore, smaller SMPER values are safer.
When the position error exceeds the value entered by the SMPER command, an
error condition is latched (see TAS or AS bit #23) and the 6000 controller
issues a shutdown to the faulted axis and sets its analog output command to
zero volts. To enable the system again, the appropriate DRIVE1 command
must be issued, which also sets the commanded position equal to the actual
feedback device position (incremental devices will be zeroed).
If the SMPER value is set to zero, the position error condition is not
monitored, allowing the position error to accumulate without causing a
fault.
Step 4 Optimize the Proportional (S G P ) and Velocity (S G V ) gains (see illustration for
tuning process ):
a . Enter the following commands to create a step input profile (use a comma
in the first data field when tuning axis 2—e.g., D,1ØØ):
C o m m an d D escr ip t io n
> A999 Set acceleration to 999 units/sec2
> AD999 Set deceleration to 999 units/sec2
> V3Ø Set velocity to 30 units/sec
> D1ØØ Set distance to 100 units
Increase SGP
UNTIL
OR
OR
Decrease SGV
UNTIL Increase SGV
UNTIL
OR
Decrease SGV
UNTIL
OR
STOP
Decrease SGP
UNTIL
OR
Increase SGV
UNTIL OR
Decrease SGV
UNTIL
Step 5 Use the Integral Feedback Gain (S G I ) to reduce steady state error:
☞ a . Determine the steady state position error (the difference between the
Steady state position error is commanded position and the actual position). You can determine this
described earlier in the error value by the TPER command when the load is not moving.
Performance Measurements
section.
NOTE
If the steady state position error is zero or so small that it is acceptable for your
application, you do not need to use the integral gain. For hydraulic
applications, it is usually best to use a small SGI value, or use SGIØ while moving and
use SGIn when stopped. The use of the Target Zone Settling Mode (STRGTE) is
recommended.
➃ Servo Tuning 51
b. If you have to enter the integral feedback gain to reduce the steady error,
start out with a small value (e.g., SGIØ.1). After the gain is entered,
observe two things from the response:
• Whether or not the magnitude of steady state error reduces
• Whether or not the steady state error reduces to zero at a faster rate
c. Keep increasing the gain to further improve these two measurements until
the overshoot starts to increase and the response becomes oscillatory.
d. There are three things you can do at this point (If these three things do not
work, that means the integral gain is too high and you have to lower it.):
1st Lower the integral gain (SGI) value to reduce the overshoot.
2 nd Check whether the 6270's analog output saturates the ±10V limit; you can
do this by observing the signal from a digital oscilloscope. If it saturates,
then lower the integral output limit by using the SGILIM command. This
should help reduce the overshoot and shorten the settling time.
Sometimes, even if the analog output is not saturated, you can still reduce
the overshoot by lowering SGILIM to a value less than the maximum
☞ output value. However, lowering it too much can impair the effectiveness
If you are using current control, of the integral feedback.
convert the offset from
milliamps to volts and enter the 3 rd You can still increase the velocity feedback gain (SGV value) further,
result in the SGILIM
command. provided that it is not already at the highest possible setting (causing
the motor or valve to chatter).
Step 6 Use the Velocity Feedforward Gain (SGVF) to reduce position error at
constant speed:
a . Execute a continuous (MC1 command) move, setting the acceleration,
deceleration and velocity values appropriate to your application. Set the
SGVF value to be the product of SGP ∗ SGV (if SGV = zero, set SGVF equal to SGP).
NOTE
The steps shown below (steps 1 - 11) represent the major steps of the process; the actual
progression between these steps usually requires several iterations.
The motion command used for this example is a step command with a step
size of 100. The plots shown are as they might appear on a scope (X axis =
time, Y axis = position).
Step 1 For a starting trial, we set the Commanded Position
proportional feedback gain (SGP) to
2. As you can see by the plot, the
response is slow.
In the next step, we should increase
SGP until the response is slightly SGP = 2
underdamped.
Actual Position
➃ Servo Tuning 53
Step 6 Lowering the SGV gain to 2.3 does not
help reduce the chattering by much.
Therefore, we should lower the SGP
gain until chattering stops.
SGP = 105
SGV = 2.3
SGP = 70
SGV = 2.52
Position
from the move trajectory. The 6270 Move is actually
Completed
considers the current preset move to be Actual
Time
complete when the commanded
trajectory has reached the desired target When the Target Zone Mode
is not enabled, the move is
position; after that, subsequent considered to be complete
and subsequent moves can
commands/moves can be executed for now be executed.
Velocity
that same axis. Consequently, the next
move or external operation can begin
Actual
before the actual position has settled to Commanded
the commanded position (see diagram).
Time
Commanded Commanded
Position
Position
Move Move
Completed Completed
Actual Actual
Time Time
Commanded
STRGTV STRGTV
(Velocity Zone) (Velocity Zone)
Time Time
TSTLT
(Actual Settling Time)
➃ Servo Tuning 55
Checking the Using the TSTLT command, you can display the actual time it took the last
Actual Settling move to settle into the target zone (that is, within the distance zone defined
Time by STRGTD and less than or equal to the velocity defined by STRGTV). The
reported value represents milliseconds. This command is usable
whether or not the Target Zone Settling Mode is enabled with
the STRGTE command.