# Trying to close the velocity loop sensorless

**URL:** https://community.simplefoc.com/t/trying-to-close-the-velocity-loop-sensorless/7816
**Category:** applications
**Created:** [November 17, 2025, 11:35pm UTC](https://community.simplefoc.com/t/trying-to-close-the-velocity-loop-sensorless/7816 "2025-11-17T23:35:11Z")
**Posts on this page:** 1
**Showing post:** 22

<div class="post-metadata">

### Author: ![dekutree64](https://community.simplefoc.com/user_avatar/community.simplefoc.com/dekutree64/32/3398_2.png) [@dekutree64](https://community.simplefoc.com/u/dekutree64)
#### Post date: [December 1, 2025, 12:08pm UTC](https://community.simplefoc.com/t/trying-to-close-the-velocity-loop-sensorless/7816/22 "2025-12-01T12:08:12Z")

</div>

zero\_electric\_angle should always be 0 for the sensorless observer.

I’ve tried velocity mode with it before and got a bit of wobble in the velocity. I didn’t mess with it for very long, and changed to torque mode with voltage\_limit acting as a speed setting (no good for a record player). I normally set I to about 10x P and D=0, so next time I’ll try I=0 and see how it goes.

One possibility would be to use closed-loop angle mode and step the target similar to how open-loop velocity does it. I think observer tracks full rotations, so angle mode will probably work. It will go wonky if you keep spinning long enough due to floating point precision, and there’s currently no solution for it, but I wrote a proposal here a while back [https://github.com/simplefoc/Arduino-FOC/issues/302](https://github.com/simplefoc/Arduino-FOC/issues/302)

It will probably work better if you use the experimental [angle\_nocascade](https://github.com/simplefoc/Arduino-FOC/pull/384) mode to bypass the velocity PID entirely. It requires so little modification, I find it easier to edit my local SimpleFOC source rather than trying to merge it from github. Just add the enum for it in FOCMotor.h, and copy the code in BLDCMotor::move. All it does is replace the velocity PID code with `current_sp = P_angle(shaft_angle_sp - shaft_angle);` if controller is nocascade. The stuff in BLDCMotor::init is non-essential. You can set P\_Angle.limit in your setup function (after calling motor.init, else it will be overwritten) to get the same effect.

The PID values for it are totally different than anything else I’ve encountered. Usually velocity P is around 0.05-0.2 and I around 1-10, and angle P around 10-20 and angle I=0. But in nocascade mode, angle P=100 and I=10000.

Just now I tried playing with angle D as well, and for once it actually helps rather than causing chaos. I have it set to 0.25 (I guess than means I should try values like 0.00025 with regular velocity mode), and it smooths out the motion when doing this angle stepping pseudo-velocity mode, so it should be good for your record player. You can reduce P and I to smooth it more. It results in slower response to disturbances, but that’s not an issue in your case. I’m tuning steppers for a CNC machine, so I want very precise positioning and fast response to step/dir signals.

---

_[View the full topic](https://community.simplefoc.com/t/trying-to-close-the-velocity-loop-sensorless/7816)._
