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.

Compiler/LAUNCHXL-F28027F: Trajectory module

Part Number: LAUNCHXL-F28027F
Other Parts Discussed in Thread: DRV8305

Tool/software: TI C/C++ Compiler

Hello, could you tell me how using the TRAJ_setIntValue () function to correctly set the current rotation speed (when switching the torque mode and speed mode). Those. if gMotorVars.Speed_krpm = 100 revolutions (conditionally), then when switching mode (from torque mode to speed mode) the speed was maintained at 100 revolutions. Switching should occur without jerks.

  • Which lab did you use?

    You might call TRAJ_setIntValue () as below, the current speed value must be converted to _IQ format. Actually you shloud set the EST_getFm_pu(obj->estHandle) value in TRAJ_setIntValue().

    TRAJ_setIntValue(obj->trajHandle_spd,_IQ(current speed value));

  • Hello,

    I use Lab 5a, and I sort of figured out how to use TRAJ_setIntValue () when switching modes of torque and speed.
    Now I have another problem. When current is applied to the motor, it spins up to a maximum at this moment when switching the torque mode to the speed mode, the drv8305 turns off (the power supply goes into protection). May I ask how to get rid of this problem?

  • You may set the right torque current according to the load of the motor, the speed will be very high if the torque current is large and the load is light. It should be an engineering problem that needs to be tuned based on the requirement of the system, you must add some transition process for the switching.

  • Hello Yanming Luo, faced the problem of switching modes. When the mode is switched, the speed is reset to almost 0, and only then does the unwinding start to the speed that is needed. How can you get rid of it ?. If you use the code given below, the speed (torque increase) is no longer supported.

       PID_setUi(obj->pidHandle_spd, _IQ(0.0));//gMotorVars.Iq_A
       TRAJ_setIntValue(obj->trajHandle_spd,_IQmpy(gMotorVars.SpeedRef_krpm,EST_get_krpm_to_pu_sf(obj->estHandle)));

  • You may refer to the lab10e (flying start), set the current feedback speed to speed trajectory, not the reference speed.


  • Hello Yanming Luo, it's not entirely clear what you mean. Could you paint in more detail?

  • You might refer to the motor_RunCtrl() in proj_lab10e.c and FS_run() in flyingstart.h, to set the feedback speed to the trajectory as below code. 

    TRAJ_setIntValue(ctrl->trajHandle_spd, fs->speed_set_pu);

    Or as the code you mentioned, just need to change the gMotorVars.SpeedRef_krpm to gMotorVars.Speed_krpm, but the estimator must be enabled always as lab10e.

  • Thank. I'll see it.