Home Creators Posts Import Register Favorites Logout
haven't archived this post yet. have a subscription? use the importer!

Content

The videos got approved, so here's part 1 for Patrons - this one goes out publicly on Tuesday next week.  I should have part 2 for Patrons early next week, and that will go out the week after.

I'm probably not making the CAD and code public for this build, but if any Patrons want the code just let me know.

Files

Previews only

Building a Two-Wheel Balancing Robot | with LG XBOOM Go Speakers

This video is in partnership with LG. LG XBOOM Go Brand Site : http://bit.ly/2IvJPrK - Check out the NEW White LG XBOOM Go! LG asked me to build a robot with one of their LG XBOOM Go speakers as its head. I've built a two-wheel balancing robot which used a gyro and accelerometer to stay stable. I'm using a Teensy 3.6 running a PID controller to keep the robot stable. Next time I'll add the arms and the radio controller. ① HARDWARE/SOFTWARE What more important hardware is there in life than the clothes on your back and the cup in your hand. You can get your own Robot X tee or openDog mug at the link below: Teespring: https://teespring.com/stores/james-bruton Below you can also find a lot of the typical tools, equipment and supplies used in my projects. Some of these links are affiliate links, meaning, at no additional cost to you, I might earn a little extra if you click and make a purchase. Lulzbot 3D Printers: http://bit.ly/2Sj6nil Lincoln Electric Welder: https://bit.ly/2Rqhqos CNC Router: https://bit.ly/2QdsNjt Ryobi Tools: http://bit.ly/2RhArcD Axminster Micro Lathe: http://bit.ly/2Sj6eeN 3D Printer Filament: http://bit.ly/2PdcdUu Soldering Iron: http://bit.ly/2DrNWDR Vectric CNC Software: http://bit.ly/2zxpZqv And don't forget the code for some of my projects is available on my GitHub here: https://github.com/xrobots ② GENIUS No MacArthur grant yet. But while I’m still waiting by the phone for that call, maybe you might patronise me with your Patreon-age or pick up some of my merchandise. Or, if you’re all out of digital cash just comment on one of my hilarious Instagram pics, pop me a Tweet or generally yell in my direction. Patreon: https://www.patreon.com/xrobots Teespring: https://teespring.com/stores/james-bruton Instagram: https://www.instagram.com/xrobotsuk Facebook: https://www.facebook.com/xrobots.co.uk Twitter: https://twitter.com/xrobotsuk Huge thanks to my patrons, without whom my standard of living would drastically decline. Like, inside out-Farm Foods bag decline. Plus a very special shoutout to Aleph Objects, Inc who keep me in LulzBot 3D printers and support me via Patreon. Why not join my community, who are mostly made up of actual geniuses. There’s a Facebook group and everything: https://www.facebook.com/pg/xrobots.co.uk/community ③ XROBOTS Former toy designer, current YouTube maker and general robotics, electrical and mechanical engineer, I’m a fan of doing it yourself and innovation by trial and error. My channel is where I share some of my useful and not-so-useful inventions, designs and maker advice. Iron Man is my go-to cosplay, and 3D printing can solve most issues - broken bolts, missing parts, world hunger, you name it. XRobots is the community around my content where you can get in touch, share tips and advice, and more build FAQs, schematics and designs are also available. ④ MUSIC AND SFX The majority of the music and SFX used in my videos is from Epidemic Sound http://share.epidemicsound.com/xrobots

Comments

Anonymous

Hi James, your productivity is through the roof! I know a trick to make it even more stable - seen on "Gear down for what". You currently have one PID controller where the angle is the setpoint. The trick is to feed that angle into a new PID controller where the motor speed is the setpoint. That way you shouldn't have to do any tuning and it won't be drifting. He has a video on YouTube where he explains

XRobots

I saw that, although when the PID is solved the output is zero, which means when it achieves the velocity you want from the controller it would zero the setpoint. So I think it the 'outer loop' PID would need to actually be aware of the robot's position and drive that based on incrementing and tracking the desired position when you push the stick forward.

Anonymous

I think it will work if done like this: PID 1(setpoint: angle, output: motorspeed), PID 2(setpoint: motorspeed, output: angle - which is fed into pid 1). I haven't tried this on my balancing robot yet but in my head it sounds like a great idea 😁 When controlling the motor speed you are controlling the derivative of the position so it should work

XRobots

I still think that when you're travelling at the correct desired velocity, then the PID will resolve to zero and set the angle of the other PID to zero.

Anonymous

That is fine. Because then you have already accelerated and is moving at the desired speed. Tilting/angle = acceleration so if you are traveling at the desired speed no more acceleration should be needed? Or maybe I am missing something

XRobots

Is the PID not driving the angle (not acceleration)? - so when it is solved it would make the angle zero and the robot would stop(?)

Anonymous

I think you have to think about the angle as the acceleration. If the robot is standing still and it wants to move from point A to point B then this is how it is done. 1) it tilts to gain velocity 2) it remains tilted until the desired traveling speed is achieved 3) it decreases the angle to somewhere around 0 deg(a slight angle will be present because of drag/friction) 4) The robot will tilt in the opposite direction in order to slow down. The misconception is this: The robot can in fact move forward while the angle is 0

XRobots

I don't get that. When the current setpoint/angle is zero is doesn't drive forward. It o;y drives when it tries to hold a positive or negative angle.

Anonymous

Try thinking of the robot as if it was in an "ideal" world with no friction/drag. Then if the vehicle is tilted, at some random angle, then it will keep accelerating in that direction - and in theory it would never stop moving faster. To slow down it has to tilt in the opposite direction. If it just went to 0 degrees then it would continue at a constant velocity. In the real world we have a little friction/drag so therefore the vehicle will stay at a slight angle when moving at a constant velocity and it will tilt to large angles when accelerating or descellerating.

Anonymous

You definitely have a very good starting point but if you implement the method above it wont drift around and it should be easier to control

Adam Purdie

This is really cool :) looking forward to the next vid.

XRobots

I think it depends how the first PID controller is tuned. At the moment if it's Setpoint/Angle demand is zero then the robot tries to achieve zero degrees and stops. If it were tuned so there wasn't enough gain to 'catch up' when it's driving, then the second 'velocity PID' would work. I guess. That said, you'd have to switch on the second PID function while it was already balancing, otherwise you were waving it in the air with the wheels spinning away the angle setpoint would get biased so much it would never get balancing to start with.