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: Instaspin Motor Identifying failed with LauchXL F280049C + BoostXL-DRV8320RS motor with no inertia and load

Part Number: BOOSTXL-DRV8320RS
Other Parts Discussed in Thread: C2000WARE, DAC128S085

Hello 

I think, I need some advice, how to do a motor identification . 
I have

  • LauchXL F280049C
  • BoostXL DRV8320RS
  • MotorControSDK 3.03.00.00
  • instaspin_spruhj1i.pdf
  • InstaSPIN Projects and Lab User's guide  V1.00.00.00 pdf. Instaspin FOC labs 01-13

  • I am able to run / identify a "simple" motor (like a drone motor) successfully by executing LAB05 from C:\ti\C2000Ware_MotorControl_SDK_3_03_00_00\solutions\boostxl_drv8320rs\f28004x\ccs\sensorless_foc\is05_motor_id_eabi
  • I reduced the Voltage Range and the Current Range of BoostXL-DRV8320 to 29V and 6A and modified user.h accordingly (works fine) 

Very good so far.

Now I need to identify "our" motor. It has some "tricky" parameters

  • RS = 6.67 Ohms
  • ROverL = 31,4
  • flux Volt/Hz = 0,007 
  • 1 pole pair
  • operating speed 9000 RPM -> 33000 RPM  = 150Hz -> 550 Hz
  • CANNOT be detached from load  (it is a pump) 
  • has VERY little inertia
  • has a high startup torque

I was able to run "motor identify Lab exercise" up until "EST_STATE_RAMPUP". (Operating-Point 150Hz). Motor is running. A Value for Flux Volt/Hz is measured during rampup and it is fairly stable. 

When finished, the motor immediately stops. I cannot tell, if this is during "EST_STATE_CONSTSPEED" or during "EST_STATE_RATEDFLUX_OL" or "EST_STATE_RATEDFLUX"

What options do I have to identify Lq and Ld manually? 

Is there a more detailed description, what the estimator is doing during motor identification and to find out, why it stopped immediately after ramp-up? Is there a way to stop the estimator at a certain state to find out, which step is causing the problem? 

Furthermore: 

If I want to run the motor (if identified) I need to do a open-loop startup until the frequency is e.g. 150Hz. How do I do that? Is there a more detailed description, how to tweak the startup process?

In addition: I find it quite difficult to understand, how the flag "userParams.flag_bypassMotorId" is passed to the estimator. How does the estimator know, that it does not need to run a motor identification?

Thank you for your help

