vedderb / bldc

The VESC motor control firmware
2.08k stars 1.31k forks source link

Feature Request: Disable Field Weakening at compile #689

Open Buzut opened 6 months ago

Buzut commented 6 months ago

Field weakening (and other features) can be very dangerous if badly tuned.

The VESC doesn't know what the hardware limits are and as such, an end-user could set it to high values resulting in the ESC bursting in flames if something goes wrong.

For this very reason, field weakening (and maybe MTPA) should have a flag in the config file that can remove the feature so that no operator error can occur if it's not supposed to be used.

In addition, it would also be nice to be able to cap the values that can be configured.

nitrousnrg commented 6 months ago

For that goal what I do is setting an RPM limit, like this: https://github.com/luna-cycle/bldc/blob/0fd93961d4d7fe479beb8278b7f322b03b339b8f/hwconf/other/hw_axiom.h#L321

It doesn't cover every FW failure mode but it does help limiting the amount of voltage that the motor can generate, which can kill the powerstage if pwm stops firing.

Buzut commented 6 months ago

Hey @nitrousnrg, thank you for that. I think it would still be a really good idea to just have a flag to opt out from some features, but while waiting for it, it sure helps making things safer 👍