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.

Wrong speed

Hi,

I've identified my motor with lab02b and I'm able to spin it with the speed entered in the speedref_krpm textfield. I've verified the speed with an external tachometer. However, if I use my own code (dervied from lab02b) and change the value of SpeedRef_krpm to 0.3 (Q-Value(24)) in CCS, the measured speed is only approx. 250 RPM instead of 300 RPM with the universal gui. I don't find a reason for this, does anyone have guess for the cause of this difference?

Thank you,

Carsten

  • how many poles is your machine? need to talk in terms of Hz and not RPM.
    It could be getting into the "noisy" low speed area where you can maintain control but the estimates start to drift.
    Or you could just have bad current resolution...try loading the motor as a start. If you aren't using much of the current range try different HW scaling.
    Or you may not have the speed loop tuned well, try increasing the gains.
    Or you may need to run RsOnline (lab 7) to keep the Rs measurements updated.
  • Thank you for your answer.
    - 14 poles / 7 pole pairs
    - The speed (5 Hz, 0,3 kRPM) is not the problem, the estimate and the speed remain constant with the lab02b and with my code too, but the desired speed (=estimated speed) with my code is too small in comparison with the measurement
    - I've used the same speed parameters in both versions
    - I'm using the RsOnline function already
  • 300 RPM with 14 poles = 35 Hz
    What is the flux of this machine?

    I would suspect you would not see much speed error at this frequency. Is the Estimated Speed holding steady at 300 RPM or jumping around?

    Is ForceAngle disabled?

    you can attach your user.h if you wish
  • Hello Chris,

    I'm writing about the motor roation frequency 300 RPM = 300/(60s)=5 Hz. With the lab02b ( with universal gui), the estimated speed stays at 300 +/- 1 RPM and is equal to the measured speed. Same behaviour with the lab code and CCS debugging. But with my own code and CCS debugging, I'm entering the same value for speed (SpeedRef_krpm=0.3) and the estimated speed is equal to this speed, but my measured speed is slower (approx. 250 RPM). I'm using the same user.h, so I don't think that the reason is in there, but I've attached it.

    Thank you for your help,

    Carsten

    5001.user.h

  • 300 RPM * 14 poles / 120 = 35 Hz, not 5 Hz.

    Before you enable the drive are you enabling the RsRecal and Offset flags?

    Or perhaps your settings for RsOnline are not correct...that seems to be where the issue would be since lab02b is reporting the same speed as your tach.


    regarding your user.h I don't like what you've done with the TICKS.
    You've chosen 32 KHz PWM with a PWM_TICKS of (3)

    This ends up setting 32/3 = 10.666 KHz rate to the control system. I recommend choosing something where the factor is an integer.

    So if you think 32 KHz is close, try (33) and (3), setting 11 KHz control rate.
    You can then update the SPEED_TICKS and TRAJ_TICKS to (11) setting them at a 1 KHz effective.

    based on the Rs and Ls values for your motor you should probably be using proj_lab02c to do the motor ID.
    I would also increase this to at least (50.0)
    USER_MOTOR_FLUX_EST_FREQ_Hz (15.0)

    Also based on these values I have a doubt that (600) is really the max frequency of this motor. With your 14 poles that is just over 5 KRPM. Based on the flux I suspect this motor is built to run > 1.2 KHz


    Can you tell me more about the motor?
  • Hello Chris,

    thank you for taking a look and the valuable feedback.

    I've started with the lab and copied my changed code (mainly button interaction and UART communication) step for step into it to search for the reason of the different speed. After this, the speed is still correct with the modified lab function. So I've solved this issue without finding the reason, maybe I've changed something in the included driver functions, which I have copied to my new project (I haven't compared them until now), without remebering it.

    Will I get other (better?) parameters with the lab02c code even if the motor spins OK (I think) after identifcation with lab02b?

    The datasheet of the motor indicates a value of 366 RPM/V (-> 24V * 366RPM/V = 8784 RPM) and I'm using it with a maximal motor frequency of approx. 80 Hz (=4800 RPM). Therefore I thought of a vlaue for USER_IQ_FULL_SCALE_FREQ_Hz of > (4800 * 14) /120 = 560, should I choose another value in this case?

    The max. current for the motor is 60A. Are there other technical details of the motor that are interesting and I can search for?

    Best regards,

    Carsten

  • "Will I get other (better?) parameters with the lab02c code even if the motor spins OK (I think) after identifcation with lab02b?"
    I would run proj_lab02c a few times with my recommended changes to see how the inductance changes. There is no "one right" inductance, but using this method should get you the best value to use.

    8784 RPM * 14 poles / 120 = 1024.8 Hz.
    4800 RPM * 14 poles / 120 = 560 Hz

    I would set
    USER_IQ_FULL_SCALE_FREQUENCY_Hz (1200.0)

    Since your motor is low inductance and high speed, my recommendation is to move the PWM_FREQUENCY back to the default (45.0), with the PWM_TICKS set to (3), and TRAJ and SPEED_TICKS back to (15). All others to (1)
  • Thank you for your answer, I will try this tomorrow and report back here.

    I think there is a misunderstanding regarding the unit Hz for the roational speed of the motor? How do you call this speed?
    60 RPM = 60 rounds per minute = 60/60 rounds per second = 1 s^(-1) = 1 Hz
  • RPM is a mechanical speed, what you see the rotor rotating at.
    Frequency (in Hz) is an electrical speed, the frequency of the current being drawn

    the relationship between the two is as I have stated
    RPM = Frequency_Hz * 120 / motor_poles
  • So I've used the wrong terminology until now...

    Is this calculation the source for that formula?

    electrical frequency = RPM * (motor_poles / 2 poles_per_polepair) * 1/(60 seconds)

    I've reidentified the motor with the lab02c, there is not much difference in the resulting values, but I will use these from now on:

    #define I_A_offset (0.85382080) // <-lab02c; lab02b:(0.85525328)

    #define I_B_offset (0.84649169) // <-lab02c; lab02b:(0.84734380)

    #define I_C_offset (0.84000635) // <-lab02c; lab02b:(0.84058631)

    #define V_A_offset (0.505603254) // <-lab02c; lab02b:(0.507268012)

    #define V_B_offset (0.504233122) // <-lab02c; lab02b:(0.506024361)

    #define V_C_offset (0.504376829) // <-lab02c; lab02b:(0.506124198)

    #define USER_MOTOR_Rs (0.02208750) // <- lab02c; lab02b:(0.02033904)

    #define USER_MOTOR_Ls_d (0.00001910) // <- lab02c; lab02b:(0.00001560)

    #define USER_MOTOR_Ls_q (0.00001910) // <- lab02c; lab02b:(0.00001560)

    #define USER_MOTOR_RATED_FLUX (0.02775378) // <- lab02c; lab02b:(0.02765200)

     

    Thanks again for you assistance,

    Carsten

  • yes, this states the same thing.
    electrical frequency = RPM * (motor_poles / 2 poles_per_polepair) * 1/(60 seconds)