You are here

Sensorless ERPM confusion and cogging in FOC

8 posts / 0 new
Last post
Addy
Offline
Last seen: 9 months 6 min ago
Joined: 2017-09-06 01:53
Posts: 13
Sensorless ERPM confusion and cogging in FOC

I'm having some trouble tuning my VESC 4.12 (latest firmware) for optimal performance. I use the VESC on my ebike with a 12s lithium battery and a 9C 2706 hub motor with hall sensors in FOC mode.

I find the sensorless ERPM threshold confusing. As far as I can tell there are no instructions for how to choose a good value for this. The main issue I am having is that when my bike has changed to sensorless mode under heavy acceleration, the motor cogs heavily and sometimes causes an ABS_OVER_CURRENT error. I captured an example of this with my data logger: 

ABS_OVER_CURRENT.png

Also, even when there is no cogging the current has some kind of bump around the transition between sensored to sensorless modes. I have confirmed this by logging with different sensorless ERPM values.

sensorless ERPM 5000.png

If I set the sensorless ERPM above my normal max RPM, acceleration is smooth, but I feel like the top speed is not quite as high. The battery was more discharged in the log below, but I'm not sure that explains it all.

acceleration  + brake example.png

Does anyone have any advice for this situation? I have tried playing around with saturation compensation but I have been unable to eliminate cogging in sensorless mode. 

TechAUmNu
Offline
Last seen: 2 days 16 hours ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 575

I find the best way is to measure the resistance and inductance with the actual load attached. Some of the motor parameters change when loaded or with high current. Normally reducing the resistance a little helps at the higher currents. When you run the R & I detection set the current at the current the switchover tends to occur at. Then it is tuned for the exact switchover current instead of a no load current. The Flux Linkage and observer gain don't tend to change. So you have to manually copy the values from detection to the correct fields.

Stator saturation does help quite a lot, I run my A200S at 20% compensation, but that is for 200A.

I also found deadtime compensation can cause it to cog badly at high current if it is set too high.

Addy
Offline
Last seen: 9 months 6 min ago
Joined: 2017-09-06 01:53
Posts: 13

Thanks for the tips. I will do some tuning later and try what you suggested. Here is part of my log from this morning, with sensorless ERPM set to 7500:

sensorless ERPM 7500.png

Here you can definitely see where the transition to sensorless mode is. It happened around 8000 RPM instead of 7500 as I had set it, which is somewhat strange. You can see that the speed is almost topping out before the switch, but after the transition the current is increased and the speed can reach a bit higher.

TechAUmNu
Offline
Last seen: 2 days 16 hours ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 575

If that is a low kv motor, I would change the hall sensors to turn on much much earlier. You want to switch as soon as the motor is turning fast enough for sensorless to work.

Roger Wolff
Offline
Last seen: 1 year 9 months ago
VESC Original
Joined: 2017-05-24 12:27
Posts: 202

Typo: You typed: "on" where you mean "off". 

hall sensors to turn off much much earlier. 

TechAUmNu
Offline
Last seen: 2 days 16 hours ago
VESC Free
Joined: 2017-09-22 01:27
Posts: 575

Yes what he said :D

Addy
Offline
Last seen: 9 months 6 min ago
Joined: 2017-09-06 01:53
Posts: 13

Yesterday I spent some time trying to improve my tuning. It's difficult to do this because my motor starts to overheat after repeated acceleration without much time or airflow to cool it down. I tried many different things, such as adjusting deadtime compensation, motor resistance and inductance and saturation compensation. These settings would change the cogging, sometimes making it less severe but not eliminating it completely. I had tried to set my sensorless ERPM threshold at 2500 but I could not get a usable tuning at all. Eventually I worked up to 4000 ERPM. At this value I still have some very slight cogging but it is usable. I will try to do some more tweaking.

I'm a bit confused about doing measurements under load, like the R and L measurement. For R/L measurements the motor doesn't move and also it doesn't seem to matter what I set the test current to. I did notice that different motor positions have an effect on the measured values. Changing the test current only seems to matter in the flux linkage measurement. For flux linkage measurement I hold my bike so that the rear wheel is off the ground so that it can spin freely. I'm not sure how I could safely do this under load. 

Next I will try tweaking the current P/I and observer gains. I could also try D current injection.

bayetan
Offline
Last seen: 1 month 5 days ago
VESC Free
Joined: 2019-08-30 02:40
Posts: 14

I have a question regarding any senors.  If you have a very accurate the sensor installed (ABI with 9784 cpr), why would you not use it all the time?  What advantage is there is going sensorless?