EFeru / hoverboard-firmware-hack-FOC

With Field Oriented Control (FOC)
GNU General Public License v3.0
1.11k stars 922 forks source link

Single motor operation #7

Closed Blimpyway closed 4 years ago

Blimpyway commented 4 years ago

Hi,

I need to control only one motor e.g. left one. If second motor (right) is disconnected, apart from diagnosing it as faulty, does the left side motor works as usual?

Thanks and I apologise for not testing it myself, I have no experience with reflashing the main board just want to know if I can start to learn it or use a different controller.

EFeru commented 4 years ago

Hi @Blimpyway ,

Yes, controlling one motor is possible and actually very easy to do by commenting out one line in the code. e.g., if you want to control only the Left motor, then just comment out the Right motor here: https://github.com/EmanuelFeru/hoverboard-firmware-hack-FOC/blob/1cc8b3475fc2929dea1685a7dc824458ae5e8e9e/Src/bldc.c#L209

The diagnostics will not trigger because the errorCode for the Right motor will be 0 (no error) since the function is not called.

Blimpyway commented 4 years ago

Thanks a lot!