• @dragontamer
    link
    English
    3
    edit-2
    1 year ago

    MicroPython is significantly slower than C.

    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.

  • LazaroFilm
    link
    English
    11 year ago

    That’s why I love arduino-pico core. I tried getting in the MicroPython and circuit python and couldn’t see the benefits apart from fast flashing with no compiling but the cost is too great imo