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.

TMDSDOCK28379D: Induction motor stops

Part Number: TMDSDOCK28379D
Other Parts Discussed in Thread: C2000WARE

Hi Experts,

Seeking your assistance on this design help about TMDSDOCK28379D motor driver issue reported by a user:

Regarding the TMS28379D processor, I was doing sinusoidal PWM on the mentioned processor to drive an induction motor and the problem I was facing is, the motor stops in between.

It happened quite a few times. Then I found that pulses are stopped whenever the motor has stopped. I am using a 2-level 3-phase inverter made by Semikron.

Attached herein is the code. Note that I am not using any IQ math libraries for generating the Sine function.

Regards,
Archie A.

/cfs-file/__key/communityserver-discussions-components-files/171/TMS_5F00_Code.txt

  • Hi Archie,

    Could it be a problem caused by the watchdog reset? Can you disable the watchdog timer and the associated register settings in the ISR?

    Thanks,

    Jiaxin

  • Jiaxin,

    You can see we have attached the code above in TXT format, showing that the watchdog timer is already been deactivated. Now shall we try activating it?

    Please assist.

    Regards,
    Archie A.

  • Hi Archie,

    I didn't noticed the line that corresponds to the disable of watchdog, usually it comes with the initialization code in the main() function. Also in the function "cpu_timer0_isr()", there are code written to manipulate the watchdog registers. Could you double confirm if it is disabled properly? Because the stop during normal operation without any trips makes me feel like some reset happened.

    Thanks,

    Jiaxin

  • Thanks, Jiaxin.

    You mean by default watchdog timer is active? Cx added a line in main function to disable the watch dog as below

    EALLOW; // This is needed to write to EALLOW protected registers
    WdRegs.WDCR.all = 0x0068; // Disable Watch dog
    EDIS; // This is needed to disable write to EALLOW protected registers

    After modifying code like this, motor ran for significantly higher duration compared to before disabling the watchdog.
    However, the motor has stopped in this case to after around 15 - 20 minutes.
    Attaching a clip of CCS window where you can observe the fault (Sinusoidal function is saturating to its limit. this should not happen).

    Regards,
    Archie A.

  • Hi Archie,

    Could you try to use the "Device_init()" function in the device.c file to have the watchdog disabled ("SysCtl_disableWatchdog()" inside)? You can refer to any example code in the C2000Ware "\C2000Ware_4_02_00_00\driverlib\f2837xd\examples". Also please make sure that there are no watchdog registers settings in other places.

    Thanks,

    Jiaxin

  • Hello Jiaxin,

    Good day.

    I have included below lines in the code first.

    #include "driverlib.h"
    #include "device.h"

    then I also added following lines to main function,

    Device_init();
    SysCtl_disableWatchdog();

    Later I am getting the error as seen in the attachment.

    Thank you.

    Regards,
    Archie A.

  • Hi Archie,

    Please check if your have the driverlib in the include options of your project. You can check in project properties:

    1. Left click project in Project Explorer

    2. Click Properties in the bottom

    3. Go to Include Options

    4. Check if "/driverlib" is included, if not, please add it manually. 

    Thanks,

    Jiaxin

  • Thank you, Jiaxin.

    I previously added the driverlib. However I got some error. So, I removed the path.
    The error I was getting after adding the driverlib is

    ****
    "C:/ti/C2000Ware_4_01_00_00/driverlib/f2837xd/driverlib/adc.h", line 174: error #41: expected an identifier
    "C:/ti/C2000Ware_4_01_00_00/driverlib/f2837xd/driverlib/adc.h", line 175: error #41: expected an identifier

    Further support.

    Regard,
    Archie A.

  • Hello Archie,

    Did you create the project from a template or from scratch? You may want to verify that the linked resources and include options are configured correctly. Below are some screenshots of a working example:

    Let me know if this still produces an error.

    Best regards,

    Omer Amir

  • Hi Omer and Jiaxin,

    Responded:

    I imported project from examples and edited it to do my needs. I am attaching below linked files screenshots. I feel everything looks good to me. Let me know if anything I am missing.

    Further, I am also attaching project folder so that you can upload in a pc at your end for cross verification.

    Regars,
    Archie A.

    adc_soc_epwm_cpu01.rar

  • Hello Archie,

    I was able to confirm the error, but your project properties seem to be modified compared to the example. When I imported the example project from my own C2000Ware, it built without any errors. As a sanity check, can you re-import the project (File --> Import) and verify that it builds without any errors? If so, try copying and pasting your program into the adc_soc_epwm_cpu01.c file and building it from there.

    Best regards,

    Omer Amir

  • Hi Amer,

    Apology for the delayed update as the customer was on leave and just got here.

    We have followed instructions, as you mentioned. We are writing everything step by step.

    1. I imported a new example.
    2. It was building properly.
    3. Then I added included driverlib paths as shown in screenshots.
    4. It was building properly.
    5. Now added two lines of code as below.
    #include "driverlib.h"
    #include "device.h"
    6. Now when I am building again, I am getting following error (see the attachment.)

    What shall we do now?

    Thank you.

    Regards,
    Archie A.

  • Thanks Archie,

    I will try to ask one of our software experts to see what's happening here and see if they have any insight.

    Best regards,

    Omer Amir

  • Hi Archie,

    The error is indicating that the ADC_Resolution enum values are defined in other file. In this case it is defined in F2837xD_Adc_defines.h. So, you can comment out those lines from that file and add #include "adc.h" in the F2837xD_Adc.c file to remove further error. It will remove the build errors that you are getting. 

    Regards,

    Meghavi

  • Hello Meghavi,

    Thank you.

    Have tried the solution you proposed, and the example code is now building without any errors. However, we still need to test it with our own code and run the motor before confirming its effectiveness.

    On another note, we are experiencing a small issue where any changes we make to a new .c file are also affecting the code in an existing .c file. Do you have any suggestions on how to solve this issue?

    Regards,
    Archie A.

  • Hello Meghavi,

    Seems this is a new issue now.

    Thus, I would advise the customer to create a separate post in E2E (after he change to valid corporate email accnt).

    Thank you for your support.

    Regards,
    Archie A.

  • Hi Archie,

    Sure. In that case, I will lock this thread.

    Regards,

    Meghavi