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: Unable to achieve higher Acceleration(upto 50Krpm) with TMS320F28027F using Lab1C of C2000 motorware

Part Number: TMS320F28027F


Hi Everyone,

I am using Lab1C with my custom board to drive BLDC motor(48V,10000rpm,peak current 2A) with following data

Motor Parameter

#define USER_MOTOR_TYPE                                MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS         (2)
#define USER_MOTOR_Rr                                      (NULL)
#define USER_MOTOR_Rs                                     (1.2)
#define USER_MOTOR_Ls_d                                  (0.000721023)
#define USER_MOTOR_Ls_q                                  (0.000721023)
#define USER_MOTOR_RATED_FLUX                   (0.28)

#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                   (9.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz          (20.0)

#define USER_MOTOR_FREQ_LOW                            (2.0)
#define USER_MOTOR_FREQ_HIGH                           (220.0)
#define USER_MOTOR_FREQ_MAX                            (250.0)
#define USER_MOTOR_VOLT_MIN                              (3.0)
#define USER_MOTOR_VOLT_MAX                             (68.0)

Board Parameter is

#define USER_IQ_FULL_SCALE_FREQ_Hz                 (433)

#define USER_IQ_FULL_SCALE_VOLTAGE_V             (88.0)

#define USER_ADC_FULL_SCALE_VOLTAGE_V          (69.3)

#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             (19.8)

#define USER_ADC_FULL_SCALE_CURRENT_A          (33)

#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 USER_PWM_FREQ_kHz                                      (15.0)

#define USER_MAX_VS_MAG_PU                                   (0.5)

#define USER_NUM_PWM_TICKS_PER_ISR_TICK        (1)

#define USER_NUM_CTRL_TICKS_PER_SPEED_TICK  (5)

#define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK    (5)

#define USER_VOLTAGE_FILTER_POLE_Hz                   (698.34)

Actually physically i have only 2 current sensor(Phase "A" sensor is not available), so i have manged it from software side by using following equation in HAL_readAdcData(hal.h)

// convert current B
value = (_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_2);
value = _IQ12mpy(value,current_sf) - obj->adcBias.I.value[1]; // divide by 2^numAdcBits = 2^12
pAdcData->I.value[1] = -value;                                            //-ve to change the polarity of current Sensor

// convert current C
value = (_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_3);
value = _IQ12mpy(value,current_sf) - obj->adcBias.I.value[2]; // divide by 2^numAdcBits = 2^12
pAdcData->I.value[2] = -value;
//pAdcData->I.value[2] = (pAdcData->I.value[0]+pAdcData->I.value[1]);

// convert current A

value = (_iq)ADC_readResult(obj->adcHandle,ADC_ResultNumber_1);
value = _IQ12mpy(value,current_sf) - obj->adcBias.I.value[0]; // divide by 2^numAdcBits = 2^12
//pAdcData->I.value[0] = -value;
pAdcData->I.value[0] = (pAdcData->I.value[1]+pAdcData->I.value[2]);

and in hal.c while declaring Current sensor adc

ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_0,ADC_SocChanNumber_A4);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_0,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_0,ADC_SocSampleDelay_7_cycles);

ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_1,ADC_SocChanNumber_A4);                   //Same as phase b current Sensing
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_1,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_1,ADC_SocSampleDelay_7_cycles);

ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_2,ADC_SocChanNumber_A4);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_2,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_2,ADC_SocSampleDelay_7_cycles);

ADC_setSocChanNumber(obj->adcHandle,ADC_SocNumber_3,ADC_SocChanNumber_A6);
ADC_setSocTrigSrc(obj->adcHandle,ADC_SocNumber_3,ADC_SocTrigSrc_EPWM1_ADCSOCA);
ADC_setSocSampleDelay(obj->adcHandle,ADC_SocNumber_3,ADC_SocSampleDelay_7_cycles);

bcz if was selecting 2 current sensor and according adc in hal.c, it was drawing 14A(more than Limit)

So like this when i manged from software side then it was working fine and i have achieved my desirable speed upto 8400 RPM with the max acceleration of 10 KRPM.

But now my question is

i want to increase my acceleration to 50KRPM, and i am unable to achieve it(even after increasing Motor MAx current to 18A, i was not getting).


After reading 

https://e2e.ti.com/support/microcontrollers/c2000/f/171/t/463896 thread i have tried to LAB10a but it was also drawing 14A.(Even other than Lab1b and Lab1C whichever lab i was trying it was drawing 14A)

So my question is 

How to get Higher Acceleration ?

