simplefoc / Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
https://docs.simplefoc.com
MIT License
1.94k stars 510 forks source link

[BUG] Error in doc: initFOC() cannot be used in open loop mode #382

Closed sylque closed 2 months ago

sylque commented 4 months ago

On page https://docs.simplefoc.com/velocity_openloop, in the sample code, there is this line:

motor.initFOC();

I think it shouldn't be here, as initFOC() is not compatible with open loop mode.

askuric commented 2 months ago

hmm, I mean you can use the initFOC with the openloop, the only problem is that it will disable the motor. So if you call the inifFOC you need to enable the motor afterwards. :D I agree that is not the best practice.

So, from now on, the initFOC can be used will allow the initialisation of the openloop if no sensor is available. It will not disable the motor.