Possible error in the open loop tutorial code, missing motor.loopFOC()

Hello!

I’m new to simpleFOC and i was following the Getting Started Guide. I sucessfully tested the driver, but when i got to the open loop example (BLDC motor 3PWM), i couldnt get the motor to spin. However when i added the “motor.loopFOC();” to the loop function it worked perfectly. I would like to report this so people can save some time when first starting with SimpleFOC, given that this is an error and i didnt misunderstand anything :slight_smile:

1 Like

You’re absolutely right. I’ll update it asap!
Thanks for pointing this out :slightly_smiling_face:

EDIT:
motor.loopFOC() is mandatory for all applications, I juut forgot to update it at a couple of locations.
The docs should be up to date now.

However, I’ve just noticed that I did not update the openloop examples in the library.
They are up to date in the master branch. Here is the link for those having issues:

motor.loopFOC() was not required previously for Open Loop velocity control. only closed loop. has that changed with the new version?

loopFOC is not mandatory because we now can choose between all the torque control strategies for the open-loop control.

  • voltage (the only one possible till v2.4.0)
  • estimated current
  • foc current
  • dc current

And loopFOC is the one doing the torque control.

Ohh! Interesting. I definitely need to try out 2.4.0 now. I will update my device this weekend.