This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LAUNCHXL-F28379D: sync btw QEP and PWM

Part Number: LAUNCHXL-F28379D
Other Parts Discussed in Thread: C2000WARE

In TMS320F2837x, FCL ensures the smallest possible delay time from sampling to PWM update.

My understanding is that the capture of instantaneous QEP module counter is driven by the unit time out interrupt, which seems to be independent from the PWM interrupt.

I believe there must exist s mechanism for both counters, QEP unit time counter and PWM counter, to start in the synchronized way, so as to eliminate the unknown phase misalignment and achieve the smallest delay from BLDC measurement to PWM update.

I am following TI sample project C2000Ware_MotorControl_SDK_4_01_00_00/dual_axis_servo_drive_fcl_qep_f2837x

Could anybody kindly share some hints on the underlying implementation details? Thanks a lot.

  • It's not necessary to make the synchronization between the QEP and PWM. You just need to get the rotor position with QEP every PWM ISR for motor control with FCL.

  • Hi, Yanming, thanks for your help. What I don't get now is that Cla1Task1 takes value from register QPOSLAT instead of QPOSCNT, as is in code quoted below:
    fclVars[0].qep.MechTheta =
    (fclVars[0].qep.MechScaler * fclVars[0].ptrQEP->QPOSLAT);
    My understanding is that QPOSCNT is the instantaneous counter value, and QPOSLAT is the reading latched at unit time out event. Therefore it needs sync between QEP and PWM. Could you share some more ideas please? Many thanks in advance.

  • The CLA task and CPU ISR for motor control are triggered by EPWM period, so the synchronization of EQEP and PWM is not necessary to update position information. The time error could be less than a PWM period always that is not matter of the synchronization and is very low impaction vs angle and speed of the motor if the PWM frequency is far higher than the motor speed.

    You can use the QPOSCNT to calculate the position directly if needed.

  • Hi, Yanming, thanks a lot, your analysis is clear and great!