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.

TMS320F28069: Issue During Reverse Phases

Part Number: TMS320F28069
Other Parts Discussed in Thread: DRV8305

Hello,

I'm helping a customer that is developing an application is based on a custom HW board using TMS320f28069m uC and DRV8305 driver. We post it on here since we believe the answer might be helpful to others.

They are in reverse, flying at 14-15m/s with a 9x6 propeller attached to a AXI2808/20 PMSM motor (parameters attached). They would spin in reverse with an acceleration >7.5 kRPM (accel = f(speed) has a trapezoidal aspect). Part of the time, everything went well, but in some cases, they are facing an issue : motor stays stucked at 0 RPM, it does not switch to reverse.

As recommended in another post, they did the following :

  • Decrease acceleration close to 0RPM to 1kRPM/s (before 7.5kRPM/s) -> An important improvement has been observed. Still some cases remaining (during startup and during reverse)
  • Complete removal of the RsOnline feature -> An important improvement also, no bad case detected
  • Decrease acceleration & complete removal of RsOnline feature -> Good behavior, no more issue detected, we are going to launch further tests (>1000 startup + reverse phases & flight tests)
  • Use low acceleration and different Kp&Ki, control bandwidth of speed regulator for startup and add a limitation value ( the output of speed regulator) for startup also.
  • Use the instaSPIN-motion for velocity control in this case and turned off the force angle feature (“gMotorVars.Flag_enableForceAngle” set to 0)
  • Tune the control bandwidth by changing the “gMotorVars.SpinTAC.VelCtlBw_radps” as the following code in project, and the “gMotorVars.SpinTAC.VelCtlOutputMin_A” to limit the maximum torque current for startup also.
// set the SpinTAC (ST) bandwidth scale
STVELCTL_setBandwidth_radps(stObj->velCtlHandle, gMotorVars.SpinTAC.VelCtlBw_radps);
 
// set the maximum and minimum values for Iq reference
STVELCTL_setOutputMaximums(stObj->velCtlHandle, _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMax_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A)), _IQmpy(gMotorVars.SpinTAC.VelCtlOutputMin_A, _IQ(1.0/USER_IQ_FULL_SCALE_CURRENT_A)));

Since it's still note working perfectly every time, can you help us respond to the following questions :


  1. When we try to have square curves as input (-10000RPM -> 10000RPM -> -10000RPM), we can observe that acceleration is not updated as we ask. (STVELMOVE_getAccelerationLimit answers the maximal value we have set, but the STVELMOVE_getActualAcceleration answers very far). Do you have any idea ?
  2. When we activate RsOnline at a middle RPM range (between 4000 and 8000), we still have issues at reverse, do you have any explanation ?
  3. We tried to decrease again acceleration to 0.5kRPM/s, reduce Jerk and maximum current output but we still have some percentage of failures. Can you clarify the startup sequence and the state of the flags please ? Do you an idea on how to fix it ?
  4. We tried to set and log the bandwidth, but got bandwidth is not equal to the one we have set. How and why the controller changes it ?

Thanks for your support !

Best Regards,

