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.

TMS320F28027F: About the problem of lab5b project angle loss

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

TI technical expert, when I use the lab5b project, the motor set speed is 40rpm. In order to ensure no modulation, I limit the output of the speed loop to 0.5, and then I use the load to drive the motor to rotate in the same direction, and the load speed is greater than Motor, the motor will produce an adjustable maximum voltage to counter the excess speed generated by the load. The torque output of the motor can be maintained for a period of time, but I hope it can be maintained, but unfortunately the torque will only be maintained for a period of time, causing this reason It seems to be related to the EST estimation angle. The following figure clearly shows this process:

The picture above shows the phase currents of three phases.

In the figure below, the ref red line is the output value of CTRL_getSpd_out_pu, the blue line Actual is the output value of CTRL_getIq_in_pu, and the yellow line Angle is the output value of EST_getAngle_pu.

When the expected value of CTRL_getSpd_out_pu is maintained at the maximum modulation value of 0.5, the torque is stable. When out of step occurs, the angle value is severely distorted, causing the speed loop output value to fluctuate up and down, and the corresponding three-phase current spatial modulation is also distorted.
How can I prevent this from happening?

  • Please expect some delay in the response as 31-May is a TI Holiday

  • Are you working on the TI EVM kit or your won board?

    It seems like the adding load is higher than the maximum output torque of the motor, and the machine is not working in motor mode. This instaspin lab can't support four-quadrant operation, so you have to add additional functions for controlling the machine in this generation status by yourself.

  • Using LAUNCHXL-F28027F+DRV8305, I am sure that the torque of the motor is not exceeded, because I have limited the output of the speed loop to ±0.5, but this problem still occurs. The problem often occurs at the inflection point of the speed loop output ± current (The load drives the motor to rotate in the same direction, and the motor outputs a negative torque current to suppress overspeed. When the load decreases speed equal to or lower than the motor speed threshold, the motor will output + torque current in the positive direction) Is there any way to overcome this? Does this happen?

  • What speed is the motor running during this case? Maybe, you have to use the sensored-foc for this application.

  • In addition, I would like to ask,

    1. I see gMotorVars.IqRef_A * (1.0/USER_IQ_FULL_SCALE_CURRENT_A), which means that the maximum torque current is 1? When my USER_IQ_FULL_SCALE_CURRENT_A is equal to 24, I input 24a to gMotorVars.IqRef_A in lab4 and feel that the torque is the largest, but 1a is very small. Why? More than 24a, the motor will be abnormal, is this correct?

    2. In addition, I noticed that USER_MAX_VS_MAG_PU is set to 0.5, which means that the maximum modulated vector sum is 0.5, but the gAdcData.I.value[0] value I collected through adc will be 1 at the peak value. Can you explain why?

  • The instaspin uses per unit (PU) format in FAST estimator and FOC functions, so the normal range of all of the control variables in FOC function could be _IQ(-1.0) to _IQ(1.0). The gMotorVars.IqRef_A must be converted to _IQ value for setting the Iq reference. 

    The USER_MAX_VS_MAG_PU is used for setting a modulation index for SVPWM that is not equal to the PWM duty and is not related to ADC value. You might take a look at a motor control textbook that could have a detailed description of PWM and FOC.

  • In lab5b, the bus voltage is 24v, USER_IQ_FULL_SCALE_CURRENT_A and USER_IQ_FULL_SCALE_CURRENT_A are both 24, and USER_MAX_VS_MAG_PU is 0.5. How to judge that the motor is injected with 24a current? To determine the maximum torque output? I see that the output of ctrl.spd_out is already 1, but the value of vs is only about 0.057. How can I reach the maximum torque?

    My motor runs lab5b in this way:

    I noticed that the torque can reach about 1.5nm, but the power supply current is only about 1.2a:

  • You might find the detailed description of d/q-axis current, phase current, and power supply dc bus current in a textbook about motor control and FOC, these are different values and there are not directly proportional relationships between them.

    The ctrl.spd_out is the target torque current, and vs is the vector voltage, both are _IQ format.

    You can refer to lab05a for implementing the torque closed-loop control, or lab05b for speed closed-loop control.

  • Can you directly tell me how to judge that the motor output has reached the maximum USER_MOTOR_MAX_CURRENT? Because I saw your answer in other posts, the value of vs should be close to USER_MAX_VS_MAG_PU, which means the maximum output. My USER_MAX_VS_MAG_PU value is 0.5, but the measured value is only about 0.05. Is my output not maximized? How can I maximize the output? Thank you for your patience.

  • As mentioned above, the USER_MAX_VS_MAG_PU is the maximum voltage vector value and maximum modulation, you can't measure this output with any instruments directly.

    You might refer to klab10a to add the codes below for checking the vector output voltage.

    // read Vd and Vq vectors per units
    gMotorVars.Vd = CTRL_getVd_out_pu(ctrlHandle);
    gMotorVars.Vq = CTRL_getVq_out_pu(ctrlHandle);

    // calculate vector Vs in per units
    gMotorVars.Vs = _IQsqrt(_IQmpy(gMotorVars.Vd, gMotorVars.Vd) + _IQmpy(gMotorVars.Vq, gMotorVars.Vq));

    Also, checking the ctrl.pid_spd.Ui or ctrl.pid_Iq.refValue for the torque current which maximum should be _IQ(USER_MOTOR_MAX_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A).

  • I use LAUNCHXL-F28027F, DRV8305, USER_MOTOR_MAX_CURRENT, USER_IQ_FULL_SCALE_CURRENT_A are 24A, and I use TRAJ_setIntValue(ctrlHandle->trajHandle_spdMax,_IQ(0.5)) to limit the output of the speed loop to 0.5.

    The total vector of the desired torque current vs. is calculated by the following code:

    gMotorVars.Vd = CTRL_getVd_out_pu(ctrlHandle);
    gMotorVars.Vq = CTRL_getVq_out_pu(ctrlHandle);
    gMotorVars.Vs = _IQsqrt(_IQmpy(gMotorVars.Vd, gMotorVars.Vd) + _IQmpy(gMotorVars.Vq, gMotorVars.Vq));

    The total vector of the actual torque current in ampere is calculated by the following code:

    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));
    gMotorVars.Is_A = _IQsqrt(_IQmpy(gMotorVars.Id_A, gMotorVars.Id_A) + _IQmpy(gMotorVars.Iq_A, gMotorVars.Iq_A));

    The following figure shows that the various outputs of the speed loop meet the expected saturation 0.5:

    According to the principle of 0.5 saturation output, the USER_MOTOR_MAX_CURRENT of 24a should be 12a after scaling. The following figure shows that the values of iq_A and Is_A meet expectations:

    Unfortunately, I still don't quite understand the correspondence between vd, vq, vs and id_A, iq_A, and is_A. In principle, shouldn't their values be the same? I set the value of vd, vq, vs * USER_IQ_FULL_SCALE_CURRENT_A, but still does not match id_A, iq_A, is_A, Yanming, can you tell me why?

    In addition, I would like to ask another question. In the above figure, the value of is_A meets the expectation of 0.5 saturated output, that is, the torque current of 12a. Does this mean that the maximum output of 0.5 is already? So if I set 0.5 to a saturated output of 1, does it mean that 24a is the maximum output? Should we consider the USER_MAX_VS_MAG_PU (0.5) situation in this case? Because its maximum duty cycle is 86%, is the maximum output actually around 21a?

  • I can't understand what do you want to implement instaspin-foc lab in motor control. You might have a look at the motor control textbook about FOC that could help you to understand these concepts about d/q-axis current and voltage, and FOC.

    No, Vd and Vq are the output voltage on d/q-axis with PU format, Id and Iq is the feedback current on d/q-axis, there are not direct proportional relationships between these variables as mentioned above, there is a formula based on the motor model you might find in motor control textbook.

    You might just increase USER_MOTOR_MAX_CURRENT based on the spec. of the motor for achieving enough torque current, and don't need to care what the value of those variables as you mentioned above.

  • We want to use the lab5b speed loop to generate resistance. Just like the video above, the load drives the motor to rotate quickly. Because the motor speed is given a very low value, 10rpm, it will generate a torque opposite to the load to suppress overspeed. I say you can Understand?

    I keep asking this kind of question because I want to make sure that when spd_out is 1, the phase current output is the maximum? Should iq_A and is_A be close to 24? (Under the current parameters, for example, USER_MOTOR_MAX_CURRENT is 24)

  • USER_MOTOR_MAX_CURRENT, USER_IQ_FULL_SCALE_CURRENT_A are 24A,

    Seemingly not a good condition to have ADC full scale amps set the same value as PI control motor saturation amps. There is no ADC head room for peak motor current to accurately scale. Motor max current is the saturation peak of momentary switching time at various rotor speeds, assumed >1Hz in most cases. You can refer to the Instaspin Motion User Guide SPRUHJ1H–January 2013–Revised June 2019 for detailed explanation of user.h settings. 

      

  • We want to use the lab5b speed loop to generate resistance.

    A typical and well documented Matlab rotor load might be shaft connected to power generator with load resistor bank to calculate KW output. Perhaps you could use high current BLDC as the connected generator for Lab5 connected motor drive. Seems over kill being CCS debug shows motor Amps and torque Nm. Also could connect diode trio rectifier onto BLDC phase wires to gather linear and later graphed output plots of power produced via 3 ADC input channels. And TIRTOS supports real time graphing via CCS debug.

    We want to use the lab5b speed loop to generate resistance

    I don't think that is the intended purpose for these labs but notice the Axiom project doing similar testing method with VESC controller. 

  • The USER_MOTOR_MAX_CURRENT is limited to the hardware board and should be set to the right value according to the motor, and it must be lower than half of the USER_ADC_FULL_SCALE_CURRENT_A and USER_IQ_FULL_SCALE_CURRENT_A.

    As replied to you before, recommend that you should use a sensored-FOC for your application, I don't think the sensorless-FCO is easy to meet your requirement for running the motor at a low-speed stably.