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.

INSTASPIN-BLDC: Trouble running above a certain current/RPM

Part Number: INSTASPIN-BLDC
Other Parts Discussed in Thread: UCC27211, MOTORWARE, DRV8301

Currently, I'm having trouble running my motor control solution above a certain Iq_ref/RPM.  Unfortunately, what I mean by "trouble" is that the power stage of my motor controller is being damaged as I try to run up in speed.  The reason I state it as a current and/or RPM limitation is because I am using the motor controller to turn a propeller, so a given current produces a given torque for my motor, which yields a certain steady state RPM.  However, I don't know if the trouble I'm encountering is related to current or motor speed. 

Summary of motor/prop setup:

- 42 pole, 55Kv motor

- Nomimal RPM roughly 1700 RPM (595 Hz electrical frequency)

- Roughly 4kW ominal output power

Now, my first guess would be that I had made some sort of hardware error, because I've made my fair share of hardware errors in the past.  However, these previous errors have gained me much experience in the design and layout of power electronic hardware, and I've done many things to ensure the hardware is robust, including:

- Parallelization of FETs for power handling

- Inclusion of parallel Power Schottky rectifiers for reduced reverse recovery

- Phase node RC snubbers

- Tight, low inductance layout with excellent ceramic decoupling (I have almost zero phase-node ringing)

- 15V Zener protection diode on driver bootstrap capacitor (using UCC27211 driver)

- Schottky protection diode on to clamp phase node at the driver 

Sorry for the laundry list of hardware circuitry! The reason I include it is because all my hardware seems to be working great.  I can run the motor controller with a heatsink and everything is well-cooled and highly performant all the way up to an Iq_ref = 125A (just below 1700 RPM, roughly 4kW output power).  Essentially, I run in to absolutely no trouble up to and including this point.  However, when I commanded just a slightly greater Iq_ref of 130A, all of a sudden the power stage failed with several MOSFETs being damaged and shorting out.

I won't deny that the problem could still be somewhere in the hardware, but I'm also wondering, could it be somewhere in the software?  Do I have some setting wrong? For example, do I have a problem with:

- IQ Full Scale Voltage?

- IQ Full Scale Current?

- Voltage Filter Pole?

I've included my user.h.  Please let me know if you see any problems, or what might be the best test to get a diagnosis.

Thanks!

