VelocityControlSimple¶
A simple velocity control implementation.
The VelocityControlSimple processing block can be found in the ‘Templates’ feature in the PMP installer.
The most basic version of the typical feedback control structure is shown above, where a velocity reference is tracked by a mechanical plant using sensor feedback. The reference signal is the demanded velocity and the output of the plant is position, which is measured using an encoder and differentiated to obtain the velocity.
Description¶
The implementation of the processing block is shown in the figure below. The block consists of multiple components, which are further explained in the following sections:
Differentiator
Tracking error calculation and loop control
Feedback controller
Saturation and limits
Feedforward control
Consider using the advanced version of this processing block if one of the following additional extensions or features are required:
Extra filter for the control algorithm.
Delay in the reference signal for feedforward timing optimization.
A state observer for velocity estimation.
Differentiator¶
A discrete (Euler) differentiator is implemented to calculate the velocity from the position sensor data.
Hint
Position sensor data that contains noise can affect the differentiated signal significantly. This can be attenuated using a low pass filter in the control algorithm.
Tracking error calculation and loop control¶
TrackingError = (DemandVelocity - MeasuredVelocity) * IsClosedLoop
The velocity controller can be in open loop or closed loop state.
A request for a certain loop state is done via the CloseLoopRequest
input.
The IsClosedLoop
signal is used to inform PMP about the active loop state.
The behavior for different loop states are as follows:
Loop state |
Move commands |
Feedforward |
Feedback |
---|---|---|---|
OpenLoop |
Allowed |
Enabled |
Disabled |
ClosedLoop |
Allowed |
Enabled |
Enabled |
Feedback controller¶
The tracking error is forwarded to the control algorithm. The feedback controller has a PID controller and a generic filter.
The filter and PID controller are implemented in series. The filter can be excluded from the control loop by configuring it as pass-through.
- Generic filter
The generic filter can be used to apply one of the following filters: 1st or 2nd order lowpass or highpass, 1st order lead/lag, 2nd order notch or 2nd order custom filters in either the continuous or discrete domain. By default, the generic filter type is set to
PassThrough
, which means that it’s disabled and the signal passes through the block.- PID
The PID controller combines a proportional, a derivative and an integral control term with a second order low pass filter. The second order low pass filter is applied to the results of the proportional and derivative terms, but not to the result of the integral term. The integrator output can be clipped to configurable limits. An
IntegratorSaturated
event is raised if the output exceeds the limits, i.e.,IntegratorOutput < IntergratorLowerClip
orIntegratorOutput > IntergratorUpperClip
.If the PID controller is not used, it can be configured as pass-through by using a proportional gain of one and setting the integrator and differentiator frequencies to zero. In this pass-through mode it is still required to configure the second order low pass filter.
Note
The PMP Generic Filter block is a GenericFilter. The PID block is a PIDLowPass. Both blocks are discretized using Tustin’s method.
Saturation and limits¶
Limits are available to evaluate if the tracking error and control output stay within defined bounds. Event are raised if these bounds are exceeded.
Tracking error limit¶
The purpose of the control loop is to keep the tracking error small. If the tracking error becomes very large, then it’s likely that some part of the loop is not correctly functioning. For instance due to a failing actuator, a noisy sensor or obstructed mechanics.
The limit can be configured using the TrackingErrorLimit
signal.
The TrackingErrorLimitExceeded
event is active if the tracking error exceeds the configured limit:
|TrackingError| > TrackingErrorLimit
Saturation¶
The control output saturation limits make sure that the velocity controller is aware of the physical limitations of the connected actuator. If the control output saturates, then the integrator of the PID controller is locked to prevent ‘integral windup’.
Attention
The control output saturation is not intended to protect the actuator against thermal overload. These protections should be configured on the actuator interface.
Note
The values of the saturation limits depend on the unit of the control output.
The saturation limits can be configured using the ControlOutputUpperSaturation
and ControlOutputLowerSaturation
signals.
The CoutSaturationExceeded
event is active if the control output exceeds these limits:
ControlOutput < ControlOutputLowerSaturation
ControlOutput > ControlOutputUpperSaturation
The saturation is disabled if ControlOutputUpperSaturation =< ControlOutputLowerSaturation
.
Hint
If possible, design the controller such that the control output saturation limit is never exceeded during normal operation. Then use this event to disable the axis. This way, unsafe high forces due to mechanical obstruction, instability or magnetic misalignment are detected and captured early.
Feedforward control¶
The FeedforwardControl input can be used to connect the feedforward controller to the velocity controller. It is added after the PidOutput
.
Integration¶
The integration of this processing block in the software platform is shown in the figure below. Most connections between the processing block and other software components are required for correct operation, but some are optional. The optional connections are depicted using dashed lines.
Hint
In case a three phase actuator is used, the control output must be connected to the quadrature axis, often denoted as ‘DemandIq’.
Note
The unit of all signals is not defined by the processing block.
The unit of the control output and feedforward control depends on the unit of the Demand
input of the actuator.
The unit of the demand velocity and position sensor depends on the unit of the Actual
signal of the sensor.
Interface¶
Inputs¶
Name |
Description |
---|---|
CloseLoopRequest |
Input to request a ClosedLoop loop status. |
DemandVelocity |
Demand velocity input used for tracking error calculation. |
FeedforwardControl |
Input to connect the feedforward controller to the velocity controller. |
PositionSensor |
Sensor value input used for tracking error calculation. |
Read only signals¶
Name |
Description |
---|---|
CombinedControlOutput |
Combined feedback and feedforward controller output. |
ControlOutput |
Output of the velocity controller. |
GenericFilterOutput |
Control output of the sequence of generic filters. |
IsClosedLoop |
Indicates if the velocity feedback control loop is open or closed. |
MeasuredVelocity |
Differentiated DemandPosition value. |
PidOutput |
Output of the PID controller. |
TrackingError |
Tracking error value. |
Read-write signals¶
Name |
Description |
---|---|
ControlOutputLowerSaturation |
Controller output lower saturation value. |
ControlOutputUpperSaturation |
Controller output upper saturation value. |
TrackingErrorLimit |
Tracking error limit for feedback tracking limit determination. |