vedderb / bldc

The VESC motor control firmware
2.1k stars 1.32k forks source link

Disable field weakening when erpm < sensorless #573

Closed surfdado closed 1 year ago

surfdado commented 1 year ago

Signed-off-by: Dado Mista dadomista@gmail.com

vedderb commented 1 year ago

Why would you disable field weakening in the sensored region?

Teslafly commented 1 year ago

If the sensored cutoff erpm is increased with a higher speed sensor into the region you want field weakening. (aka not using the observer at all really.) This could be problematic. And probably needs more justification and nuance.

surfdado commented 1 year ago

The reason I've added this change is that I have personally experienced massive torque loss when going up really steep inclines slowly, so this change fixed that problem for me. If I'm going 2-3mph I just don't see the benefit of having field weakening kick in, just wasn't sure if there was some corner case I wasn't considering

But I have to admit that I was approaching this with a pretty narrow mindset, thinking only about our Onewheel usecases and 2000erpm aka 4mph sensorless transition speed. I didn't necessarily expect this to get accepted into mainline, just wanted feedback to make sure I'm not doing something stupid/dangerous

nitrousnrg commented 1 year ago

Big no-no for those using a resolver 100% of the time 🙂 Large inverters usually run 100% sensored and use field weakening.

vedderb commented 1 year ago

A better way might be to limit the fw current to sqrt(i_max^2 - iq^2). Then the Q-axis gets priority on the current. I don't want to try that before the release though, so that is for the next beta.