GM4108H-120T Gimbal Motor Needs a kick to start

Hi,
I’m trying to implement position control with my Arduino Due. I’m using a GM4108H-120T gimbal motor together with an AS5048 encoder.
The code is working in theory, but in practice, the motor usually needs a slight push to start moving.
I’ve already tried adjusting the PI controller values, but nothing seems to help.

Do you have any suggestions on how to fix this issue?

Thanks in advance!

#include <Arduino.h>
#include <SimpleFOC.h>

// Konstanten
const double zweiPi = 2 * 3.14159265359;

// Motor-Setup
BLDCMotor motor = BLDCMotor(11); // 11 Polpaare

// Treiber-Setup
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 5, 6, 8); // PWM Pins A, B, C, EN

// Sensor (AS5048 über SPI)
MagneticSensorSPI sensor = MagneticSensorSPI(AS5048_SPI, 10); // CS Pin = 10

// Optional: Inline-Strommessung (falls verwendet)
InlineCurrentSense current_sense = InlineCurrentSense(0.01f, 50.0f, A0, A2, A1);

// Zielwinkel-Variable
float target_angle = 0;

// Commander-Schnittstelle
Commander command = Commander(Serial);
void onTarget(char* cmd) { command.scalar(&target_angle, cmd); }

void setup() {
// Serial Monitoring
Serial.begin(115200);
while (!Serial); // warte bis Serial bereit

// Sensor initialisieren
sensor.init();
motor.linkSensor(&sensor);

// Treiber initialisieren
driver.voltage_power_supply = 24;
driver.init();
motor.linkDriver(&driver);

// Optional: Current Sensing
current_sense.init();
current_sense.linkDriver(&driver);
motor.linkCurrentSense(&current_sense);

// Steuerungsmodus: Positionsregelung
motor.controller = MotionControlType::angle;

// PID-Parameter für Geschwindigkeitsregelung
motor.PID_velocity.P = 0.2;
motor.PID_velocity.I = 20.0;
motor.PID_velocity.output_ramp = 1000;
motor.LPF_velocity.Tf = 0.02;

// PID für Positionsregelung
motor.P_angle.P = 15.0;
motor.velocity_limit = 4.0; // rad/s
motor.voltage_limit = 12.0; // V

// Initialisieren
motor.init();
motor.initFOC();

// Commander-Befehl hinzufügen
command.add(‘T’, onTarget, “target angle”);

Serial.println(“Motor bereit.”);
Serial.println(“Zielwinkel setzen über Terminal oder Poti.”);
}

void loop() {
// Poti auslesen (optional)
int potiWert = analogRead(A7);
float potiRad = potiWert * zweiPi / 1023.0;
target_angle = potiRad;

// FOC Schleife
motor.loopFOC();

// Zielwinkel setzen
motor.move(target_angle);

// Terminal-Befehle auswerten
command.run();
}