85111.user.h

  • Hello,

    Most of the InstaSPIN team is out of office due to the Christmas and New Year holidays and so responses may be delayed. Thanks for being patient.

    Elizabeth
  • Hey Elizabeth,

    Thanks for letting me know. I just wanted to get my info up on the forum so that we could start a dialog as soon as someone was available.

    Thanks, and we'll continue this conversation soon!

    Chris
  • The Iq_ref need to be less than 127 if using IQ is 24. The 130 will be overflow for IQ24 saturation. You need to set a correct value to avoid saturation.
  • Yanming,

    Thank you very much for the reply!  Unfortunately, I don't know the understand the Instaspin and Motorware software well enough to fully understand the problem.

    I'm glad to hear that it might be a numerical overflow issue, but how do I make it so that I can achieve currents higher than 127 Amps Iq_ref?  What do I need to do to fix this type of problem?  Is it also a problem that my USER_IQ_FULL_SCALE_CURRENT_A  and USER_ADC_FULL_SCALE_CURRENT_A  are greater than the 129 limit of an IQ24?

    Sorry in advance, but I've been mostly focused on motor control hardware, and I'm relatively new to the Instaspin and Motorware software. Thanks for your help!

    Chris

  • Greetings, and Happy New Year!


    Now that the holidays are coming to an end, I wanted to reply to this to "bump" the comment thread, and see if I could receive an official TI response to how I can handle Iq_ref currents that are above the IQ24 limit.


    What is the best approach to this issue? Is it a simple fix to change the Iq_ref in the gMotorVars to a different IQ type? (As in, could I simply change this one variable type and the IQ math will still work fine, or would there be a large set of software changes?)

    If changing the software would be a very large task, would it instead make sense to add some type of artificial scaling (e.g. in software, scale the sampled current by a constant, say 0.5, or in hardware, alter the gain of my current sense amplifier by 0.5 to lead the controller to believe it is at half the current it actually is?) This type of solution, while certainly faster to complete, seems like it may not be the best long term approach.


    Has anyone ever encountered this problem before with Instaspin? I would imagine that I'm not the first, but I couldn't find an E2E post on this topic.

    Thanks in advance!

    Chris

  • Chris,

    First off, you won't be able to change the IQ math Q value from 24 to a different value. This is because the InstaSPIN ROM, which is hard coded into each of our InstaSPIN-enabled devices, has been pre-compiled for IQ24 specifically.

    That said, the IQ math variable for current is not a "straight" output value as I believe you are interpreting them to be. Instead, you should be commanding an IQ that is a scale value between (-0.5,0.5) - this range of 1 represents the rated output of your motor. Commanding _IQ(127) would be equivalent of commanding 127 times your rated current, which is not correct.

    For InstaSPIN, we rely on USER_IQ_FULL_SCALE_CURRENT_A in the user.h to convert output currents into per unit values. If you need a range of +/-128A, you'll need to set that appropriately in your user.h. All of this of course depends on your HW design. Please take a look in the user.h if you haven't, this may give you some more insight into how we scale the currents for both IQ and the device ADC, compared to your specific HW design.

    Sean
  • Hey Sean,

    Thanks for the feedback; I think we're halfway to meeting in the middle on solving the problem, but there's still some miscommunication.

    Note that I attached my user.h in my original post, where I have set up all the necessary user.h variables, where my USER_IQ_FULL_SCALE_CURRENT_A is 330.0 Amps, and my USER_ADC_FULL_SCALE_CURRENT_A is 660.0 Amps. This corresponds to my chosen sense resistor and differential amplifier gain, and works very well over a wide range of operating conditions so far.

    I am using Lab 4 to command current on my motor test stand, using the variable gMotorVars.IqRef_A in the CCS Debug interface. IqRef_A is an IQ24, and I am able to command a wide range of currents, until I get up to 128, when of course my motor controller "ceases to function properly". ;)

    I'm now aware that the current is set via a function call in proj_lab04.c, on line 540, which reads:
    CTRL_setIq_ref_pu(handle, iq_ref);

    where iq_ref is a per unit current quantity, derived from both the "human readable" IqRef_A (which I'm simply setting in the CCS Debug window) and USER_IQ_FULL_SCALE_CURRENT_A, from the calculation on line 524:

    _iq iq_ref = _IQmpy(gMotorVars.IqRef_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A));

    In another post I found on E2E forums just a little bit ago (e2e.ti.com/.../296202), Chris Clearman suggested that to set higher currents (1000 Amps, as an example) one should perform a calculation as:

    _iq iq_ref = _IQ(1000.0 / USER_IQ_FULL_SCALE_CURRENT_A);
    CTRL_setIq_ref_pu(handle, iq_ref);

    I guess all I'm trying to figure out is if there are any other variable type pitfalls I might fall in to. For the most part I'm a hardware engineer, so I did all the design, layout, etc. of the motor controller, and I'm only now digging into the code. I'm a novice with the Motorware/Instaspin software environment, and I damaged several motor controllers simply because I didn't know about the gMotorVars.IqRef_A limit due to it being an IQ24.

    My end goal is to relay a current command via a UART (SCI) connection, and use that in conjunction with USER_IQ_FULL_SCALE_CURRENT_A to control my torque output.

    Thanks again for your time, and if you have any guidance on doing this the "right way", your help is much appreciated.
  • Ok, sorry for the misunderstanding, I understand now the issue you're seeing.

    You'll need to change " _iq iq_ref = _IQmpy(gMotorVars.IqRef_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A));" to "_iq iq_ref = _IQmpy(gMotorVars.IqRef_kA,_IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A/1000.0));" and input the IqRef_kA as kiloamps instead of amps.

    Additionally, you'll need to change the definition of IqRef_A to IqRef_kA in the _MOTOR_Vars_t_ object in main.h to accompany your change in code.

    That will result in the proper scaling of your commanded current and allow you to input up to +/-0.165kA, which should be your full range based on your user.h

    Sean
  • Sean,


    Thanks so much for the awesome feedback.  I'll definitely be implementing this fix for my particular application.

    I do have one final thing that I am confused about in this dialog, specifically where you mentioned that I should be setting my Iq reference current in pu in the range of (-0.5, 0.5). Is this actually the range of input values for the function CTRL_setIq_ref_pu() to work appropriately?  I was under the impression that the range was actually between (-1,1).

    As an example, I will compare my current-sense hardware values and user.h entries to that of the TI DRV8301 Rev. D Kit.

    On the DRV8301 Rev. D Kit:

    Current Sense Resistor: 0.002 Ohms

    Current Sense Gain: 20

    Thus, a current of 41.25 Amps yields -> (0.002) * 41.25 * 20 = 1.65V, and a current of -41.25 would yield -1.65V.  Since this is super-imposed on the 1.65V midrail reference by the current sense differential amplifiers, the peak-to-peak current of 82.5 Amps corresponds to the full ADC range.

    USER_IQ_FULL_SCALE_CURRENT_A is set as 41.25 Amps in the default user.h for this hardware, and...

    USER_ADC_FULL_SCALE_CURRENT_A is set as 82.5 Amps.

    It is my understanding that this hardware/software combination can handle currents up to roughly 40 Amps peak (as an example, see the motor included in the default user.h called ' ebike_48v_large_dia_afsel_hfi')  This motor has a listed USER_MOTOR_MAX_CURRENT of 40.0.

    If it were the case that current can only be commanded in the pu range of (-0.5,0.5), then the max current command possible would be only 20.625 Amps.

    On my hardware:

    Current Sense Resistor: 0.0001 Ohms

    Current Sense Gain: 50

    Thus, a current of 330 Amps yields -> (0.0001 Ohms) * 330 Amps * 20 = 1.65V, and a current of -330 would yield -1.65V.  Since this is super-imposed on the 1.65V midrail reference by the current sense differential amplifiers, the peak-to-peak current of 660 Amps corresponds to the full ADC range.

    USER_IQ_FULL_SCALE_CURRENT_A is set as 330 Amps in my application, and...

    USER_ADC_FULL_SCALE_CURRENT_A is set as 660 Amps.

    MAIN QUESTION:

    Based on this, is it truly the case that based on my hardware/user.h settings that I'd only be able to do +/- 165 Amps, or can I actually command the +/- 330 Amps (using the creative kA solution you suggested)?

  • You are correct, the range should be from (-1,1) pu, not (-0.5,0.5) as I mentioned earlier. You should be able to achieve the full +/-330 range given you've setup your hardware appropriately and instantiated the kA code I showed above


    Sean

  • Thanks so much for all your help Sean.

    I'd like to mark this as answered, so that others might benefit from the insights in this forum thread.

    Cheers!

    Chris