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.

TMS320F28069F: Few Questions. Freewheeling, different braking strategies

Part Number: TMS320F28069F

Hi,

I already read a lot in this forum, where I mostly found the answers to my questions. Thanks for that!  But now i have some own questions.

In my application I will mostly use the Torque mode. There will also be a cruisecontrol. For this I would like to use the instaspin-foc-PI - controller.

1. When I am in Torque mode and I want to limit the speed to a maximum.... Is it a good solution to activate the Speed-Controller when maximum speed is reached. (or a bit before maximum speed is reached). Is there a better way to limit the Speed in Torque mode?

2. When i am switching between Torque and Speed Controller i assume, that i have to feed the Speedcontroller input with the actual speed and the output of the controller with the actual IQ, for smooth transitions.  Am i Right?  When i activate the speed-controller. Is it allready feeded with the actual speed or will the actual speed be zero in the first step of the Controller?

3. I know how i do regenerative Braking. But i also would like to use short-curcuits to the coils for braking. If i understood the FOC right i do this when i set IQ_ref  and ID_ref to zero?  I think i will be in the middle of the 7 possible SVPWM-Patterns where the ouput Pattern is 0,0,0 and all 3 Half Bridges are connectet to Ground?

4. This brings me to my next question. How can i realize Freewheeling, as my Coils are shortened when I set IQ to 0.0 ?  I know there is the freewheeling-function. But does it work in Torque-Mode as well? How does the freewheeling work?

5. Also i want to use active braking. I want to take Power from the Battery for braking. When i set IQ_Ref negative the electrical field will rotate slightly behind the magnetical field. But this ends up in recuperation. My Idea is to set a negative ID and a negative IQ. I am thinking that this will result in a is-Vector that will have 180° to a motoring vector. This should produce a electrical field that "pushes" against the magnetical field instead of "pulling" it (motoring). Did i understand this correctly?   So I will do a motoring with 180°phase shift. Is that possible and could this work for braking?

Thanks in advance! I hope my questions are clear :)

Best Regards

Sebastian

  • sorry i forgot one Question.
    6. I tried to measure RS while running the Motor. Is this possible? It seemed like Motor didn'T ran smoothly anymore. When the motor is running does the RS-caluation use IQ_ref or does it set IQ to RsOnLineCurrent_A? I wanted to use the measurement of RS to calculate the Motor-Temperature. Is this even possible while running the motor?
    Thanks in advance again
  • Hi Sebo -

    I can help with questions 1 & 2:

    1) You can limit the gMotorVars.OverModulation variable to limit speed in torque mode. Are you using Overmodulation? If so, max speed will be a value of 0.6666 (overmodulation) or 0.5 without overmodulation. You can set this value lower and it will limit the top speed without having to use the Speed Controller.

    2)  To switch from torque control to speed control, you need to seed the Ui value of the speed controller with the current output of the torque controller. For swithching back to torque mode, you'll need to seed IqRef_A with the current output of the speed controller. I have written code to do this:

    Enable speed control:

    _iq Spd_ref_current = EST_getSpeed_krpm(ctrlHandle->estHandle);
    gMotorVars.SpeedRef_krpm = Spd_ref_current;
    
    _iq Iq_ref_threshold = CTRL_getIq_ref_pu(ctrlHandle);
    PID_setUi(ctrlHandle->pidHandle_spd, Iq_ref_threshold);
    
    _iq Spd_ref_threshold = EST_getFm_pu(ctrlHandle->estHandle);
    TRAJ_setIntValue(ctrlHandle->trajHandle_spd, Spd_ref_threshold);
    
    
    CTRL_setFlag_enableSpeedCtrl(ctrlHandle, true);

    Disable speed control:

    if (gMotorVars.Iq_A > 0)
    {
    	gMotorVars.IqRef_A = gMotorVars.Iq_A;
    }
    else
    {
    	gMotorVars.IqRef_A = 0;
    }
    
    CTRL_setFlag_enableSpeedCtrl(ctrlHandle, false);

  • Hi, thanks for your answer. :) I think I just found a better solution for my first question. It also is a solution for my second question. I will run the Speed-Controller with maximum speed as SpeedRef. The User Input will set the IQ-Output Limit of the Speed-Controller. When the User sets the IQ_output-maximum he/she will control the torque as the Speed-Reference is set to maximum Speed and the PI-output will allways be a high current.
  • Hi,
    i think i solved it nearly by myself. But now i have some new questions:

    1. Just to be sure: My only possibility to short all windings to ground is to activly set PWM outputs to 0 am i right? Could i do it like this in the main isr?:

    // run the controller
    CTRL_run(ctrlHandle,halHandle,&gAdcData,&gPwmData);

    If(Shortenbrake==true) //If brake over windig is requestet set PWMdata to Zero
    {
    gPwmData= {_IQ(0.0), _IQ(0.0), _IQ(0.0)};
    }
    HAL_writePWMData(haltHandle, &gPwmData);
    // setup the controller
    CTRL_setup(ctrlHandle);

    2. I want to Handle the following Case: Battery-pack is fully loaded, but user wants to brake.
    For handling this i want to brake actively. I mean to activly push a current into the coils to brake. I found out i could do this by playing with the angle. When i set Iq_ref_A=-4 and Id_ref_A=-10, the controller needs Power to brake. A negative point is that the Inverter gets hot because the Current throught the inverter is about 10A. The Battery-Current is about 1.2A. As long as i can transfer the heat this shoul not be a problem, am I right? If i brake to hard could this harm the magnets?
    I haven't seen that anybody is braking like that? But why? Is it dangerous?

    3. When i use RSOnline. Does it measure while running the motor or do i have to stop the operations so the RsOnline function can put its 1A for Measurement inside the windings?

    Thanks in advance!!
  • 1. You means 3 high side is off, and 3 low side is on. If yes, your code can't work well as this, it's 50% duty for all sides. You have to write a code to turn off all 3 high sides, and turn on all 3 low sides using pwm as below by your self.
    // Force high side off, low side on
    PWM_setActionQualContSWForce_PwmA(obj->pwmHandle[PWM_Number_1], PWM_ActionQualContSWForce_Clear);
    PWM_setActionQualContSWForce_PwmB(obj->pwmHandle[PWM_Number_1], PWM_ActionQualContSWForce_Set);

    PWM_setActionQualContSWForce_PwmA(obj->pwmHandle[PWM_Number_2], PWM_ActionQualContSWForce_Clear);
    PWM_setActionQualContSWForce_PwmB(obj->pwmHandle[PWM_Number_2], PWM_ActionQualContSWForce_Set);

    PWM_setActionQualContSWForce_PwmA(obj->pwmHandle[PWM_Number_3], PWM_ActionQualContSWForce_Clear);
    PWM_setActionQualContSWForce_PwmB(obj->pwmHandle[PWM_Number_3], PWM_ActionQualContSWForce_Set);

    2. There are several brake mode, regenerative brake ( Add a opposite torque current), hardware brake(low side on).

    3. RsOnline support calculating the motor stator resistance without stopping motor, you need to inject a current on d-axis when you enable this function.