driving brushless motors via electronic speed controllers (ESCs) using the RP2040’s pulse-width modulation (PWM) capabilities
I mean this is very impressive. But good grief. Was it really easier to do this all in MicroPython? 250Hz is still pretty slow. That’s an update every 4-miliseconds, or roughly every 800,000 clock ticks on this 200+MHz overclocked RP2040.
I can’t say I’m into robotics or drones, but I do know that STM32F3 / CortexM4F chips are common flight controllers in the drone community at only 72MHz or so (albeit with hardware FPU units). Micropython needs to probably change all the floating-point math into fixed-point to work on the CortexM0+ (no FPU), and then deal with the severe inefficiencies associated with an interpreter.
EDIT: I should note that reading over the flight-dynamics / this whole problem and blog is making me want to make my own quadcopter. Apparently quadcopters are all just relatively basic control theory. Somehow I thought they were far more complicated than this. But this kind of simple poll data / math out some PID controllers / send-data-to-motors loop is the bread-and-butter of electrical-and-computer engineering today.
MicroPython is significantly slower than C.
I mean this is very impressive. But good grief. Was it really easier to do this all in MicroPython? 250Hz is still pretty slow. That’s an update every 4-miliseconds, or roughly every 800,000 clock ticks on this 200+MHz overclocked RP2040.
I can’t say I’m into robotics or drones, but I do know that STM32F3 / CortexM4F chips are common flight controllers in the drone community at only 72MHz or so (albeit with hardware FPU units). Micropython needs to probably change all the floating-point math into fixed-point to work on the CortexM0+ (no FPU), and then deal with the severe inefficiencies associated with an interpreter.
EDIT: I should note that reading over the flight-dynamics / this whole problem and blog is making me want to make my own quadcopter. Apparently quadcopters are all just relatively basic control theory. Somehow I thought they were far more complicated than this. But this kind of simple poll data / math out some PID controllers / send-data-to-motors loop is the bread-and-butter of electrical-and-computer engineering today.