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.

TMS320F280039C: EPWM_getTripZoneFlagStatus API throwing error

Part Number: TMS320F280039C
Other Parts Discussed in Thread: SFRA

Hey TI experts,

We've been doing the Dual-Axis Motor Drive Using Fast Current Loop (FCL) and SFRA on a Single MCU Reference Design example. Basically, the example is built on F280049C, since this example has position loop, we wanted to use this to control one BLDC motor. 

we've trimmed the example to work only for one motor and with LAUNCH-XL-f280049C, the project is working well. we've ported the same example to LAUNCH-XL-F280039C.

  • The Projectspec file is edited to point F28003x device support files and libraries.
  • We've edited the linker cmd file to work with FLASH.
  • In dual_axis_servo_drive_user.h , The ADC channels, EPWM channels were changed as per pin configuration of F80039C.

After compiling and flashing. whilw debugging, after changing the enableFlag to and flagSyncRun to 0. the motorVars[0].isrTicker  increasing continuously.  when the motorVars[0].ctrlState is chnaged to CTRL_RUN, the motorVars[0].tripFlagDMC goes to high (0x0001) which is OVERCURRENT_FAULT.  When checked, this trip_flag is going high when EPWM_getTripZoneFlagStatus() returns high. But when the EPWM flag register TZOST was checked, the values of (EPWM_getTripZoneFlagStatus(obj->pwmHandle[0]) & EPWM_TZ_FLAG_OST) remains 0. Hence, this function should never execute but the code inside is getting executed and throwing over current error.

Any insights would be helpful.

Regards,

Raghu.

  • Hi Raghu,

    Which ePWM is being triggered causing the OST event? Are you sure the the ePWM output pins are configured properly using the same EPWM modules like in F28004x?

    Can you scope the output PWM signals to verify that they are indeed the same like in F28004x outputs?

    Best,

    Ryan Ma

  • Hi Ryan,

    Thanks for replying.

    I've mapped the pin configuration based on the LAUNCH-XL-F280049C to match the pin configuration of LAUNCH-XL-F280039C. I'm using EPWM 1,2,6.

    On all the ePWM channels, these are the values of the registers TZCTL - 0x000A, TZFLG - 0x000C, TZOSTFLG - 0x0040 

    Since the OST being hardware interrupt (I presume), the ePWM outputs are forced to go low and I can't see any output on the scope.

    Can you help me in understanding when will this OST gets triggered? The OST will trigger when there is an over current but as far as I can see, the variables offset_currentAs,offset_currentBs & offset_currentCs values are within the range. what is actually triggering the OST? I guess this is some configuration error.

     Can you please confirm if the ADC channels and the SOC, PPB numbers associated with them are correct? I guess any channel can use any SOC as per the TRM document.

    Regards,

    Raghu.

  • Hi Raghu,

    Your DCAEVT1 event is causing the OST event. What is your DCAEVT1 source?

    Best,

    Ryan Ma

  • Hi Ryan,

    I've attached the screenshot for trip configuration.

    I've found out that the current drawing from source is higher than CMPSS DAC HI values.  I don't have any mechanical load, phases connections double cross checked. is it any configuration error?

    Thanks in advance.

    Regards

    Raghu

  • The ePWM will only trip if TRIP4 is in fact being tripped. Are you sure the connection for TRIP4 is correct? CAn you double check the DAV Hi values to see if they are being set properly?

    Best,

    Ryan Ma 

  • Hello Ryan,

    sorry for the delayed response. I was out of office for a while.

    The problem was incorrect ePWM phase sequence. it was resolved. Now we were in BUILD_LEVEL4, and the speed values are not showing correct. 

    we have 36V BLDC motor, as soon as the motorVars[0].ctrlState  is set to CTRL_RUN, what we can see is motor starts rotating, but the input voltage was being dropped to 5-6V and the maximum current limit that was set in power supply was being drawn. whilst the current limit was kept under nominal values (checked from 0.3 Amps to 1.5 Amps, didn't went beyond to avoid damage) the observance is motor rotation is satisfactory and motorVars[0].speed.Speed is showing erratic values. The motor was under no load.

    The motor, driver board and power supply device were checked with LAUNCH-XL-F280049C and were working fine.so, possibly no suspicion on hardware.

    What are the possible causes to draw more current and reason for erratic values of speed?

    Thanks in advance.

    Regards,

    Raghu

  • Hi Raghu,

    Could we post this query as a separate question and mark this thread as resolved due to phase sequence causing trip condition? We'll connect you with the correct subject matter expert on this to provide help.

    Best,

    Ryan Ma

  • Hi Ryan,

    Sure, that'll do. please do the needful.

    Thanks & Regards,

    Raghu

  • Hi Raghu,

    Please follow the thread here.

    Best,

    Ryan Ma