Estimated_current and velocity mode: high current at standstill

When I use that setup and velocity is zero, the motor still wants to position itself “on the cogging point”. Which means there is a significant Iq of ~340mA at standstill, result of a nonzero Vq.
The sign of the current changes when I manually move the motor “over the hump”.
I tried that mode with digital and linear halls, but it doesn’t make a difference.

Can I set Vq to zero, when velocity/motor.target is zero? I would rather like to understand what’s the cause.

1 Answer

1
  // 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;
  }

If I were in angle mode, that would be my solution, but I don't see how it helps in velocity mode?