Class Ssab_ServoReg
|
Redaktör |
Jonas Haulin |
|
Version |
1.0 |
|
Modified |
25-JAN-2006 14:57:22.76 |
|
Kod |
ssabox_plc_servoreg.c |
|
Servoregulator with direct positioning


The function works as a combined servo regulator, deadzone and positioning ramp.
The features may be used individually or all at once.
It was developed to ensure trajectory tracking and positioning in automated cranes with anti-sway control,
but can be deployed for any positioning problem. The output of the function is a velocity reference.
A brief description of the features:
1. The servo regulator is used to enhance the real-time reference tracking of a system.
It is a simple three-term regulator, where the output is determined as
uReg = kP*(uReference - uMeasured) + kI*(xR - xM) + kD*(aR - aM)
If a non-zero PID delay time is set (see DelayPID attribute), input reference
values will be placed in a queue and extracted to the PID regulator with the given delay.
This is useful if a delay is unavoidable, but acceptable if it is uniform throughout travel.
The D-part should not be used if a low-noise measured signal aM is not available.
2. The positioning ramp limits the output according to the equation
uRamp = -DelayRamp*amaxS + sqrt(DelayRamp^2*amaxS^2 + 2.0*|Delta x|*amaxS)
where Delta x is the remaining distance to the command position.
In the case of zero delay, uRamp(x) is just a constant deceleration curve,
where amaxS is the magnitude of deceleration.
3. The deadzone sets the output to zero, if within its limits. A second larger deadzone that is
activated after a specified time within its limits may also be used.
See also
RtBody attributes pwr_sClass_Ssab_ServoReg |
Float32 |
aR |
AR |
Current reference acceleration of the desired trajectory. The input is used by the PID regulator of the object. |
Float32 |
uR |
UR |
Current reference velocity of the desired trajectory. The input is used by the PID regulator of the object. |
Float32 |
xR |
XR |
Current reference position of the desired trajectory. The input is used by the PID regulator of the object. |
Float32 |
ac |
AM |
Current measured acceleration. The input is used by the PID regulator of the object. |
Float32 |
uc |
UM |
Current measured velocity. The input is used by the PID regulator of the object. |
Float32 |
xc |
XM |
Current measured position. The input is used by the PID regulator of the object. |
Float32 |
xCommand |
XCOM |
Command position. Final travel destination. |
Float32 |
umaxP |
MAXP |
Maximum positive output velocity. This value may depend on other system variables,
such as local low-speed restrictions etc, and is therefore supplied as an input. |
Float32 |
umaxN |
MAXN |
Maximum negative output velocity. Same as above, but this value should be < 0,
and reflects a restriction on movement in the other direction. |
Boolean |
positioning |
pos |
If true, and if the ramp is enabled, the control output is initially set to umaxP or umaxN,
depending on the sign of Delta x, the distance to the command position.
The output is then limited by the ramp. The effect is a very accurate positioning, given that
the relevant parameters are set correctly.
Direct positioning disables the PID regulator, as the two cannot be used simultaneously. |
Boolean |
enable |
en |
On/Off switch. If false, uR is simply passed untouched through the object. |
Float32 |
amaxS |
|
"Soft" maximum acceleration, i.e. the acceleration or deceleration that the system
can be guaranteed to uphold. |
Boolean |
enablePID |
|
Enabling or disabling of PID regulator. The positioning input overrides this setting, however. |
Array of Float32 |
kPID |
|
PID constants:
kPID[0] - kP
kPID[1] - kI
kPID[2] - kD |
Float32 |
DelayPID |
|
Reference delay in seconds. |
Int32 |
maxdelaysteps |
|
Limit as to how many time steps will be stored in the queue.
If DelayPID / ScanTime > maxdelaysteps, the full delay will not be realized. |
Pointer to Float32 |
RefListp |
|
Pointer to the reference list / queue. |
Boolean |
enableRamp |
|
Pointer to the reference list / queue. |
Float32 |
DelayRamp |
|
Delay parameter in the ramp model. A larger delay causes a less steep deceleration. |
Boolean |
enableDZ |
|
Enabling or disabling of deadzone. |
Float32 |
DeadZone |
|
Determines the extension of the deadzone in both directions about the command position.
Interval = [xCommand - DeadZone, xCommand + DeadZone] |
Boolean |
enableTDZ |
|
Enabling or disabling of timer deadzone. |
Float32 |
TimerDeadZone |
|
Determines the extension of the deadzone in both directions about the command position.
Interval = [xCommand - TimerDeadZone, xCommand + TimerDeadZone] |
Float32 |
TDZTime |
|
Waiting time for the timer deadzone. The deadzone is activated after
TDZTime seconds within the timer deadzone. |
Float32 |
TDZElapsedTime |
|
Time counter of the timer deadzone. |
Pointer to Float32 |
ScanTime |
|
|
Float32 |
uReg |
UREG |
Control output velocity. |
Boolean |
RampActive |
ramp |
Indicates whether the ramp is active or not, that is if it currently
limits the magnitude of the control output. |
Boolean |
DZActive |
dz |
Indicates whether the deadzone is active or not, that is if it currently
limits the magnitude of the control output.
The output may be used as a confirmation of completed positioning. |
Boolean |
TDZActive |
tdz |
Indicates whether the timer deadzone is active or not, that is if it currently
limits the magnitude of the control output.
The output may be used as a confirmation of completed positioning. |
GraphPlcNode |
object_type |
11 |
parameters[0] |
11 |
parameters[1] |
15 |
parameters[2] |
4 |
parameters[3] |
0 |
graphmethod |
0 (standard, individual attributes) |
graphindex |
0 |
default_mask[0] |
502 |
default_mask[1] |
1 |
segname_annotation |
1 |
compmethod |
4 |
compindex |
0 |
tracemethod |
0 |
traceindex |
0 |
connectmethod |
0 |
executeordermethod |
2 |
objname |
servoreg |
graphname |
ServoReg |
Template Object |
umaxP |
2.000000e+00 |
umaxN |
-2.000000e+00 |
amaxS |
3.800000e-01 |
kPID[0] |
6.000000e-01 |
kPID[1] |
3.000000e-01 |
maxdelaysteps |
1000 |
DelayRamp |
1.000000e-01 |
DeadZone |
2.000000e-02 |
TimerDeadZone |
5.000000e-02 |
TDZTime |
5.000000e+00 |
Attributes detail
Current reference acceleration of the desired trajectory. The input is used by the PID regulator of the object.
Current reference velocity of the desired trajectory. The input is used by the PID regulator of the object.
Current reference position of the desired trajectory. The input is used by the PID regulator of the object.
Current measured acceleration. The input is used by the PID regulator of the object.
Current measured velocity. The input is used by the PID regulator of the object.
Current measured position. The input is used by the PID regulator of the object.
Command position. Final travel destination.
Maximum positive output velocity. This value may depend on other system variables,
such as local low-speed restrictions etc, and is therefore supplied as an input.
Maximum negative output velocity. Same as above, but this value should be < 0,
and reflects a restriction on movement in the other direction.
If true, and if the ramp is enabled, the control output is initially set to umaxP or umaxN,
depending on the sign of Delta x, the distance to the command position.
The output is then limited by the ramp. The effect is a very accurate positioning, given that
the relevant parameters are set correctly.
Direct positioning disables the PID regulator, as the two cannot be used simultaneously.
On/Off switch. If false, uR is simply passed untouched through the object.
"Soft" maximum acceleration, i.e. the acceleration or deceleration that the system
can be guaranteed to uphold.
Enabling or disabling of PID regulator. The positioning input overrides this setting, however.
PID constants:
kPID[0] - kP
kPID[1] - kI
kPID[2] - kD
Reference delay in seconds.
Limit as to how many time steps will be stored in the queue.
If DelayPID / ScanTime > maxdelaysteps, the full delay will not be realized.
Pointer to the reference list / queue.
Pointer to the reference list / queue.
Delay parameter in the ramp model. A larger delay causes a less steep deceleration.
Enabling or disabling of deadzone.
Determines the extension of the deadzone in both directions about the command position.
Interval = [xCommand - DeadZone, xCommand + DeadZone]
Enabling or disabling of timer deadzone.
Determines the extension of the deadzone in both directions about the command position.
Interval = [xCommand - TimerDeadZone, xCommand + TimerDeadZone]
Waiting time for the timer deadzone. The deadzone is activated after
TDZTime seconds within the timer deadzone.
Time counter of the timer deadzone.
Indicates whether the ramp is active or not, that is if it currently
limits the magnitude of the control output.
Indicates whether the deadzone is active or not, that is if it currently
limits the magnitude of the control output.
The output may be used as a confirmation of completed positioning.
Indicates whether the timer deadzone is active or not, that is if it currently
limits the magnitude of the control output.
The output may be used as a confirmation of completed positioning.