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.

DRV8301-HC-C2-KIT: InstaSpin BLDC Library Source code

Part Number: DRV8301-HC-C2-KIT
Other Parts Discussed in Thread: CONTROLSUITE, INSTASPIN-BLDC, DRV8301, DRV8305

I'm interested in understanding what's happening in each of the InstaSpin BLDC blocks.  

The compiled library is located here in control suite

"\ti\controlSUITE\libs\app_libs\motor_control\libs\InstaSPIN-BLDC\v100\lib\C28x_InstaSPIN_BLDC_Lib.lib"

Is the source code available to look at?  Do I need to sign an NDA or something?

The reason I need to look is because we need to decouple the PWM and ISR frequency.  We're violating a DRV chip parameter by over using the charge pump regulator GVDD to drive the MOSFET gate capacitors at 35kHz.  Equation is I = freq x 6 x GateCap and only 30mA is available.  We're using around 45mA and already damaged some chips.

20khz is the max to run PWM without damaging the DRV chip.  The problem is that limits your RPM to ~10k RPM and we need around 12k RPM.

Now the next issue is we've decoupled the ISR and PWM but now you have a ISR running at 40khz and a PWM at 20khz.  You need to only sample BEMF at the PWM OFF times within each of the 6 steps.  At twice the frequency you get 1 sample at the OFF time and 1 sample at the ON time.  This messes up the BEMF integration waveform and thus the commutation timing.

Is there a way to convert the ON time reading to an equivalent OFF time reading? 

On time is essentially 1/2 PVDD at the neutral point.

OFF time is essentially 1/2 Motor voltage at the neutral point.  So if you're 50% duty cycle it's 1/4 PVDD.  

Any help on the libraries or solving this issue would be greatly appreciated.

My setup is

Setup:
DRV8301-HC-C2 kit Rev D
CC2803x ISO DIMM Rev 1.3 control card
CCS 6.2 and latest control suite install.

PWM: 35kHz
ISR:    35kHz

Motor:
KDE600XF-530-G3
Poles = 10, verified by counting magnets
Voltage = 22V - 52V
Current = 88A continuous, 170A peak
Kv = 530 RPM/V
L = 15uH - measured by LCR
R = 17mOhm

14 x 7 prop on static thrust stand

 

  • Hi Jensen,

    1. Sorry. We probably won't be able to release the source code of instaSPIN-BLDC library even signed NDA. Actually, you may run the BLDC perfectly using the library without modifying it.
    2. The instaSPIN-BLDC do commutation by bemf zero pint which is calculated from the sampling phase voltage, that is important to sense the voltage of un-executed phase by using ADC module. You can run control loop and pwm with different frequency.
  • Hi Yanming,

    We did decouple the two frequencies but it doesn't work.

    You're now sampling at a PWM ON and OFF time which gives different BEMF readings.  One has an offset from the other and thus it breaks the integration scheme to find the zero crossing.

    I'm not sure how to calculate that offset between the two to make both ADC samples correlate.

  • It may be not a better idea to use faster control loop frequency than the pwm frequency since the ADC is trigged by PWM event in instaSPIN-BLDC project. The ADC must be sampled during the low side pwm is on and high side pwm is off at pwm counter equals to Zero. The bemf zero point is checked by bemf voltage integration which can't be used in both modes.
  • Right that's the problem. We need to sample faster but can't push the pwm above 20khz because it damages the DRV chip by over using it's charge pump regulator to drive the mosfet gates. but if you don't sample faster than 20khz your RPM is limited to 10k. We need 12k RPM.
  • Which DRV device was you using? The DRV8301 or DRV8305 can support the pwm input frequency up to 200Khz, so the 30~45KHz is no problem for DRV device.
  • It's the DRV8301.
    I understand that the PWM freq can but very high.
    Please refer to page 26 section 8.2.2.1 Gate Drive Average Current Load of the datasheet.
    Gate Drive RMS Current = MOSFET Qg × Number of Switching MOSFETs × Switching Frequency

    30mA max for the part.
    Our MOSFET is 220nC
    6 mosfets
    20khz

    This consumes about 26.5mA of the 30mA max but limits the RPM to 10k.

    You can spin the motor at 200khz if you have very low gate charge mosfets.

    If i could decouple the pwm and adc samples then i can sample however fast i want.
    The problem again is that when you sample faster than the PWM the samples happen at times the control alogrithm doesn't handle well.
    Specifically it's designed to sample at MOSFET OFF times. Doubling the sample freq means half the samples are during the ON time which gives a different BEMF voltage reading. I don't know how to correlate the two readings.
  • This is a challenge for sensorless BLDC control, we have to use a higher PWM frequency for the high frequency motor since the BEMF zero cross point is sampling by ADC during the low side is ON. Maybe, this is a easy way to change the MOSFET to enable higher pwm frequency, I have tried 30kHz pwm frequency on DRV8301-HC-kit, it's ok for motor running with light load.
  • That is a good suggestion.  Unfortunately i can't find a FET that meets the power requirements but also has a lower gate capacitance.

    It's unfortunate I can't look at the source code.  I believe it would be easily fixable by a tweak to one of the blocks in the control algorithm.

  • The algorithm in instaSPIN-BLDC library used bemf integrator method to check the commutation time, so you can call the function twice every pwm period, you only need to change the threshold (InstaSPIN_BLDC1.Int_Threshold), but you need to make sure the phase voltage can be sampled correctly.