How this Active Gyroscope Balances

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i've built several balancing robots in the past which were pretty stable these typically use an inertial measurement unit which consists of a solid-state gyro and a solid-state accelerometer the data from both these sensors is mixed together to give us a reliable measurement of the absolute angle of the robot so we can drive the wheels and compensate accordingly to make the robot balance but can we use a physical spinning gyro to make a robot balance i've got a simple spinning gyro here which you wind a string around and pull to make it spin and it seems to stand up okay but what happens if we try to push the gyro off balance we can see that it still seems to defy gravity but it goes around and around in the direction that the gyro is spinning as the gyro slows down it leans over more and more and more but it still goes around in the direction it's spinning and it doesn't have enough momentum anymore and it just falls over and this spinning around is called gyroscopic precession and this is a combination of the two forces gravity pulling down on the edge of it and the already spinning gyro and that gives us the product of both forces this is a bit like rolling a ball and hitting it sideways with another force and what we see is a resulting diagonal force which is a combination of both forces and that's why we see this gyroscopic precession force which is the combination of gravity pulling down on the edge and the direction of the spinning gyro however we can use this gyroscopic procession to our advantage so i've now fixed the gyro into a gimbal so it can move in two axes and we're going to spin the gyro up and see what happens so now we can see as i tilt the yellow part the gyro moves with a perpendicular force and makes the red part roll and that seems to work pretty reliably this of course works the other way around as well if i move the red axis then we can see the yellow axis moving in a perpendicular direction however our gyro can also creep which means if we force it to another angle it still works and it doesn't know which way up is there are various videos on youtube of things balancing using this method so here we can see the gyro can move in tilt but it has quite a lot of inertia because it's heavy so it tries to stay in place and that means as the car is moved in roll the gyro exerts an opposite force perpendicular to its own axis to balance the car on two wheels and that seems to be working pretty well so now i've made something that balances on two points with the gimbal attached so now we're going to spin up the gyro and see if it'll balance just like the balancing car and that works for a time until the gyro creeps and then it just falls over this is probably because my gyro has hardly any inertia so it does spin but it also doesn't want to stay in place very readily so the gyro creep is really noticeable but it does prove the principle that we can move the gyro in one axis to balance the whole device in the other i added some nuts to the bottom so the gyro tends to stay upright to see if i can passively keep it upright and stop it creeping but that just seems to make things worse but what about if we could control the tilt of the gyro actively with a motor and use that to exert a force on the role of the whole device this example is using an inertial measurement unit to measure the roll and making the gyro respond automatically with some control electronics and that seems to balance really well it's made of metal and you'll notice that gyro looks extremely substantial there are also various commercial devices available that use this method for stability this is the sea keeper which is for yachts you'll notice that the gyro moves in tilt and that stabilizes the boat in roll it runs at about 10 000 rpm as far as i can tell the flywheel weighs 100 kilograms but it seems to work pretty well it has active control so it's measuring the roll of the boat and compensating the gyro in tilts but the whole thing runs in a vacuum and uses around a kilowatt of power there are quite a few demos on youtube with this in different types of boats that you can check out it's important to point out at this stage that gyroscopic balancing or stabilization is different from a reaction wheel in these examples you can see a reaction wheel moving in opposite directions around a center point and that's just twisting the device in the opposite direction to make it balance so the next thing to try and do is build a device where we can actively move the gyro in tilt with a motor to stabilize the whole device in roll but before we look at that it's time for a quick add from the video sponsor which is morning brew catching up on the morning news used to take a while mainly having to check out various news and social media sites for the top stories but now i love starting my day with morning brew which is a free daily newsletter and it comes out monday to sunday morning brew gets you up to speed on business news in about five minutes and compared to traditional news which can be a bit dense and boring morning brews witty and informative this week i found out about facebook's new social audio initiative which sounds like they're going after clubhouse to me and also found out that mcdonald's are partnering with k-pop band bts globally so wherever you are in the world you'll be able to order a bts meal which by the way is apparently 10 mcnuggets with sweet chili and cajun dipping sauces medium fries and a medium coke so there's no reason not to sign up to morning brew if you're interested in business finance or tech it's completely free and takes less than 15 seconds use the link in the description to subscribe to morning brew today right it's time to 3d print some more parts i guess [Music] thanks to 3d fuel for the filament for this project and lots of other projects so check out my channel for more 3d printing projects and check out 3dfuel.com i'm using a brushless motor which is 160 kv and it's a 92 25 motor so a fairly big one and we're going to use this motor to spin up the gyro my gyro is made of a 3d print and i've put a groove in it so i can put lots of ball bearings in to give it some mass however they don't really fit properly there's a bit of a gap which means it probably won't be very well balanced and spin on center very well they'll do for our purposes for the test on top of that is another disc which screws down all the way around to hold the ball bearings in that of course fits onto the motor and it's bolted down with four m3 bolts i'm driving it from a skateboard esc which should be fine and if we spin that up i'm hoping all the ball bearings evenly distribute around the groove so you can see there's some wobble but it's not looking too bad as we get faster and faster that wobble should get less noticeable but you can still see it walking slightly so it is spinning slightly off centre i'm going to start by making something that can stabilize a hull like the sea keeper so i've printed this whole boat shape cross section i'm putting it on a rubber mat so it's not too slippery because it's smooth we're going to use a servo to tilt the gyro around thanks to robotis for the dynamics or servo this is one of the spare ones from the really useful robot arm project which is fairly hefty but should be more than adequate for this job i'm using the dynamics or shield for arduino and so far i've just connected a pot so i can turn the knob and turn the servo until the gyro and see what the effect is on my boat hole so obviously my boat hole will roll freely side to side and that seems to be pretty free to move and obviously there's quite a lot of oscillations there until it settles and of course my gyro will move in tilt which is in the opposite direction and i should be able to exert a force on the roll once the gyro is spinning it takes a little bit of time to get up to speed but it gets there eventually and by the way i added some pieces of metal bar on the left there to compensate for the weight of the gyro so it naturally settles in the middle and things look evenly balanced and now as i tilt the gyro we can see it moves the boat hole in roll so this is pretty much the same test we did at the beginning with the passive gyro but with the gyro locked in place we can see it does absolutely nothing to stabilize the roll of the boat hole if i try and roll it we can see we still get lots of oscillations and that's still really unstable so now we need to actively stabilize it but that involves measuring the angle of roll so we backed our inertial measurement unit with its solid state gyro and accelerometer in that we can read the angle i've attached this to an arduino pro mini and it's actually attached with a serial line to the arduino mega so i can put the inertial measurement unit on the boat hull and read that data remotely on the arduino that's controlling the dynamics all and we can see we get a nice envelope of motion there and of course attaching it to the boat hole means that we can read when it's being tipped and hopefully actively control that gyro to compensate to start with i've made a one to two relationship so every one degree of roll moves the gyro two degrees of tilt but let's see what happens when we power it up so we can see it kind of dampens it tipping back but it doesn't kill the oscillations and if i get it wrong then it makes more and more oscillations as the gyro is constantly trying to catch up but doing it a bit late and actually causing the roll to be much worse as the gyro moves in tilt so we need a better controller so we're going to use a pid controller that i'd use in most balancing robots and you can read all about this on wikipedia ultimately this will allow me to control how fast we accelerate towards the desired target and also damp the response i'm tuning this manually by trial and error and it's very easy to get it wrong in fact this has made it much much worse than just having a linear relationship so we need to keep tuning the proportional integral and derivative terms of the pid controller this is the temp 2 and you can see it's kind of starting to work there so it's actually killing the oscillations a bit but it's far too slow to respond for short sharp movements after quite a bit of work off camera i finally managed to make a response which is fast enough to respond to the motion but also damps the response to stop the oscillations this is similar to what we see in the sea keeper and other stabilization systems and just to remind ourselves what it's like with it switched off obviously that's much freer moving and oscillates all over the place even with the rubber mat in place so that works well but then i decided to make things even harder on myself and add this extra yellow keel part to the boat and that means it doesn't settle in the middle anymore and to balance it actually has to balance on a single point even though it's curved and on a rubber mat i can't make it stay there even if i try really hard to balance it the first test is a control test we've got the gyro spun up to speed but no active control there is some backlash in the servo but otherwise the servo is locked in place and that just demonstrates that it still won't balance in the middle i spent quite some time doing extra tuning on that pid controller to get our first version which actually balances on the edge and that's pretty amazing you can see that it's totally unsupported and it just balances there this version of the controller will survive light touches so if i touch the mechanism we can see that it wanders a bit and the gyro compensates however it's not very good for anything more than a light touch and eventually just loses it completely and will fall over if i push it too hard i tuned up the next version so it's a bit more aggressive it still balances okay but if you push it or there's any external influence on it then oscillations build up too much and it over compensates and eventually just falls over this is my final tuning for now we can see it balances perfectly well and it'll also be fine with an external influence of quite some force now the flywheel is constrained to only move to 25 degrees so whatever you do you can't push it so that the flywheel would exceed 25 degrees because it can't balance i can give it quite a shove and it should kill the oscillations eventually within a couple of oscillations and return to the center point we could probably tune this up to be slightly more responsive however there are a number of issues with the setup namely that the gyroscope doesn't have quite enough mass in it if it had double the ball bearings it will be much more responsive also you can see the inertial measurement unit circuit board getting shaken around as the gyroscope spins off center so my inertial measurement unit data that it relies on is probably quite noisy but nonetheless i'm pretty happy that i've actually managed to make that balance and tune up my pid controller with the right parameters and for anyone interested these are typical parameters you'd find on a two-wheel balancing robot where the d term is roughly 0.1 of the p term and the item is 10 times bigger i will be publishing the code and the cad for this if you want to build one and try re-tuning it yourself and of course when i power down the gyroscope the whole thing just falls over one issue we still would have is that we would still get some rotation in your while the gyro is tilted as we got with our original gyroscopic procession example however there are ways of compensating for this as dimitri sakolov has done so with jairu bot this has two pairs of counter rotating gyros which tilt in opposite directions making a scissor motion this robot has a static gate which is basically moving its leg joints to fix positions on fixed timers and the gyroscopes move at a fixed rpm the dynamic motion comes from tilting the gyros as i did in my example but moving them in pairs so there's no rotation in your i'm really happy that i managed to tune this up to balance on the edge like that with this gyro and i managed to make a controller that works even if my imu data is a bit noisy and the whole thing isn't quite ideal opens up quite a lot of possibilities for robots looking at gyrubot you can see how uncanny it looks just walking along there with the body just keeping its balance and the legs doing pretty much anything without any dynamic positioning as far as i can tell so there's quite a lot of possibilities for walking robots most of the walking robots i've built today even the bipedal robots actually use the solid state inertial measurement unit to go and shift their mass side to side like a human which is quite a hard thing to achieve so this might be an easy solution be quite good to put one in a robot dog and see how it performs disadvantages of course are we need to carry around all these gyros which could get quite weighty and the mechanism to move them and the batteries to power them but i guess that just means having slightly stronger legs so i'm going to publish the canon code on github the links in the description to this video if you'd like to build one and experiment with it and if you'd like to support me through patreon or youtube channel membership then those links are in the description below and youtube channel members and patrons can get access to all the videos up to a week early and also sneak peeks and pictures of what's coming up and be part of that discussion all right don't forget to like the video if you liked it and subscribe for more alright that's all for now [Music] you
Info
Channel: James Bruton
Views: 165,785
Rating: 4.9538159 out of 5
Keywords: gyroscope, gyro physics, making a balancing robot, build a robot with a gyroscope, how to gyroscopes work, how gyroscopes can be used, stabilisation with gyroscopes, 3d printed robotic parts, 3d printing a gyroscope, motorised gyroscope, gyroscope project, homemade gyroscrope, gyroscopes used in robotics, how to build a robot, 3d printed physics experiment, physics experiment
Id: UVJx8T8wTQA
Channel Id: undefined
Length: 18min 18sec (1098 seconds)
Published: Mon May 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.