Lego, Raspberry and Python Project - Reaction Wheel Inverted Pendulum

2024 ж. 14 Мам.
3 972 118 Рет қаралды

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#t1s6i...
or
www.dropbox.com/sh/pem1mbpp82...

Пікірлер
  • Ah yes, PID loop refining. The true "Try some numbers and see" of engineering

    @mezzer34@mezzer342 жыл бұрын
    • That was just too beautiful! Everything else was well thought out and planned. and then this tuning "algorithm". Roll 3d100 and see what happens.

      @IgnavumFortuna@IgnavumFortuna2 жыл бұрын
    • Nowadays you just put in some result parameters, and train the PID based on the results

      @kk10494@kk104942 жыл бұрын
    • Sounds like the kind of problem you throw at a genetic algorithm or neural network.

      @emmote77@emmote772 жыл бұрын
    • @@emmote77 neural network is more for complex patterns

      @JohnDoe-po3ku@JohnDoe-po3ku2 жыл бұрын
    • You can model the whole setup, throw it into a block diagram, and calculate out the correct parameters. Seems a little silly with something this simple but it pretty important in chemical processes etc where trial and error isn't feasible.

      @thepengwn77@thepengwn772 жыл бұрын
  • 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!

    @TymTym55@TymTym552 жыл бұрын
    • Yes, I want to make something like that but things are expensive because I'm a kid🤣🤣😅

      @alvlp-xyz@alvlp-xyz2 жыл бұрын
    • this is all very basic stuff, give it a shot and you will make reaction wheel robots in no time

      @Marco-yk8kp@Marco-yk8kp2 жыл бұрын
    • @@alvlp-xyz Ngl, I’ve seen kids do some cool engineering stuff. Example is the kid in Mark Rober’s video. I’ve also seen a kid in a third world country solder and create some stuff out of discarded e-waste. The thing here is maybe you’ve never really tried to create things like this.

      @noname-codm4590@noname-codm45902 жыл бұрын
    • I think most people i STEM know at least some basic Python or C, because it's used all over the place (in fact a common complaint related to working in Python is having to work with code written by non-programmers)

      @xGOKOPx@xGOKOPx2 жыл бұрын
    • @@xGOKOPx damn, wish I have a programming subject. I think there will be in g12. But I plan to learn to code anyway. I really hear a lot in phyton.

      @noname-codm4590@noname-codm45902 жыл бұрын
  • so cool to see you branch out the skills you apply on this channel, amazing work!

    @Azeal@Azeal2 жыл бұрын
    • wow you watch him?

      @user-zt5bq9tf2z@user-zt5bq9tf2z2 жыл бұрын
    • It really is fascinating!

      @CSharpDCS@CSharpDCS2 жыл бұрын
    • Cool to see your favorite youtubers watching your other favorite KZheadrs

      @The_Dancing_Elephant@The_Dancing_Elephant Жыл бұрын
    • Hey Azeal did not expect to see you here! Been a fan for almost a year now

      @Raindrop199@Raindrop199 Жыл бұрын
    • @@user-zt5bq9tf2z жаль. . .

      @VOENNI_MILK@VOENNI_MILK Жыл бұрын
  • 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!!

    @Kombivar@Kombivar2 жыл бұрын
    • yes and no

      @Hans-tr6dx@Hans-tr6dx2 жыл бұрын
    • @@Hans-tr6dx Well it depends how often do you press "Pause" :)

      @Kombivar@Kombivar2 жыл бұрын
    • @@Kombivar Yes that's true. If you really go and understand everything he writes / codes then you get a huge amount out of it ^^

      @Hans-tr6dx@Hans-tr6dx2 жыл бұрын
    • @@Hans-tr6dx True

      @MScienceCat2851@MScienceCat2851 Жыл бұрын
    • No

      @epolpier@epolpier Жыл бұрын
  • You've made some pretty cool things for your channel, but this one is by far the best one. Excellent work!

    @330f@330f2 жыл бұрын
    • I dont get it. What did he make? What purpose does it have?

      @EfeAksoy08@EfeAksoy082 жыл бұрын
    • @@EfeAksoy08 If you have no knowledge of Python, Lego, or physics, this won’t be interesting for you. Read the description or don’t, it’s not anyones responsibility to entertain you.

      @DK1213@DK12132 жыл бұрын
    • @@DK1213 easy Einstein, i just asked what it is

      @EfeAksoy08@EfeAksoy082 жыл бұрын
    • @@EfeAksoy08 Obviously in the title and description of the video.

      @LogicDoesStuff@LogicDoesStuff2 жыл бұрын
    • Qowgfb

      @todisbhatti7638@todisbhatti7638 Жыл бұрын
  • Nicely done! I particularly appreciate how you documented everything at the end, so anyone could replicate your work and build on it. Thanks!

    @mikepetersen2927@mikepetersen29272 жыл бұрын
  • 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.

    @Tigrou7777@Tigrou77772 жыл бұрын
  • 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 👏👏👏

    @superman55566@superman555662 жыл бұрын
  • 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.

    @matthew.wilson@matthew.wilson2 жыл бұрын
    • Nice. So one control loop tries to minimize the angle difference between setpoint and actual angle, and another control loop adjusts the setpoint angle to minimize the motor effort

      @Frits34000@Frits340002 жыл бұрын
    • I would do a pulsed step-up acceleration in relation to the deviation angle.

      @ZoonCrypticon@ZoonCrypticon Жыл бұрын
  • 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

    @calimero14@calimero142 жыл бұрын
    • Ah un français. On nous reconnais direct à cause du correcteur qui met des "thé" quand on veut écrire "the" 😂

      @Matthias-tc4ec@Matthias-tc4ec2 жыл бұрын
    • @@Matthias-tc4ec j'ai fait ce que j'ai pu contre le correcteur 😆

      @calimero14@calimero142 жыл бұрын
    • @@calimero14 moi, j'ai éliminé la compétition. J'ai enlevé l'autocorrecteur parce que je devais trop souvent écrire deux fois ma phrase. J’étais tanné d’être en compétition avec l'autocorrecteur!😂

      @GuillaumePerronNantel@GuillaumePerronNantel2 жыл бұрын
    • @@GuillaumePerronNantel sinon ultime solution que j'avais sur mon ancien téléphone, j'avais mis français et anglais dans le correcteur, le meilleur des deux mondes !

      @calimero14@calimero142 жыл бұрын
    • I think you mean trial-and-error instead of step-by-step? Your English is great otherwise👍

      @bruhbwoi3618@bruhbwoi36182 жыл бұрын
  • 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!

    @aaronrovinsky11@aaronrovinsky112 жыл бұрын
  • Absolutely loved that iterative engineering process, it was therapeutic

    @chinmayk8004@chinmayk80042 жыл бұрын
  • I love the testing method of "hit it with a bottle"

    @Katvanished@Katvanished2 жыл бұрын
    • it's a tried and true method It works on large insects, younger siblings, and sensory robots you want to hit without damaging any components

      @Fishman7523@Fishman75232 жыл бұрын
  • My favorite lego building youtuber is back! Got my morning coffee with me and ready to enjoy your builds!

    @Steve_McMillen@Steve_McMillen2 жыл бұрын
    • Morning? I have 16:13😅

      @dominikromanczyk4595@dominikromanczyk45952 жыл бұрын
    • @@dominikromanczyk4595 HEHE

      @sanishot9326@sanishot93262 жыл бұрын
    • @@dominikromanczyk4595 Haha its morning for me, Pacific Time!

      @Steve_McMillen@Steve_McMillen2 жыл бұрын
    • I am in UTC+8,now is 20:10

      @newswang1217@newswang12172 жыл бұрын
    • @@newswang1217 We have an hour in Poland 16:25

      @sanishot9326@sanishot93262 жыл бұрын
  • You've made this so approachable and informative. I found myself speaking aloud along with you as you were iterating on the variables. This was wonderful!

    @StayGold3333@StayGold3333 Жыл бұрын
  • It's really, really nice seeing how well documented this is. I really want to build this myself now.

    @null1023@null10232 жыл бұрын
  • I have loved watching this channel break into more complex engineering projects, this is exactly my slice of pie.

    @Dangineering@Dangineering2 жыл бұрын
  • 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.

    @rubikfan1@rubikfan12 жыл бұрын
    • The one downside is that it decreases the reactive weight/dead weight ratio of the pendulum for a certain direction. But if it can achieve the angles and agility you want, then this doesn't really matter.

      @Marci124@Marci1242 жыл бұрын
    • @@Marci124 true. So i guess it depends on how heavy the motor and wheels are.

      @rubikfan1@rubikfan12 жыл бұрын
    • It's the acceleration that is needed though. Less acceleration=less torque

      @TheTomco11@TheTomco112 жыл бұрын
    • @@TheTomco11 angler momentum will also stabiles the proces.

      @rubikfan1@rubikfan12 жыл бұрын
    • One the other hand, due to the increased total reactive weight, this setup would have twice the saturation margin as the single wheel setup. When one wheel is nearing saturation, the angular momentum could be transferred to the other wheel. You could do this by decelerating the saturated one at the same time as accelerating the other one in the same direction. During this operation, it's possible to not apply any torque, but one could also incorporate this to always run in the background by differentially moving the two wheels in concert. On the other other hand, doing the above would require one to move at least one wheel in both directions, doing away with the benefit frim the OP.

      @Marci124@Marci1242 жыл бұрын
  • My favorite part was when the wheel spun.

    @theftking@theftking2 жыл бұрын
    • Hi theft king I liked your videos ty

      @biancadarosa9053@biancadarosa90532 ай бұрын
  • 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

    @sage5296@sage52962 жыл бұрын
  • Beautiful video for understanding how control algorithms work! You are probably a very good engineer.

    @ab_c4429@ab_c44292 жыл бұрын
    • Reading this comment as he hits it with a pop bottle/shakez entire thing, very ironic thing to read lol

      @kameronmyles2013@kameronmyles20132 жыл бұрын
    • @@kameronmyles2013 average engineer

      @unoriginalcopy9844@unoriginalcopy98442 жыл бұрын
  • Please... PLEASE make one that works in 2 axis! :D Awesome video btw!

    @familiameseguersantiago2399@familiameseguersantiago23992 жыл бұрын
    • yeah, and try free standing on a carpet or something

      @superpowerdragon@superpowerdragon2 жыл бұрын
    • Or all 3 ones. O.o

      @user-eb8ul1hc9w@user-eb8ul1hc9w2 жыл бұрын
    • @@user-eb8ul1hc9w *buys drone*

      @SylvieTheBagel@SylvieTheBagel2 жыл бұрын
    • @@SylvieTheBagel really :D

      @user-eb8ul1hc9w@user-eb8ul1hc9w2 жыл бұрын
  • Watching the code evolve was a good insight into programming. Very cool.

    @thecatofnineswords@thecatofnineswords2 жыл бұрын
  • As a mechanical engineering student interested in mechatronics, this is the coolest thing I've ever seen. It makes me want to try something like it myself!

    @marblemaster1@marblemaster1 Жыл бұрын
  • As a college student in aerospace engineering who is now learning PID controllers, this video is awesome. This is easily one of my top 3 channels, this is a great new topic and I can’t wait to see what’s next!

    @jacksonschuler3785@jacksonschuler37852 жыл бұрын
    • is this stuff difficult to learn in your course?

      @hchickenz1138@hchickenz11382 жыл бұрын
    • @@hchickenz1138 conceptually yes, the theory behind it is difficult, but implementing it is pretty straightforward.

      @jacksonschuler3785@jacksonschuler37852 жыл бұрын
    • What are the other two channels? ))

      @difirsty5045@difirsty50458 ай бұрын
  • This is a really great intro to controls and dynamics! I especially like how you showed the effect of different kinds of control delay, and different mechanical setups that also had noticeably different stiffnesses 👏🏽👏🏽👏🏽👏🏽👏🏽

    @omaristephens2143@omaristephens21432 жыл бұрын
  • Wow, this is insanely impressive. I'm truly blown away by your level of knowledge and skill. Very awesome video.

    @JustinDrentlaw@JustinDrentlaw2 жыл бұрын
  • I recently finished my control system course in eee , and this was one of the best project i have seen.

    @arnsassassiner@arnsassassiner2 жыл бұрын
  • If you set up a livestream with this thing running I'd watch it for hours.

    @higgsbonbon@higgsbonbon2 жыл бұрын
  • This is so epic. Coincidentally im doing this exact thing right now for a final project but using Non-linear backstepping control so it can swing up from any position. Nice job!!

    @thatwontwork9046@thatwontwork90462 жыл бұрын
  • This channel is gonna give Boston Dynamics a run for their money in a few years at this rate. I for one welcome our new Lego overlords.

    @GoofballAndi@GoofballAndi2 жыл бұрын
  • your past videos have impressed me, but not to this degree, this is some seriously next level!

    @marcusdechant7092@marcusdechant7092 Жыл бұрын
  • Yo, as a control engineer, it's cool to see you applying PID control to a project anyone can do. Keepit up

    @Sam-gk7wn@Sam-gk7wn2 жыл бұрын
  • This is incredibly thorough documentation! Great job! I'm very much impressed!

    @GaleAeras@GaleAeras2 жыл бұрын
  • As a guy that loves to code, this was amazing to watch. You gotta do more stuff like this man. This is freaking COOL!

    @negativeflare@negativeflare2 жыл бұрын
  • Amazing experiment - a pleasure to see how features were developed - and documented! Thanks for sharing!

    @EJEuth@EJEuth2 жыл бұрын
  • This sudden yet clear jump in intellectual difficulty is based. You're about to redpill a lot of unsuspecting people on the simplicity and power of mechatronics.

    @killsalot78@killsalot782 жыл бұрын
    • 100% might minor in mechatronics after seeing this a raspberry pi is such low cost but high potential computer!!!

      @imakedookie@imakedookie2 жыл бұрын
    • @@imakedookie 4 seconds ago I see

      @AidanGamesYT@AidanGamesYT2 жыл бұрын
    • @@imakedookie Raspberry pis are not really that great for imbedded projects minus robotics. Arduino, Teensy, and ESP are more suited for those tasks. I mostly use Pis as micro servers and for things that really need all that computing power.

      @NetAnon@NetAnon2 жыл бұрын
    • baste and mechpilled

      @higgsbonbon@higgsbonbon2 жыл бұрын
    • There's always a better mousetrap, but in the end it's still just a mousetrap. 🤔

      @alpine1600s@alpine1600s2 жыл бұрын
  • Easily my favorite video you've put together. Well done documenting everything on this project.

    @SKIND-SMOKEWAGON@SKIND-SMOKEWAGON2 жыл бұрын
  • Man, look at all these engineers that you've drawn on to this channel/your video. Well done. I really love your work. Outstanding 🤩

    @razerh0@razerh02 жыл бұрын
  • Ohh man yes please. Love the combination of LEGO with electronics. My two guilty pleasures. Keep going!

    @BladeScraper@BladeScraper2 жыл бұрын
  • I literally have no idea what's going on what they're coding or even what they're trying to achieve, but goddamn I sat thru everything mildly entertained and interested

    @dampierre99@dampierre992 жыл бұрын
    • @@tusharxo that is correct. it's a reaction wheel, which spins in reaction to it's angle being changed to get back to where it started. They're used in rockets, missiles, and other flying things.

      @no-lifenoah7861@no-lifenoah78612 жыл бұрын
    • @@tusharxo yea i also got it eventualy

      @lourencopereira5959@lourencopereira59592 жыл бұрын
    • I was scrollin trying to see if anybody else was also clueless

      @kameronmyles2013@kameronmyles20132 жыл бұрын
    • I thought reaction wheels were pretty common these days.

      @bitlong4669@bitlong4669 Жыл бұрын
  • Would it be possible to turn this into a ‘Ferris wheel’ with Lego people on it that keeps itself upright? That would be insane and awesome

    @defcon1gaming@defcon1gaming2 жыл бұрын
    • wouldn’t it be a dull ride though?

      @KiLLJoYYouTube@KiLLJoYYouTube2 жыл бұрын
    • @@KiLLJoYKZhead depending how fast the thing spins!

      @legendreoli@legendreoli2 жыл бұрын
    • This some roller coaster tycoon mentality

      @benjaminrudy9942@benjaminrudy99422 жыл бұрын
    • I want to get off Mr. Brick's Wild Ride.

      @HaganConnell@HaganConnell2 жыл бұрын
    • Damn that would be so complicated. The little people in their cars swinging about would add extra chaotic forces to the system. If anyone could do it though it’s this guy.

      @jacoblawrence9145@jacoblawrence91452 жыл бұрын
  • This is probably one of the best videos about PID in a practical way you will find in KZhead. If only I had had this in my school years, control theory would have been easier. Keep it up with the good work! (and more videos like this pls ☺)

    @0lAlex0@0lAlex0 Жыл бұрын
  • holy crap, this went so far over my head but it's amazing to watch you make this work through a pi.

    @isaakwelch3451@isaakwelch34512 жыл бұрын
  • dude you are a magician

    @TRAHUN4IK@TRAHUN4IK2 жыл бұрын
  • Basically a human flailing his arms when he’s unbalanced

    @JoSeph-qo4gq@JoSeph-qo4gq2 жыл бұрын
  • Wow love your style - just tons of data and experimenting, no voice over or music. Thanks!

    @h82fail@h82fail Жыл бұрын
  • This made me realize how much more is the engineering behind those Mule robots. Cool project!

    @raphaeldepaula3054@raphaeldepaula30542 жыл бұрын
  • Absolutely amazing work. The way that you are able to understand the meaning of formulas that there are behind an inverted pedulum and how do you implement them into the code and correct all the issues that apears during the development is incredible. I would like to be half as smart as you 😂

    @destripapcs@destripapcs2 жыл бұрын
    • i know Jack shit about this kind of programming or math, but I do know from getting decent algebra grades, they give you the formulas so you learn how to plug and play with random numbers to see what happens. eventually if you get good at the world is your oyster

      @kdevlogs5550@kdevlogs5550 Жыл бұрын
    • Actually that's not an inverted pendulum to be precise, but still an awesome project!

      @alfiolocatelli5093@alfiolocatelli5093Ай бұрын
  • I love how all your content has the same style even if it's not legos.

    @mediocreanimator@mediocreanimator2 жыл бұрын
    • legally it is lego

      @no-lifenoah7861@no-lifenoah78612 жыл бұрын
  • You do some really cool stuff but this is by far the most amazing and useful! This has turned from entertainment to educationally valuable. Thank you!

    @cloudyeight@cloudyeight2 жыл бұрын
  • I was so impressed by your video that I decided to watch the 12 min mid roll all the way through. Love the videos brother!

    @ChrisBates888@ChrisBates8882 жыл бұрын
  • I love it. Great project. How about a version with an arm that can freely rotate 360 degrees? Could it get up from neutral hanging down position? Could it deal with rotating the entire apparatus?

    @CyborgX7@CyborgX72 жыл бұрын
    • Given that these are Lego motors, probably not, at least not without some gearing to increase the torque produced.

      @nikkiofthevalley@nikkiofthevalley2 жыл бұрын
    • @@nikkiofthevalley Probably not with a simple PID controller like this but with a rigid arm and some extra code, you could get it to start swinging to the point where it does a 180 swing - you just reverse the reaction wheel direction at each end of the swing to load it in the opposite direction. It would take some work but it's imo doable. In high school I made a self-sustaining pendulum out of a mindstorms kit that only used a mass that was raised a few centimeters at the apex of the swing, and then released at the bottom - to model a children's swing set. It's pretty easy to get that to increase amplitude. That was attached via a string, though, so it couldn't do a full 180 swing... you need a rigid arm for that.

      @rsedivy2@rsedivy22 жыл бұрын
  • Impressive. I will stick to Lego Duplo.

    @u22727@u227272 жыл бұрын
  • I have literally looked up Lego, Raspberry and Python Project separately this week. The algorithm then sends me this video. Amazing! This is so cool!

    @DUSTINISMS@DUSTINISMS Жыл бұрын
  • unbelievable the way you have edited this makes it look so easy. thanks

    @LDem-xj7ex@LDem-xj7ex2 жыл бұрын
  • Dude, that would make an amazing science Fair entry

    @BobbyDukeArts@BobbyDukeArts2 жыл бұрын
  • This channel is so special. I love content like this, playing with toy problems and using engineering principles to make stuff that's so fun. keep up the good work!!

    @samfelton5009@samfelton50092 жыл бұрын
  • I have no knowledge of electronics or coding, and I still watched this whole video. Well done! Proud to be a sub.

    @_PoLR@_PoLR2 жыл бұрын
  • Holy moly this took so much effort and knowledge. Amazing

    @richardpike8748@richardpike87482 жыл бұрын
  • Can't wait to see a few of these in your upcoming Lego I.C.B.M.

    @no-lifenoah7861@no-lifenoah78612 жыл бұрын
  • So cool seeing the gyroscopic effect being used this way , I have been amazed when learning about the physics of it . and I appreciate the engineering of it now .

    @abderrahimelgomri1626@abderrahimelgomri16262 жыл бұрын
    • This is not a demonstration of gyroscopic effect. Acceleration of the wheel just transfers torque trough the motor to the pendulum to keep it upright.

      @kasparroosalu@kasparroosalu2 жыл бұрын
  • Your skills with Lego and engineering is so cool to see what u make for your channel with all the experiment what you do on Lego power functions and EV3

    @tailsgamingchannel8554@tailsgamingchannel85542 жыл бұрын
  • I really like, that you show the setup, label the parts and show the code!

    @konstantinl.3316@konstantinl.33162 жыл бұрын
  • Man, this project is super cool. Also reminds me how much I absolutely would hate being a programmer.

    @Scott.E.H@Scott.E.H2 жыл бұрын
    • 🤣

      @lourencopereira5959@lourencopereira59592 жыл бұрын
  • That's impressive! Looks like someone is putting their engineering degree to good use

    @BeTheGr8@BeTheGr82 жыл бұрын
  • 10:49 I opened my mouth wide in amazement for more than 1 minute, really amazing work

    @legarm1876@legarm18762 жыл бұрын
  • bro as a programmer, this took so much work and learning lol. This is awesome, I also love the "put in a random number and try again" technique

    @arial_01@arial_012 жыл бұрын
  • That was, in my opinion, the most inspiring video you've made, and god knows how inspiring your vids are :) Keep it up !

    @falcau9089@falcau90892 жыл бұрын
  • Very cool, although it was a little nerve-wracking seeing direct contact with carpet and risking electrostatic discharge.

    @jarrit_os@jarrit_os2 жыл бұрын
  • Really impressive stuff! In graduate school I made an inverted pendulum and basically just tuned a PID until it stood upright lol. Now you have a cool physical system to test more advanced control methods though!

    @samuelkemp4557@samuelkemp4557 Жыл бұрын
  • Very satisfying video! Amazing work and result

    @kastet93@kastet93 Жыл бұрын
  • I think ANGLE_FIXRATE is playing a role similar to what you would get from clamping the integral term to avoid windup. Might try that to simplify the code

    @scose@scose2 жыл бұрын
  • Very cool experiment! Calibrating PID settings, you seem have read the same paper we used to us as a reference; I recognize the same strategy (however, the last fine tuning always feels a bit at random for anybody :p).

    @Erikve@Erikve2 жыл бұрын
    • what paper is that?

      @Taygetea@Taygetea2 жыл бұрын
    • @@Taygetea PID Without a PHD? Great read in any case.

      @aibok42@aibok422 жыл бұрын
  • This is very relaxing to watch, I appreciate you showing the code.

    @aiden_3c@aiden_3c2 жыл бұрын
  • I just love these videos. I'm not an engineer but I know maths and I'm interested in physics. I never expect to make it to the end of something this long, but I often do - it's compelling to watch. Thank you for sharing!

    @macronencer@macronencer Жыл бұрын
  • 5:35 I didn’t know the lego motor could respond and make that noise

    @celebrityxcruises8087@celebrityxcruises80872 жыл бұрын
    • 1 SECOND AGO!!

      @AidanGamesYT@AidanGamesYT2 жыл бұрын
    • @@AidanGamesYT whatcha doing timing these comments? Just curious

      @batzzz2044@batzzz20442 жыл бұрын
  • Cool! This makes me want to start programming again. I would love to see this done with a genetic algorithm using a neural network. Although it might take awhile to find a solution.

    @abrasivepaste@abrasivepaste2 жыл бұрын
    • I had the same exact thought. Should be fairly easy to implement in python using tensorflow. To reduce the training time on the physical application, you could start by training a model against an ideal physics simulation and then refine it by training on the real thing. The same way you manually "trained" your parameters by starting from the upright position, you could also train the neural network in stages by adding an automated righting mechanism so the initial training code can initially start from a the upright position and learn how to hold this position, before increasing the difficulty and let it learn how to startup from one of the extreme positions. Would be very interesting to see how the neural network can deal with the sensor noise, delays and perhaps even changing variables like the vibration of longer arms. The layout of the neural network could be as simlpe as a time series of sensor data as input and a single motor speed value as output; the fitness function could be as simple as a penalty exponential to the radial distance from the target plus penalties for "radical" motor movement.

      @Jellow2202@Jellow22022 жыл бұрын
  • I learned more from this video than my entire controls course. Kudos.

    @justinnamilee@justinnamilee2 жыл бұрын
  • Awesome video! I work with avionics a lot and seeing you use an IMU and pi just as I did was unexpected!!

    @zacharywaring8259@zacharywaring82592 жыл бұрын
  • This is really so cool! Does that mean we'll get to see an AI-driven, self-climbing, self-righting Lego vehicle on the channel soon? EDIT: I just thought about this, but... Hey, you could even make a WALKING Lego mech with that kind of setup controlling the legs!

    @ZeLunatic@ZeLunatic2 жыл бұрын
  • Id like to see this made into a lego segway. That would be neat.

    @mrawesome3579@mrawesome35792 жыл бұрын
    • you could also do a motorbike on a similar principle

      @charleslambert3368@charleslambert33682 жыл бұрын
  • As someone doing electrical engineering at university the trying the different numbers to see what works method really resonated with me

    @MoodyGooseCow@MoodyGooseCow2 жыл бұрын
  • AWESOME video! great job like always pioneering in the lego build youtube scene, no one else compares!

    @okRegan@okRegan2 жыл бұрын
  • im too dumb to understand whats going on

    @crex-pd1vv@crex-pd1vv Жыл бұрын
    • same

      @grace921@grace921Ай бұрын
  • Wow, that's crazy. I've never actually thought about what an inverted pendulum means, I just know it's what you need to ride a unicycle, so with that in mind I wonder if this Lego robot could ride a unicycle?

    @jblen@jblen2 жыл бұрын
    • There's at least one extra step missing here that basically means the answer is no. On a unicycle, you intentionally overbalance in one direction to get moving. This robot would not know to do that, or have any concept of navigation for that matter. Not to mention, this is a single axis inverted pendulum, and a unicycle not only has all three axes of rotation available, it also has two-and-some axes of movement. An attempt to convert this robot to a unicycle riding robot that could even remain stationary would be at least as complicated as making either robot from scratch, if not moreso.

      @Woodledude@Woodledude2 жыл бұрын
    • @@Woodledude good point. I didn't mean navigating at all, but it does make sense what you say about rotation in other axes just to try and stay upright. I suppose you could remedy that by adding a track, like if the wheel on the bottom had an axel sticking out either side, you could rest that on an elevated surface to ensure it can only fall in one dimension, and perhaps use a gear on a gear track to keep friction better.

      @jblen@jblen2 жыл бұрын
    • @@jblen Training wheels would probably be sufficient to reduce the balancing problem to effectively single axis. I have a suspicion the twist about the vertical axis might still pose unexpected issues with gyroscopic precession, but a sufficiently "calm" single-axis balancer could probably ignore that. Probably. Be interesting to see. Your track suggestion would definitely do it, but then we're reducing the problem so much as to be very nearly the original problem with a different coat of paint. On the flip side, if you can control the twist of the unicycle with gyroscopic precession, there might exist a highly optimized solution for a single-axis balancer to actually navigate effectively. I have NO idea if gyroscopic precession actually comes into play in a controllable way here, I haven't run through the logic in my head - This is all suspicion and speculation. But it's certainly interesting to muse on.

      @Woodledude@Woodledude2 жыл бұрын
  • i agree on the suggested ideal state of the setup. and the compromise being done. you made real art.

    @steelbrotherhoodof2359@steelbrotherhoodof2359 Жыл бұрын
    • like a bleu note.

      @steelbrotherhoodof2359@steelbrotherhoodof2359 Жыл бұрын
    • going to watch it again.

      @steelbrotherhoodof2359@steelbrotherhoodof2359 Жыл бұрын
  • This is one of your best videos yet, maybe THE best!

    @matthewsaxman1028@matthewsaxman10282 жыл бұрын
  • Ok this is sick. I wouldn’t be surprised if you made a whole ass lego satellite

    @OrbitalLizardStudios@OrbitalLizardStudios2 жыл бұрын
    • *3 seconds ago*

      @AidanGamesYT@AidanGamesYT2 жыл бұрын
    • get this comment out of here man. respect the vid

      @imakedookie@imakedookie2 жыл бұрын
    • @@imakedookie? i meant “sick” as in “cool”, if thats what u are talking about

      @OrbitalLizardStudios@OrbitalLizardStudios2 жыл бұрын
    • @@OrbitalLizardStudios @aiden my guy. "3 seconds ago" is a useless comment

      @imakedookie@imakedookie2 жыл бұрын
  • if you want less delay, use C instead of Python. Will be like a thousand times faster on a Pi (or anything)

    @zkatt3238@zkatt32382 жыл бұрын
    • even faster, use asm. even faster, write directly in machine code

      @samuelgunter@samuelgunter2 жыл бұрын
    • The code isn't the bottleneck here but the sensors

      @Henrix1998@Henrix19982 жыл бұрын
  • Only 11 minutes in and my mind is blown. Seeing you dial in the PID was amazing.

    @daviddawkins@daviddawkins2 жыл бұрын
  • This is a great practical demonstration of reaction wheels!

    @Sir_Uncle_Ned@Sir_Uncle_Ned2 жыл бұрын
  • One question, what library did you use for the continuous plots? And how did you extract that data from your scripts? Just dumped out as text and plotted later or plotted on the fly?

    @ReyMysterioX@ReyMysterioX2 жыл бұрын
    • Matplotlib

      @vetelys6652@vetelys6652 Жыл бұрын
  • Now make an AI that automatically figures out these PID parameters independent of the configuration.

    @earomc@earomc2 жыл бұрын
    • This is a field of control systems that's called adaptive control. No ai needed

      @95frekhaug@95frekhaug2 жыл бұрын
  • This looks awesome. Congrats, its a really cool project.

    @ruoichisenpai@ruoichisenpai2 жыл бұрын
  • Well done! Loved Lego technic as a kid. I didn't know that they added that many new parts; makes me want to buy some to tinker with ^^

    @marwinthedja5450@marwinthedja54502 жыл бұрын
  • Ok

    @iloveflashtv@iloveflashtv2 жыл бұрын
    • Tamam

      @anzof5361@anzof53612 жыл бұрын
    • ok

      @Snidbert@Snidbert2 жыл бұрын
    • Man if you just scroll down the newest first this is the first comment

      @AidanGamesYT@AidanGamesYT2 жыл бұрын
    • sige

      @air7148@air71482 жыл бұрын
    • Ok

      @thebigboi5357@thebigboi53572 жыл бұрын
  • Man, you're growing! I like that! Do more of this stuff)

    @danzaikin@danzaikin2 жыл бұрын
  • Amazing!! You could use this as a balancing system to make a lego robot that does tight rope walking! Looking forward to it!!

    @H.Kuznetsov@H.Kuznetsov2 жыл бұрын
  • Screw learning at a school or online I’m just gonna watch this guy

    @thordarnell5080@thordarnell5080 Жыл бұрын
KZhead