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.

Speed Limitation while using Torque Mode

Other Parts Discussed in Thread: MOTORWARE

Hello Guys,

I am using MotorWare for a university project. We have an experimental electrical car, and want to use InstaSPIN for control. 

We have adapted the HAL to our custom platform, and for safety reasons we switched from sensorless control to using Hall sensors which are installed in the motor. (I found a forum post with some unofficial observer module, this works fine!) The sensorless estimated speed is used for redundancy and error checking.

The DC Bus comes from a battery, and varies from 3xx to 400 Volts. But, our motor reaches his mechanical speed limitation at about 240 Volts RMS phase voltage, so I want to limit the currents controller's output voltages to around 340 V peak. 

In the user.h I found the parameter USER_MAX_VS_MAG_PU, which I could reduce - but to which value does the PU refer in this case? Or I think there are some min/max limits in the controller initialization. Which is the right parameter for me to change? And how do I calculate the PU values, to limit the output voltage to a certain value in Volts?

Basically, I want to do a complete torque control, only with an upper speed limit. This speed limit does not have to be exact, just somewhere around 8000 rpm (mechanical max speed is 10000rpm, so there is enough safety margin).

What would you recommend me to do?

Thank you very much,

Philipp

  • in ctrl.h you can see where the MAX_VS_MAG_PU is used in the section:
    if(CTRL_doCurrentCtrl(handle))

    it sets the output limits of the Id and Iq controllers, which are the inputs to the IPARK which produces the Vd and Vq component which you are attempting to limit.

    If you are NOT using the over modulation introduced in proj_lab10 then the maximum value you should use for MAX_VS_MAG_PU should be (1.0), which a per unit for the peak of the sinewave, or 3/4 of the peak voltage.....I believe this peak voltage is the measured Vdc-bus voltage. I've sent along to the expert in hopes they confirm.
  • Hi Philipp,

    As you pointed out, the variables used throughout the code are scaled to be "per unit" values.  The number they are scaled with respect to is the value of the variable called "USER_IQ_FULL_SCALE_VOLTAGE_V".  So, for example,  if USER_IQ_FULL_SCALE_VOLTAGE_V is equal to 500 volts, a code voltage value of 0.5 implies a real-world voltage of 250V.  So if you want to limit the motor voltage output waveform to 340V (I assume you mean P-P, line-to-neutral), you must translate this into a bipolar limit of +/- 170V represented in P.U. format by dividing 170 by USER_IQ_FULL_SCALE_VOLTAGE_V.  Let's call this value "X".

    Next, you replace the existing values for the max and min limits of the d-axis PI controller output with +/- X.

    To determine the new limits for the q-axis PI controller output, you must use the following equation:

    Y = sqrt(170^2 - Vd^2), where Y represents the new +/- limits on Vq.

    Something else you may have to consider is that we use space vector modulation to create the motor voltages.  Since SVM results in 15% greater bus utilization for the same phase voltage amplitudes, you may have to take this effect into consideration by lowering the 170 volt limit  to 145 volts.  But since your speed limit doesn't have to be exact, you may find that you are already in the ballpark without having to do any further changes to your limit values.

    I hope this solves your problem...

    Best Regards,

    Dave

     

  • Hi Chris, hi Dave,

    Thank you very much for your answers. 

    I'm going to try using a call to the "CTRL_setMaxVsMag_pu" function, and I will scale the pu-value according to my USER_IQ_FULL_SCALE_VOLTAGE_V. I can experiment with that value a little bit, until it works as desired. I can report back when I'm successful.

    One last question: Is there an Anti-Windup functionality in the current controller? I think I saw something like that in the code, but just to make sure. I will need this, I guess...

    Thanks,

    Philipp

    Edit: I experimented with these values, and it worked. The value in MaxVsMag_pu seems to be linear to the maximum speed. It seems to have anti windup, too.

  • Hello 

    Excuse me ,I found this post,I have some questions to ask.

    In electrical car application,the motor needs to produce high torque (double or even triple rated torque) when the motor starts.If limit the current controller's output voltage for speed limit, this will affect startup performance of motor.Right?

    If I only want to limit the speed, I want to use "gMotorVars .Speed_krpm" to monitor the speed,then if gMotorVars .Speed_krpm > some value,I will decrease Iq reference.Can I limit speed in this way? Compare with Philipp L’s method,   What are the pros and cons of my method?

  • "In electrical car application,the motor needs to produce high torque (double or even triple rated torque) when the motor starts.If limit the current controller's output voltage for speed limit, this will affect startup performance of motor.Right?"
    Yes, if you are limiting the Iq_Ref coming from the speed reference.

    I don't understand your method. If the speed_est is > the speed command you reduce the Iq_ref? That's what a speed controller does...how is your proposal different?

    In an electric car you need to run in torque mode, where the Iq_Ref is controlled by the user's throttle alone. Any speed monitoring/limitation would be done for safety, governor, or cruise control.
  • My motor run in torque mode.I limit speed for safety.If the motor overspeed for some reason and I find "gMotorVars .Speed_krpm" more than some threshold value,I think I must limit speed, what should I do reasonably? I make Iq_Ref = 0? Or shutdown all the PWM?Or another better ways?

  • Hi chao yang,

    you seem to have the same problems as I have. For an electric car, you have to do torque control, otherwise driving won't feel natural and there are some safety issues, for example if your tire is blocked by the road curb, what happens when you do speed control with your throttle control?

    So, torque control. But still, limiting the speed at some value must be done, otherwise the motor can be mechanically damaged. I think the best way to do this is to limit the current controllers output voltage. You could even do this depending on the load, if it has to be an exact limiting speed. You don't have to be afraid that your startup torque will decrease. In electrical machines, speed equals voltage, and torque equals current. When you are at zero or very low speeds, you barely need no voltage to produce torque. Look at the voltage equation for the permanent magnet machine: u = R*i + L* di/dt + Flux_const*speed. Most of the voltage drops over the last, speed dependant term at higher speeds.

    I would not do some Iq derating, because by doing that you would attempt to put some speed controller over your torque control, and then you could do speed control just from the start (what I would not recommend, as I said above). For safety reasons, you could compare your speed_est to some limit which is higher than the limit your voltage limitation produces. And if you hit that limit, you should shut off your drive, because something has gone wrong. In normal operation, you should never reach this limit.

  • Thanks Philipp for your excellent response and your willingness to help another TI customer.  I am glad to hear that you are having success using the "CTRL_setMaxVsMag_pu" function.

    Best wishes for the success of your project!

    Dave