In Hall Sensor based FOC , Hall
signals are used to detect the rotor position information and drive the motor
efficiently. FOC application requires three digital Hall Inputs placed 60 degrees
electrically connected to the GPIO's as inputs feeding the rotor position
information.
User needs to populate the Hallangle
table in IQ27 P.U appropriately for a given Hall Sequence with reference to Phase
connections in the ISR.c file as shown in Figure 6-5.
In general, the Hall placements can be
erroneous and the electrical displacement can be less than or greater than 60
degrees. Any error in the hall placement results in torque ripple and non sinusoidal
current. The Hall pin sequence is also significant with reference to the Motor Phase
connection and the driving angle for a given phase depends on the sequence of
connections. This information is typically available in data sheet.
Hall calibration eliminates need for
the data sheet and corrects the hall placement error for improved current waveform
in motors with erroneous hall placements.\
The above hall angle table values can
be auto generated with Hall Calibration routine as described below:
Calibration Routine:
- Motor_Align: Aligning the
motor to a known rotor angle is the first step in the calibration sequence. In
this routine Motor aligns to CALIBRATION_ALIGN_ANGLE macro for a duration
calibAlignTime set in the User Inputs Motor Startup1 parameters.
Sufficient calibAlignTime is to be configured such that the motor aligns
and stops movement before the calibration is initiated.
- Motor_Calib_Run: Once
Align step is successfully completed, the rotor microsteps with an angle
specified as in macro CALIBRATION_ANGLE_STEP for a duration of
calibRunTime set in the User Inputs Motor Startup1 parameters. Motor
rotates for one complete mechanical cycles (Pole_Pairs * Electrical cycles) in
both forward and reverse direction to compute the average Hall angle.
- Motor_Calib_Complete: Once
motor calibration is successfully completed , rotor angle for each Hall State
transitions for both Forward and Reverse directions are generated in the Hall
angle tables as hallAngleTableForward and hallAngleTableReverse .
Below is the
sequence to follow for the Auto Hall Sensor Calibration:
- Configure and tune the below
input parameters.
- Configure the Current
loop Kp & Ki Parameters in the System parameters.
- Configure the Motor
Startup 1 parameters as below to tune the Motor Align and Motor Calib
Run States
- CalibCurrLimit : Id current forced during
Calibration
- calibAlignTime : Time in milli seconds applied for
the CALIBRATION_ALIGN_ANGLE while aligning for the first
time.
- calibRunTime: Time in milli seconds applied while
micro stepping and sweeping the mechanical cycle in steps of
HALL_CALIBRATION_STEP.
- CurrRampRate: Ramp rate of Id current during the
first align to CALIBRATION_ALIGN_ANGLE.
- Set the Hall Sensor Calibration
Enable bit in Algo Debug Control 2 Register and set the Motor speed to non zero
value.
- Once the Calibration sequence is
completed, the CalibState changes to HALL_CALIB_ COMPLETE.
- Once
satisfactory Calibration routine is performed such that the Motor Spins smoothly
in closed loop operation, user can store these calibrated angle values in the
forwardHallIndexLUT & reverseHallIndexLUT defined in ISR.c. Upon
MCU restart the values from these LUT’s are used by default for spinning the
motor.