Position Sensor Offset Calibration for Quadrature Encoder and Hall Sensor
The controller requires the position sensor offset computation to determine accurate real-time feedback of the rotor position and implement the Field-Oriented Control (FOC) or six-step commutation algorithm for the motor correctly.
Quadrature encoder sensor offset is the angle between the d-axis of the rotor and the encoder index pulse position detected by the quadrature encoder.
Hall sensor offset is the angle between the d-axis of the rotor and the position detected by the Hall sensor. You can use the offset to correct and compute an accurate position of the d-axis of the rotor.
The offset computation examples in Motor Control Blockset™ use a unique algorithm along with open-loop control to compute the position offsets of the position sensors (Hall or quadrature encoder). Open-loop control (also known as scalar control or volt/Hz control) is a popular motor control technique that can be used to run any AC motor. This is a simple technique that does not need any feedback from the motor. To ensure a constant stator magnetic flux, keep the supply voltage amplitude proportional to its frequency. This figure shows an overview of the open-loop control. See Open-Loop and Closed-Loop Motor Control Techniques for more details.

By using this algorithm, the offset calibration examples detect the position offset in this manner:
Check if the motor is in a no-load condition.
Start and run the motor in open-loop at a very low speed (for example, 60rpm). At a low speed, the rotor d-axis closely aligns with the rotating magnetic field of the stator.
Measure the feedback position of the available position sensor (Hall or quadrature encoder).
Compare the open-loop position with feedback position and check that the phase-sequence is correct. If required, correct the motor phase-sequence.
Compute the Hall sensor position offset by obtaining the difference between the open-loop position and feedback position.
Run the motor in the open-loop for few cycles and stop the motor. Ensure that the encoder index pulse is detected at least once. Lock the rotor in the d-axis. The quadrature encoder position offset is identical to the position feedback. This outputs the quadrature encoder mechanical offset position.

This figure shows the comparison of open-loop position from the control algorithm along with the actual position of the motor. The figure also shows the feedback from the position sensor. The position offset, which is the difference between the open-loop position and feedback position from the sensor, is computed by the algorithm provided in the offset calibration models.
| If you want to.... | Then.... |
|---|---|
| Learn how to use Motor Control Blockset blocks designed for Hall position sensors | Refer to How to Use Hall Validity and Hall Speed and Position Blocks. |
| Use Hall sensor with LAUNCHXL-F28379D or F28069M controller card along with BOOSTXL-DRV8305 or BOOSTXL-3PHGANINV inverter, to run a three-phase PMSM using field-oriented control (FOC), and perform Hall offset calibration | Refer to Hall Offset Calibration for PMSM and Field-Oriented Control of PMSM Using Hall Sensor The
measured offset value can be used to update the
|
| Use Quadrature encoder with any custom motor-control hardware to run a three-phase PMSM using field-oriented control (FOC), and perform position offset calibration | Refer to Quadrature Encoder Offset Calibration linked from Algorithm-Export Workflows for Custom Hardware. |
| Use Quadrature encoder with LAUNCHXL-F28379D or F28069M controller card along with BOOSTXL-DRV8305 or BOOSTXL-3PHGANINV inverter, to run a three-phase PMSM using field-oriented control (FOC), and perform Hall offset calibration | Refer to Quadrature Encoder Offset Calibration for PMSM and Field-Oriented Control of PMSM Using Quadrature Encoder, and The measured offset value can be used to update the
|
Note
The Hall Offset Calibration for PMSM example outputs the electrical position offset. Whereas, the Quadrature Encoder Offset Calibration for PMSM example outputs the mechanical position offset.