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.

C2000WARE-MOTORCONTROL-SDK: Need some help with source code

Part Number: C2000WARE-MOTORCONTROL-SDK
Other Parts Discussed in Thread: MOTORWARE, C2000WARE, DRV8316

Hi Team,

Working on Field oriented control of a BLDC Motor I had bought this LaunchXL F280049C Microcontroller and the DRV8316R Motor driver, I tried to find support for source code for this rig online but had very less luck only found the GUI composer studio support, for FOC using code I found TI E2E FAQ's regarding the use of Motorware SDK for source code implementation on DRV8316R (Link for the FAQ). But this did not solve the purpose for me and didn't understand much from the example codes as well. Had some questions regarding the codes in general and regarding CCS as well, will list those down below, I'll be grateful if I find some help regarding these...

  1. Whenever I run example codes with CCS they don't tend to print debug statements for one to know what is going on after you have flashed, to test the controller i had to add print statements on my own to know the state and had to modify the example codes a bit. 
  2. This is what bothers me with c2000ware motor control SDK example codes, they tend to build flash and debug but am not able to find any debug statements on what the controller is actually doing.
  3. From using the GUI for sensorless control using DRV8316 i have found out what my motor parameters are so now do I have to add these parameters in user.h files so as to make the code work??
  4. And as I see in all the example codes including the Torque control example or the one with speed control or MTPA every code calculates the offset with the Offset_Calc function, so is it necessary to get the motor parameters and calculate offset every time I run a code? because this is a bit of a time consuming process.

Thanks,
Shlok Desai 

  • Whenever I run example codes with CCS they don't tend to print debug statements for one to know what is going on after you have flashed, to test the controller i had to add print statements on my own to know the state and had to modify the example codes a bit. 

    We don't usually add print statements to the code because they can add quite a bit of overhead to execution time. We generally rely on watching variables in the Expressions window with the continuous refresh mode turned on to monitor program execution. We also in some of our MotorControl SDK projects provide some datalogging tools or utilities to convert variable values to DAC outputs so they can monitored on an oscilloscope.

    This is what bothers me with c2000ware motor control SDK example codes, they tend to build flash and debug but am not able to find any debug statements on what the controller is actually doing.

    Usually in the SDK code, a debug build means a build with optimization turned off (since optimization can make single stepping through code harder) and in some libraries the addition of asserts for doing things like parameter checking. It generally does not add any instrumentation like print statements for the reasons I mentioned above.

    From using the GUI for sensorless control using DRV8316 i have found out what my motor parameters are so now do I have to add these parameters in user.h files so as to make the code work??

    I assume you're using the InstaSPIN labs for F28004x? Are you following the lab guide? That is the idea--that you should be able to capture the parameters identified by this lab and put them in your user.h as described in the lab guide so they will be used as you run the other labs.

    And as I see in all the example codes including the Torque control example or the one with speed control or MTPA every code calculates the offset with the Offset_Calc function, so is it necessary to get the motor parameters and calculate offset every time I run a code? because this is a bit of a time consuming process.

    Are you looking at the is02_offset_gain_cal lab? As described in the lab guide section for that lab, once you've determined the values, you can copy them into your user.h.

    Whitney

  • Hey Whitney,

    Thanks for the solution, will have a look at the Lab Guide to go ahead with understanding the projects, never found my way to this lab guide earlierSweat smile .

    Thanks 

    Shlok