So the last thing on the agenda is to find motor timing settings to remove the resident banshee haha!
Your code above shows calls for motor.initFOC()= and motor.loopFOC(). You can comment those out in Open Loop.
Same code works fine on the Uno and the G474re when flashed from Arduino IDE. The squealing only appears when flashed by PIO with the correct clock settings.
Hey, do you have the option
lib_archive = false
in your platformio.ini?
It’s required.
Yes, i did add it. The speed is now excellent but the squeal is definitely a motor timing issue. Have seen it with an esc set to incorrect timing on an rc model bldc in the past.
Ah, good.
The reason I asked was because the noise sounds a lot like what you get with a slow PWM frequency, in the audible range. Which is what happens when you run SimpleFOC on platformIO without the option…
Yes, you are a genius. I had nested the line. Reflashed and all good. Just trying to get the wow down a bit but totally useable now.