Hello,
I'd like to double check the following process with you to ensure that we are aligning the motor the right way.
We are using an absolute encoder that returns an absolute position (multiturn count + single turn position) via SPI.
We are actually doing the following process:
- At first power-up, the motor is aligned using Rs calibration.
- During Rs calibration, the QEP position count is reset to 0 using the following code snippet (in the main ISR):
if (EST_State_Rs == EST_getState(m_ctrlHandle->estHandle))
{
HAL_resetQepPosnCounts(m_halHandle);
}
- As soon as the Rs calibration is done, we set the actual position of the absolute encoder with the position of QEP POSCNT.
- At this point, the motor is aligned and the absolute encoder is synchronized with the QEP.
After a power cycle (when the motor is already aligned):
- The absolute encoder position is read.
- The QEP POSCNT is set with the absolute encoder singleturn position.
- At this point, the motor is aligned and FOC controller can be started.
Please note that we use a zero offset for the electrical angle equal to 0, this is why we reset the QEP during alignment.
Could you please confirm this process and give us proposals in case of not optimal?
Regards,
Johann