HAL9000 : Ball Balancing Robot #2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello it's part 2 of Hal 9000 the robots which balances on a ball and we started this last time I'm revisiting a bull balancing robot I made some years ago which was themed like bb-8 from Star Wars now is one of my first Arduino projects it didn't work all that well it kind of balanced but it was very temperamental so now I've come back to improve the hardware and the software to make something that works pretty well hopefully the main improvements are using brushes motors with encoders so we've got lots of power and agility for balancing and also accuracy and also using an inertial measurement unit that does the DMP onboard so we get much more accurate results about how data about the robot tipping around so we're still going for four wheels which is what we did before there's various pros and cons between three and four wheels but four wheels should be fine my wheels are built on suspension so that they should be okay and it should grip the ball in both axis now this project is going to be open-source I'm going to publish all the canon code when it's done and if you'd like to support me on patreon or for a youtube channel membership than those links are in the description below patrons and YouTube channel members can get all the videos up to a week early which means that they've probably already gone next week's video and don't forget I've got a merchandise store if you'd like to support the channel that way as well the main thing I've done since last time is painting the ball black this was originally a two-part expanded polystyrene ball and it was already painted with liquid latex with acrylic paints mixed in to get bb-8 ball pattern I've now gone on to mix molding latex with black acrylic paint to make quite a thick rubber solution that I painted several coats on all over there are some things and dents in it but it's quite grippy and that should just be fine I really like to get a rigid fiberglass ball at some point but I can't immediately find one for sale I've also taken a dremel to the aluminium bits in between the rollers on these omnidirectional wheels that I'm using because they were sticking out to match the contour of the wheel but of course the ball sticks out the other way which means sometimes they scrape a little bit so I've gone and cut all of those back on all of those pieces on all four wheels so I've installed two o drives on this mount here we've got one here and one on the other side you can't quite see and those are connected to both the motor power for both the motors and the motor encoders both motors so each o drive controls two motors this one's connected to this motor and the one on the other side and that's the one that moves in one direction the other one will be responsible for moving it in the other axis the O drive uses those encoders so that it can energize each phase of the motor it's a three-phase motor and it can energize them at the right time as the motor is rotating so it knows what the motor stator position is that's really important for driving three-phase brushless motors it also uses the encoder for position and velocity control and we can feed it that date over serial from an Arduino the brushless motors of course are really powerful so we get high torque at low speed and high torque at high speed and that's a really important characteristic for a motor and drivetrain for a balancing robot I fifty two eleven point one volt lipos in there which will give us a total in series of twenty four volts and I should be fine for driving all these motors the O Drive is actually a 56 volt version where we're not going anywhere near that in this build and that should be sufficient for powering the motors at the right speed with the right amount of torque and it currently weighs in at about four and a half kilograms they've got quite a bit of mass building up there and that doesn't include the head cosmetics which pop on top there and the rest of the control electronics but that's okay because what we really want is the heavy mass on top and the light MT ball underneath if I were to balance our stick on my hands and try and move my hand around underneath to keep it balanced it's much easier with a heavy mass on top and that's because the heavy mass on top has lots of inertia that keeps that still and my hand can move around really quickly underneath in this case is exactly the same the ball is essentially the wheel of the robot and we all appear to move that very quickly to keep it under the center of gravity of the RO ball to keep it balanced so having the mass on top is really good and having the ball light underneath is exactly what we want if we're the other way rounds then the robot wouldn't be to control the ball and it would essentially end up driving off or it wouldn't be able to move around and it would stay sat on the top with the ball just embedded in the car pay if it were really heavy and a little robot that would just rise to the top and nothing else would happen the next thing we need to do of course is put some control electronics in there to actually make it actively balanced on the ball but before we do that is a quick add from the component sponsor for this video and that is called components core components stock Arduino Raspberry Pi micro bit and Men many other electronics and project parts there are reseller for Adafruit spark fine electronics and teensy so you can get all these parts and associated modules for your projects such as shields hats sound boards and displays cool components also stock a range of robot arms and accessories and lots of other components like switches LEDs cameras and controllers so you may remember lye film like Sonic the Hedgehog balancing robot the final part of that video series in cool components warehouse cuz there's lots of space to go whizzing around and that projects a really good primer building a two wheel balancing robot for building a robot that balances on a ball so check out that series and also the LG robot I built also balanced on two wheels and both of those projects use brushless motors [Music] yep we're going to be using the teensy 4.1 again and the MPU 6050 and this is the Adafruit mpu 60 50 and the reason I like that board is because the NPU 60 50 does the DMP on board which means it will mix the gyro and accelerometer data for you and just give you the answer in degrees for tip in at least two axis and rotation as well now the teensy 4.1 is a 600 megahertz arm cortex-m seven it's far over specs for this project we can easily build a balancing robot with a good old Arduino mega apart from is huge and the teens he's really small so I've soldered everything onto the perma proto board all these things on socket so I can replace them or change them upgrade them or use them in another project in the future the NPU 6050 is I squared C and I've also got the NRF 24 lo1 radio chip here and that's an SPI device that's gonna allow me to use a remote control to control the robot so I'm using Jeffery bugs I squared C dev Lib library to read the data from the MP u 6050 there's a number of examples for Arduino the important one is the IMU 0 sketch and that allows you to calibrate the MP u 6050 it dumps out some values you put into your own sketch and that means that even though their manufactures slightly differently in the factory we get that calibration data and we can get a 0 points correct so I'm currently using that sketch to outputs the data for the MP u 60 50 which is the last two columns and I'm also using the NRF library to go and read the axis from the remote and I've got three axis there so we've now got our remote and this is just an Arduino mega it's got two three axis joysticks in it which also rotate as well as moving in the other axis but I'm only going to be using one axis on one joystick and two on the other ones that's all we actually need to control the robot this is actually the remote from the LG robot and obviously we're just using the NRF 24 lo1 and reading the same data structure so now we can move that remote around this axis is two of those data columns and this one is another one which is going to actually rotate the robot head around and that's why we need three axis we're also reading the MP u date when you can see that in the last two columns as I tip it one for pitch and one for roll and as you can tell from the funny shape mounted so on if it's just on there and that mean the NPU 6050 axis are aligned perfectly with the wheels for the two axis we're going to drive with so I now need to wire in the serial lines and I need to wire in some power and we should wait to get this thing tuned up now I have had some issues with the NRF 24 la ones being close to brushless motors and that causing interference so I'm not sure if we're going to be ok with the brushless motors down there we do have the power wise for the brushless motors quite close and I'm not sure exactly where the issue is so I'm going to make the lines for the serial lines long enough that we can raise this up and this plenty of space in the robot head to mount this higher and try and get some clearance from the nasty RF we might get so we're all wired in we have the two main batteries wide in series and those are fed to both the old drives so that we get 24 volts underneath this platform is actually another battery which is an 11 point 1 volt lipo and that feeds a separate regulator to power the electronics so I'm using an adjustable regulator here set to 5 volts and that goes to my perma proto board and it powers everything now there's a 3.3 regulator on board the teensy and that's actually powering the NRF 24 lo1 which is a 3.3 volt device but the NPU 6050 despite being a 3.3 volt device has its own regulator on board so that's why to the 5 volts as well I also have a common ground wire that goes from the grounds from this regulator and the battery and the ground for all the electronics into the ground of the O drives we've got common grounds throughout the system and that means we don't need a separate ground for our serial comms so we've just got the Rx and TX Y's coming down to the O drive because already commonly grounded for out the whole system so that's fine and we've also got another ground wire that comes down to the reset pin now that will get grounded to reset boffo drives to cut the motors off so it's a bit like an emergency stop and the advantage of not having all these ground wises we don't introduce any ground loops if we were to ground in more than one place at once then we essentially make a big loop antenna without ground wires that can pick up lots of nasty radio noise and there's now this top panel which has two pots which will be for trimming up each axis because the robot isn't perfectly symmetrical and perfectly balanced all need to vary those zero points for the IMU data so we can get it to balance perfectly on the top of the ball we've also got two switches and one of those is for O Drive initialization and one of those is the reset which resets the o drives and that's kind of the emergency stop so that is all the motors powered up and now we've got holding power using those encoders to hold the motor position and the little sequence you saw there is the calibration that calibrates the motor stator position versus the encoder position so it can energize the motor phases correctly now I can set an offset here we've got Zed index on those encoders so we could have a quicker start up where we can pre calibrate that offset but I'm not using that for now so we're just using the full calibration sequence on the O drives power supply is incredibly important for this obviously this has to balance on a ball it weighs quite a bit and we don't want it to fall down because the data is bad so both the mpu 60 50 and the NRF 24:01 incredibly susceptible to bad power so that's why we've got that set or a battery and we've isolated from any transients on the main battery lines that would come back from those brushless motors and we've also got that single point of grounding so we don't get ground loops now we are using regenerative braking as well so I've not got the brake resistors on the O drives and I've used the O Drive tool to calibrate the O Drive to use the battery for braking so when it decelerates the motors it recharges the batteries and that's another reason we could have transients on the power lines that would affect the electronics and I've isolated that to a separate battery so now we need to make an algorithm that will actually allow it to balance on the ball reading that I am.you data and moving the wheels in response [Music] [Music] [Music] so of course what we're trying to do here is tune up a PID controller which has three terms we can choose to go and make the robot balance and I've got quite a lot of experience with balancing robots which I've shown in this video and in part one so should have been an easy tune-up however it feels like I can tune it aggressively enough to balance is almost there but as soon as I try and put that bit of extra gain on to try and make it sensor properly then basically as you can see the wheels are spinning out of control and I think that's for a number of reasons so I think my suspension system and the wheels okay because if I turn it this way all the wheels run absolutely fine but when I come to move it and what axis or the other then it's not quite so good and you can hear are nasty scraping sounds oh it's stuck so this is an expanded polystyrene ball and I've coated it of liquid latex as I said at the beginning but the ball is quite soft I can stick my finger right into that and it's quite kind of flexible and I thought that would give me extra grip but I think what's happening is the wheels are actually getting stuck in with a little Omni wheels around the outside of the wheels they're getting embedded into the ball and I've still got these metal pieces in the middle of the wheels which are actually causing the scraping and you see I've carved out several lumps of the rubber here which is just coming off the ball now so I'm pretty sure that's what's happening when it's moving in one axis the wheels run fine this direction when they have to move the other way and they're in the wrong position then the metal is actually scraping and carving up the ball surface and that's causing loads of friction which of course means the other axis can't move easily all the time whatever thought is whether the wheels are far enough apart so if they grip around the ball enough and perhaps if they did when it tilted over then there wouldn't be so much gravity just pulling it off so it falls off and the wheels would still be gripped around it however the original one I made which actually were better at this stage the wheels are actually much closer together because they have to fit inside bb-8 head however this is much lighter so probably the effect of those sticking in the ball isn't so much and it's the same ball remember and so they probably don't get jammed on the bits in between the only wheels as March which is probably why this almost worked I really shouldn't have done and check out part 1 for more details and what I did in the first place several years ago and of course what I really want to solve here is the problem of a robot that balances on a ball and I want to publish that as open-source when I'm done I have built various droids in the past which I detailed in part one which have the mechanism inside the ball another to bb-8 and also be b9e and that had the head held on with magnets of course on a head control arm that could move in three axis as well as three axis of rotation and so on in the ball so I've already sort of solved that problem multiple times and there's lots of other builds out there but this is something significantly different so I fall about 3d printing a rigid ball to put this on I did that for my BB 9e build and that did have the mechanism inside with a head held on with magnets but I had casters on that head and those are really forgiving so even though there's some blemishes in the surface and the details of pp 9e those casters ran on that rough surface okay with this it's going to be a lot more critical to get that ball smooth so at the moment I'm thinking about purchasing a fiberglass ball which is perfectly smooth on the outside so we're gonna have to come back for a part three on that once I've acquired one and of course we've still got a Hal 9000 head to put on this is going to be Hal 9000 from Space Odyssey 2001 themed because I don't want to do any more BB droids having done four already so now forget subscribe for more updates on this project and all the other projects and if you want to support me through patreon our youtube channel membership the links are in the description below alright that's all for now [Music] [Applause] [Music] you
Info
Channel: James Bruton
Views: 83,296
Rating: undefined out of 5
Keywords: hal9000, 2001 a space odyssey, balancing robot, how to build a balancing robot, arduino controlled robot, HAL9000 IRL, real robot, ball balancing robot, HAL9000 balancing on a ball, brushless motor robot, how to build a robot, xrobots, james bruton, building an arduino robot, disco robot
Id: ntkT41rJFI4
Channel Id: undefined
Length: 16min 29sec (989 seconds)
Published: Mon Jun 29 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.