Johannes

  • Hi Johannes, 

    Forwarding to the C2000 team for MotorControl SDK support. 

    Thanks,
    Aaron

  • 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. And follow the operation steps in the lab user's guide to identify/run the motor.

     

    #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

    Set the userParams.flag_bypassMotorId = false before calling  EST_setParams(estHandle, &userParams), the estimator will run the motor identification.

  • Hello Yanming
    Sorry, but this is not possible. I cannot remove the load. The motor is so small, it needs to be flushed by fluid to lubricate the bearing. I cannot run it dry. Therefore I cannot remove any load. 

    What other options do I have?

  • You might try to tune the identification parameters as mentioned above to enable the motor to spin smoothly during the identification process.

    If the load is changed with speed, or it's too larger to identify the motor, you have to get the motor parameters from the motor manufacture, and set the parameters as described in Section 6.8 "Setting PMSM Motor Parameters in user.h" in InstaSPIN-FOC and InstaSPIN-MOTION User's Guide

    http://www.ti.com/lit/ug/spruhj1h/spruhj1h.pdf 

  • I was able to build a rig, running the motor with no load. Same effect. Motor ramps up until 150Hz, then immediately stops (getting non synchronous) after "EST_STATE_CONSTSPEED" during motor identification. MotorVars.faultUse is zero (no error flags)

    I need some voltage to make the motor run in the first place. How to set a minimum voltage? The constant USER_VOLT_MIN_V seems not to be used in LAB05 (obviously only for early labs running a fix trajectory) 

    How can I debug what happens after Estimator steps "EST_STATE_RAMPUP" ?

    Thank you for your help

  • Is your motor a PMSM one? Or ACIM?

    Did you try to tune the identification parameters as mentioned above?

    I need some voltage to make the motor run in the first place. How to set a minimum voltage? The constant USER_VOLT_MIN_V seems not to be used in LAB05 (obviously only for early labs running a fix trajectory) 

    Yes, these parameters are only for lab03 to do the hardware verification.

  • Yes it is a "non salient" PMSM motor with an outer diameter of 7mm. It runs between 10000 RPM and 35000 RPM. Rated power is 15V 1A

    I experimented with the settings you have shown me. But instead of choosing MOTOR_MAX_CURRENT  5A as motor current limit, I went for 2A. I tried various various FLUX_EST_FREQ_Hz 20 / 40 /100 / 150
    all unsuccessful. As soon as the estimator finished rampup and, the motor stopped immediately. 
    I could try 5A on Monday, but I am afraid of damaging the motor. It gets quite hot during detection (remember it is a pump, which is cooled by fluid. Now have run it dry to remove any load, it gets quite hot now) 

    Johannes

  • The above identification parameters are just for your reference, you should set these parameters according to your motor. Since you are using the TI EVM kit, you only need to change the value of these variables to identify the motor.

    Or you can get the motor parameters from its manufacturer if you can't run the motor without load for identification.

    Rated power is 15V 1A

    And it seems like the motor is too small to use this kit for getting a good current and voltage sensing resolution. You have to change the hardware for improving the current and voltage sensing resolution.

  • Hello Yanming

    Please read previous postings of mine. I already modified the hardware to scale down the voltage and current measurement range. 
    I changed the current measurement range from 42A to 6A 
    I changed the voltage measurement range from 48V to 29V

    As described above, I was able to remove the load by running the motor "dry". But still: motor detection does stop after rampup. 

    No improvement. 

  • Do you have a chance to run/identify the other motors for verify the hardware and software you changed?

  • Yes. I ran the other motor and id did just fine,

    Yes I ran it after my software changes,

    yes I ran it after I have changed the voltage and current range changes,

    yes I changed the scale settings in user.h according to the changed voltage and current ranges.

    Large Motor: all fine (even with load) 

    Small motor: stops during identification after rampup.

    I can see with the large motor, that the identification process reduces the speed after rampup in an abrupt way from a high speed to a medium speed. I assume, if the motor has enough inertia, it would stay running. My "small" motor stops at this stage. It has very little inertia.

    I can see, that with my small motor, it only would rotate during identification, if the voltage applied to the motor is above 2.5V 
    I can see that during identification after rampup, the Estimator drops the voltage below that point. As a result, the motor stops. Can I setup the Estimator / Motor Identifier to stay above 2.5V?

    Do you have an advice, which parameters I should put on PWMDAC and record for you to show? 
    I also managed to connect BOOSTXL DAC128S085 EVM to LauchXL F290049C (yes I know, the chip select is on another pin, I changed that) I can output up to 8 channels via DAC128S085.

    Johannes

  • What's rated current and voltage of your motor? How do you change the current and voltage measurement range?

  • Hello Yanming

    Is there a way to improve our conversation / understanding? It seems as if you are repeating questions, I already have answered in this thread. Maybe I didn't make myself clear enough:

    Regarding your questions:

    The motor is 15V 1,5A 1 pole pair PMSM (see above), RS=8Ohm, Ls_d = Ls_q = 30µH (measured with an LRC meter)

    The other motor ( the large one, which is working fine) 7 pole pairs, 2,87A @ 12V, RS 0,46, Ls_d = Ls_q = 181µH

    The hardware modifications:


    I changed the shunt resistors on DRV8320RS from 0.007 to 0.05R (3 times) 

    //#define USER_ADC_FULL_SCALE_CURRENT_A ((float32_t)(42.843)) //RShunt = 0,007
    #define USER_ADC_FULL_SCALE_CURRENT_A ((float32_t)(5.999)) //RShunt = 0,05


      

    I changed the voltage dividers from 82k / 4.99k to 39K / 4k99  (4 times. 3x phase, 1x VSupply)

    //#define USER_ADC_FULL_SCALE_VOLTAGE_V ((float32_t)(57.528)) //Rupper = 82k, Rlower = 4k99
    #define USER_ADC_FULL_SCALE_VOLTAGE_V ((float32_t)(29.091)) //Rupper = 39k, Rlower = 4k99

    Maybe I missed to modify the overcurrent threshold in source code. Is there a special setting? I would assume, that the settings "USER_ADC_FULL_SCALE_CURRENT_A" would also modify the overcurrent threshold.

    Johannes

  • The motor is 15V 1,5A 1 pole pair PMSM (see above), RS=8Ohm, Ls_d = Ls_q = 30µH (measured with an LRC meter)

    Since the motor is a low inductance motor, you need to use a higher PWM frequency like 45kHz as the settings below in user.h

    #define USER_PWM_FREQ_kHz          ((float32_t)(45.0))     //45KHz PWM frequency

    #define USER_NUM_PWM_TICKS_PER_ISR_TICK         (3)

    #define USER_ADC_FULL_SCALE_CURRENT_A ((float32_t)(5.999)) //RShunt = 0,05

    Make sure that you don't change the PGA configuration, the Gain is 12.

    #define USER_ADC_FULL_SCALE_VOLTAGE_V ((float32_t)(29.091)) //Rupper = 39k, Rlower = 4k99

    You should change the voltage filter for the low inductance motor. Change the C9, C10, C11 from 0.1uF to 47nF, and change the parameter below in user.h

    #define USER_VOLTAGE_FILTER_POLE_Hz           ((float32_t)(719.9083429f))

    And try the following identification parameters.

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

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

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

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

  • Hello Yanming
    Thanks for your recommendation
    I changed everything like you recommended:  Result: motor does not turn at all during identification (only oscillates) 

    changed C9,C10,C11 to 47nF 
    #define USER_VOLTAGE_FILTER_POLE_Hz           ((float32_t)(764.0))  //39k 4k99 47nF
    #define USER_PWM_FREQ_kHz          ((float32_t)(45.0))       //45KHz PWM frequency
    #define USER_NUM_PWM_TICKS_PER_ISR_TICK         (3)
    #define USER_MOTOR_RES_EST_CURRENT_A (0.5)
    #define USER_MOTOR_IND_EST_CURRENT_A (-0.2)
    #define USER_MOTOR_MAX_CURRENT_A (2.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (60.0)
    #define USER_NOMINAL_DC_BUS_VOLTAGE_V ((float32_t)(24.0))
    #define USER_ADC_FULL_SCALE_VOLTAGE_V         ((float32_t)(29.091)) //Rupper = 39k, Rlower = 4k99
    #define USER_ADC_FULL_SCALE_CURRENT_A         ((float32_t)(5.999))  //RShunt = 0,05

    result: Motor does not run at all during identification, only oscillates.

    Can I provide some scans? Oscilloscope images etc. to help to find the problem?

    Johannes

  • Did you try to run/identify the other similar motors for verify if the motor is fine? You have to keep tuning the following parameters to spin the motor smoothly for identification if you make sure that both hardware and motor are good.

    #define USER_MOTOR_RES_EST_CURRENT_A (0.5)
    #define USER_MOTOR_IND_EST_CURRENT_A (-0.2)
    #define USER_MOTOR_MAX_CURRENT_A (2.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (60.0)

  • Hello Yanming
    We are running in circles here.  Did you read my last posting? 
    I ran the test with these settings, you are proposing:

    #define USER_MOTOR_RES_EST_CURRENT_A (0.5)
    #define USER_MOTOR_IND_EST_CURRENT_A (-0.2)
    #define USER_MOTOR_MAX_CURRENT_A (2.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (60.0)

    Yes, the motor is fine, I can run it with lab 03_hardware_test (open loop hardware test). Motor runs inefficient, but it runs. 

    I have 3 small motors available, all the are behaving the same. 
    With your settings above, the motor stops during rampup or even does not start at all (only oscillates)
    With lab 03_Hardware_test all motors run in an open loop scenario.

    Of course, I experimented with various settings not only these. I was not able to find a settings, which works. 

    in Lab 05 : after ramp up during identification process, the motor stops. 

    PLEASE!!!! provide some insight, so I can DEBUG not GUESS. Can I record some variables via PWMDAC or DAC128S085 and show them to you?

    Which one?

    Johannes

  • The identification parameters above are just for your reference. It's difficult to tell you that the right parameters without observing the motor running state. No any variables can be monitored to show that how to tune these parameters, you have to TUNE these parameters according to the running state if you make sure that the motor is a PMSM motor, ensure that the motor can run smoothly during the identification process. Please go ahead and try some other parameters since your motor is so small and it's very sensitive to the parameters.

  • thank you, I will continue trying. 
    Can you please explain, what the estimator is doing after step EST_STATE_RAMPUP ? 
    If I could understand, a little bit of the motor identification algorithm, it would be much easier to understand, which parameter causes the motor to stop.

    As the motor is very small, it has a very bad relation of  inertia over friction. If the algorithm is trying to free spin the motor after ramp up, it might cause the motor to stop. 

    Is there a way to observe the algorithm, find an error code, which helps me, identifying, on which step the detection algorithm is failing and why?

    Johannes

  • You may take a look at Chapter 6 of InstaSPIN-FOC and InstaSPIN-MOTION User's Guide that has a detailed description of motor identification.

    https://www.ti.com/lit/ug/spruhj1i/spruhj1i.pdf

    During the EST_STATE_RAMPUP state and the following states EST_STATE_RATEDFLUX, the motor runs with current closed-loop and position open-loop, the rotor angle is generated according to the setting frequency (USER_MOTOR_FLUX_EXC_FREQ_Hz). The rated flux will be identified in these two states. So you need to set the right USER_MOTOR_IND_EST_CURRENT_A  and USER_MOTOR_FLUX_EXC_FREQ_Hz  according to the motor, and make the motor run smoothly to/at the setting frequency.

    You can try to tune the control bandwidth and default inertia as below marked RED to change the gains of PI controllers for identification. Maybe, the default parameters are not good for your motor since the motor is too small. 

    pUserParams->BWc_rps = MATH_TWO_PI * (float32_t)100.0;
    pUserParams->BWdelta = (float32_t)8.0;


    pUserParams->Kctrl_Wb_p_kgm2 = (float32_t)3.0 *
    pUserParams->motor_numPolePairs *
    (float32_t)(0.001) /
    (float32_t)(2.0 * 0.000001);

  • I will try that. Thank you. 

  • OK. Keep tuning these parameters mentioned above till the motor can run smoothly. Let's know and close this thread first if you have any further questions.

  • Hello Yanming
    I played with the Iq Id PI-Regulators to make my motor run smoothly before I try to do a motor identification. The result is quite poor. 
    Problem: our motor seems to be not very symmetrical. The motor is so small, that it is difficult to manufacture it with high symmetry an perfect magnetization. 

    I am using Lab03 (open loop hardware test) I outputted some measured values through DAC128S05 to see, how good PARK output Iq is. 
    I outputted: 
    - angle (angle generator) (yellow)
    - measured Voltage on one motor line (blue)
    - Clark output Ia (green)
    - output of the PARK module (Iq) (by software PARK module, not via estimator) (red)

    The park output should be a flat line. The motor is running at a constant speed driven from the angle generator only.

    As you can see, Iq is not a flat line. the measured current is not a "nice" sine wave. 

    If I try to run the Id iq PI-regulator in this, the regulator easily gets unstable. 
    What can I do to ?

    Maybe this is a stupid question: is this wobbly Iq measurement because, the motor has a salient characteristic? So this would be an effect because of largely different Ld and Lq ? 

    If so, by knowing Ld and Lq, would the estimator cancel this out?  

    Meanwhile, to check, if the motor has different friction during one rotation, I will add some inertia. If the iq measurement flattens out, it is a mechanical issue. (but it doesn't help me either, because it is an inherent characteristic of our motors) 

    Johannes

  • No, you can't eliminate the ripple, just reduce the ripple amplitude if the current and voltage sampling signals have a good resolution and the motor parameters have much exact value. And tuning the gains of speed and current PI controller also improves the performance of the torque output.

    Maybe this is a stupid question: is this wobbly Iq measurement because, the motor has a salient characteristic? So this would be an effect because of largely different Ld and Lq ? 

    Yes, you may set the Ld and Lq value if you know these parameters, not use the identified Ls. The motor identification of the FAST only support SPMSM to identify the Ls (Ld=Lq).