Mickael

  • 1. Which example lab are you referring to? What functions are calling to update the acceleration in the project? SpinTAC velocity control should be better for this application than motion. Or just use the instaSPIN-FOC for such application.
    2. You should disable the RsOline during the motor speed is lower than a threshold value in the full running process. The "low speed" doesn't mean for the target speed is lower. Simply, to disable the Rs online feature during the acceleration or deceleration process, just enable it during the running state with almost constant speed.
    3. Is the motor starting from zero speed? Is there any current waveform to show this issue? Or please have a more detailed description of the process you are using.
    4. As for question 1, not all labs can support online change the control bandwidth and acceleration value.
  • 1. We use instaSPIN-FOC for this. we are setting the MaxAccel_krpmps in the following code portion : 

    		// Get the configuration for SpinTAC Move
    		STVELMOVE_setCurveType(stObj->velMoveHandle, mc_motorData.SpinTAC.VelMoveCurveType);
    		STVELMOVE_setVelocityEnd(stObj->velMoveHandle, _IQmpy(mc_motorData.SpeedRef_krpm, _IQ(ST_SPEED_PU_PER_KRPM)));
    		STVELMOVE_setAccelerationLimit(stObj->velMoveHandle, _IQmpy(mc_motorData.MaxAccel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM)));
    		STVELMOVE_setJerkLimit(stObj->velMoveHandle, _IQ20mpy(mc_motorData.MaxJrk_krpmps2, _IQ20(ST_SPEED_PU_PER_KRPM)));
    
    		// Enable SpinTAC Move
    		STVELMOVE_setEnable(stObj->velMoveHandle, true);
    
    STVELMOVE_run(stObj->velMoveHandle);

    2. Ok, we are never in a constant speed process. But is this normal that if RsOnline activated at mid-RPM value, we are facing issues at low RPM (it is like if the RsOnline has not been disabled)
    3. Yes, the motor is starting from 0 speed. We are recalibration offsets, RsOnline, disabling forceAngle (we tried with forceAngle enabled until 150RPM but still the same issues). In the faulty cases, IqRef raises up to a big value, but rotor does not spin and stalls.
    4. Issue fixed, scaling was not good between logging and setting.

    Thanks for your help

  • I would add a question : 
    5. What is the maximum update frequency for the desired speed ? we found that if the update rate is >200Hz the library has a periodic weird behavior (period of 1s, acceleration seems reset, abnormal behavior).

    Thanks

  • 1. You are using instaSPIN-Motion since you used SpinTAC for velocity control. Which original lab are you referring?
    3. May you have a detailed description of the running transition plan? That helps us to understand the running flow, and it'd better have some current waveform to show the problem. You should disable the RsOnline calibration, just enable Rs re-calculation during starting run the motor, both used different flags in the project.
    5. As of Q1, instaSPIN-motion doesn't enable online change the position profile.

  • Hello Yanming,

    1. As mentionned before, we are no using a specific lab as reference as we are using several fetures from the labs togethter. I can share with you out motor_control file but it is based on several labs.

    3. The issue has been fixed by updating maximum output current for now.

    5. Hum I am a little surprised by this answer. As the target speed is always moving in out application, don't you have a suggestion about the update rate ?

    6. Can you confirm me that when we call the following amount of code, RsOnline feature is fully disabled and all its effects are ineffective

    EST_setRsOnLine_qFmt(handle, EST_getRs_qFmt(handle));
    EST_setRsOnLineId_mag_pu(handle, _IQ(0.0));
    EST_setRsOnLineId_pu(handle, _IQ(0.0));
    EST_setRsOnLine_pu(handle, EST_getRs_pu(handle));
    EST_setFlag_enableRsOnLine(handle, false);
    EST_setFlag_updateRs(handle, false);

    Best

  • 1. Just want to know if you are using motion control with SpinTAC, or only velocity control with SpinTAC. You can't change the speed and acceleration value if using the motion control and during the running process.
    5. As question 1, maybe need to see your project file. Often, you might try the update the target frequency with 1kHz.
    6. It's fine if you don't call EST_setFlag_enableRsOnLine() at somewhere else.
  • 1. We are using Motion control with insta-spin if I've understood correctly, file attached in personnal mail.

    5. Attached in personnal mail

    6. Ok understood thanks.

    7. What can lead to oscillations in speed at high RPM ?

    Best

  • Hi Yanming, I would add some questions.

    8. When does the following code has to be called ? 

    		// Get the configuration for SpinTAC Move
    		STVELMOVE_setCurveType(stObj->velMoveHandle, mc_motorData.SpinTAC.VelMoveCurveType);
    		STVELMOVE_setVelocityEnd(stObj->velMoveHandle, _IQmpy(mc_motorData.SpeedRef_krpm, _IQ(ST_SPEED_PU_PER_KRPM)));
    		STVELMOVE_setAccelerationLimit(stObj->velMoveHandle, _IQmpy(mc_motorData.MaxAccel_krpmps, _IQ(ST_SPEED_PU_PER_KRPM)));
    		STVELMOVE_setJerkLimit(stObj->velMoveHandle, _IQ20mpy(mc_motorData.MaxJrk_krpmps2, _IQ20(ST_SPEED_PU_PER_KRPM)));
    
    		// Enable SpinTAC Move
    		STVELMOVE_setEnable(stObj->velMoveHandle, true);

    is it at each loop (500Hz for us) or only when the SpeedRef_krpm changes )

    9. Our application requires a good phase from 0 to 11200RPM in <3s. As the RsOnline process is quite long, do we have to set ?

    const _iq RsOnLine_Angle_Delta_pu = _IQmpy(MC_RSONLINE_ANGLE_FREQ_HZ, _IQ(1.0 / USER_EST_FREQ_Hz)); // MC_RSONLINE_ANGLE_FREQ_HZ = 1.0 Hz
    	EST_setRsOnLineAngleDelta_pu(obj->estHandle, RsOnLine_Angle_Delta_pu);

    How does the frequency has to be set ? I trid with 1Hz but it is unsettling the Rs estimation (which becomes decreasing...)

    10. During some middle to high RPM phases, measured RPM is very noisy (real speed is around 6400RPM but some glitches are reaching 8600RPM). Do you have any idea ?

    Best,

  • Hello,

    I would add what follows :

    • haw can I know the final Iq and Id current asked to the motor ? (including Id for Rs and others...) Which functions do I have to use ?

    Thanks,

  • 1. Not easy to understand your code in a short time, a control flowchart may help me to study it quickly.
    7. Much more factors, incorrect motor parameters, the Gains of PI controller, the bandwidth of spinTAC controller.
    8. Just the idle state of SPINTAC as you looked in the code.
    9. Not easy to implement, you only need to enable the Rs recalculation when starting the motor, and should disable Rs-online function during the acceleration/deceleration process, just enable it periodically when the motor is running with a constant speed. You don’t need to change anything on this code.
    10. Current&Voltage sampling signal should be one of the main reasons.
    11. You might try the following codes.
    // read Id and Iq vectors in amps
    gMotorVars.Id_A = _IQmpy(CTRL_getId_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));
    gMotorVars.Iq_A = _IQmpy(CTRL_getIq_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));
  • Hello Yanming,

    1. answered by direct mail

    7. Ok thanks

    8. Hum not fully understood... When do we have to update the desired speed ?

    9. Ok... If we never spin at a constant speed ?

    10. ok thanks

    11. That's what I've tried and it works, thanks

  • 8. Only during IDLE state if you want to use velocity profile. You can change the reference speed any time if you just need to implement a fast speed close control and maybe using instaSPIN-FOC is a better choice than instaSPIN-motion.
    9. No critical, but it will get a better re-calibration Rs if the reference or feedback speed keeps a constant value.

    We would like to close this thread first since most questions are solved. You can create a new thread if you have any further question on this topic. Thanks.
  • 8. OK so you mean we are not using a good setup as our speed is always moving, we should not use the instaSPIN-MOTION lib ? Can you confirm and explain why please ?

    9. OK thanks, 

    Concerning you question, we are still facing a lot of not understood issues and it is critical for us... But we are not moving forward.. I would be happy to open a new thread but we mainly have to understand and fix our issues, even if you need current scopes or PWMDAC outputs. 

    Is there anything to begin with ?

    Best,

  • 8. You can change the reference speed anytime since you don't care the precise velocity profile for motion control that you have done in your code. As mentioned, so you don't need spinTAC ( instaSPIN-MOTION lib) for this velocity control, just use intsSPIN-FOC, especially on fast speed response.

    Just want you to create a new thread with the unsolved questions, not to keep this thread with too many questions mixed, that help us to solve your question one by one. Thanks.
  • Let's short the thread to close it first, just keep the un-resolved questions for a new thread. Thanks.