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.

BOOSTXL-DRV8320RS: Control of BLDC with F280049C

Part Number: BOOSTXL-DRV8320RS
Other Parts Discussed in Thread: LAUNCHXL-F280049C,

Hi Everyone!

I've used the LAUNCHXL-F280049C and BOOSTXL-DRV8320RS to control small PMAC motors before without issue.  I'm trying to control a small BLDC for the first time, and it's not behaving as expected.

I've run lab Is05_motor_id_eabi, and the motor will both spin and identify with values that agree with an FRA that I have.  However, when I try to move to is06_torque_control_eabi, things get strange.  According to the datalog, the current controller is working- Id and Iq go to the specified values.  However, the motor doesn't spin- it just sits there with the current flowing through it.  Is there something special that I have to do with a BLDC to get it moving when using an inverter like this?  Has anyone come across a similar issue before?

Justin

  • What's the specification of the small BLDC you used? Did the motor run smoothly and identify the correct parameters when you run the lab05? And did you try to run the lab07 for speed close loop and what happens when run lab07?

    If you try to run the lab06, you should set the right reference current (Iq) to overcome the friction for starting run the motor. So you may try to run the lab07 first if the motor parameters can be identified correctly in lab05.

  • Hi Yanming!

    This is the motor I'm using:

    https://sunnyskyusa.com/collections/xs-motors/products/x8318s

    The motor does run smoothly and identifies parameters that agree with a frequency scan that I did when I run lab05.  When I try to run lab07, I get an overcurrent fault.  Is this motor just too big for this setup?

    Justin

  • Any load is added on the motor? Did you try to run the motor without load or with a light load?

    Yes, the rated current of the motor is too large for this kit if you try to run the motor with full load on the kit.

  • It also looks like the motorVars.speed_Hz is going a bit crazy- even when the motor isn't moving, it's fluctuating from -10k to 10k

  • You may have to use lab05 to identify the motor parameters again with a higher PWM frequency like 45kHz.

    Please take a look at the link below also,

    https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/921747/tms320f280049c-fast-estimator-questions

  • Hi Yanming!

    Thank you so much for helping me with this!

    I just tried to identify the motor parameters at 45kHz, and they were indeed different.  However, the result using is07 is still the same- the motorVars.speed_Hz is unstable jumping from -10k to 10k. 

    I should also note that I set the maximum current for the motor to 8A, and it now "dances" when in closed loop voltage.  It moves erratically clockwise and counterclockwise, and the speed estimator is still unstable.

    I looked at the link, and found that the files and code lines that you recommended to add were already in the project for is07.  I attempted to modify the 3 values of USER_EST_FLUX_HF_SF , USER_EST_FREQ_HF_SF , and USER_EST_BEMF_HF_SF within the recommended range to no success.

    Do I need to give the speed estimator something special to estimate correctly?

    Justin

  • 1. Tuning the gains of speed and current PI controllers.

    2. Keep using the default values of USER_EST_FLUX_HF_SF , USER_EST_FREQ_HF_SF , and USER_EST_BEMF_HF_SF.

  • Hi Yanming!

    Ok!  I loaded up lab is06 and started tuning the current controller.  A screenshot of what's going on is below.

    The top graph is Id, and the bottom graph is Iq.  The command for Id is 0, the command for Iq is 8.  The controller is stable, if slightly off of the setpoint.  The motor is not moving at all.  The motorVars.speed_Hz , however, is oscillating between -1k and 1k with the motor not moving and the current going to almost exactly the setpoint and staying there.  Do you know what's going on?

    Justin

  • I just tried this BLDC as well, and am having the exact same problems- ident runs fine, current controller is stable but to a slightly lower value than commanded, motorVArs.speed_Hz showing values all over the place.

    hobbystarlabs.com/hobbystar-2204-2822-brushless-outrunner-motor.html 

  • You may try to run the motor with speed closed-loop first as is07 lab and know how much torque current must be set to start the motor. And also tuning the gains of the speed PI controller and acceleration if the motor can't start and run well with is07 lab.

  • Hi Yanming!

    Thanks again for all the help!

    I brought it up with is07, and it started dancing erratically.  I lowered the gains, and it just slowed down the dancing until it stopped.  I raised the gains, and it danced faster until it overcurrented.  I have quite a bit of experience tuning PI controllers for power electronics, and I was unable to find a set of gains that would stabilize the motor.  The speed observer was always behaving erratically, jumping from big negative numbers to big positive numbers and back.

    The current loop is stable- If I command 8A, I get a little over 7A, but the phase isn't changing.  The higher the current I pass through the q channel, the harder the motor becomes to turn manually, so I think that the current controller is working, but the observer isn't generating an angle that can be used.

    I've tried this with 3 different BLDC's.  What's the BLDC that you guys tested this with?  I'd like to pick one up just to make sure that I have all of the other settings right.

    Justin

  • Most of the motors listed in the user.h have been tested that include a few drone motor also from Hobbywing.

    Please make sure that the motor parameters are identified correctly, and then use the identified motor parameters for lab06 and lab07. Please don't add any load on the motor for identification, and set the correct identification variables value in the file of user.h according to the specification of the motor, to make sure the motor spin smoothly during Flux measurement and Ls identification states.

    #define USER_MOTOR_RES_EST_CURRENT     (1.0)                               // A - 10-30% of rated current of the motor

    #define USER_MOTOR_IND_EST_CURRENT     (-1.0)                             // A - 10-30% of rated current of the motor, just enough to enable rotation

    #define USER_MOTOR_MAX_CURRENT           (5.0)                               // A - 30~150% of rated current of the motor

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)                           // Hz - 10~30% rated frequency of the motor

    Keep tuning the gains of both speed and current PI controller until the motor run smoothly and stably as you want, which should be an real engineering topic, the default gains in the lab are just for a reference as a starting point. You have tune these gains according to the testing result, there is no a quick guide for this.

  • Hi Yanming!

    Those are very close to what I was using to identify, and I think the identified values came out correct.  Here's the whole motor description after identification:

    #elif (USER_MOTOR == HobbyStar_2204)
    #define USER_MOTOR_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR_NUM_POLE_PAIRS (7)
    #define USER_MOTOR_Rr_Ohm (NULL)
    #define USER_MOTOR_Rs_Ohm (0.153268591f)
    #define USER_MOTOR_Ls_d_H (3.38808459e-05)
    #define USER_MOTOR_Ls_q_H (3.38808459e-05)
    #define USER_MOTOR_RATED_FLUX_VpHz (NULL)
    #define USER_MOTOR_MAGNETIZING_CURRENT_A (NULL)
    #define USER_MOTOR_RES_EST_CURRENT_A (1.0)
    #define USER_MOTOR_IND_EST_CURRENT_A (-1.0)
    #define USER_MOTOR_MAX_CURRENT_A (5.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (20.0)

    // Number of lines on the motor's quadrature encoder
    #define USER_MOTOR_NUM_ENC_SLOTS (1000)

    #define USER_MOTOR_FREQ_MIN_HZ (5.0) // Hz
    #define USER_MOTOR_FREQ_MAX_HZ (600.0) // Hz

    #define USER_MOTOR_FREQ_LOW_HZ (20.0) // Hz
    #define USER_MOTOR_FREQ_HIGH_HZ (400.0) // Hz
    #define USER_MOTOR_VOLT_MIN_V (4.0) // Volt
    #define USER_MOTOR_VOLT_MAX_V (14.0) // Volt

    The current is stable, but the motor will not continually rotate in is06.  The speed readout (motorVars.speed_Hz) is not stable and changing from very high negative numbers to very high positive numbers and back and the motor is not physically moving at all.  Again, the current is stable and going to setpoint, but the motor is not moving and the speed observer is unstable.  Are you saying that the current controller is what stabilizes the speed observer even when the motor is not moving?

    If I command a negative current after a positive one, the motor will move to a different position and stay there.  This happens also when I command a positive current after a negative one.  This happens on both the D and the Q channels.  I don't think that the FAST observer is locking to what the motor is doing.  Again, the current controller is stable and goes to the setpoint, the system just doesn't continually generate an angle that keeps the motor moving.  It's of note that the stable current in the q channel changes when I change the command in the d channel without changing the value in the q channel.  Again, the controllers are stable, they go to a set value and stay there.

    Here are Id and Iq (above and below) when the Id setpoint is 0 and the Iq setpoint is 3

    Here are the Id and Iq (above and below when the Id setpoint is 3 and the Iq setpoint is 3

    Notice that the d channel goes to the correct value, but the q channel is dependent on what the d channel is- doesn't this mean that the d and q channels aren't field oriented correctly?  Note that both currents are STABLE- the current controllers are working.

    Here are the speed and angle (estOutputData.fe_rps and estOutputData.angle_rad).

    Note that the speed is jumping from -70k to 70k, and the angle is always infinite.  Again- the motor is NOT MOVING during this time.  The current is going to the setpoint and staying there, but the motor is not moving and the speed estimator is unstable and providing an infinite angle.

    I'm using a BOOSTXL-DRV8320RS and a LAUNCHXL-F280049C

    I've used this with PMAC's before with no problem, I've just seen this with BLDCs, which makes me think I have a setting somewhere else incorrect.  Which Hobbystar did you use?  I will buy one and replicate your results.  Please tell me which BLDC from Hobbystar you used.

    Justin

  • As the link below, 9616-110KV model motor was tested with InstaSPIN-FOC.

    https://www.hobbywing.com/goods.php?id=679&filter_attr=15033

    Why the USER_MOTOR_RATED_FLUX_VpHz  is NULL? It should be identified with a value for PMSM/BLDC motor.

    #define USER_MOTOR_RATED_FLUX_VpHz (NULL)

    Try to tune the identification variables to identify the motor parameters again as below, seems like you should set a higher USER_MOTOR_RES_EST_CURRENT_A , USER_MOTOR_IND_EST_CURRENT_A, and USER_MOTOR_FLUX_EXC_FREQ_Hz for your motor.

    #define USER_MOTOR_RES_EST_CURRENT_A (4.0)
    #define USER_MOTOR_IND_EST_CURRENT_A (-3.0)
    #define USER_MOTOR_MAX_CURRENT_A (15.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (60.0)

  • Thank you Yanming!  The USER_MOTOR_RATED_FLUX_VpHz was the missing setting- it all works now!!

  • Good to know the issue is resolved. Let's know if have any further question. We'd like to close this thread. Thanks!