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.

TMS320F28069F: Updating an Instaspin project from motorware V16 to V18

Part Number: TMS320F28069F
Other Parts Discussed in Thread: DRV8301, MOTORWARE

I inherited a TI Instaspin motorware based project that runs on a custom board using a DRV8301.  The project was based on proj_lab11a so much so my predecessor didn't even bother to create a new instance and just edited the original V16 project.  I've been tasked with updating the project to V18 and getting rid of the bloat in the code.  To that end I've Exported/Imported proj_lab11a V18 and renamed it to a new project.  After changing several CCS include paths and variables I've gotten it to compile properly.  I've gone through his code line by line and updated user.c, user.h, hal.h, hal.c and hal_obj.c to add in the fairly simple IO of the custom board.  Before I proceed with adding the rest of the to main and mainISR in the main project I wanted to spin the motor just to see if there was control.

At this point it doesn't seem to be "controlling" the motor.  While watching the expression during debug I can see a couple of things that don't make sense.  The gMotorVars.Speed_krpm expression is bouncing around positive and negative.  In addition gMotorVars.VdcBus_kv is bouncing around which makes me think somethings not write with the Adc read.

Any help on where to investigate next would be appreciated.

Thanks, John

  • You don't need to update the lab11a from mw16 to mw18 since this lab doesn't have any difference between these two versions.

    If you want to migrate, you might check if the ADC channels are configured  correctly, or you just port the customization codes to the example lab11a in MW18. 

  • I did notices some differences between mw16 and mw18, whether they are significant or not, I couldn't tell.  The custom board has a speed pot on it and I'm able to read it correctly via the ADC so there most be some other configuration issue.

    I will try copying all his added code from the v16 main/mainISR and see if that gets it going. 

  • I went through hal.c again to make sure IO lined up with the custom board and found that the ADC channels for the drive were not correct.  I corrected those and now it spins the motor, kind of.  However, it seems like the motor only wants to spin backwards.  Even if I change the sign of of .SpeedRef and .Speed changes to negative, the motor still seems to be spinning backwards.  I've tried switching two output phases to the motor and still doesn't change the direction.

    Thanks, John

  • You might check if the output of the speed regulator is negative when you set a negative reference speed for reverse. And make sure that the motor parameters are correct.

    BTW, check if ADC for current and voltage sampling is configured according to the assignment, and the ADC scale value of current and voltage is set correctly in user.h as well.

  • Double checked the motor parameters and other config variables in user.h to make sure they were close to the recommendations in the Instaspin User's Guide.  I made a few minor adjustments but for the most part they are the same as what he was running in v16.  Also double checked the ADC setup in hal.c and they line up with the schematic.

    Looking at gMotorVars while it's trying to run and I've noticed several things that don't seem right.  

    Looking at variable under gMotorVars this is what I see, please let me know if I should be looking at something else.

    SpeedRef_krpm is -5900k, but Speed_krpm fluctuates between positive and negative.  Not a classical oscillation as it meanders.

    SpeedRef_pu and SpeedTraj_krpm are both 0

    IdRef_A is about -1300k and IqRef_A is 0

    Please bare with me as I come up to speed on the application and CCS.  I appreciate the help, Let me know if there is a better way for me to convey information.

    Thanks, John

  • You might copy the related ADC and GPIO configuration functions in hal.c from m16 to mw18. Or you can keep using mw16 since there is no any significant changes on lab11a in mw18, and just need to refer to the lab11a.c in MW18 to do some changes in the lab11a.c in mw16.