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.

Motor current control : Motor current increases but speed not increases

Other Parts Discussed in Thread: MOTORWARE

I'm developing a VFD based on my own inverter stack and control PCB using F28069 and InstaSPIN.

My motor is kinda special so that it's hard to finish the motor identification procedure. (It's blower so that it has initial load)

So I just conducted R/L and Rs estimation and then put those values in code of lab5a.

The motor could run, and was controlled well by Iq reference from 5A to 20A.

But the problem was the motor speed didn't vary. It just changed slightly even though its rated current at 18krpm is around 25A.

I found that frequency of the motor current waveform captured by oscilloscope didn't correspond to krpm value on CCS window.

I also found that Id fluctuated not keeping zero.

So I drew the motor phase voltage which was got by the following code on CCS.

I believed that gAdcData.V.value is the value that already applies the bias. So I expected to see AC motor voltage waveform.

But it wasn't actually. Please see below captured image.

The motor U-phase voltage seemed wrong. (It has offset or bias) I guessed that's why the motor speed estimation was also wrong and the motor speed didn't change even though I increased the motor Iq reference and the motor current tracked it.

Is there anyone who suffered from the similar problem or can help me? I have to solve this problem and make a progress urgently cuz the deadline is coming soon. OMG

  • can you post your user.h?
    Use rich formatting, drag an drop

    have you already done a test of your ADC voltage and currents with DC signals to make sure you are getting proper values? Even though your motor has a fan attachment you can usually still perform ID...so it makes me curious that you cannot.
  • Dear Chris :

    Here, my user.h. 

    The DC-link voltage and the motor current ADC is perfect. Even motor voltage ADC was perfect when I applied DC voltage for the kinda testing that you mentioned.

    My motor has a big impeller and especially, an airfoil bearing so that there's heavy load at low speed. I guess that's why the ID failed.

    But I couldn't try various user setting for ID cuz of abnormal motor voltage.

    #ifndef _USER_H_

    #define _USER_H_

     

    #include "sw/modules/types/src/types.h"

    #include "sw/modules/motor/src/32b/motor.h"

    #include "sw/modules/est/src/32b/est.h"

    #include "sw/modules/est/src/est_states.h"

    #include "sw/modules/est/src/est_Flux_states.h"

    #include "sw/modules/est/src/est_Ls_states.h"

    #include "sw/modules/est/src/est_Rs_states.h"

    #include "sw/modules/ctrl/src/32b/ctrl_obj.h"

     

    #include "sw/modules/fast/src/32b/userParams.h"

     

    #ifdef __cplusplus

    extern "C" {

    #endif

     

    #define USER_IQ_FULL_SCALE_FREQ_Hz        (800.0)

    #define USER_IQ_FULL_SCALE_VOLTAGE_V      (800.0

    #define USER_ADC_FULL_SCALE_VOLTAGE_V       (765.0)

    #define USER_VOLTAGE_SF               ((float_t)((USER_ADC_FULL_SCALE_VOLTAGE_V)/(USER_IQ_FULL_SCALE_VOLTAGE_V)))

    #define USER_IQ_FULL_SCALE_CURRENT_A          (62.5)

    #define USER_ADC_FULL_SCALE_CURRENT_A        (125)

    #define USER_CURRENT_SF               ((float_t)((USER_ADC_FULL_SCALE_CURRENT_A)/(USER_IQ_FULL_SCALE_CURRENT_A)))

    #define USER_NUM_CURRENT_SENSORS            (3)

    #define USER_NUM_VOLTAGE_SENSORS            (3)

     

    #define   I_A_offset    (1.006788850)

    #define   I_B_offset    (1.009521067)

    #define   I_C_offset    (1.013614953)

    #define   V_A_offset    (0.3385268450)

    #define   V_B_offset    (0.3384960294)

    #define   V_C_offset    (0.3403902650)

     

    #define USER_SYSTEM_FREQ_MHz             (90.0)

    #define USER_PWM_FREQ_kHz                (8.0)

    #define USER_MAX_VS_MAG_PU        (2.0/3.0)

    #define USER_CTRL_HANDLE_ADDRESS   (0x13C40)

    #define USER_EST_HANDLE_ADDRESS    (0x13840)

    #define USER_VD_SF                 (0.95)

    #define USER_PWM_PERIOD_usec       (1000.0/USER_PWM_FREQ_kHz)

    #define USER_ISR_FREQ_Hz           ((float_t)USER_PWM_FREQ_kHz * 1000.0 / (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)

    #define USER_ISR_PERIOD_usec       (USER_PWM_PERIOD_usec * (float_t)USER_NUM_PWM_TICKS_PER_ISR_TICK)

     

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK        (1)

    #define USER_NUM_ISR_TICKS_PER_CTRL_TICK       (1)

    #define USER_NUM_CTRL_TICKS_PER_CURRENT_TICK   (1)

    #define USER_NUM_CTRL_TICKS_PER_EST_TICK       (1)

    #define USER_NUM_CTRL_TICKS_PER_SPEED_TICK  (8)

    #define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK   (15)

    #define USER_CTRL_FREQ_Hz          (uint_least32_t)(USER_ISR_FREQ_Hz/USER_NUM_ISR_TICKS_PER_CTRL_TICK)

    #define USER_EST_FREQ_Hz           (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_EST_TICK)

    #define USER_TRAJ_FREQ_Hz          (uint_least32_t)(USER_CTRL_FREQ_Hz/USER_NUM_CTRL_TICKS_PER_TRAJ_TICK)

    #define USER_CTRL_PERIOD_usec      (USER_ISR_PERIOD_usec * USER_NUM_ISR_TICKS_PER_CTRL_TICK)

    #define USER_CTRL_PERIOD_sec       ((float_t)USER_CTRL_PERIOD_usec/(float_t)1000000.0)

     

    #define USER_MAX_NEGATIVE_ID_REF_CURRENT_A     (-0.5 * USER_MOTOR_MAX_CURRENT)

    #define USER_ZEROSPEEDLIMIT   (0.5 / USER_IQ_FULL_SCALE_FREQ_Hz)

    #define USER_FORCE_ANGLE_FREQ_Hz   (2.0 * USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz)

    #define USER_MAX_CURRENT_SLOPE_POWERWARP   (0.3*USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz

    #define USER_MAX_ACCEL_Hzps                 (20.0)

     

    #define USER_MAX_ACCEL_EST_Hzps           (2.0)

    #define USER_MAX_CURRENT_SLOPE           (USER_MOTOR_RES_EST_CURRENT/USER_IQ_FULL_SCALE_CURRENT_A/USER_TRAJ_FREQ_Hz)

    #define USER_IDRATED_FRACTION_FOR_RATED_FLUX (1.0)

    #define USER_IDRATED_FRACTION_FOR_L_IDENT    (1.0)

    #define USER_IDRATED_DELTA                  (0.00002)

    #define USER_SPEEDMAX_FRACTION_FOR_L_IDENT  (1.0)

    #define USER_FLUX_FRACTION           (1.0)

    #define USER_POWERWARP_GAIN                   (1.0)

    #define USER_R_OVER_L_EST_FREQ_Hz (200)

    #define USER_VOLTAGE_FILTER_POLE_Hz  (615.0)

    #define USER_VOLTAGE_FILTER_POLE_rps  (2.0 * MATH_PI * USER_VOLTAGE_FILTER_POLE_Hz)

    #define USER_OFFSET_POLE_rps            (20.0)

    #define USER_FLUX_POLE_rps              (100.0)

    #define USER_DIRECTION_POLE_rps             (6.0)

    #define USER_SPEED_POLE_rps           (100.0)

    #define USER_DCBUS_POLE_rps           (100.0)

    #define   USER_EST_KAPPAQ               (1.5)

     

    #define Estun_EMJ_04APB22           101

    #define Anaheim_BLY172S             102

    #define My_Motor                    104

    #define GE_pump                     105

    #define fridge_compressor           106

    #define Belt_Drive_Washer_IPM       201

    #define Marathon_5K33GN2A           301

    #define Marathon_56H17T2011A        302

    #define Selni_AHV242N06             303

    #define Dayton_3N352C_230           304

    #define Dayton_3N352C_460           305

    #define Weg_00118ET3E143T_W22_230   306

    #define Weg_00118ET3E143T_W22_460   307

    #define Oriental_4IK25A_SH_230      308

    #define Dayton_2N865T               309

    #define SEO_motor                                    400

    #define Fan_motor                                    401

     

    //#define USER_MOTOR Estun_EMJ_04APB22

    //#define USER_MOTOR Anaheim_BLY172S

    //#define USER_MOTOR My_Motor

    //#define USER_MOTOR GE_pump

    //#define USER_MOTOR fridge_compressor

    //#define USER_MOTOR Belt_Drive_Washer_IPM

    //#define USER_MOTOR Marathon_5K33GN2A

    //#define USER_MOTOR Marathon_56H17T2011A

    //#define USER_MOTOR Selni_AHV242N06

    //#define USER_MOTOR Dayton_3N352C_230

    //#define USER_MOTOR Dayton_3N352C_460

    //#define USER_MOTOR Weg_00118ET3E143T_W22_230

    //#define USER_MOTOR Weg_00118ET3E143T_W22_460

    //#define USER_MOTOR Oriental_4IK25A_SH_230

    //#define USER_MOTOR Dayton_2N865T

    //#define USER_MOTOR SEO_motor

    #define USER_MOTOR Fan_motor

     

     

    #if (USER_MOTOR == Estun_EMJ_04APB22)                  // Name must match the motor #define

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm  // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)

    #define USER_MOTOR_NUM_POLE_PAIRS       (4)            // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only

    #define USER_MOTOR_Rr                   (NULL)         // Induction motors only, else NULL

    //#define USER_MOTOR_Rs                   (2.200221)     // Identified phase to neutral resistance in a Y equivalent circuit (Ohms, float)

    //#define USER_MOTOR_Ls_d                 (0.008721023)  // For PM, Identified average stator inductance  (Henry, float)

    //#define USER_MOTOR_Ls_q                 (0.008721023)  // For PM, Identified average stator inductance  (Henry, float)

    //#define USER_MOTOR_RATED_FLUX           (0.3846985)    // Identified TOTAL flux linkage between the rotor and the stator (V/Hz)

     

    #define USER_MOTOR_Rs                   (2.425783)     // Identified phase to neutral resistance in a Y equivalent circuit (Ohms, float)

    #define USER_MOTOR_Ls_d                 (0.008207544)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_Ls_q                 (0.008207544)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_RATED_FLUX           (0.3859799)    // Identified TOTAL flux linkage between the rotor and the stator (V/Hz)

     

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)         // Induction motors only, else NULL

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)          // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current

    #define USER_MOTOR_IND_EST_CURRENT      (-1.0)         // During Motor ID, maximum current (negative Amperes, float) used for Ls estimation, use just enough to enable rotation

    #define USER_MOTOR_MAX_CURRENT          (3.82)         // CRITICAL: 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_EST_FREQ_Hz     (20.0)         // During Motor ID, maximum commanded speed (Hz, float), ~10% rated

     

    #elif (USER_MOTOR == Anaheim_BLY172S)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm

    #define USER_MOTOR_NUM_POLE_PAIRS       (4)

    #define USER_MOTOR_Rr                   (NULL)

    #define USER_MOTOR_Rs                   (0.4110007)

    #define USER_MOTOR_Ls_d                 (0.0007092811)

    #define USER_MOTOR_Ls_q                 (0.0007092811)

    #define USER_MOTOR_RATED_FLUX           (0.03279636)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (-1.0)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

     

    #elif (USER_MOTOR == My_Motor)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (NULL)

    #define USER_MOTOR_Rs                   (0.3918252)

    #define USER_MOTOR_Ls_d                 (0.00023495)

    #define USER_MOTOR_Ls_q                 (0.00023495)

    #define USER_MOTOR_RATED_FLUX           (0.03955824)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)

    #define USER_MOTOR_RES_EST_CURRENT      (3.0)

    #define USER_MOTOR_IND_EST_CURRENT      (-0.5)

    #define USER_MOTOR_MAX_CURRENT          (20.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

     

    #elif (USER_MOTOR == GE_pump)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm

    #define USER_MOTOR_NUM_POLE_PAIRS       (4)

    #define USER_MOTOR_Rr                   (NULL)

    #define USER_MOTOR_Rs                   (0.1931403)

    #define USER_MOTOR_Ls_d                 (0.0001903657)

    #define USER_MOTOR_Ls_q                 (0.0001903657)

    #define USER_MOTOR_RATED_FLUX           (0.06034314)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (-1.0)

    #define USER_MOTOR_MAX_CURRENT          (8.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

     

    #elif (USER_MOTOR == fridge_compressor)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (NULL)

    #define USER_MOTOR_Rs                   (4.707864)

    #define USER_MOTOR_Ls_d                 (0.1728041)

    #define USER_MOTOR_Ls_q                 (0.1728041)

    #define USER_MOTOR_RATED_FLUX           (0.418879)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)

    #define USER_MOTOR_RES_EST_CURRENT      (0.3)

    #define USER_MOTOR_IND_EST_CURRENT      (-0.3)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (40.0)

     

    #elif (USER_MOTOR == Belt_Drive_Washer_IPM)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm

    #define USER_MOTOR_NUM_POLE_PAIRS       (4)

    #define USER_MOTOR_Rr                   (NULL)

    #define USER_MOTOR_Rs                   (2.70544)

    #define USER_MOTOR_Ls_d                 (0.0115)

    #define USER_MOTOR_Ls_q                 (0.0135)

    #define USER_MOTOR_RATED_FLUX           (0.5022156)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (-1.0)

    #define USER_MOTOR_MAX_CURRENT          (4.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

     

    #elif (USER_MOTOR == Marathon_5K33GN2A)                      // Name must match the motor #define

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)                  // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only

    #define USER_MOTOR_Rr                   (5.574939)           // Identified phase to neutral in a Y equivalent circuit (Ohms, float)

    #define USER_MOTOR_Rs                   (10.71121)           // Identified phase to neutral in a Y equivalent circuit (Ohms, float)

    #define USER_MOTOR_Ls_d                 (0.04282236)         // For Induction, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d      // For Induction, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_RATED_FLUX           (0.8165*220.0/60.0)  // sqrt(2/3)* Rated V (line-line) / Rated Freq (Hz)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.514201)           // Identified magnetizing current for induction motors, else NULL

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)                // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)               // not used for induction

    #define USER_MOTOR_MAX_CURRENT          (2.0)                // CRITICAL: 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_EST_FREQ_Hz     (5.0)                // During Motor ID, maximum commanded speed (Hz, float). Should always use 5 Hz for Induction.

     

    #elif (USER_MOTOR == Marathon_56H17T2011A)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (5.076565)

    #define USER_MOTOR_Rs                   (7.777135)

    #define USER_MOTOR_Ls_d                 (0.02756402)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*230.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.130457)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Selni_AHV242N06)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (1)

    #define USER_MOTOR_Rr                   (0.6519378)

    #define USER_MOTOR_Rs                   (1.863846)

    #define USER_MOTOR_Ls_d                 (0.01710425)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*190.0/200.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.246659)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Dayton_3N352C_230)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (2.064656)

    #define USER_MOTOR_Rs                   (2.858907)

    #define USER_MOTOR_Ls_d                 (0.02556416)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*230.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (2.938731)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Dayton_3N352C_460)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (9.077622)

    #define USER_MOTOR_Rs                   (11.106)

    #define USER_MOTOR_Ls_d                 (0.0713708)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*460.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.462848)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (4.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Weg_00118ET3E143T_W22_230)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (1.067204)

    #define USER_MOTOR_Rs                   (2.406377)

    #define USER_MOTOR_Ls_d                 (0.05482391)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*230.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (2.17855)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (6.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Weg_00118ET3E143T_W22_460)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (2.934001)

    #define USER_MOTOR_Rs                   (9.537757)

    #define USER_MOTOR_Ls_d                 (0.2160697)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*460.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.086798)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Oriental_4IK25A_SH_230)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (64.00807)

    #define USER_MOTOR_Rs                   (128.2861)

    #define USER_MOTOR_Ls_d                 (0.6856454)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*230.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (0.166837)

    #define USER_MOTOR_RES_EST_CURRENT      (0.1)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (0.3)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

    #elif (USER_MOTOR == Dayton_2N865T)

    #define USER_MOTOR_TYPE                 MOTOR_Type_Induction

    #define USER_MOTOR_NUM_POLE_PAIRS       (2)

    #define USER_MOTOR_Rr                   (2.540533)

    #define USER_MOTOR_Rs                   (4.681129)

    #define USER_MOTOR_Ls_d                 (0.02621018)

    #define USER_MOTOR_Ls_q                 USER_MOTOR_Ls_d

    #define USER_MOTOR_RATED_FLUX           (0.8165*230.0/60.0)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (1.838921)

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    #define USER_MOTOR_IND_EST_CURRENT      (NULL)

    #define USER_MOTOR_MAX_CURRENT          (5.0)

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (5.0)

     

     

    #elif (USER_MOTOR == SEO_motor)                  // Name must match the motor #define

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm  // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)

    #define USER_MOTOR_NUM_POLE_PAIRS       (3)            // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only

    #define USER_MOTOR_Rr                   (NULL)         // Induction motors only, else NULL

    #define USER_MOTOR_Rs                   (2.230033)     // Identified phase to neutral resistance in a Y equivalent circuit (Ohms, float)

    #define USER_MOTOR_Ls_d                 (0.0104946)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_Ls_q                 (0.0104946)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_RATED_FLUX           (0.2369867)    // Identified TOTAL flux linkage between the rotor and the stator (V/Hz)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)         // Induction motors only, else NULL

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)          // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current

    #define USER_MOTOR_IND_EST_CURRENT      (-1.0)         // During Motor ID, maximum current (negative Amperes, float) used for Ls estimation, use just enough to enable rotation

    #define USER_MOTOR_MAX_CURRENT          (5.0)         // CRITICAL: 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_EST_FREQ_Hz     (15.0)         // During Motor ID, maximum commanded speed (Hz, float), ~10% rated

     

     

    #elif (USER_MOTOR == Fan_motor)                  // Name must match the motor #define

    #define USER_MOTOR_TYPE                 MOTOR_Type_Pm  // Motor_Type_Pm (All Synchronous: BLDC, PMSM, SMPM, IPM) or Motor_Type_Induction (Asynchronous ACI)

    #define USER_MOTOR_NUM_POLE_PAIRS       (1)            // PAIRS, not total poles. Used to calculate user RPM from rotor Hz only

    #define USER_MOTOR_Rr                   (NULL)         // Induction motors only, else NULL

    #define USER_MOTOR_Rs                   (0.1217002)     // Identified phase to neutral resistance in a Y equivalent circuit (Ohms, float)

    #define USER_MOTOR_Ls_d                 (0.00001094549)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_Ls_q                 (0.00001094549)  // For PM, Identified average stator inductance  (Henry, float)

    #define USER_MOTOR_RATED_FLUX           (0.4343111)    // Identified TOTAL flux linkage between the rotor and the stator (V/Hz)

    #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)         // Induction motors only, else NULL

    #define USER_MOTOR_RES_EST_CURRENT      (9.0)          // During Motor ID, maximum current (Amperes, float) used for Rs estimation, 10-20% rated current

    #define USER_MOTOR_IND_EST_CURRENT      (-4.5)         // During Motor ID, maximum current (negative Amperes, float) used for Ls estimation, use just enough to enable rotation

    #define USER_MOTOR_MAX_CURRENT          (28.0)         // CRITICAL: 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_EST_FREQ_Hz     (30.0)         // During Motor ID, maximum commanded speed (Hz, float), ~10% rated

     

    #else

    #error No motor type specified

    #endif

     

    #ifndef USER_MOTOR

    #error Motor is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_TYPE

    #error The motor type is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_NUM_POLE_PAIRS

    #error Number of motor pole pairs is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_Rr

    #error The rotor resistance is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_Rs

    #error The stator resistance is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_Ls_d

    #error The direct stator inductance is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_Ls_q

    #error The quadrature stator inductance is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_RATED_FLUX

    #error The rated flux of motor is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_MAGNETIZING_CURRENT

    #error The magnetizing current is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_RES_EST_CURRENT

    #error The resistance estimation current is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_IND_EST_CURRENT

    #error The inductance estimation current is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_MAX_CURRENT

    #error The maximum current is not defined in user.h

    #endif

     

    #ifndef USER_MOTOR_FLUX_EST_FREQ_Hz

    #error The flux estimation frequency is not defined in user.h

    #endif

     

     

    // **************************************************************************

    // the functions

     

     

    //! \brief      Sets the user parameter values

    //! \param[in]  pUserParams  The pointer to the user param structure

    extern void USER_setParams(USER_Params *pUserParams);

     

     

    //! \brief      Checks for errors in the user parameter values

    //! \param[in]  pUserParams  The pointer to the user param structure

    extern void USER_checkForErrors(USER_Params *pUserParams);

     

     

    //! \brief      Gets the error code in the user parameters

    //! \param[in]  pUserParams  The pointer to the user param structure

    //! \return     The error code

    extern USER_ErrorCode_e USER_getErrorCode(USER_Params *pUserParams);

     

     

    //! \brief      Sets the error code in the user parameters

    //! \param[in]  pUserParams  The pointer to the user param structure

    //! \param[in]  errorCode    The error code

    extern void USER_setErrorCode(USER_Params *pUserParams,const USER_ErrorCode_e errorCode);

     

     

    //! \brief      Recalculates Inductances with the correct Q Format

    //! \param[in]  handle       The controller (CTRL) handle

    extern void USER_softwareUpdate1p6(CTRL_Handle handle);

     

     

    //! \brief      Updates Id and Iq PI gains

    //! \param[in]  handle       The controller (CTRL) handle

    extern void USER_calcPIgains(CTRL_Handle handle);

     

     

    //! \brief      Computes the scale factor needed to convert from torque created by Ld, Lq, Id and Iq, from per unit to Nm

    //! \return     The scale factor to convert torque from (Ld - Lq) * Id * Iq from per unit to Nm, in IQ24 format

    extern _iq USER_computeTorque_Ls_Id_Iq_pu_to_Nm_sf(void);

     

     

    //! \brief      Computes the scale factor needed to convert from torque created by flux and Iq, from per unit to Nm

    //! \return     The scale factor to convert torque from Flux * Iq from per unit to Nm, in IQ24 format

    extern _iq USER_computeTorque_Flux_Iq_pu_to_Nm_sf(void);

     

     

    //! \brief      Computes the scale factor needed to convert from per unit to Wb

    //! \return     The scale factor to convert from flux per unit to flux in Wb, in IQ24 format

    extern _iq USER_computeFlux_pu_to_Wb_sf(void);

     

     

    //! \brief      Computes the scale factor needed to convert from per unit to V/Hz

    //! \return     The scale factor to convert from flux per unit to flux in V/Hz, in IQ24 format

    extern _iq USER_computeFlux_pu_to_VpHz_sf(void);

     

     

    //! \brief      Computes Flux in Wb or V/Hz depending on the scale factor sent as parameter

    //! \param[in]  handle       The controller (CTRL) handle

    //! \param[in]  sf           The scale factor to convert flux from per unit to Wb or V/Hz

    //! \return     The flux in Wb or V/Hz depending on the scale factor sent as parameter, in IQ24 format

    extern _iq USER_computeFlux(CTRL_Handle handle, const _iq sf);

     

     

    //! \brief      Computes Torque in Nm

    //! \param[in]  handle          The controller (CTRL) handle

    //! \param[in]  torque_Flux_sf  The scale factor to convert torque from (Ld - Lq) * Id * Iq from per unit to Nm

    //! \param[in]  torque_Ls_sf    The scale factor to convert torque from Flux * Iq from per unit to Nm

    //! \return     The torque in Nm, in IQ24 format

    extern _iq USER_computeTorque_Nm(CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf);

     

     

    //! \brief      Computes Torque in lbin

    //! \param[in]  handle          The controller (CTRL) handle

    //! \param[in]  torque_Flux_sf  The scale factor to convert torque from (Ld - Lq) * Id * Iq from per unit to lbin

    //! \param[in]  torque_Ls_sf    The scale factor to convert torque from Flux * Iq from per unit to lbin

    //! \return     The torque in lbin, in IQ24 format

    extern _iq USER_computeTorque_lbin(CTRL_Handle handle, const _iq torque_Flux_sf, const _iq torque_Ls_sf);

     

     

    #ifdef __cplusplus

    }

    #endif // extern "C"

     

    //@} // ingroup

    #endif // end of _USER_H_ definition

    user.h.docx

     

     

  • Haneol,

    I am sure your motor has low inductance and low BEMF. So, you need to increase USER_MOTOR_FLUX_EST_FREQ_Hz up to at least five percentages of rated speed to get the valid ADC value during Flux Identification.

    The gMotorVars.Flag_enableOffsetcalc = 0 means that you run the motor with predefined offset value in user.h. Is it correct?

    How about trying speed mode instead of torque mode with Flag_enableRsRecalc = 1 & Flag_enableOffsetcalc=1?

    I think the total phase inductance is too small because it's not possible to drive motor with 500Vdc/10uH at 8KHz Fs due to too high ripple current.

    What's the lab number you referenced?

    Compiler version?

    -Steve

  • what bus voltage are you using with nearly 800V scaling?

    this motor is 28A but your HW is build for 62.5A, correct?

    The Ls value is much too small IMO for this type of motor. What is the Lhf value after RoverL state?
  • Dear Steve :

    Thank you for your reply.

    I also expected that My motor has low inductance. Back-EMF is also low at low-speed region because this motor was designed for high-speed operation up tp 20krpm.

    I used a predefined offset for the current control mode after getting it from the motor ID and I think the obtained values are reasonable.

    I already tried speed control mode but it failed. That's why I got back to the current control mode.

    I know my motor is having high ripple current at the low-speed range. But it's rated speed is 20krpm.

    I have to escape that region as fast as possible. This motor generally stays around 20krpm for practical application.

    But the problem is that the speed controller doesn't work and even the speed estimation also doesn't run.

    My target is speed control, lab5b of previous motorware.

    The compiler version is TI v6.2.3 [TI v6.2.9].

  • I'm using 380Vrms input voltage for the inverter stack. So the DC-link voltage reaches around 550V something.
    I use a CT having maximum current 62.5A because this inverter stack have to support bigger motors too.
    I think the current resoultion is not so poor.
    Lhf result shows 0.00001094549 with 300Hz. The procedure was OK. I checked it by a scope.
    The current and the fequency for R/L met the setting that I intended.

    Actually, I already rotated this motor up to 20krpm by InstaSPIN based on another my own PCB and inverter stack. (prototype)
    This is my second PCB and inverter stack which is bigger than previous one and for practical production.
    Baiscally, two PCB boards are similar.
    Bad problem is that I lost the source code that I applied for the prototype.

    Anyway, I'm still strugling for the bad ADC of the motor voltage. I just wanted to know if 'gAdcData.V.value[0]' is before considerting offset or after considering offeset. I concluded that it's the value considering the bias and the offset. But my motor voltage ADC result seems totally wrong.

    So I need your help to confirm whether motor didn't speed up because motor voltage wasn't converted properly... or not.
    Do you think the motor voltage ADC is the root-cause?

    Many thanks!

    - Haneol -
  • "'gAdcData.V.value[0]' is before considerting offset or after considering offeset."

    gAdcData.V is in per unit (based on IQ_VOLTAGE) with offsets removed
    you can see this in
    HAL_readAdcData

    // convert voltage A
    value = (_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_4);
    value = _IQ12mpy(value,voltage_sf) - obj->adcBias.V.value[0]; // divide by 2^numAdcBits = 2^12
    pAdcData->V.value[0] = value;