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.

DRV8303EVM: support on InstaSpin_BLDC project in CCS

Part Number: DRV8303EVM
Other Parts Discussed in Thread: CONTROLSUITE, , INSTASPIN-BLDC, C2000WARE-MOTORCONTROL-SDK, C2000WARE

Hello,

I've recently bought the evaluation module DRV8303EVM and I got it to work with the InstaSpin_BLDC project in CCS 11. I found the project in: controlSUITE\development_kits\DRV830x-HC-C2-KIT_v105\InstaSPIN_BLDC.

I've followed the instructions in the 8 incremental build levels of the User Guide and I managed to successfully test a BLDC motor. Now I'm trying to better understand the code in the InstaSpin_BLDC project in order to be able to modify/adapt it to my specific requirements. 

One question I've got is related to the voltage and current measurements using the ADC modules on the TMS320F2803x microcontroller. In the code I can find that the phase voltages are acquired with: 

iqVaIn = _IQ15toIQ((AdcResult.ADCRESULT1<<3));
iqVbIn = _IQ15toIQ((AdcResult.ADCRESULT2<<3));
iqVcIn = _IQ15toIQ((AdcResult.ADCRESULT3<<3));

and the current with:

IDCfdbk=-((_IQ15toIQ(AdcResult.ADCRESULT4<<3)-IDC_offset)<<1);

Which to me suggests that voltages of phases A, B and C are capture with the ADC channel ADC-A0, ADC-A1, ADC-A2 and the current with ADC-A4. However, if I look at the schematic of the DRV8303EVM board (see snapshot below and attached pdf) I can see that phase voltage A is connected to ADC-B7, phase voltage B is connected to ADC-A7, phase voltage C is connected to ADC-B4 and the current of phase A (see S01 in the schematic) goes to ADC-A1. 

DRV8303EVM_SCH.pdf

I'm relatively new to CCS, however could you please explain me how the different ADC channels are mapped in CCS? My initial thought was that ADC-A0 (i.e. the 1st ADC channel) would be mapped to AdcResult.ADCRESULT1 but apparently I was wrong.

Thanks

Giorgio

  • Hi Giorgio,

    I'm forwarding your thread to the C2000 team for InstaSPIN-BLDC support. 

    Thanks,
    Aaron

  • Change the ADC channel (marked RED) selection number to the related input in "f2803xidc_vemf.h" according to the hardware kit.

    AdcRegs.ADCSOC0CTL.bit.CHSEL = 15; /*Dummy meas. avoid 1st sample issue Rev0 Picollo*/ \
    AdcRegs.ADCSOC0CTL.bit.TRIGSEL = 5; \
    AdcRegs.ADCSOC0CTL.bit.ACQPS = 6; \
    \
    AdcRegs.ADCSOC1CTL.bit.CHSEL = 15; /* ChSelect: ADC B7-> V Phase A */ \
    AdcRegs.ADCSOC1CTL.bit.TRIGSEL = 5; /* Set SOC0 start trigger on EPWM1A, due to round-robin SOC0 converts first then SOC1*/ \
    AdcRegs.ADCSOC1CTL.bit.ACQPS = 6; /* Set SOC0 S/H Window to 7 ADC Clock Cycles, (6 ACQPS plus 1)*/ \
    \
    AdcRegs.ADCSOC2CTL.bit.CHSEL = 7; /* ChSelect: ADC A7-> V Phase B */ \
    AdcRegs.ADCSOC2CTL.bit.TRIGSEL = 5; \
    AdcRegs.ADCSOC2CTL.bit.ACQPS = 6; \
    \
    AdcRegs.ADCSOC3CTL.bit.CHSEL = 12; /* ChSelect: ADC B4-> V Phase C */ \
    AdcRegs.ADCSOC3CTL.bit.TRIGSEL = 5; \
    AdcRegs.ADCSOC3CTL.bit.ACQPS = 6; \
    \
    AdcRegs.ADCSOC4CTL.bit.CHSEL = 2; /* ChSelect: ADC A2-> Low Side DC Bus Return Cur.*/ \
    AdcRegs.ADCSOC4CTL.bit.TRIGSEL = 6; \
    AdcRegs.ADCSOC4CTL.bit.ACQPS = 6; \
    \

    If you haven't had a chance to look at the workshop material, I think this will help you get started using C2000 devices.

    [FAQ] Where can I find training content for C2000 devices?

    “Thanks for your questions on the solutions in controlSUITE.  I’d like to point out that these solutions in controlSUITE are about 10 years old and haven’t had any updates in that time. We recommend our customers use our latest generation of devices which are supported for InstaSPIN-FOC, other sensorless techniques, and sensored servo control through C2000Ware-MotorControl-SDK

  • Hello and thank you for the answer.

    What is the latest generation of devices that you would recommend then? I chose the TMS320F2803x series purely because it's used in the DRV8303EVM evaluation board that you sell. Is the material in C2000Ware-MotorControl-SDK compatible with TMS320F2803x? 

  • Is there an equivalent version of the controlSUITE project 'DRV830x-HC-C2-KIT_v105\InstaSPIN_BLDC' in C2000Ware-MotorControl-SDK that it's compatible with the DRV8303EVM evaluation board? 

  • As mentioned above, please change the using ADC channel marked RED according to DRV8303EVM board. Just tell you how to change the ADC channel in the example code in controlSUITE you used, it's not the right value for your board.

    Is there an equivalent version of the controlSUITE project 'DRV830x-HC-C2-KIT_v105\InstaSPIN_BLDC' in C2000Ware-MotorControl-SDK that it's compatible with the DRV8303EVM evaluation board? 

    The example lab in motor control SDK doesn't support DRV8303EVM  with F2803x. You may keeping using the reference code in controlSUITE if you want to use DRV8303EVM.

  • sorry if this sounds like a dumb question but is there any specific downside of using F2803x rather than the latest generation of devices? I'm in the process of designing a custom drive unit similar to DRV8303EVM and I'd like to know if I should consider a different MCU for that

  • Yes, you may try to use the newer TMS320F28002x and DRV8323RS/H for BLDC control with InstaSPIN-BLDC.

    You may download and install the latest MotorControlSDK,  which can support a set of hardware kits and control algorithms for BLDC/PMSM drive. The kits include LAUNCHXL-F280025C with BOOSTXL-DRV8323RS, or BOOSTXL-DRV8323RH, or DRV8353Rx-EVM, or BOOSTXL-3PHGANINV, or DRV8316REVM. The control algorithms include InstaSPIN or eSMO based Sensorless-FOC, and incremental encoder or hall sensor based sensored-FOC,and sensorless trapezoidal BLDC control with InstaSPIN-BLDC. The detailed introduction about the lab can be found in the lab user’s guide as the links below.

    C2000WARE-MOTORCONTROL-SDK: https://www.ti.com/tool/C2000WARE-MOTORCONTROL-SDK

    Universal Project and Lab User’s Guide: https://www.ti.com/lit/spruj26

    Example lab project at the folder: C:\ti\c2000\C2000Ware_MotorControl_SDK_<version>\solutions\universal_motorcontrol_lab\f28002x