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.

Problems with Lab2a post-identification and Lab3a

Other Parts Discussed in Thread: DRV8301, BOOSTXL-DRV8301

Dear Sir/Madam,

I have problems to run lab2a properly with a PMSM motor. Identification is made with no error (there is some difference between the datasheet and the identified parameters):

Datasheet (Maxon 452741)

R = 1.08ohm

L = 2.2mH

Kt = 0.27N/A -> Rated flux = 0.09

From identification:

Rr = 0.29

Lsd = Lsq 0.0012

Rated Flux: 0.057

Once the identification has been completed I have run the speed controller, but motor has started to vibrate. 

I have also run the lab3a with motor datasheet parameters, but control performance has been the same.

During lab 2a, the identification has been made quite softly (The motor spins Ok during Ls and Rated flux identification) so I suppose the hardware (DRV8301 board) is OK.

If motor parameters are known beforehand, what parameter should be revised to ensure a correct speed control?

User.h params has been completed using the .xls example file. Please, found attached both files.

Thank you in advance

  • speed control needs to be manually tuned by the user. there are no motor parameter settings that can be used to calculate the tuning.

    the speed loop tuning is discussed in proj_lab05b. There are some calculations included in that lab if you know the inertia of the motor.

    I find it just as easy to tune by hand. For most of these small motors (although yours isn't particularly high speed) you usually need to reduce the default speed Kp and Ki by about a factor of /10. I would start there and then increase to reach better control stability. Also remember that at lower speeds you may need larger gains but as you increase the speed command these gains may be too large so you will need to reduce.

    regarding the parameters ID'd vs. the datasheet; most datasheet values are shown line-line. The parameters we ID are line-neutral in a delta configuration. Also, there is no single "correct" Ls value. It varies with frequency and current/load. The Rs value you got is a bit lower than I would expect, but it is likely accurate for your specific motor at the temperature you are running.

    how did you calculate the rated flux to 0.09?

    you can attach your user.h file if you like and I will check it for any issues.
  • Dear Chris,

    I will run the Lab5 to tune the speed control. I Thought that once the identification had been done the pre-tuned control was always stable (not my case).

    Rated Flux = 2*pi/1.5*Kt/PolePairs

    Please find attached the .h

    Thank you in advance

    Borja

    motorware_MAXON_452741.xlsx

    0250.user.h

  • "I Thought that once the identification had been done the pre-tuned control was always stable (not my case)."
    No, the motor parameter ID process only identifies Rs, Ls, and Flux which are required for the FAST estimator and are used to set the current loop tuning. There is no information extracted to be able to tune the speed loop (you would need at least intertia). we set initial speed Kp/Ki values based ONLY on USER_MOTOR_MAX_CURRENT, IQ_CURRENT, and MAX_FREQUENCY.

    some user.h comments

    #define USER_IQ_FULL_SCALE_FREQ_Hz (220.0)
    this is pretty low. I see in your spreadsheet you think you will only run to 1KRPM/200 Hz. Really? Regardless, you don't get any benefit by lowering this value so personally I would set it in the 400 - 800 range.

    If you are happy with your 10 KHz PWM rate I would update these to (10) so that you have an effective 1 KHz speed/trajectory rate
    #define USER_NUM_CTRL_TICKS_PER_SPEED_TICK (10)
    #define USER_NUM_CTRL_TICKS_PER_TRAJ_TICK (10)

    minor, but please update this, it should have a factor of 2.0 to keep the rotational frequency above the limit frequency
    #define USER_FORCE_ANGLE_FREQ_Hz (2.0* USER_ZEROSPEEDLIMIT * USER_IQ_FULL_SCALE_FREQ_Hz)

    I'd keep this at 20 Hz. You want a higher speed when looking at the flux and Ls during identify.
    #define USER_MOTOR_FLUX_EST_FREQ_Hz (12.0)


    do you have a link to the datasheet? I'm not able to find through google.
  • Dear Chris,

    I have made the .h modifications and the control performance has been the same. In our app the motor does not have to run at high speed (always below 500rpm).

    Please find attached both .h file and motor datasheet.

    Thank you in advance

    Borja.

    7411.user.hEC90fl+long_452741-motor+Data.pdf

  • Borja,

    the suggestions I made were minor and won't have any impact on the performance.

    1. we need to make sure the motor parameters you are using are correct.

    in the user.h file you attached it looks like you have just entered the values from the datasheet. This is not correct. Please use the values from motor ID.

    according to the speed constant of 35.4 RPM, with 24 poles (are you sure of this?) that translates to 0.14 V/Hz.  So for 24V that gives you a max frequency of 171 Hz =  857 RPM.  Now, you can't always calculate this directly, but it's in the same range as your 0.094 value in user.h  But in your first post you have 0.057.  These are very different values.  And this is a measurement which should be very consistent as long as the HW is good.  So this has me a bit worried.

    2. once we know you are using good motor parameters it comes to tuning the speed controller.

    you can check that the current controllers are well tuned by running proj_lab05a. This is torque mode only with no speed loop. You will enter an direct Iq_Ref_A value. With no load the motor should reach ~650 RPM or so (in this lab you are not using full modulation so you won't reach absolute max speed) and be stable.  If so, you can move to 5b and work on tuning the speed loop.  For most small hobby motors you need to reduce the speed Kp and Ki values by factors of 5 or 10. But this motor is quite different. You may need to INCREASE the speed Kp and Ki values.

  • Dear Christ

    Using identified params lab3 works OK. The dynamic response is not good, but it is stable. The

    according to the speed constant of 35.4 RPM, with 24 poles (are you sure of this? According to Datasheet the motor has 24 polesthat translates to 0.14 V/Hz.  So for 24V that gives you a max frequency of 171 Hz =  857 RPM.  Now, you can't always calculate this directly, but it's in the same range as your 0.094 value in user.h  But in your first post you have 0.057.  These are very different values.  And this is a measurement which should be very consistent as long as the HW is good.  So this has me a bit worried.

    There is a non expecting offset value during the offset measurement

    #define I_A_offset (0.9936615229)
    #define I_B_offset (0.9968560934)
    #define I_C_offset (0.99804461)

    #define V_A_offset (1.31616056)
    //#define V_A_offset (0.5020679235)
    #define V_B_offset (0.4939085841)
    #define V_C_offset (0.4949371219)

    Va offset differs from the expected value. I do not really know what is the influence of this parameter during the identification process

    you can check that the current controllers are well tuned by running proj_lab05a. This is torque mode only with no speed loop. You will enter an direct Iq_Ref_A value. With no load the motor should reach ~650 RPM or so (in this lab you are not using full modulation so you won't reach absolute max speed) and be stable.  If so, you can move to 5b and work on tuning the speed loop.  For most small hobby motors you need to reduce the speed Kp and Ki values by factors of 5 or 10. But this motor is quite different. You may need to INCREASE the speed Kp and Ki values.

    I have run lab5a and 5b and doing the theoric calculations i do not obtain a stable speed controller. Please find below the calculations made to calculate the speed controller's gains:

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    %% Motor Parameters (MAXON 452741)
    Ls = 0.000403361; % Stator Inductance in H
    Rs = 0.2946038; % Stator Resistance in ohm
    Ke = 35.4; % Speed Constant [rpm/V]
    P = 24; % Rotor Poles
    J = 5060; % gcm2

    %% Controller parameters
    Fs = 10e3; % Sampling Frequency in Hz
    Ts = 1/Fs; % Sampling Period in s
    Fsv = Fs/10; % Speed controller sampling frecuency in Hz
    Tsv = 1/Fsv; % Speed controller sampling period in s
    BWc = 2*pi*Fs/20; % Current bandwidth: 20 times lower than the Fs

    Velfs = 440.0; % Full Scale Frecuency in Hz
    Ifs = 41.25; % Full scale current in A
    Vfs = 24; % Full scale voltage in V

    Df = 4; % Damping Factor
    tsf = 100; % Speed filter pole in rad/s


    %% Conversions
    Ke = Ke*(1/60); % from [RPM/V to Hz/V]
    % This Ke is similar to Rated flux identified 
    Ke = 2*pi*Ke; % From [Hz/V to rad/Vs]
    Ke = 1/Ke; % Convert to Vs/rad

    J = J/1000; % From gcm2 to Kgcm2
    J = J/10000; % From kgcm2 to Kgm2

    %% Controller's gain calculation

    Kpseries = BWc*Ls; % Integral gain of the current controller

    if (Kpseries < (10*Ls/(Df*tsf)))
    f = errordlg('Kpseries should be Higher', 'Error Dialog', 'modal');
    elseif (Kpseries > (2*pi*Ls/(10*Ts)))
    f = errordlg('Kpseries should be Lower', 'Error Dialog', 'modal');
    end

    Kiseries = Rs/Ls; % Propotional gain of the current controller

    spdKiseries = 1/(Df*Df*(1/tsf));

    K = 3*P*Ke/(4*J);

    spdKpseries = 1/(Df*K*(1/tsf));

    % Convert from series to parallel mode
    spdKpparallel = spdKpseries;
    spdKiparallel = spdKiseries*spdKpparallel;

    % Convert to PU
    spdKipu = spdKiparallel*Tsv*((4*pi*Velfs)/(Ifs*P))
    curKipu = Kiseries*Ts
    spdKppu = spdKpparallel*((4*pi*Velfs)/(Ifs*P))
    curKppu = Kpseries*(Ifs/Vfs)

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    I have reprogrammed the PI's gains with the following values

    spdKipu = 9.094048450312396e-05

    curKipu = 0.073037254469322

    spdKppu = 0.014550477520500

    curKppu = 2.177993046529837

    Using this parameters the controller is not stable

    Ke is directly related with Rated flux. What Ke should be used? The one that comes from datasheet or the identified Ke (from identified Rated flux)?

    Using identified Ke (0.055) the controller is stable, but the dynamic response is not the expected one. In fact, the calculated gains are quite similar to the default controller's gains.

     

    spdKipu = 0.002802480262038 (0.006399929523)

    curKipu = 0.073037254469322 (0.073037254469322)

    spdKppu = 0.448396841926035 (0.6399998665)

    curKppu = 2.177993046529837 (2.177993046529837)

     

    But this motor is quite different. You may need to INCREASE the speed Kp and Ki values.

    Probably I have made something wrong during gains calculation because the gains I have obtained are smaller than the default gains.

    Thank you in advance,

    Borja

  • #define V_A_offset (1.31616056)

    there is a hardware problem. The 3 channels need to be very similar in value.  I believe something has been damaged on your voltage sensing circuit for the A channel. You can try replacing the C/R on the board, or you may just want to get another BOOSTXL-DRV8301.  This happens very rarely, but I have seen one damaged like this once before.

    let's first solve this problem.

    regarding speed loop tuning, this is not so straight forward I agree.