Hi community,
First I want to say, thank you for being so awesome. The library is a great project and it’s amazing to see the involvement of everyone here on the forum.
I’ve been fidgeting with simplefoc, with different drivers, controllers, sensors and both BLDCs and stepper motors. And even though I get my motors to spin and get pretty good torque out of them, there are some aspects of which I’m not sure if it’s going as well as it should. Some of the main things being that the max rpm I’m getting is a bit lower than expected, and that the movement of the motors often doesn’t seem very smooth.
First off, my current setup:
- Raspberry Pi Pico controller
- Drivers : BTS7960B
- Angle sensor: AS5600
- Motor: cheap 14pole 360KV 5010 bldc from Ali-express
- Current sensors: 2 x ACS712 hall sensor
- powered from 2 li-ion cells (~7.4V)
I’m currently testing with voltage control mode. I’ve also gotten both of the current sense modes to work, but results were not necessarily better.
With this setup (and basically any other I’ve tried with the same motor), it seems that there is an ‘invisible wall’ to get the motor to spin at more than ~100 rad/s in closed loop velocity control or about 150 rad/s in closed loop torque control mode. Raising values above that just makes the motor more noisy, draw a lot more current and make rad/s more unstable or even go down.
In open loop velocity mode I can get it to around 200 rad/s, by manually stepping up both the target velocity and current limit. I haven’t tried to go above that as the sweet spot for the current limit becomes smaller and smaller, so it just becomes tedious.
I don’t think the limitation is the speed of the controller; my main loop runs at a fixed 2.5 kHz (both move and foc) I’ve read at other posts here that foc should work well with at least 4 loop iterations per pole pair (or was that per pole, so 8 per pair?), meaning that purely from that aspect I think I should be able to reach ~560 rad/s (2500hz / 7pp /4 its/pp * 2 * pi), so that’s quite a way to go from 100 or 150.
I think one issue I have is that the magnet is not perfectly aligned to the sensor. At low rpm there is a notable ‘pattern’ of different sounds and variation in velocity over the course of a motor rotation. However I don’t think this is the issue as with higher rpm the motor is actually running smoother and smoother.
So, 1: is there anything obvious that I should be doing differently?
And 2: could this possibly be an effect of the delay in the read-out of sensor values? I haven’t calculated or measured the actual delay, but as this is generally the limiting factor in loop iteration speed, I think it’s save to assume that by far most of the iteration time is spend in waiting for I2C communication back and forth, meaning that the sensor value was actually sensed around half of the iteration time earlier, let’s say 200uS in my case, by the time by the voltages are adjusted based on that reading. I would imagine that at low rpm this delay is no problem as it is only as small fraction of the time between two passing poles, but this fraction of course grows as rpm goes up and therefore time between passing poles reduces. Is there any compensation for this delay in the library?