How to choose the SimpleFOC mode for the application of three-axis gimbal

Hi, @Antun_Skuric!

Thank you for your reply!

I have tried several sets of PID parameters. I input the target angle in the serial port, and SimpleFOC can quickly reach the target position. But when I joined the blue pill to control the gimbal, the rotation of the motor could not keep up with the movement speed of the gimbal. This makes it look very lagging.

In addition, in order to improve the accuracy, I tried to use the 14-bit AS5048A magnetic encoder. I run the example code of magnetic_sensor_spi_example. It uses

Serial.println(sensor.getVelocity())

to get the speed.But I found that the speed noise is relatively large, and I don’t know if this is normal. It looks like this:

I use AS5600 to run the same code, and its noise seems to be smaller than AS5048A. The resulting image looks like this:

Your suggestion of using the angular velocity data of the gyro as the speed feedback of the motor is great! But I have some problems. The gyro measures the angular velocity relative to its own coordinate system, not the speed of the motor. I don’t know if it is right that the gimbal is usually in a horizontal position, so the coordinate axis of the IMU and the axis of the gimbal are parallel at this time, so the angular velocity of the gyro can approximately replace the speed of the motor?

Thanks again for your help.