Lego, Raspberry and Python Project - Reaction Wheel Inverted Pendulum

4,105,388
0
Published 2022-04-16
Single axis self-balancing reaction wheel inverted pendulum.
This thing is inherently unstable and a common challenge in control theory.
The mechanical structure is built using only Lego parts.
Motor is also Lego. Angle sensor and electronics are not Lego.
Enjoy!

00:00 platform
00:27 inertial measurement unit
02:39 motor driver
04:08 PID controller
07:10 tachometer
10:26 rise up sequence
10:57 the final result
13:06 change parts and parameters to see how they affect performance
18:32 specs (including python code)

PARTS:
Raspberry Pi Zero 2 W
OKYSTAR TB6612FNG motor driver
Elecrow SM9250MPU 9DOF IMU
Lego EV3 Medium Servo motor [45503]
Lego PF Rechargeable Battery Box [8878]
Lego Gear Rack 11 x 11 Curved [24121]

CODE:
mega.nz/folder/h6Y2EYwQ#t1s6ihP5UcFOJb5QGhX1Ww
or
www.dropbox.com/sh/pem1mbpp82pbgwz/AAAc5Uqdah6dsNd…

All Comments (21)
  • @mezzer34
    Ah yes, PID loop refining. The true "Try some numbers and see" of engineering
  • @Azeal
    so cool to see you branch out the skills you apply on this channel, amazing work!
  • @Kombivar
    I personally learned more in this "one cup of tea" episode then I would ever do so on the PID matter during my entire engineering course. Outstanding job!!
  • @Tigrou7777
    5:00 PID controller values : usually you set the P and D constants first, and end up with I part. The integral part is useful when current angle lags behind target, not for overall stability.
  • @TymTym55
    I'm really impressed by Your skills. You are lego designer, physicist, programmer and electronics engineer. Thanks for the effort You put into Your videos, good luck in future experiments!
  • @330f
    You've made some pretty cool things for your channel, but this one is by far the best one. Excellent work!
  • @theftking
    My favorite part was when the wheel spun.
  • @chinmayk8004
    Absolutely loved that iterative engineering process, it was therapeutic
  • @matthew.wilson
    Instead of switching the target angle at a fixed frequency to avoid saturation, run a slower feedback loop that adjusts target angle as a function of motor acceleration. Essentially get it to search for a target angle where it doesn't need to accelerate. You could probably get it completely stationary that way.
  • Nicely done! I particularly appreciate how you documented everything at the end, so anyone could replicate your work and build on it. Thanks!
  • @superman55566
    This channel just constantly ups the game. My jaw dropped multiple times throughout the video. It's more than just engineering, this is art. BRAVO 👏👏👏
  • @aaronrovinsky11
    this is so cool!! we need more videos like this that show the building/coding/tuning process all in one. makes projects like this way less intimidating for people just starting out!
  • @calimero14
    I've had a similar prodgect in class ( the name was "ball and plate", a stabilized ball on a touch panel) and I love how we spend litteraly 10 hours on a precise calculus of the value of kp ki and kd (modelize thé forces and momentum etc...) when you simply Made it step-by-step lol Super great video btw
  • @Katvanished
    I love the testing method of "hit it with a bottle"
  • Watching the code evolve was a good insight into programming. Very cool.
  • @null1023
    It's really, really nice seeing how well documented this is. I really want to build this myself now.
  • @Steve_McMillen
    My favorite lego building youtuber is back! Got my morning coffee with me and ready to enjoy your builds!
  • @rubikfan1
    If you want more precision. You could use 2 wheel instead of 1. 1 for clockwise and 1 for count clockwise. Meaning the wheels keep going in the same directions and less jerking back and forth. As less accelaration is needed.
  • Screw learning at a school or online I’m just gonna watch this guy
  • @sage5296
    This was amazing to watch, the whole thing is just sooooo cool! I loved seeing you experiment with the different configurations. The target angle curve reminds me of a sine approximation of a square wave