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: How to finish the custom board settings and run universal motor control lab on a custom board(such as DRV8312)

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

Hi all:

I am trying to run this lab on my DRV8312 board which is not currently supported and i am doing this by following the instructions in building custom board part of user's guide of universal motor control lab.

but I encountered some questions:

1. How should I set up all these parameters? should I just add the codes or should I copy the #if defined() form and give it a name like DRV8312? I noticed that a lot parameters are not mentioned in the guide. Is it because they are not necessary so I don't have to set them?

I wonder what is the proper way to do these settings.

2. This may be very basic but I can't find the answer. Based on question1, how should I set the build configurations->set active to make sure the lab is built according to the custom board settings.

thanks a lot

  • 1. I would pick a similar supported board and copy and paste all its #if defined sections and rename them to whatever you want to call your custom board. Then start changing the code within those sections to suit your hardware. Can you give me an example of which parameters you aren't sure about because they aren't covered in the guide?

    2. I think it makes sense to create a new build configuration. Right click on your project and go to Build Configurations -> Manage.... Hit New... and give it a name based on your board. Use the "Existing configuration" option to choose the board that is most similar to the one you're creating. Now you can set your new configuration to the active one. Then go into the project properties and find the "Predefined symbols" section. Change the defined value for the old board to the one you used in the code for the new board.

    Whitney

  • Thank you.

    Here is the guide, only 3 parameters for board and 7 parameters for motor are mentioned respectively.

    However, the parameters in the Lab project are much more than that. like USER_M1_NOMINAL_DC_BUS_VOLTAGE_V, USER_M1_OVER_VOLTAGE_FAULT_V,USER_M1_FAIL_SPEED_MIN_HZ ............for board

    and USER_MOTOR1_RATED_VOLTAGE_V, USER_MOTOR1_FREQ_HIGH_HZ,USER_MOTOR1_IND_EST_CURRENT_A.............for motor.

    Do I have to copy them with no change if they are not necessary settings?

  • Hi Yuanzhe,

    Is it because they are not necessary so I don't have to set them?

    Short answer is No, you need most all user.h parameters for your added defined motor and to later add detected motor parameters with ADC channel offsets into user.h. Assuming your custom board has x25c MCU would make it much easier to simply modify DRV8312 SPI registers configuration structures from an existing supported SPI motor driver.

    That said you may need to study DRV8312 datasheet and compare hal.c SPI interface loaded registers. Whitney points out likely similar in names to DRV-8312 and GPIO use by the ePWM-A/B port drive channels to booster headers. You have to check if a 1:1 GPIO ports to booster header pins is even possible for 8312. That may have been answered in the C2000 forum not long ago for LaunchXL as I recall.  

    Regards,

  • I'll add that MotorWare used to have some support for DRV8312, so although the underlying SPI drivers are different, grabbing those files from MotorWare could save you some time on figuring on the register structure.

    Edit--Just recalled the 8312 isn't one with SPI programmable registers, but the point remains that there are HAL files for DRV8312-C2-KIT out there.

    Whitney

  • thanks a lot. I have basically finished the settings.