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.

TMS320F28069M: Combining 2 Motorware Labs

Part Number: TMS320F28069M


I'm using the TMS320F28069M to controller 2 motors based on Lab11d and added SCI to have a communication channel to a host controller.
Meanwhile I found out that I have to do motor re-identification for one of the motors. For motor identification I'm using Lab5b.

I'd like to stick with Lab11d as base and tried to implement the main() and mainISR() code from Lab5b into Lab11d and depending on the value of a variable switch between both modes. Unfortunately the motor won't run if the mode variable is set to use the code from Lab5b.

I seem to miss some important part that is different from Lab5b and Lab11d (besides dual motor). I even tried to do the same with Lab11 as base with the same result for the Lab5 part.

  • You may refer to lab10d that supports dual-motor and has the same project structure as lab5b. Lab11x can't support motor parameter identification since these labs don't use a controller object (ctrl). 

  • I tried that first but I ran into different issues.

    1) With 45kHz PWM frequency the motor_ISRx routines take a bit longer than PWM period and even with _SINGLE_ISR_EN_ enabled

    2) With _SINGLE_ISR_EN_ enabled I can use both motors but when I do a motor identification the results differ from Lab5b which I did not expect (probably caused by the longer running ISR)

    So I came up with the idea of implementing all lab5b code (mainly main(), mainISR() and missing variables) guarded by a variable like

    if (operationMode == 0)
    {
        // do lab11d stuff
    }
    else
    {
        // do lab5 stuff
    }

    Lab11d parts run as expected but lab5b behaves completely diffent

  • 1. You need to set the USER_NUM_PWM_TICKS_PER_ISR_TICK to 3 if you want to use the 45kHz PWM frequency, the ISR should be less than 15KHz, even 10kHz for the dual-motor drive. 

    2. You can try, but you should ensure all the ISR codes are running from RAM to achieve the full execution speed of the CPU.