and how to run other lab(Specifically Lab10A)?(which was drawing higher current)

 

  • You might just enable the current loop and disable speed close loop to get the higher acceleration. You should set a lower acceleration for a startup, and then change the acceleration to a higher value if you still need speed close loop.

    Can you post some phase current waveform capturing by the scope? And is it possible to increase the maximum current of the power board if you want to get so high acceleration?

  • Dear Yanming,

    Thank you for response.

    " And is it possible to increase the maximum current of the power board if you want to get so high acceleration?"

    Yes, it can take upto 10A.

    "Can you post some phase current waveform capturing by the scope? "

    Image of current and voltage waveform is attached, from 1000rpm to 8400rpm(using Lab1C)

    Current@1krpm

    Current@2krpm

    Current@3krpm

    Current@4krpm

    Current @5krpm

    Current @6krpm

    Current@7krpm

    Current@8krpm

    Current@8.4krpm

    Voltage

    voltage@1krpm


    voltage@2krpm


    voltage@3krpm


    voltage@4krpm


    voltage@5krpm


    voltage@6krpm


    voltage@7krpm


    voltage@8krpm


    voltage@8.4krpm


    I have some some doubt as

    Q1)

    "You might just enable the current loop and disable speed close loop to get the higher acceleration."

    Are you suggesting me this for Lab1C or Lab10A?.

    In lab1c i have tried with following combination

    1) gMotorVars.Flag_enableSpeedCtrl  = 0 ,keeping Speed to 500 rpm  and varying gMotorVars.Iqref_A  to 0.1 to higher.

    But at gMotorVars.Iqref_A=0.1 only it was drawing 14A.

    2) gMotorVars.Flag_enableSpeedCtrl  = 0 and if i will keep gMotorVars.Iqref_A=0 and increase Speed by varying gMotorVars.SpeedRef_Krpm to 1Krpm to 8.5krpm with V_bias.IqSet_A=0.5 it was working fine with max 1.3A 

    3) gMotorVars.Flag_enableSpeedCtrl  = 1 and same obesrvation as (1) and (2)

    Q2)

    So from your above suggestion,

    in Expression window,  there are 3 Iq

    1) gMotorVars.Iq_A

    2) gMotorVars.Iqref_A

    3) V_bias.IqSet_A

    among the 3 Iq, which Iq needs to be changed?

    Q3)

    In my previous post

    "Actually physically i have only 2 current sensor(Phase "A" sensor is not available), so i have manged it from software side by using following equation in HAL_readAdcData(hal.h)"

    Does it affect my performance? Whatever problems i am facing regarding acceleration, does this thing matter to it?

    Q4)

    And please give me suggestion to my last question also

    "how to run other lab(Specifically Lab10A)?(which was drawing higher current)"

     I am unable to perform all lab except Lab1b and Lab1c, if i will proceed according to Lab manual it will draw high current(14A).

  • Q1. lab10a or lab05b. Lab01b and Lab01c are just used to verify the hardware, it's not used to spin the motor at high speed and under load that's why ou can't get higher acceleration, these two labs are not open-loop control without rotor position.

    Refer to lab05a if you want to use a torque control without a speed-close loop.

    Q2. Answer as Q1.

    Q3. You can't implement over-modulation and need to set the USER_MAX_VS_MAG_PU less than 0.5 in user.h

    Q4. Please refer to the operation steps in InstaSPIN lab guide, you should run the lab02b or lab02c first to identify the motor parameters, and then run the subsequent labs like lab05a/b or lab10a.

  • Dear Yanming,

    Thank you for suggestions.

    Now i have successfully implemented Lab2a,2b and Lab4. 

    I have referred Lab manual as well as HVkitr1p1 kit manual to perform the Lab.

    But speed loop based lab is not working properly.

    Q1) Lab5b

    Right now i am using HVkitr1p1. While tuning Kp, Ki in Lab5b my performance is not at all changing.

    I have set speed to 500rpm, suddenly it will go to high rpm and it will stop.

    My Calculated values for Speed 

    Kp = 30.14

    Ki  = 1.49

    Even varying it there is no change in performance.

    My motor parameter is

    #define USER_IQ_FULL_SCALE_FREQ_Hz               (433.0)

    #define USER_IQ_FULL_SCALE_VOLTAGE_V           (50.0)

    #define USER_ADC_FULL_SCALE_VOLTAGE_V       (409.6) 

    #define USER_IQ_FULL_SCALE_CURRENT_A          (12.0)

    #define USER_ADC_FULL_SCALE_CURRENT_A       (19.89)  

    #define USER_MOTOR_NUM_POLE_PAIRS             (2)

    #define USER_MOTOR_Rs                                         (0.352500051)

    #define USER_MOTOR_Ls_d                                      (0.00025)

    #define USER_MOTOR_Ls_q                                      (0.00025)

    #define USER_MOTOR_RATED_FLUX                       (0.045)

    #define USER_MOTOR_RES_EST_CURRENT          (1.0)  

    #define USER_MOTOR_IND_EST_CURRENT           (-1.0)

    #define USER_MOTOR_MAX_CURRENT                  (10.0) 

    #define USER_MOTOR_FLUX_EST_FREQ_Hz         (20.0) 

    #define USER_MOTOR_FREQ_LOW                          (1.0)

    #define USER_MOTOR_FREQ_HIGH                         (200.0)

    #define USER_MOTOR_FREQ_MAX                          (250.0)

    #define USER_MOTOR_VOLT_MIN                             (3.0)

    #define USER_MOTOR_VOLT_MAX                            (48.0)

    And 

    Q) Lab1C

    Even in Lab1C,when i was changing Kp and Ki of both Speed as well Current, there is no variation in performance as well as in input current.

    If i am increasing or decreasing the Current Kp, then it should draw more/less current according to set current Kp.

    But no variation observed.

    So is there anything is missing?

    Waiting for your response.

  • Lab01b and lab01c are open-loop control without using a speed loop and position angle.

    It seems like the Kp and Ki is too high for a speed controller, you might tune these two parameters according to the running state of the motor.

  • Yes, that was according to calculation.

    Then during running condition In Lab5b, i set

    Speed Kp = 5

    Speed Ki  = 0.01 to 1.66

    But, i haven't observed any significant changes.

    Later just to verify, is it accepting the Speed Kp,ki changes or not

    I make Speed Kp and Ki=0 ,Iq_ref=0, Speed_krpm=0 at that time motor was running at its High Speed(9500rpm).

    Why this kind of behavior is coming?

  • Dear Yanming,

    Now my motor is working fine from 800 rpm to 10000 rpm with higher acceleration.

    The issue was of Speed and current Kp, Ki  only.

    I have measured multiple data of Motor using Lab2b and accordingly calculated Kp,Ki.

    So now its working fine with Lab5b.

    But not able to get lower rpm range.

    My V/f = 0.048, which was consuming 

    1)Vphase=3V &

    2)volt_sensing from controller side =0.18V at 800 rpm.

    So i have attached all 4 jumper at R2(bypassed 800Kohm in Voltage Sensing) on Hvkitr1p1 and accordingly ADC_volt and pole_freq updated in user.h

    But still i am not able to spin motor from 0 to 800rpm, its working fine from 800rpm to 10000rpm with higher acceleration.

    So how to get lower rpm range?

  • The sensorless FOC is difficult to spin a motor with load in such a wide speed range, especially zero or w very low speed. You have to use sensored-FOC if you need to run the motor with load at zero or near zero speed.

    You might tune the speed controller using different gains for low and high speed.

  • Q1

    "You might tune the speed controller using different gains for low and high speed."

    Yes, by doing so it is working.

    But i don't want to define different gains for high and low speed range.

    Q2)

    "The sensorless FOC is difficult to spin a motor with load in such a wide speed range, especially zero or w very low speed. You have to use sensored-FOC if you need to run the motor with load at zero or near zero speed."

    Ok, Do you mean by Lab12b.?

    In the sensored-FOC,Can i get both speed and current control?

    Q3) 


    According to this snippet

    ref.Literature Number: SPRUHJ1F


    So according to this if i will increase the lower voltage sensing range, won't i get lower rpm with the Lab5b only?

  • Q1. Usually, using different gains for low and high speed is a common solution in a real product.

    Q2. Both sensorless and sensored-FOC support speed and current close loop, the only difference is the position feedback.

    Q3. Yes, that just means a lower speed if the resolution of the sampling voltage is good enough, not zero speed.

  • "Q1. Usually, using different gains for low and high speed is a common solution in a real product."


    yes,that i have observed.

    "Q3. Yes, that just means a lower speed if the resolution of the sampling voltage is good enough, not zero speed."


    No,not zero.min is 300rpm.

    Now by increasing the voltage sensing range, i am able to 400rpm also with higher acceleration. But getting problem in deceleration with Lab5b.

    So, according to your suggestion i moved to Sensored lab. With Lab6a i am able to achieve higher acceleration+deceleration as well as low rpm(10rpm tested). 

    Thank you Yanming  for your support.