C2000WARE-MOTORCONTROL-SDK: Motor Control SDK. The estimator keeps trying to calculate the angle even when the PWM is disabled.

Part Number: C2000WARE-MOTORCONTROL-SDK

Tool/software:

Hello dear support team,

  I'm running a program based on the i07_speed_control_eabi in a sensor-less configuration. What I'm trying to achieve is to stop and restart the motor but at the same time, disable the PWM output when the motor is not spinning. The problem I'm facing is that the estimator is continuing to try to estimate the angle and that results in the fact that when I'm trying to restart the motor, the angle is wrong and there's a jerk at the beginning. 

  I have tried disabling both the trajectory and the estimator itself but disabling the estimator sets the angle to zero. So, the question is: what the correct way is to disable the PWM and the estimator output while preserving the angle for the next run?

  Alternatively, is there any way for the estimator to calculate the angle before applying torque while the shaft is stopped?

Best Regards,

   Victor Munoz

  • The angle will be reset and estimated when you restart the motor. You don't need to disable the estimator, just need to disable the PWM output and stop the motor as shown in the example.

  • Hi Yanming,

    I understand that the angle will be reset and re-estimated when restarting the motor. However, I am still encountering an issue where the motor jerks at startup due to the angle being reset to zero, which adds unnecessary stress to the hardware. I have spent considerable time reviewing the source code and documentation, but the documentation is incomplete, and there are obvious IP-restricted zones of the code.

    I have tested preserving the angle by disabling the control loop when the PWM is disabled, and this approach has proven effective:

    __interrupt void mainISR(void){
       ...
       if(motorVars.flagEnableOffsetCalc == false && HAL_getPwmEnableStatus(halHandle) == true);
           ...
       }
       ...
       return;
    }

    I would appreciate your direct advice on whether this method aligns with best practices for the system or if there are alternative solutions to achieve smoother operation during motor restarts. Specifically, I'm interested in whether there is a recommended approach to preserve the angle while the motor is stopped or a method for the estimator to accurately calculate the angle before applying torque.

    Any additional insights would be greatly appreciated.

    Best regards,
    Victor Munoz

  • However, I am still encountering an issue where the motor jerks at startup due to the angle being reset to zero, which adds unnecessary stress to the hardware.

    What do you mean that the motor jerks at startup? Do you have any measured current waveform to show this? What application motor are you working on?

  • Hi Yanming,

    This is my motor definition:

    #define USER_MOTOR_TYPE                   MOTOR_TYPE_PM  // Ok
    #define USER_MOTOR_NUM_POLE_PAIRS         (8)            // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only
    #define USER_MOTOR_Rr_Ohm                 (NULL)
    #define USER_MOTOR_Rs_Ohm                 (1.9428525)     // Datasheet Rs:=1.8Ω
    #define USER_MOTOR_Ls_d_H                 (0.0144718466)    // Datasheet Ls:=18mH
    #define USER_MOTOR_Ls_q_H                 (0.0144718466)    // Datasheet Ls:=18mH
    #define USER_MOTOR_RATED_FLUX_VpHz        (6.97267914)     //  sqrt(2/3)* Rated V (line-line) / Rated Freq (Hz)   : 0.8165*360.0/25.6 = 11.482 [V*s], [V/Hz] = 1.8274 [Wb]
    #define USER_MOTOR_MAGNETIZING_CURRENT_A  (NULL)
    #define USER_MOTOR_RES_EST_CURRENT_A      (1.45)          // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current
    #define USER_MOTOR_IND_EST_CURRENT_A      (-1.45)         // not used for induction
    #define USER_MOTOR_MAX_CURRENT_A          (14.5)          // Used during ID and run-time, sets a limit on the maximum current command output of the provided Speed PI Controller to the Iq controller
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz       (20)            // During Motor ID, maximum commanded speed (Hz, float). Should always use 5 Hz for Induction.
    #define USER_MOTOR_INERTIA_Kgm2           (0.2f)
    
    #define USER_MOTOR_DECEL_BRAKE_ENGAGE_HZ  (0.01f)
    #define USER_MOTOR_FREQ_LOW_HZ            (2.56)          // Ok - Hz - suggested to set to 10% of rated motor frequency
    #define USER_MOTOR_FREQ_HIGH_HZ           (25.6)          // Ok - Hz - suggested to set to 100% of rated motor frequency
    #define USER_MOTOR_FREQ_MAX_HZ            (30.72)         // Ok - Hz - suggested to set to 120% of rated motor frequency
    #define USER_MOTOR_VOLT_MIN_V             (72)            // Ok - (90V Emergency) Volt - suggested to set to ~20% of rated motor voltage
    #define USER_MOTOR_VOLT_MAX_V             (360)           // Ok - Volt - suggested to set to 100% of rated motor voltage

    By jerk, I mean uncontrolled transient acceleration of the shaft which causes the shaft to rotate a few degrees in a random direction. This rotation angle is also variable, but it is usually less than 5 to 10 degrees (mechanical.)

    One typical cycle would be:

    • Enable the PWM
    • Set the reference to 0Hz (Jerk is noticed here)
    • Set the reference to 7Hz 
    • Set the reference t0 0Hz
    • Disable the PWM
    • Enable the PWM and repeat the cycle
  • Any motor phase current waveform to show this question you mentioned above?

    If you are using the sensorless-FOC without IPD like the InstaSPIN-FOC labs in motor control SDK, the jerk with vibration or reverse should be normal when startup the motor, and the sensorless-FOC can't run the motor at zero speed or very low speed as well. If you need to run the motor with zero or low speed, you may have to run the motor with sensored-FOC.