Angle position vibration

Hi,

last year I gave a try to simpleFOC without that much success.

I started again very recently, and now I succeeded to get a system working made of a rather standard arrangement: a high current motor, a DRV8302 driver, a SPI magnetic sensor (AS5048A), and an pi pico board.

So far, so good, I got everything working : open-loop, closed-loop: torque, velocity and position :smile:

Everything is nice so far, except that I did not succeeded in eliminating vibrations on close-loop angle mode. I used low pass filter, and I lowered the P velocity gain, which greatly helped.

But I still get a bit of vibration which cause a permanent current of approx .2 A to be injected in the motor. Which of course makes it heat, etc.

Any idea ?

My current parameters set:

// controller configuration based on the control type
motor().PID_velocity.P = 0.08; // default value: 0.5
motor().PID_velocity.I = 10;  // default value: 10

// velocity low pass filtering time constant
motor().LPF_velocity.Tf = 0.01;
motor().LPF_angle.Tf = 0.01;

// angle loop controller
motor().P_angle.P = 10; // default value: 20.

Have you tried different motors?
Can you share details on the motor that you have ?

Last time I had a stuttering motor, I had issues with manufacturing placement of the position sensor. How does the motor run open loop?

I also got vibration if loop() is too slow, for example because of doing other intensive processing, or slow/blocking i/o

What is your pole count and what mechanical and electrical frequency are you running?

What uC are you using and what is your sampling rate ?

I don’t know what the general thoughts of this group are, but I typically run the motor controller portion on one uC or core and run any other logical on a separate Uc to ensure fast sampling speed. Shooting for 2x or more electrical rpm.

Try placing this in your main loop and see if it helps

  // Don't try to stop between cogging steps
  if (motor.controller == MotionControlType::angle) {
    const float c = _PI_3/motor.pole_pairs;
    target = floor(target / c + 0.5f) * c;
  }

Some motors really fight to resist holding position between cogging steps, and the best the PID can do is oscillate back and forth around the target.