I’ve been wasting far too much time over the last few weeks on a silly tone-player arduino library for brushless DC motors. It turns your bldc motor into a speaker!
It, of course, uses SimpleFOC underneath. It can play polytones (with two motors) and has some jukebox functionality.
I can finally get back to doing some proper robotics!
(A shout out to @blackblue007 who wrote a nice post which describes most of the storm32 pins. Thanks!)
It is using SimpleFOC - velocity_openloop with setPhaseVoltage. It can oscillate using square or sinusoidal wave. Square is louder and uses less cpu.
I’d be happy for it to get moved under SimpleFOC umbrella.
And of course @Antun_Skuric, your croatia national anthem and my welsh national anthem are available on the jukebox!
@David_Gonzalez - I’ve just tested it on esp32. Works fine (although don’t have capability of testing polyphony).
I’ve also retested on atmega328p - I’ve pushed a couple of fixes to repo. Now the first 4 examples work but the last 2 do not (only so much you can fit in 2K SRAM). It’s possible that there might be a timer issue on atmega328p - I’ve got a dual bgc gimbal controller and it works on one driver (BLDCMotor(9, 10, 11, 7) but not the other (BLDCMotor(3, 5, 6, 7)).
I’ve done most of my testing on stm32f103rc (storm32 triple gimbal controller).
My testing is on a wooden bench - for smaller motors it works best on something that resonates. Increasing voltage_limit typically makes it louder. The hoverboard motor is MUCH louder than gimbals!