Other Parts Discussed in Thread: DRV8323, , MOTORWARE
Good morning TI community,
I would like to implement an interrupt-based hall sensor commutation to achieve very high RPM for my motor. I'm using an TMS320F28027F with the DRV8323 driver and hall sensor feedback. I've been able to configure lab11e for my setup and drive the motor using GPIO-based hall sensor feedback sampled in the mainISR. However, this approach fails at very high RPM, and I need to drive my motor at 120,000RPM. Looking at my scope, I can see the control falls apart when there is a delay between the hall sensor state change and the change in PWM output. To get around this limitation, I'd like to implement hardware interrupts for these pins and toggle the hall state in a new ISR (e.g. hall_ISR).
We've implemented changes to enable this hall_ISR based on a state change to the pin, but we found that there is a variable delay between the rising/falling edges and when the interrupt is triggered (based on triggering a GPIO output pin in the hall_ISR). This delay varies from a few microseconds to ~20 microseconds. What other interrupts may be running in lab11 that could delay the execute of my hall_ISR function? Why am I seeing a variable delay between a rising/falling edge and triggering this function?
Here's an example of the logic to configure the ISR. Thanks for your support!
/* Set this GPIO as TZ input so that the qualification mode can be Async */
GPIO_setMode(obj->gpioHandle,GPIO_Number_29,GPIO_29_Mode_TZ3_NOT);
GPIO_setExtInt(obj->gpioHandle, GPIO_Number_29, CPU_ExtIntNumber_1);
PIE_registerPieIntHandler(obj->pieHandle, PIE_GroupNumber_1, PIE_SubGroupNumber_4, &hallISR);
PIE_enable(obj->pieHandle);
PIE_enableExtInt(obj->pieHandle, CPU_ExtIntNumber_1);
CPU_enableInt(obj->cpuHandle, CPU_IntNumber_1);
GPIO_setQualification(obj->gpioHandle, GPIO_Number_29, GPIO_Qual_ASync);
GPIO_setQualificationPeriod(obj->gpioHandle, GPIO_Number_29, 0);
PIE_setExtIntPolarity(obj->pieHandle, CPU_ExtIntNumber_1, PIE_ExtIntPolarity_RisingAndFallingEdge);
PIE_enableInt(obj->pieHandle, PIE_GroupNumber_1, PIE_InterruptSource_XINT_1);
And here's my hall_ISR function:
//! \brief The Hall sensor based ISR that implements the motor control.
interrupt void hallISR(void)
{
PIE_clearInt(halHandle->pieHandle, PIE_GroupNumber_1);
GPIO_toggle(halHandle->gpioHandle,GPIO_Number_28);
}
Best regards,
Chris
