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.

Rs and Ls inconsistencies, motor "wiggling" in Lab02c

Other Parts Discussed in Thread: LAUNCHXL-F28069M, BOOSTXL-DRV8301, DRV8301

Hey team,

I've been using lab02c to identify a low inductance PM motor, and I'm experiencing some issues with the lab. Approximately 2 out of 3 attempts to ID the motor, the motor will only "wiggle", i.e turn about 5 degrees, then reverse. It occasionally works as intended, and will react to changes in SpeedRef correctly.


Also, the Lsd & Lsq values vary widely; last instance, they've been hovering around 5uH, but will change to ~2nH once motor ID completes. Any idea what's causing this? I would expect an inductance in the micro range, not nano.


My motor parameters in the user.h:

#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                   (NULL)
#define USER_MOTOR_Ls_d                 (NULL)
#define USER_MOTOR_Ls_q                 (NULL)
#define USER_MOTOR_RATED_FLUX           (NULL)
#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          (3.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

Everything else is unchanged in the user.h

Thanks

Sean

  • Sean,

    you may need to increase

    #define USER_MOTOR_RES_EST_CURRENT      (1.0)

    to guarantee that the motor starts spinning during RampUp phase

    if the motor doesn't start spinning you will likely get nH type results.

    you also need to increase this to about 10% of the rated frequency or your results are not valid

    #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

  • Chris,

    I tried increasing the values to:

    USER_MOTOR_RES_EST_CURRENT (8.0)

    USER_MOTOR_FLUX_EST_FREQ_Hz (25.0)

    I calculated the elec frequency as 7500*4/120 = 250, that's how I arrived at 25.0. Is this correct?

    I'm using the DRV8301-69M-EVM with a Vin = 16V. My motor curve is included below:

    I'm still experiencing the same motor humming with no shaft rotation as before with these new values. Do these values for est current and freq look correct?

    -Sean

  • Sean,
    Is this a hobby motor? Any link to any data on it? 7500 RPM with 4 poles is a bit abnormal. Most hobby and low inductance motors have much higher rated frequency than 250 Hz. Also, in the first post you had a maximum current for the motor of (3.0) yet in the second you use (8.0) just for the RES_EST_CURRENT. Do you have a spec on the rated voltage and current of this motor?

    When ID starts look at the .RoverL value please and report the .Rs value

    Please also attach your user.h
  • Chris and Sean,

    It is not a hobby motor but unfortunately there is not "standard" nameplate data available.  The only data I have is the curve that Sean shared above.  I drove the motor at 1000 RPM and there are 2 electrical periods per revolution.  Period of 1 electrical phase = 30ms and 1 revolution = 60ms, so 2 periods per revolution.  How many poles is that?  If we assume 6000 RPM is rated speed the revolution period would be 10ms so one electrical period would be 5ms (200Hz).  Maybe I am incorrect on this thought...

    When ID starts and EstState is RoverL, there is no value for .Rs_Ohm.  Just after EstState goes from  RoverL to Rs, then Rs_Ohm begins updating.  It eventually arrives at 16-18mΩ.  I measured the R line to line to be 32mΩ, so Rs = 16mΩ makes sense for Rline-neutral. 

    I do have a hobby motor with more data available that I tried as well, but it has the same results.  (very low Ls (10E-9) and no ramp up)

    www.hobbyking.com/.../__22407__Turnigy_AquaStar_3974_2200KV_Water_Cooled_Brushless_Motor.html

    RPM/v: 2200kv
    Poles: 4
    Max voltage: 18.5V (5S)
    Max Current: 100A
    Max Watts: 1200w
    Resistance: 0.0094ohm
    No Load Current: 2.9A
    Can Diameter: 39mm (actual motor diameter) 
    Can Diameter inc. Water Jacket: 49mm
    Can Length: 69mm
    Shaft Size: 5mm
    Weight: 415g

    Here is the user.h  (I think it is attached?)

    18453.user.h

  • the user.h you sent is one used for InstaSPIN_motion projects. They aren't the user.h included in the InstaSPIN_foc projects. Please check the actual user.h that is being compiled in proj_lab02

    what is the effective compiler you are using? As long as you are using CCS v6 you should be fine. Some versions of CCS v5 had a compiler with a nasty bug that won't let you ID.

    The hobby motor is a true low inductance, high speed motor.
    you must use proj_lab02c to ID this motor

    something like this should probably work:
    #define USER_MOTOR_RES_EST_CURRENT (3.0)
    #define USER_MOTOR_IND_EST_CURRENT (-1.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (60.0)

    We ID motors like this all the time with no issues.

    I will say that it is better to ID these low voltage motors on something like a LAUNCHXL-F28069M + BOOSTXL-DRV8301 as the voltage and current scaling are more reasonable. You lose some resolution with the DRV8301-69M-KIT.


    for your non-hobby motor, please use proj_lab02c and let me know the value of .RoverL. This should update ~10 seconds into the ID process.

    Then report the Rs, Ls, and Flux values found from ID. And let me know if the motor starts spinning during the EST_State_RampUp and continues until RampDown.
  • Chris,


    We reinstalled MW15 to get a fresh copy of user.h. Using CCSv6, we modified the user.h to include the values you posted. The project runs until EST_State_RatedFlux, and then goes to EST_State_Error and CTRL_State_Error. There is no error code identified at this point.

  • post the user.h please

    any chance you can get a LaunchPad and BOOSTXL-DRV8301? It works better for these motors.

    You can also send the motor to me.
  • I am not very familiar with these products yet, but I believe the  BOOSTXL-DRV8301 has a lower current rating and may not work when we actually run the motor in the application.  So, I would use it just to identify the motor or for normal operation also?  

    Here is the user.h

    2287.user.h

  • 4403.user.hHere is the correct user.h file.  We had a power outage here and the one I was working with did not get saved.

    Sorry for the confusion.

  • are you using the Hobby motor or the original high current motor?

    you currently have the default motor selected. Anaheim_BLY172S

    for the high current I would try
    #define USER_IQ_FULL_SCALE_VOLTAGE_V (14.0) // this is the Vbus displayed in the above image

    #elif (USER_MOTOR == Anaheim_BLY172S)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (2) // this was a 4, your motor is 2 pairs
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (NULL)
    #define USER_MOTOR_Ls_d (NULL)
    #define USER_MOTOR_Ls_q (NULL)
    #define USER_MOTOR_RATED_FLUX (NULL)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (10.0)
    #define USER_MOTOR_IND_EST_CURRENT (-3.0)
    #define USER_MOTOR_MAX_CURRENT (40.0) // do you have enough current from a supply or battery?
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (40.0)


    if you are using the hobby motor
    #define USER_IQ_FULL_SCALE_FREQ_Hz (1400.0)

    #define USER_IQ_FULL_SCALE_VOLTAGE_V (14.0) // this is the Vbus displayed in the above image

    #elif (USER_MOTOR == Anaheim_BLY172S)
    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (4) // this was a 4, your motor is 2 pairs
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (NULL)
    #define USER_MOTOR_Ls_d (NULL)
    #define USER_MOTOR_Ls_q (NULL)
    #define USER_MOTOR_RATED_FLUX (NULL)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (9.0)
    #define USER_MOTOR_IND_EST_CURRENT (-2.0)
    #define USER_MOTOR_MAX_CURRENT (40.0) // do you have enough current from a supply or battery?
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (60.0)



    Again, this EVM has 66V of scaling and you are looking at 16V bus, that's less than 1/4 of the resolution. And these motors will have very small flux, so you are throwing away too much resolution. You may need to design your own HW to get consistent results....but I'm still surprised you can't get either to ID with proj_lab02c.
  • Chris,

    I tried your parameters for each motor and bothhad the same result, didn't identify and state error.  My power supply is large enough, 110 amps.  Attached are the "results".

    Can I increase Vbus to improve the scaling to see if it helps with the identifying routine?  If so, What voltage should I set?

  • Mike,
    Any chance you can ship me a motor?
  • "Can I increase Vbus to improve the scaling to see if it helps with the identifying routine? If so, What voltage should I set?"
    this depends on how much voltage your motor can withstand

    this won't help much if any though
  • Chris,

    Yes, I can send the motor to you. It is the only one that I have right now so it will have to be sent back to me when you are done.

    What address should I ship it to?
  • Sean has it, please work through him. I can test it next week.
  • Mike,
    Just got your motor. It immediately ID'd and ran just fine for me.

    DRV8301-69M-KIT
    15V/15A supply limits

    #define USER_IQ_FULL_SCALE_VOLTAGE_V (15.0)
    #define USER_PWM_FREQ_kHz (15.0)
    #define USER_NUM_PWM_TICKS_PER_ISR_TICK (1)


    #define USER_MOTOR_TYPE MOTOR_Type_Pm
    #define USER_MOTOR_NUM_POLE_PAIRS (2)
    #define USER_MOTOR_Rr (NULL)
    #define USER_MOTOR_Rs (0.018)
    #define USER_MOTOR_Ls_d (0.000035)
    #define USER_MOTOR_Ls_q (USER_MOTOR_Ls_d )
    #define USER_MOTOR_RATED_FLUX (0.0246)
    #define USER_MOTOR_MAGNETIZING_CURRENT (NULL)
    #define USER_MOTOR_RES_EST_CURRENT (7.0)
    #define USER_MOTOR_IND_EST_CURRENT (-2.0)
    #define USER_MOTOR_MAX_CURRENT (15.0) // you can raise this with your own supply
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (20.0)


    @ 5 KRPM, ~2.2A on power supply
    @ 10 KRPM, ~4.4A on power supply

    Speed controllers aren't auto tuned, but the default when using USER_MOTOR_MAX_CURRENT (15.0)
    is stable. The low speed tuning isn't great and torque is a little low at <360 RPM (12 Hz), but that's to be expected with a low flux, low voltage, low inductance machine.

    If you increase USER_MOTOR_MAX_CURRENT to 40 your gains will increase by (40/15) = 2.66x as well, which should still work well, but check it at higher speeds for stability.

    The current measurements get noisy at high speeds, which is usual. If you are actually going to run this motor to the 80A rated you probably want to design a board with in line current sensors (LEM).
  • Chris, for reference, you ID'd Mike's motor using the F28069M LaunchPad + DRV8301 BoostXL?

    Edit: Disregard - I see you mentioned the 69M-KIT in your response upon a second read through.

  • no
    DRV8301-69M-KIT
  • I ID'd it 5 times with no problems.

    However, I just tried again and it failed a few times during RatedFlux or Ls measurement.

    I changed
    #define USER_MOTOR_RES_EST_CURRENT (8.0)
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (25.0)

    and it's been ID ing fine again.
  • That is good news.  

    Do you know why it will not calibrate (ID) or run on my setup?  Could something be wrong with the DRV?

    What would be the next step?

  • Mike,
    It's hard to say. If this is a new DRV8301-69M-KIT I doubt it is damaged. I think that it is right on the border with this EVM having such high voltage scaling and relatively poor current measurement. For your motor you need to scale the voltage to something more appropriate, and you will want to use in-line current sensors so you aren't wasting power through the shunt drop.
  • Chris,

    Do you have a recommendation for the voltage scaling? I assume you are referring to ADC-VhbX input, is that correct?

    Similar questions for the current measurement, what is the recommended scaling based on my motor that you have? I understand that there may be power dissipation issues with a shunt, but I can change the value initially to test the idea.

    I can modify anything that needs to be adjusted. Perhaps, there is some reading material relative to these concepts that you could point me towards?
  • SPRUHJ1 chapter 5 discusses the scaling

    for a 12V motor I would choose a voltage range of 0-16V.

    I don't recall specifically the max current of your motor...I think it was 120A? So I would design for current scaling of +/- 140A. And I would absolutely use in-line current sensors
  • I am working on this and have made an adjustment to the voltage scaling so the Va max = 19.5 volts (was 66.3V) by changing the the 3 resistors as well as

    USER_ADC_FULL_SCALE_VOLTAGE_V       (19.54)

    Every time I try to ID the motor I get the following error.  I cycled the power and this error comes up every time now.  Do you know what can cause this?  I got this error every once in a while before I changed the resistors.

  • did you change all 3 phases and the Vbus?
    check your calculations?
    did you also review the calculation of the voltage filter pole?
    #define USER_VOLTAGE_FILTER_POLE_Hz

    what did you set this to?
    #define USER_IQ_FULL_SCALE_VOLTAGE_V

    the error looks like what happens when you try to connect to a target which is already debugging code in real-time mode. when you first connect you are able to load the project, enter real-time, run, and enable the system?
  • did you change all 3 phases and the Vbus?  Yes all 3, but didn't know about the Vbus divider.  I will change the divider for Vbus measurement.

    check your calculations? Ru= 24.6k, Rl=4.99k Vxmax = 3.3*(4.99+24.6)/4.99 = 19.5V

    did you also review the calculation of the voltage filter pole?  New calculated value is 383Hz, which is above the recommended value (>200HZ).  

    #define USER_VOLTAGE_FILTER_POLE_Hz  This was set to 335Hz (default)

    what did you set this to?  It was set to 24 (default).  Notes in user.h say to start with 3X of USER_ADC_FULL_SCALE_VOLTAGE_V      (3*19.54= 58.62), so I will change it.

    #define USER_IQ_FULL_SCALE_VOLTAGE_V

    the error looks like what happens when you try to connect to a target which is already debugging code in real-time mode. when you first connect you are able to load the project, enter real-time, run, and enable the system?  The error occurs shortly after I start the ID'n by changing gMotorVars.Flag_Run_Identify from 0 to 1.  It happens when the motor is first energized (at least audibly).

    With the above changes, the error no longer occurs, but the motor will not ID, Lsd_H and Lsq_H are 5.018264e-13 and the motor does not run up.  I didn't change the current feedback hardware.  To be clear I am not using the motor that you have (that is my only one) I am using a hobby RC  motor 3974-2200KV.

  • #define USER_IQ_FULL_SCALE_VOLTAGE_V (12.0) // set this to your power supply, so 12-15V

    #define USER_VOLTAGE_FILTER_POLE_Hz (383.0) // set this to 383 Hz

    "To be clear I am not using the motor that you have (that is my only one) I am using a hobby RC motor 3974-2200KV."
    Please attach the user.h you are using for this motor. And what is your Vbus?
  • Chris,

    In following up with the above conversation, a dyno has been setup to gather data from the motor. We've changed out the FETs on a new DRV8301-HC board, and things seem to be performing much more reliably than we had been experiencing in the past. We have some new observations from initial testing on the dyno we were hoping you could comment on

    1) Motor will not start up on dyno without help to get it spinning when IqRef_A  is commanded to 30-50. It makes a noise like its trying to spin based on commanded torque, but can't start without an external force

    2) On dyno we measure torque up to a limit (6 in-lbs, should be capable of 12+ in-lbs for example), but increasing IqRef_A > 55 causes motor to stop. Thinking we are hitting a current limit, but changing USER_MOTOR_MAX_CURRENT and USER_IQ_FULL_SCALE_CURRENT_A didn't seem to change the cap we were hitting

    3) What variable can we look at to determine if the current feedback is railing (saturating) due to the high current levels?

    Attached the user.h

    Thanks,

    Sean

    52855.user.h

  • 1. are you using ForceAngle Flag enabled?
    50A commanded? Your user.h says 41.5 A max.

    2. IqRef_A peak currents are != continuous current for torque production. your peaks will need to be higher than your RMS current

    3. the output of the Iq PI controller will tell you if things are saturating.

    you can also look at the code in proj_lab10a to see the use of the Vs and Is variables. Those are helpful to look at saturation. For maximum torque you also need to implement the overmodulation in lab10a, even if you want to use in torque mode only.
  • 1. are you using ForceAngle Flag enabled?

    I tried it with and without ForecAngleFlag enabled, didn't notice a difference.

    50A commanded? Your user.h says 41.5 A max. 

    Yes, IqRef_A = 50 (lab05a).  I am not clear what you say is set to 41.5A max in my user.h, I can't find that anywhere.  Which variable?  Are you referring to  USER_IQ_FULL_SCALE_CURRENT_A?  It is set to 80 in my user.h file.  I downloaded the user.h that is attached in the previous post (thinking I sent you the incorrect file) and it is set to 80 also.  I am not sure where you see 41.5 anywhere in the user.h.

    2. IqRef_A peak currents are != continuous current for torque production. your peaks will need to be higher than your RMS current 

    Understood, so how high can IqRef_A be commanded?

    3. the output of the Iq PI controller will tell you if things are saturating.  

    What is the variable for this Iq?  How will I know it is saturating

    you can also look at the code in proj_lab10a to see the use of the Vs and Is variables. Those are helpful to look at saturation. For maximum torque you also need to implement the overmodulation in lab10a, even if you want to use in torque mode only.  OK, I will look a that.

    Also, I changed R60, R61, and R63 to 17.8k to better scale the phase voltage measurement.  I also changed:

    USER_IQ_FULL_SCALE_VOLTAGE_V      (15)

    USER_ADC_FULL_SCALE_VOLTAGE_V       (15.07)

    USER_VOLTAGE_FILTER_POLE_Hz  (408)

    These changes improved the max torque I measured on the dyno and it took lees rotational input from me to get past startup, it was a marked improvement.  I have attached the user.h with the changes above.2337.user.h

    Start up torque needs to be improved and I have read on this forum that hall effects will improve this because position is better known.  My motor has sensors (60 degree spacing) and my EVM can accommodate hall sensors (J10).  Is there an improved lab over lab11e that shows how to do this?  At what current level will I need to rescale the current sensors (voltage divider and ADC)?

     

  • 1.
    #define USER_ADC_FULL_SCALE_CURRENT_A (82.5)
    this is the full scale current, which means the HW can only measure currents between +/- 41.25 A

    2. you shouldn't command peak currents higher than you can measure

    3. the output of the Iq/Id controllers will be in the controller_obj at Vdq_out. It will saturate to the value at pid_Iq.outMax


    Unfortunately we don't have a good working example of using Hall sensors for start-up right now. lab11e has some issues that we need to correct.
  • your user.h looks ok

    "Start up torque needs to be improved"

    I think you are just reaching the limit of the HW for the amount of power your motor requires.

    for load start-up considerations please review SPRUHJ1 chapter 14.3