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.

Identification and motor current reconstruction problem with BLDC

Other Parts Discussed in Thread: MOTORWARE, BOOSTXL-DRV8301, BOOSTXL-DRV8305EVM

Hi,

we are trying to identify and run one hobby motor. It is 12pole very low speed outrunner, 41rpm/V with huge RS something around 22.4Ohm line to line. We are unable to keep motor running during Flux and LS identification phase and identification always fail. Also RoverL phase set RoverL to infinity. Cause it is hobby motor I don't have any specific data about it so only link to this motor: www.hobbyking.com/.../__53939__Turnigy_HD_3508_Brushless_Gimbal_Motor_BLDC_EU_Warehouse_.html

I tried to play a lot with USER_MOTOR_RES_EST_CURRENT, USER_MOTOR_IND_EST_CURRENT, USER_MOTOR_MAX_CURRENT and USER_MOTOR_FLUX_EST_FREQ_Hz. During RampUp motor is rotating just fine, but I am not able to achieve more than 60Hz for stable rotation. I am little bit lost in this so any help will be fine. We are using our own proven HW. 

Some parameters of HW:

#define USER_IQ_FULL_SCALE_FREQ_Hz        (800)

#define USER_IQ_FULL_SCALE_VOLTAGE_V      (36.0)

#define USER_ADC_FULL_SCALE_VOLTAGE_V       (30.3) 

#define USER_IQ_FULL_SCALE_CURRENT_A         (16.5)

#define USER_ADC_FULL_SCALE_CURRENT_A        (33.0)

#define USER_VOLTAGE_FILTER_POLE_Hz  (795.96)

My second question is about Current reconstruction algorithm, different and well known motor than in issue above. I was playing with variable minWidth_microseconds and I set it to value 3.5us, which was fine and current reconstruction works well until motor suddenly stop spinning. PWM stuck at last value so motor windings was still energized, mainISR interrupt stop working. Find out that current reconstruction algorithm set compare register to bigger value than period register of PWM, which was finally caused by large value of variable minWidth_microseconds .

Is this expected behavior, or is this a bug?

I can't find any note or warning that minWidth_microseconds  is untouchable and change can cause motor and HW damage. Now I use this workaround in the end of HAL_setTrigger function. 

if (pwm1->CMPB >= pwm1->TBPRD) pwm1->CMPB = pwm1->TBPRD/2;

We are using MotorWare 15.

Regards,

