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.

Instaspin and PMSM. Peak current and other topics.

Hi,

 

Working with my own HW, a PMSM motor (attached user.h) and InstaSpin-FOC, I’m getting a strange behavior sometimes, so in the same environment I observe different feebacks. I’ll try to explain although it’s a little bit difficult.

The scenario is as follow:

  • The goal is to move a mass of 30kg, from 0 rpm up to 400 rpm, first of all in one direction and after that in the other direction, in a distance of 800mm.
  • The movement is repetitive.
  • The initial and final positions are always the same.
  • My system is sensorless.

I found two problems:

PROBLEM 1

In both directions, at the very beginning of the movement, sometimes the motor can’t start to spin softly. As you can see in the second picture, there is a current peak so high, as opposed to the first picture where the movement is really soft and any peak is found in current wave.

In this situation, I try to change the speed from 0 to 10rpm in a short distance (about 43mm), and the speed controller and accelerations are as follow:

gMotorVars.MaxAccel_krpmps=_IQ(0.06);

gMotorVars.Kp_spd = _IQ(7);                 

gMotorVars.Ki_spd = _IQ(0.1);

I know in the document Spruhj1f, chapter 14, some recommendations are explained in order to improve the motor startups, so now stator Rs recalibration is enabled as well the forced angle (never disabled), but the problem is not solved in any case.

I guess this issue could be related with the speed controller, but I would like to know an expert opinion.

PROBLEM 2

After some cycles (not always the same number) and when the mass should be accelerating, it can’t follow the speed reference and the movement is so “dirty”. As you can see in last picture, the current wave is really weird, like in a resonance. To solve this, I tried different few changes without a success result:

  1. Check the user.h according to my HW so I thought the current could be saturating.
  2. I reduced the acceleration.
  3. Reset the integral start value in the PID controller when the speed reference is 0rpm.

In this case, the parameters are as follows:

gMotorVars.MaxAccel_krpmps=_IQ(0.7);

gMotorVars.Kp_spd = _IQ(3.9);                             

gMotorVars.Ki_spd = _IQ(0.043);

Let me say that when this happens once, the problem frequency is higher or even the oscillation occurs in every movement, as if some controller part would be adding any type of error.  Besides this, if I reduce the load, the problems never happen.

And nothing more, I hope my explanation was sufficiently clear and easily comprehensible.

Many thanks  in advance.

   3365.user.h

  • Hi Masky,

    Your post is being moved to the InstaSPIN forum for better support.
  • You can try disable force angle, and enable Rs re-calcualtion. Meanwhile, you can increase Kp&Ki for speed and Iq.
    What's the rated current, speed, torque of your motor? How many torque need for a mass of 30kg to startup?
  • I disabled force angle but the motor didn't spin, so now the force angle is enabled only at low speed (up to 80 rpm) and disabled in all other cases.

    The Rs re-calculation was always enabled.

    Regarding PI tuning I tried different situations and the result was not really good:

    1.- Increase Kp_spd and Ki_spd...the problem 2 happens even before.

    2.- Decrease Kp_spd and Ki_spd...the problem 1 was a little bit mitigate but problem 2 is still happening.

    3.- Increase Kp_iq...nothing change.

    I noticed one thing. In the problem 2, the current resonance always reaches 6A and never less or more, and the torque is around 1Nm (see picture below), as if the controller couldn’t give more current. I increased USE_MOTOR_MAX_CURRENT from 6.0 to 8.0, but nothing change.

    Finally, the motor specifications:

    • Rated speed 600 rpm.
    • Rated torque 0.5Nm. Peak torque 1.5Nm without saturation.
    • Torque to move a mass of 40Kg (plus frictions so the motor moves a door). This graph is in a normal operation, without problems 1 and 2.

    Thanks in advance.

  • Hi,

    besides this, I noticed in some cases the stator resistance calculation is wrong. Normally, the value returned by EST_getRs_Ohm  and EST_getRsOnLine_Ohm is between 2.2 and 2.5 ohms, but suddenly, Rs and RsOnline is more than 5 ohms!!! I have checked that:

    1.- When the Rs estimation is wrong, If I restart the program the Rs estimation is ok again.

    2.- When the Rs estimation is wrong, the motor can’t spin so the torque is more than the maximum allowed, around 1Nm (below the motor current along some attends to move).

    3.- The problem shows up after some minutes, when the motor is not cold.

    4.- I measured the stator resistance and it’s between 2,3 ohms.

  • Sorry, any idea???
  • 1. Don't need to use Rs_online function if the motor is not working in a long time with a directory.
    2. Use Rs recalculation to get more exact resistance before motor startup, the exact Rs can improve startup performance.
  • Hi,

    regarding to your answer:

    1.- The motor is almost the time spinning, so the Rs online calculation is always enabled.

    2.- The Rs recalculation is always enabled.

    So, is this ok? And what about the other problems???

    Thank you in advance.

  • When the Rs estimation is wrong, If Flag_enableSys and Flag_Run_Identify are set to 0 and then to 1, the Rs value is ok again. Even when I get the current problem, if these flags are reset, the system behaviour is improved.

    Please, tell me if I should open different post for different problems. Any help would be appreciate.

  • Please, could you say me anything? Any help will be appreciate. Many thanks.
  • Hi Masky,

    Reset both Flag_enableSys and Flag_Run_Identify to 0, will use the motor parameters in user.h.
    1. Only enable enable RsRecalc, and disable RsOnline.
    2. Generally, sensorless is difficult to work well with very low speed, so enable force angle to pass low speed range quickly, don't run motor in low speed with high load.