Main Content

Position Compensation

Compensate for position offset due to different types of delays

Since R2022b

Libraries:
Motor Control Blockset / Signal Management

Description

The Position Compensation block compensates for position offset due to different types of delays in a system.

Motor control algorithms can introduce offsets in the computed position because of different algorithmic entities such as delays and filters. These offsets affect accuracy in motor control algorithms such as the field-oriented control (FOC) and direct-torque control (DTC). You can use this block to compensate for the offsets in the motor control algorithms.

The block uses the following computations for a sample delay compensation.

Offset introduced by delay = Applied compensation =( Sample time) × (Number of delay) × (angular velocity) radians

The block uses the following computations for a first-order Butterworth highpass and lowpass filter compensation.

  • For a highpass filter:

    Phase offset=π2arctan(ωspeedωcutoff)=arctan(ωcutoffωspeed)

    Phase compensation=arctan(ωcutoffωspeed)

  • For lowpass filter:

    Phase offset=arctan(ωspeedωcutoff)

    Phase compensation=arctan(ωspeedωcutoff)

Ports

Input

expand all

Position input value that needs offset correction. This port supports the following range of values:

  • -2π to +2π radians

  • 0 to 1 per-unit

  • -360 to +360 degrees

Data Types: single | double | fixed point

Externally computed position offset value. This value must have same unit as that of θin input. This port supports the following range of values:

  • -2π to +2π radians

  • 0 to 1 per-unit

  • -360 to +360 degrees

Dependencies

To enable this port, set Nature of offset parameter to External delay.

Data Types: single | double | fixed point

Externally computed angular velocity. This value represents the change in the θin input.

Dependencies

To enable this port, set Nature of offset parameter to Sample delay, High-pass filter delay, or Low-pass filter delay.

Data Types: single | double | fixed point

Output

expand all

Position output value that is corrected for offset.

Data Types: single | double | fixed point

Parameters

expand all

Type of delay or offset in the system that you want to compensate for. Select one of the following values:

  • Constant delay — Compensate for a fixed delay or offset.

  • External delay — Compensate for a constant delay using an externally computed position offset value.

  • Sample delay — Compensate for the delay based on a discrete step size or block execution time.

  • High-pass filter delay — Compensate for delay from first-order Butterworth highpass filter using a cutoff frequency value.

  • Low-pass filter delay — Compensate for delay from first-order Butterworth lowpass filter using a cutoff frequency value.

Position offset for constant delay in a system.

Dependencies

To enable this parameter, set Nature of offset to Constant delay.

Number of block execution time samples that the block uses for position offset compensation.

Dependencies

To enable this parameter, set Nature of offset to Sample delay.

The fixed time interval (in seconds) between consecutive instances of block execution.

Dependencies

To enable this parameter, set Nature of offset to Sample delay.

Cutoff frequency of the first-order Butterworth highpass or lowpass filter.

Dependencies

To enable this parameter, set Nature of offset to High-pass filter delay or Low-pass filter delay.

Unit of the position input θin.

Unit of the angular velocity input ω.

Dependencies

To enable this parameter, set Nature of offset to Sample delay, High-pass filter delay, or Low-pass filter delay.

Upper limit or the maximum possible value for the angular velocity input ω, in RPM.

Dependencies

To enable this parameter, set Nature of offset to Sample delay, High-pass filter delay, or Low-pass filter delay.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.

Fixed-Point Conversion
Design and simulate fixed-point systems using Fixed-Point Designer™.

Version History

Introduced in R2022b