Jozef

  • Let's start with the first problem:

    #define USER_ADC_FULL_SCALE_VOLTAGE_V (30.3)
    This is not the value for BOOSTXL-DRV8301. Did you change your voltage dividers on this board? If not, you must set this back to
    #define USER_ADC_FULL_SCALE_VOLTAGE_V (26.314) // 26.314 boostxldrv8301_revB voltage scaling

    same here, did you change the HW filter pole? Why did you choose this value? Keeping it 300-400 Hz is recommended.
    #define USER_VOLTAGE_FILTER_POLE_Hz (795.96)
    if not, set back to default
    #define USER_VOLTAGE_FILTER_POLE_Hz (364.682)

    set this to your Vdc bus. I doubt you are using 36V for one of these 12V motors, especially since the default board value is 26.314V and even if you changed the HW it looks like you changed it to 30.3 V
    #define USER_IQ_FULL_SCALE_VOLTAGE_V (36.0)


    Is your plan just to run these 12V gimbal motors?
    If so, I would design your HW for something like
    #define USER_ADC_FULL_SCALE_VOLTAGE_V (15.0)
    #define USER_VOLTAGE_FILTER_POLE_Hz (300.0)
    #define USER_IQ_FULL_SCALE_VOLTAGE_V (12.0)
  • Chris,

    parameters are for our custom board, so it is not boostxl board. But actually I tried it also on boostxl kit and with the same result.

  • please try it with a standard kit first.
    post the user.h file you are using for that.

    I just ran three Gimbal motors yesterday, 50 KV and 66 KV. This was with BOOSTXL-DRV8305EVM but BOOSTXL-DRV8301 should work just fine

    use proj_lab02c because sometimes (like this first one) the RoverL value is ridiculously large. Sounds like your motor is similar (but even larger Rs).

    #elif (USER_MOTOR == TMOTOR_GB2208_GIMBAL)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (7)
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (6.59)
    #define USER_MOTOR_Ls_d (0.000100)
    #define USER_MOTOR_Ls_q (USER_MOTOR_Ls_d)
    #define USER_MOTOR_RATED_FLUX (0.041)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (0.2)
    #define USER_MOTOR_IND_EST_CURRENT (-0.2)
    #define USER_MOTOR_MAX_CURRENT (2.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (24.0)

    #elif (USER_MOTOR == TMOTOR_GB36_1_GIMBAL)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (7)
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (7.2)
    #define USER_MOTOR_Ls_d (0.0045)
    #define USER_MOTOR_Ls_q (USER_MOTOR_Ls_d)
    #define USER_MOTOR_RATED_FLUX (0.10) // 50 KV = 600 RPM @ 12V
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (0.2)
    #define USER_MOTOR_IND_EST_CURRENT (-0.2)
    #define USER_MOTOR_MAX_CURRENT (2.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (24.0)

    #elif (USER_MOTOR == EMAX_GB4008_66KV_GIMBAL)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (11)
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (3.37)
    #define USER_MOTOR_Ls_d (0.000764)
    #define USER_MOTOR_Ls_q (USER_MOTOR_Ls_d)
    #define USER_MOTOR_RATED_FLUX (0.048)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (0.5)
    #define USER_MOTOR_IND_EST_CURRENT (-0.5)
    #define USER_MOTOR_MAX_CURRENT (5.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)
  • if your motor is like the first one listed, once you ID the motor and move on to the other labs you are likely going to need to comment out a USER error code that will get thrown. from user.c


    if((USER_MOTOR_Rs != 0.0) && (USER_MOTOR_Ls_d != 0.0) && (USER_MOTOR_Ls_q != 0.0))

    {

    if(((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_d + 1e-9))) ||

    ((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_q + 1e-9))))

    {

    // USER_setErrorCode(pUserParams, USER_ErrorCode_ctrlFreq_Hz_Low);

    }

    }


    I also found it was necessary to reduce the current control Kp by a factor of 4x and then adjust the speed control gains down a little.
  • As I wrote I tried it with standard kit, but without success. Behavior was the same, but I am not sure If I used lab 2c. Will check it tomorrow morning. Also do you have any comments to the second issue?
  • Chris,

    finally we were able to identify motor. Thanks for your help in this issue.

    Can you give me any comment to second part of my question?

    Thanks,

    Jozef

  • Jozef,

    for your 2nd question on OVM:

    we have been noticing some other issues with OVM.  It has seemed to effect high voltage ACIM and some high speed hobby motors, but it certainly points to an issue with our solution that isn't robust enough for all high modulation cases. so we are actively looking at improving the solution.

    In the case you mention the pwm can be stuck at the last value if the minWidth was set too high abnormally.

     

    The scenario it will happen is as follows

    1) If we set minWidth value  too high, the svgencurrent-> IgnoreShunt value will be 4+ (two shunts ignore mode) regardless of CMP value in SVGENCURRENT_RunIgnoreShunt() function.

    2) In this case, the offset value can be higher than pwm1->TBPRD at the following equation in HAL_setTrigger() function.

        offset  = pwmCMPAx + cmpOffset;

       :

      pwm1->CMPB = offset;

      PWM_setSocAPulseSrc(obj->pwmHandle[PWM_Number_1],PWM_SocPulseSrc_CounterEqualCmpBIncr);

     

    For example,

    TBPRD = 3000(@90MHz, 15KHz),

    cmpOffset = 90(@90MHz, 1usec)

    pwmCMPA1 = 2950,

    Then, the offset can be 3040 which is larger than period value, and ISR cannot be triggered any more.

     

    We are going to look at adding some fail-safe logic for this condition.

     

    For you, you can add your own, or just limit your modulation or offset value.

      

  • Chris,

    I have on another problem with identification. I am using this motor www.modelmotors.cz/.../ , BOOSTXL-DRV kit with this parameters from user.h:

    #elif (USER_MOTOR == AXI_2820_10)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (6)
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (0.00985594)/*(0.01591392)*/
    #define USER_MOTOR_Ls_d (3.061778e-06)/*(5.707933e-06)*/
    #define USER_MOTOR_Ls_q (3.061778e-06)
    #define USER_MOTOR_RATED_FLUX (0.004409923)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (3.0)
    #define USER_MOTOR_IND_EST_CURRENT (-3.0)
    #define USER_MOTOR_MAX_CURRENT (15.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (150.0)

    I am not able to get stable identification process at all. During RoverL ident phase motor emits high pitch noise and BOOSTXL-DRV kit is drawing higher current from power supply than I am expected. Actually power supply is on current limit during RoverL. When RoverL is over and identification steps to Rs, drawn current (from power supply) goes to expected values.  Also identified Rs is lower then expected from manufacturer site. Identified RoverL is about 4400Hz.

    Here is link on video to see what I am talking about.

    https://youtu.be/TvH4tkIiLcQ

    Thanks.

    Jozef.

  • getting a page not found on the modelmotors but I think I found it.

    you are using?
    USER_R_OVER_L_EST_FREQ_Hz (300)

    what Vbus?

    I would lower
    USER_MOTOR_FLUX_EST_FREQ_Hz (80.0)

    Taking max current is very unusual. What is the current limit of your supply?

    No load current is 2.3A so I would lower this
    #define USER_MOTOR_RES_EST_CURRENT (1.0)
    USER_MOTOR_IND_EST_CURRENT (-1.0)

    and only increase if you require more current to start and keep spinning during state RampUp

    the values you have in user.h actually look reasonable. Is it running in proj_lab05b? you will need to lower the speed Kp and Ki gains about about 4x to 10x to get stable operation though.
  • from the video

    you are only using 5.6V? Why?

    the power supply has a 1.5A limit? That is not high enough
  • Dear Chris,

    I am back from vacation so I am back with my identification issue.

    I changed power supply to be able to deliver higher Amps to the BOOST-XL driver.  Strange noise still remains, during RoverL driver consumes 2.4A/14.7V, which I suppose is not standard behavior. A made a excel table with 10 consecutive identifications using lab 2c project. Please look at attached table to check if such dispersion of measured Ls and RoverL is correct.

    Used motor (AXI2820/10) has high cogging torque. High MOTOR_RES_EST_CURRENT (3.5) is needed for stable rotation of motor during identification process. 

    Thank you for any advice I am little bit lost with this.

    Also measured RoverL and Ls is highly dependent on supply voltage of driver.

    Best Regards,

    Jozef

    1300.user.h

    identification_issue.xlsx

  • the values look normal.
    with such low inductance the precision / repeatability of ID will not be strong.
  • OK, what about such high current consumption and strange sound during RoverL, is that normal?
    How will such precision of Ls influence current controller and FAST?
    Is there any workaround to get precise measurements?

    Jozef
  • you are putting in
    USER_MOTOR_RES_EST_CURRENT (3.5)
    at
    #define USER_R_OVER_L_EST_FREQ_Hz (300)
    into a motor with at least 150A of Isc

    if you want to change the tone of the sound reduce
    #define USER_R_OVER_L_EST_FREQ_Hz (100)


    The Ls value does not need to be so precise. In fact there isn't a single Ls value for any motor. There is actually an Ls_d and an Ls_q and these values change over frequency and especially over current running through the motor.

    The important thing for FAST is that the Ls value is in the right range, and it is better that the Ls value being used is lower than the actual (for more stability) rather than higher.


    Your motor essentially has almost no inductance. And almost no resistance and almost no flux. It can hardly be called a motor!

    I think you will struggle to find much benefit out of FOC on a solution like this. It will be very difficult to design hardware to measure the currents accurately and then control them in a way which really enhances the efficiency and performance vs. other techniques (like standard trapezoidal BLDC).

    With FOC you could design a much better motor which produces the torque required for this application at lower current.

    But I'm assuming the motor is fixed and you are just trying to control it...
  • Chris,

    thanks for reply, it makes sens to me.

    Actually I am able to spin this motor very well in compare with six step, but without any significant enhancement of efficiency.

    You told that I could design a much better motor, could you please clarify this please. I know you did it several times before on this forum, but I am not sure if I am understand it correctly.

    Thank you very much.

    Jozef
  • here are some thoughts on designing a motor for InstaSPIN-FOC / FAST

    • (near) sinusoidal EMF and minimum cogging gives smoothest low speeds.
    • minimize saliency for robustness and ease of just unloaded tuning.
    • freedom to minimize R to lower losses; it is OK to have low R/L ratios since voltage-source stability is not needed with FAST.
    • thinner laminations reduce core losses at high speeds, it is a waste of copper when core losses stay dominant. FAST deals with all lamination types very well.
    • Try to minimize the effect of saturation on the inductance, this will simplify the field-weakening range and keep peak-torques stable.
    • Linked flux level can be maximized to get highest torque/amp at requested speed and voltage.
    • There is no need to reduce inductance for stability reasons. Having Isc about equal to Imax is usually a good value; Isc much larger than 2x Imax is unwise and can potentially blow out your (minimized) power stage. A larger inductance value reduces current ripple and enhances accuracy of sampled current-signals. A nice consequence is that a motor with higher inductance is usually smaller in size and cheaper to build...and converter losses can be reduced due to lower PWM switching frequency.
    [this is the biggest point I see, especially with all of the super low inductance motors being used in high torque applications]

    • In systems that require a very large speed range, supplied by a source with limited maximum power (battery) the inductance could preferably be chosen as high as possible as long as Isc agrees with: Pmax = Udc*Isc*sqrt(3/2) This is the case when using full field-weakening and ignoring any resistance. Here Isc is the short circuit current in rms, and Udc the DC voltage. very simple indeed, independent of flux, pole-pairs or speed. The chosen flux level and number of pole pairs will determine at what speed the constant power threshold will be. Below this threshold, constant torque is possible, above this threshold-speed the torque goes down with 1/speed on the MTPF line. There is no theoretical upper limit on speed, the FAST evaluation frequency will limit the upper speed in this case.

    Perhaps a blunt statement: with FAST, a smooth sinusoidal PM synchronous motor with suitable Isc will completely outperform a traditional trapezoidal BLDC motor and controller.
  • Dear Chris,

    we play a lot with identification of BLDC hobby motors but is very hard to identify AXI motors (most of them have very strong magnets).

    We are using this HW : Ti C2000 LaunchPad XL F28027F s BoostXL-DRV8301 REV_B

    Motor: Motor AXI 2217/12 (www.modelmotors.cz/.../)

    user.h params:


    USER_IQ_FULL_SCALE_FREQ_Hz (1200.0)
    USER_IQ_FULL_SCALE_VOLTAGE_V (24.0)
    USER_ADC_FULL_SCALE_VOLTAGE_V (26.314)
    USER_IQ_FULL_SCALE_CURRENT_A (20.0)
    USER_ADC_FULL_SCALE_CURRENT_A (33.0)
    USER_PWM_FREQ_kHz (45.0)
    USER_NUM_PWM_TICKS_PER_ISR_TICK (3)
    USER_NUM_CTRL_TICKS_PER_SPEED_TICK (15)
    USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (15)

    USER_MOTOR_RES_EST_CURRENT (2.5)
    USER_MOTOR_IND_EST_CURRENT (-2.5)
    USER_MOTOR_MAX_CURRENT (20.0)
    USER_MOTOR_FLUX_EST_FREQ_Hz (80.0)
    //USER_MOTOR_RES_EST_CURRENT was tested from range (0.3, 5) A

    During RoverL phase current controller doesn't regulate Id current on USER_MOTOR_RES_EST_CURRENT/2 as it should be. But it behave strange and Id is jumping to high values sometimes more then 10 times greater that it should be. It looks like some variable is overflowing? 

    We find out that, when we change USER_IQ_FULL_SCALE_CURRENT_A from 20A to 27A identification runs well and we got these motor parameters:

    Rs = 0.02051391
    Ls = 3.957256e-06
    Flux = 0.003547509
    Hf R/L = 4889.4 Hz
    R/L = 5183.8 Hz

    When we change PWM freq to 60kHz and control runs at 20kHz it is sufficient enough to change USER_IQ_FULL_SCALE_CURRENT_A from 20A to 22A and again identification works well. Motor parameters are as follows:

    Rs = 0.01979103
    Ls = 4.173599e-06
    Flux = 0.003531303
    Hf R/L = 4742 Hz
    R/L = 4682 Hz

    Can you please explain this strange behavior. Why current controller isn't able to regulate Id current on predefined level? main difference between AXI motors and others we tested is that AXI motors have very very strong magnets and is harder to rotate them in hands.

    Thanks in advice.

    Jozef

    PS: We have our own HW which works well with majority of tested BLDC motors and also has similar parameters as BoostXL-DRV8301, but it behave little different, simple we need to change USER_IQ_FULL_SCALE_CURRENT_A to much higher values as in case of BoostXL-DRV8301.

  • what is your Bus Voltage?

    I'm thinking that instead of changing your IQ_CURRENT you simply need to change your IQ_VOLTAGE to the Vbus.

    So keep IQ_CURRENT = (20.0) or anything >= 16.5

    and set IQ_VOLTAGE = Vbus value (I'm guessing this is more in the 11-14V range)
  • Chris you were right (as usual :)) this helps and now it works well.

    Can you explain me why this happened? Also what can we do to avoid this issue in future?

    Also what is the optimal value for IQ_VOLTAGE?

  • it is a variable resolution issue between V/I with low flux / low inductance motors. when your IQ_VOLTAGE is too high you run out of bits.

    The recommendation is to set IQ_VOLTAGE = Vbus

    In extremely low flux motors you may need to reduce this further to ID, but that is very rare.
    In higher flux motors where you will run in field weakening, after you ID you need to increase IQ_VOLTAGE to insure > FLUX_Vphz * Max_Freq_Hz