Shin_2-41
Published © GPL3+

BalanceBot Stick-kun – M5StickC Self-Balancing Robot

Tool-free, snap-fit design with zero external components. A super-simple self-balancing robot made with just a servo and an M5StickC.

BeginnerFull instructions provided1 hour60
BalanceBot Stick-kun – M5StickC Self-Balancing Robot

Things used in this project

Hardware components

M5StickC ESP32-PICO Mini IoT Development Board
M5Stack M5StickC ESP32-PICO Mini IoT Development Board
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

_FjmvvDbnan.fzz

Stick-kun_kairozu

Simply hook up two servos to the M5StickC Plus.

Code

Main control code for the inverted pendulum robot

Arduino
This is the main part of the code.
        Speed += kpower * gain[1] * power;
        P_Angle = kp * gain[2] * Angle;
        I_Angle += ki * gain[3] * Angle + kdst * gain[5] * Speed;
        D_Angle = kd * gain[4] * dAngle;
        k_speed = kspd * gain[6] * Speed;
        
        power = P_Angle + I_Angle + D_Angle + k_speed;

Credits

Shin_2-41
1 project • 0 followers

Comments