Position control and reduction of the following error

Determination and setting the most important position control parameters: Kv factor and parameters for reduction of the following error.

Interface

The position controller parameters are accessed via the System Manager.

Weighting of the feed forward

Axes are usually operated under TwinCAT with a feed forward weighting of 1.0. In unusual cases it may be necessary to vary this setting. This can be the case if the axis is subject to a highly non-linear relationship between control and velocity. A hydraulic valve whose characteristic curve has a sharp knee would be an example. In such a case the weighting should be reduced until the axis no longer demonstrates excessive advance. In these cases it is generally necessary to use more complex controller types including an I-component in order to achieve acceptable positioning behaviour.

Position control

The purpose of the position control is to compensate for small residual errors in the positioning. The possible causes of these residual errors can consist of load changes, non-linearities originating with friction or other causes, small inaccuracies in a range of axis parameters, offsets, temperature dependencies and so forth.

Position P-controller

In this controller, a compromise is to be found between the desire for the highest possible level of control (i. e. a large Kv) and a low tendency for the system to oscillate (i.e. a small Kv). In practice it has been found that this compromise can be found quickly by increasing the Kv value step-by-step.

The procedure is extremely simple: test transits are made in both directions. During the constant velocity part of the movement, the axis should move steadily without detectable oscillation being created by the position control. A small proportion of noise in the controller output is not significant here. As it approaches the target, the axis must under no circumstances show any signs of oscillation (springing back). The Kv factor can be increased in small steps (with a factor of between 1.2 and 1.5) until the axis shows the first signs of oscillation. The Kv factor should then be reduced by about 20%, so that there is some safety margin to the stability limit.

As has already been explained, some controllers offer the facility for automatic offset adjustment. This function can be activated on the controller's PID tab. The filter time and the feed forward limit are to be provided as parameters. A value in the range of seconds is to be recommended as a rule for the filter time. It must always be borne in mind that the filter time should be very large in comparison to the response time of the axis. If it is too short, a phase-shift oscillator is created: the axis then oscillates at a very low frequency. The feed forward limit prevents the automatic adjustment during active positioning from being affected by the dynamic behaviour of the axis. A set velocity above this value has the effect of "freezing" the offset.

Position 2P-controller

The only difference between this controller and the one mentioned above is that it is possible for a different Kv value to be used during active operation from the value used for position control when stationary.
A second Kv value and a velocity threshold are to be set here as additional parameters. The effect is a smooth transition between the Kv values over the range of velocities between a 0.0 (stationary) and the threshold value.

Reducing the lag error

It is essential to use the TwinCAT Scope to minimize the lag error.

  1. Minimize the lag error for position control. Determine the mean lag error d [mm] when stationary under position control (with sign) (online menu). Set the DAC offset to Offset = d · Kv [mm/s] (If the lag error is positive, the actual value lags behind the setpoint and needs somewhat more voltage to catch-up). This formula only applies if the motor polarity and the encoder polarity are in agreement, otherwise it is necessary to take the value with the opposite arithmetic sign. This should allow the lag error to be set to an increment precisely symmetrical about 0.0.
  2. Minimize the lag error at constant set velocity. The set velocity VS, reference velocity Vref, proportionality constant Kv and the lag error that has been found d [mm] are given. The output is then to be the output velocity proportional to the voltage V = (VS + Kv × d) / V_ref. To avoid the lag error, the same velocity should now be output with the new reference velocity Vr , so that V = V_S / V_r applies. We therefore get Vr=Vref/(1.0+1.0/(Kv×d)) for the new reference velocity.

Position PP-controller

If a position P-controller is correctly adjusted, the lag error is, in theory, proportional to the acceleration. In order to minimize the lag error in the acceleration and braking phases, it is possible to use a second proportionality factor Ka in association with the set acceleration and, with the aid of which the lag error under ideal conditions comes only to consist of noise. The factor Ka is approximately equal to the system transfer time, and so is in a range that is less than 10 × T_saf s (T_saf set execution task cycle time).