PDMC AC1/4 Motor Calibration

Motor Calibration

The operation of the Field-oriented control (FOC) component is highly dependent on determining the rotor position angle. For this, the FOC needs to know:

  • Hall sensor sequence;

  • The corresponding rotor position for each sensor.

The motor calibration ensures that the FOC is provided with the correct values of these parameters (given the particular motor and load).

The user application can obtain the calibration parameters by initiating Motor self-calibration (through a FOC API function). During the self-calibration process, the motor turns at low RPMs in clockwise (capture the start points) and counterclockwise (capture the endpoints) directions and the following parameters are measured:

#define MCL_PSE_NUM_OF_HALL_SECTORS (6) /*! Motor calibration parameters / typedef struct MCL_MOTION_MOTOR_CAL_PARAMS_Ttag { uint16_t ausHallSectorPosCw[MCL_PSE_NUM_OF_HALL_SECTORS]; /!< Hall sector positions during clockwise motor rotation / uint16_t ausHallSectorPosCcw[MCL_PSE_NUM_OF_HALL_SECTORS]; /!< Hall sector positions during counter-clockwise motor rotation / uint8_t abHallSectorSequence[MCL_PSE_NUM_OF_HALL_SECTORS]; /!< Hall sector order during clockwise motor rotation */ } MCL_MOTION_MOTOR_CAL_PARAMS_T;

After PROFIdrive application starts, the drive will not move unless the FOC component is not provided with these parameters (with a dedicated FOC API function). There are two options how to set these parameters to FOC:

  • By initiating Motor self-calibration. On successful calibration, the needed parameters will be set to FOC automatically.

CAUTION! During the calibration the drive will start to move!

  • By setting the calibration parameters directly (through the FOC API). This implies that the values are known, e.g. gotten through a previous self-calibration, performed once.

Both options are initiated by the PLC (or, if using PRONETA, through a script).

PLC Triggered Calibration

The PROFIdrive example application expects the PLC (or PRONETA, through a script) to calibrate the motor. It defines a number of custom PROFIdrive parameters that facilitate:

  • Triggering Self-Calibration by the PLC (or PRONETA);

  • Getting the Self-Calibration state (e.g. “Calibration in Progress”);

  • Setting the calibration parameters by the PLC (e.g. saved values, gotten after a self-calibration).

Calibration Related Custom PROFIdrive Parameters

The table below lists the custom PROFIdrive parameters defined and implemented in the PROFIdrive example. These are to be read/written by the PLC (or PRONETA through a script).

Parameter Number

Description

Data Type

Min / Max

Read / Write

Possible values

Parameter Number

Description

Data Type

Min / Max

Read / Write

Possible values

90

FOC Control Byte

uint_8

0 / 2

Write

CALIBRATION_CONTROL_NONE = 0

CALIBRATION_CONTROL_START_SELF = 1

CALIBRATION_CONTROL_PARAMS_SET = 2

91

FOC Status Byte

uint_8

0 / 4

Read

CALIBRATION_REQUESTED = 0,
CALIBRATION_IN_PROGRESS = 1,
CALIBRATION_FAILED = 2,
CALIBRATION_SUCCEEDED = 3,
CALIBRATION_NOT_REQUESTED = 4

92

Hall sector positions during clockwise motor rotation

uint_16 |

array of 6 elements

0 / 65535

Read / Write

 

93

Hall sector positions during clockwise motor rotation

uint_16 |

array of 6 elements

0 / 65535

Read / Write

 

94

Hall sector order during clockwise motor rotation

uint_8 |

array of 6 elements

0 / 256

Read / Write

 

Table 2 - PROFIdrive example defines a number of custom Parameters (acyclic) for the Calibration

Usage:

  • Writing Parameter 90 (FOC Control Byte) with value FOC_START_SELF_CALIBRATION will trigger the Motor calibration process.

  • While the calibration is being executed, parameter 91 (FOC Status Byte) will provide the current status of the execution. The values are described in the table above.

  • Once the calibration is completed, the FOC component stores the calibration motor calibration data into its local resources which is considered as a successful calibration. Parameter 91 is implicitly set to CALIBRATION_SUCCEEDED.

  • When the calibration is completed successfully, the the parameters 92 - 94 are set with the new actual motor calibration data that can be read/store by the PLC in its non-volatile memory for future operation.

  • From this point on the FOC can accept further commands from the PROFIdrive application.

  • Calibration will not start if it already in progress or the PLC already controls the device (PROFIdrive state greater than AXISSTATE_IDLE).

  • Once the PLC already has stored the motor calibration data by reading parameters 92 - 94, the data can be already used as is in the following power cycles of the system. This means that the motor calibration does not have to be started at each power cycle.

  • The FOC will clear its copy of the motor calibration data after power loss. This means that in case the system is powered up and the PLC has the calibration data available in its non-volatile storage, the latter can send the calibration data to the FOC instead of triggering a new self-calibration. Setting the data is done through the same user parameters 92 - 92.

  • Writing parameters 92 to 94 is mandatory in case no self-calibration is triggered. After the device is powered up, either these parameters have to be set (with PLC saved values) or self-calibration should be started, for PROFIdrive operation to be enabled. As a real-world scenario, it is expected that the motor drive will be calibrated once (given the particular setup and load) and the calibration parameters are read and stored by the PLC (to be used further).

Calibration sequence

Triggering Self-Calibration

Calibration with Available Parameters