PositionControlSimple¶
A simple position control implementation.
The PositionControlSimple 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 reference is tracked by a mechanical plant using sensor feedback. For position control, the reference signal is the demanded position and the output of the plant is position, measured using an encoder.
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:
Tracking error calculation, loop control & homing
Feedback controller
Saturation and limits
Signal propagation
Consider to use the advanced version of this processing block if one of the following additional extensions or features are required:
More filters for the control algorithm.
Separate tracking error limits and control output saturation limits during movement and standstill.
Delay in the reference signal for feedforward timing optimization.
Waiting for settling before starting a new move.
Tracking error calculation, loop control & homing¶
TrackingError = (DemandPosition - ActualPosition) * IsClosedLoop
ActualPosition = PositionSensor + HomeOffset
The position 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 |
The HomeOffset
can be used to add a value to the relative position measurement to translate it to an absolute value. This absolute position is called the ActualPosition
.
When closing the loop, the tracking error is set to zero to prevent an initial step in control output which could result in unexpected movement. This is achieved by setting the demanded position equal to the actual position during the first calculation cycle in closed loop. The DemandPositionOffset signal is used to inform the trajectory interpolator of the change in demanded position. Similarly, the demanded position is updated when applying a home offset such that the home offset does not cause a step in tracking error.
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 position 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.
Signal propagation¶
The processing block has inputs that can be used to combine the feedback control output with other signals that must be propagated to the actuator (see The implementation of the processing block). These inputs are:
Input |
Description |
---|---|
FeedbackOffset |
Input to apply an offset before the |
FeedforwardControl |
This can be used to connect the feedforward controller to the position controller. It is added after the |
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, feedforward control and feedback offset depends on the unit of the Demand
input of the actuator.
The unit of the demand position, demand position offset, home offset 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. |
DemandPosition |
Demand position input used for tracking error calculation. |
FeedbackOffset |
Input to apply an offset before the FeedbackControlOutput. |
FeedforwardControl |
Input to connect the feedforward controller to the position controller. |
HomeOffset |
Home position offset value, used to add an offset to the relative position measurement to translate it to an absolute value |
PositionSensor |
Sensor value input used for tracking error calculation. |
Read only signals¶
Name |
Description |
---|---|
ActualPosition |
Actual value of the position sensor after home offset. |
CombinedControlOutput |
Combined feedback and feedforward controller output. |
ControlOutput |
Output of the position controller. |
DemandPositionOffset |
Offset for the demand position of the trajectory interpolator. |
FeedbackControlOutput |
Feedback controller output. |
GenericFilterOutput |
Control output of the sequence of generic filters. |
IsClosedLoop |
Indicates if the feedback control loop is open or closed. |
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. |