Current Sensor ADC Offset and Position Sensor Calibration
This section explains about analog to digital controller (ADC) and position sensor offset calibration.
Current Sensor ADC Offset Calibration
In an inverter, signal conditioning for the current sensor introduces an offset voltage in the ADC input to measure both positive and negative current. This offset value is different for each target hardware because it depends on the tolerances of the components in the signal sensing and conditioning circuit. It is recommend that you measure the current sensor ADC offset for the target hardware. Current sensor ADC offset is represented in ADC counts that correspond to zero ampere current.
See the example Run 3-Phase AC Motors in Open-Loop Control and Calibrate ADC Offset to manually
measure the ADC offset value. In the Motor Control Blockset™ examples, update the measured value in the
inverter.CtSensBOffset variables in the model initialization
script. By default, the script updates the
inverter.CtSensBOffset variables with the default
The examples in Motor Control Blockset calculate the current sensor ADC offset in the hardware initialization
subsystem. In the model initialization script, when you set
inverter.ADCOffsetCalibEnable = 1, the script enables the
current sensor offset calibration in the target hardware during initialization. In
the hardware initialization subsystem, ADC channels read the input current multiple
times and averages them. The current controller uses this averaged ADC offset value.
In the model initialization script, when you set
inverter.ADCOffsetCalibEnable = 0, the script disables the
current sensor offset calibration and uses the values from the initialization
Always measure the current sensor ADC offset when the motor is not running. It is recommended that you unplug the electric wires connected to the motor.
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) algorithm correctly. It is recommended that you use the examples for offset calibration to compute the position offset before running any other example that uses FOC.
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.
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.
Motor Control Blockset offers examples like Quadrature Encoder Offset Calibration for PMSM Motor and Hall Offset Calibration for PMSM Motor to obtain the accurate rotor position for implementing the control algorithm. The offset computation examples 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 Control 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.
Update the measured offset in the
pmsm.PositionOffsetvariable in the model initialization script of the examples.
For parameter estimation, update the measured Hall offset in the Hall Offset field of the
The Hall Offset Calibration for PMSM Motor example outputs the electrical position offset. Whereas, the Quadrature Encoder Offset Calibration for PMSM Motor example outputs the mechanical position offset.
For steps to compute the offsets, see these examples: