Other Parts Discussed in Thread: INSTASPIN-BLDC
Hi Team,
In the Insta-PM_sensorless routine of DRV8301, the following code is written:
// Enable CNT_zero interrupt using EPWM1 Time-base
EPwm1Regs.ETSEL.bit.INTEN = 1; // Enable EPWM1INT generation
EPwm1Regs.ETSEL.bit.INTSEL = 1; // Enable interrupt CNT_zero event
EPwm1Regs.ETPS.bit.INTPRD = 1; // Generate interrupt on the 1st event
EPwm1Regs.ETCLR.bit.INT = 1; // Enable more interrupts
At this point, the actual wave generation mode of the EPWM module is UPDOWN mode. Can it be understood that each control cycle triggers an interrupt, and the moment it enters the interrupt corresponds to the moment when the Time Base module sends out a triangular carrier wave to reset?
In InstaeBLDC, there is no such code, and instead, the code related to interrupt settings is:
/ Reassign ISRs.
// Reassign the PIE vector for TINT0 to point to a different
// ISR then the shell routine found in DSP280x_DefaultIsr.c.
// This is done if the user does not want to use the shell ISR routine
// but instead wants to use their own ISR.
EALLOW; // This is needed to write to EALLOW protected registers
PieVectTable.ADCINT1 = &MainISR;
EDIS; // This is needed to disable write to EALLOW protected registers
// Enable global Interrupts and higher priority real-time debug events:
EINT; // Enable Global interrupt INTM
ERTM; // Enable Global realtime interrupt DBGM
In this routine, the setting of EPWM is
Initialization constant for the F280X Time-Base Control Registers for PWM Generation.
Sets up the timer to run free upon emulation suspend, count up mode
prescaler 1.
#define PWM_CNTL_INIT_STATE ( FREE_RUN_FLAG + \
PRDLD_SHADOW + \
TIMER_CNT_UPDN + \
HSPCLKDIV_PRESCALE_X_1 + \
CLKDIV_PRESCALE_X_1 + \
PHSDIR_CNT_UP + \
CNTLD_DISABLE ) The customer pointed out that this is a TI error. The code is written as TIMER-CNT_UPDN, but the comment says it is a count up mode.
The customer's question is: Does the moment of entering ISR in the INsta-bldc routine correspond to the moment of resetting the triangular carrier wave? Or at some other time? This is important for him to control torque and reduce torque ripple.
Regards,
Annie