Autodetect of motor

With a lot of “trouble” I’ve managed to get my config working. A lot was guessing howmany motorpoles my motor would have, guessing what P, I D parameters I should modify, and what good values would be.

In the end, what I did was not at all that tricky to automate.

I think it should be possible to write a small program that will present a little menu: What’s your sensor? AS5600? OK Good. (-> Sanity check AS5600).
Next step: where are your motor signal pins connected? when the user has specified that, you can instantiate the driver…

Then, the number op pole pairs should be detected.

Then, angle control requires the velocity PID to be correctly tuned. I didn’t know that, so such a step-by-step program would force me to complete that too. Next the PID for the angle. and Done.

When all this is done, this should provide a structure with all detected parameters and a simple setup-function can then initialize everything…

Hey @raw,

You’re right. This might be a good idea. To have a step-by-step arudino example that guides you through the setup and tuning. Or even some simple program using the pysimplefoc in python GitHub - simplefoc/pysimplefoc: SimpleFOC Python API