Position control with AS5047 and SimpleFOCShield v.3.2

Good day everyone!

I’m trying to get SimpleFOC up and running using an Arduino Uno and the SimpleFOCShied ver.3.2 board. I’ve connected a Faulhaber BLDC motor to the board, with a magnet attached to its axis. I’m using an AS5047U magnetic sensor connected via SPI as a sensor. The sensor readings are accurate; I’ve verified them with another library and a logic analyzer connected via SPI.
When using the motion_control->open_loop_motor_control->open_loop_velocity_example example, the motor rotates, I can change the speed, and I see a response. The current consumption is negligible.

The motion_control->open_loop_motor_control->open_loop_position_example example also works well; the motor rotates to the position I specify.

But if I want to use position control using a sensor and the example motion_control->position_motion_control->magnetic_sensor->angle_control, the BLDC motor just twitches in place, without moving. The current increases significantly. Here’s the output I see in the terminal:

MOT: Monitor enabled!
MOT: Init
MOT: Enable driver.
MOT: Align sensor.
MOT: sensor_direction==CW
MOT: PP check: OK!
MOT: Zero elec. angle: 5.30
MOT: No current sense.
MOT: Ready.
Motor ready.
Set the target angle using serial terminal:

What’s happening with my motor and why isn’t it working?

Probably just PID tuning. Get velocity mode working first, then switch to angle.