Тёмный
No video :(

My Wine-Glass Carrying, Self-Balancing Inverted Pendulum Robot 

Shay Sackett
Подписаться 287
Просмотров 20 тыс.
50% 1

This is a project I've been working on over the past couple years in my free time and at this point I'm pretty happy with my progress. I learned a lot about control theory and programming through this project and I'm looking forward to taking on even more ambitious robotics projects in the future!
If you want more information related to this project, check out my website and blog post on this project:
www.shaysackett.com/inverted-...
Software wise, the code consists of over 500 lines of Arduino code. I have two nested PID loops running in tandem, one PID loop controls the angle of the robot, and the other controls the velocity of the robot.
I'm using an MPU-6050 for the inertial measurement unit, and a complementary filter to fuse the gyroscope and accelerometer data together.
The main code loop is run every 4 milliseconds, or 250 times a second.
The motors are 30:1 geared dc motors from Pololu with 64 CPR encoders. These encoders could be better, they create a noisy signal which limits their usefulness and accuracy.
Link to the github page for the code and source files: github.com/ShaySackett/Self-B...

Опубликовано:

 

15 авг 2019

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 57   
@coco805
@coco805 2 года назад
Impressive how small you were able to make this robot! Really cool demonstration.
@ShaySackett
@ShaySackett 2 года назад
Thanks!
@SeniorSoftwareVlogger
@SeniorSoftwareVlogger 2 года назад
- What is my purpose? - You carry my wine glass.
@ShaySackett
@ShaySackett 2 года назад
😂 exactly!
@dylansullivan9229
@dylansullivan9229 4 года назад
Seems like it is running even smoother than when I saw it at the Maker's Faire! Awesome! Hope all has been well!
@ShaySackett
@ShaySackett 4 года назад
Thanks Dylan! All has been well thanks, I wish the same for you!
@stardustmixture
@stardustmixture 2 года назад
Really nice project. Thank you for sharing.
@ShaySackett
@ShaySackett 2 года назад
Thanks for checking it out!
@88_WLE_88
@88_WLE_88 10 месяцев назад
Nice one, congrats!
@malcolmhodgins1671
@malcolmhodgins1671 4 года назад
Impressive!
@ShaySackett
@ShaySackett 4 года назад
Thank you!
@ConsultingjoeOnline
@ConsultingjoeOnline 2 года назад
Nice Job! Great tutorial and code! *Subscribed!*
@ShaySackett
@ShaySackett 2 года назад
Thank you!! Appreciate it!
@dhruvthakkar808
@dhruvthakkar808 4 месяца назад
Accha laga bhai
@robotics_jeong
@robotics_jeong 2 года назад
Wow very cool!!!!!
@ShaySackett
@ShaySackett 2 года назад
Thanks! Appreciate it!
@mtzmechengr5781
@mtzmechengr5781 2 года назад
Great !!!! Is there a blog describing this work? Simulations, code, 3d modeling, etc.
@ShaySackett
@ShaySackett 2 года назад
There is! www.shaysackett.com/inverted-pendulum-robot/ I have also linked to the github for this project in the video description that contains all the 3D models and code.
@aaqilkhan
@aaqilkhan 2 года назад
How does it react on an inclined plane?
@ShaySackett
@ShaySackett 3 месяца назад
Not sure, never tried it!
@mj-os4fr
@mj-os4fr 3 года назад
Hi! Nice project. I have read your webpage and it looked very cool. How did you connect the li-po battery to Arduino without frying it?
@ShaySackett
@ShaySackett 3 года назад
Thanks I appreciate that! Good question, I'm using the Arduino Mega's DC jack which has a built-in voltage regulator and can handle a 7-12V input. The LiPo battery I'm using is a 1S 3 cell LiPo, with a max output voltage of 12.6 volts at full charge. 12.6V is a bit higher than the 12V jack the Arduino is rated for, but I took the chance that there would be some wiggle room left in that 12V spec, and so far it's worked out ok for me!
@rodstartube
@rodstartube 2 года назад
a PID calibration is urgently needed
@two697
@two697 2 года назад
Pretty cool. How did you get started with robotics? I want to start making stuff like this but have little experience with it
@ShaySackett
@ShaySackett 2 года назад
I have been interested in robotics since I was a kid, but I first started building stuff after joining my high school's robotics team. I would recommend choosing a project you're interested and curious about, and start building something! When I began this project, I had little programming experience, and I wasn't sure I would be able to make it balance, but I took it one step at a time and focused on solving one small problem at a time, and eventually got to the point you see in this video. Stay persistent, don't be afraid to fail or switch approaches, don't rush yourself, and try to focus on "the journey", as cliche as that sounds, not the end product. It's easy to get caught up in fantasizing how cool the final product will be, but at least for me I've found most of the enjoyment of these projects comes from what I learn and trying to solve tough technical problems. Hope that helps! Good luck!
@ryanmckenna2047
@ryanmckenna2047 2 года назад
A Robot waiter, nice!
@muhammadqaisarali
@muhammadqaisarali 2 года назад
Part list/link please
@lukaslundgren8448
@lukaslundgren8448 3 года назад
Cool project. Are the parameters for the control loops tuned through testing or modelling? Also switching the frequency for the pwm can remove the audible noise from the motors
@ShaySackett
@ShaySackett 3 года назад
Thanks! The parameters for the control loop were tuned through testing. I made a wired remote with 3 potentiometers that allowed me to tune the P, I, and D terms while the robot was balancing which made things very easy. I elaborate more on this remote and my tuning procedure in my blog post I linked to in the comments if you are still curious.
@utetwo9709
@utetwo9709 3 года назад
@@ShaySackett excellent idea! I might try that myself!
@ShaySackett
@ShaySackett 3 года назад
@@utetwo9709 Thanks! Yes it's well worth the time and effort, I guarantee it will save you SO much trouble trying to tune the PID algorithms! What I found is if I couldn't tune the PID algorithms to have sufficient performance in about five minutes, something was wrong with my code. I think that's a good rule of thumb to have. It's not worth spending hours or days trying to get a PID algorithm tuned only to discover your code is the real underlying issue.
@hughenthomas935
@hughenthomas935 4 месяца назад
Very impressive what payload can it scale upto ?
@ShaySackett
@ShaySackett 3 месяца назад
Never weighed it deliberately, but it can balance a water bottle off-center of the robot pretty well.
@basicmachines
@basicmachines 2 года назад
Great project and nice results. Did you find you had to change the PID tuning when the robot was loaded (e.g. with wine bottle) compared to when empty?
@ShaySackett
@ShaySackett 2 года назад
Thanks I appreciate that! No I did not have to change the PID tuning when the robot was loaded! This was actually a direct result of using 2 PID loops. The first PID loop controls the speed of the motors directly, and commands the motors to speed up or slow down to achieve a set angle (in a perfect world this would keep the robot perfectly stable and balanced). However, we don't live in a perfect world, and I found my robot had a tendency to drift and "run away" over time, and build up momentum in one direction or the other; I discuss this more in the blog post I linked to in the comment section if you want more details on why that happens. Regardless, I added a second PID loop whose job it is to command the robot to always have a linear (forward or backwards) velocity of zero. The second PID loop does this by commanding the angle of the robot to change to counter and motion forwards or backwards. This second PID loop sets the desired angle of the robot, which is the input to the first PID loop, so in effect the first PID loop is "following" the commands of the second PID loop. What this means is that this robot is not 100% reliant on having a good PID tuning to achieve balance; if there is a load that is off center or drags the robot one way or another, the robot realizes it is speeding up, as an example lets say the robot is leaning and moving to the left, and as a result that "second" PID algorithm I mentioned commands the robot to tilt to the right to slow the falling/lean to the left. In this way, the robot can achieve equilibrium when loaded with objects it was not expressly programmed to carry. I never programmed it specifically to carry any of the objects I showed in this video; that was all a happy by-product of fixing the problem of my robot's tendency to "run away". I hope that answers your question! I got long winded there, but that's a pretty thorough explanation of "why".
@basicmachines
@basicmachines 2 года назад
@@ShaySackett Great explanation. Thanks. I think that approach is called cascade control.
@ShaySackett
@ShaySackett 2 года назад
@@basicmachines I did not know that, thank you for that information! I will have to look into that. I think you also left a comment on my blog the other day recommending a controls bootcamp playlist; those looked very good I'll definitely be watching those videos later!
@a.sanusinazareth9213
@a.sanusinazareth9213 2 года назад
My robot does the smoothly driving but I must place a thing in the middle of the tray, otherwise it would run so fast to maintain the balance. What part should I change: KP, KD or KI ???
@ShaySackett
@ShaySackett 2 года назад
Do you have encoders on your robot? I also ran into this "run away" problem. Check out my blog post in the description, I go into more detail there under the "MPU-6050 Software and Complimentary Filters" section. Likely what is happening is caused by the fact the robot has a sense of orientation from the IMU, but no sense of speed. So pretend the robot leans to the right a bit, the motors will speed up to the right to correct for the lean, but now the motors are going faster to the right but the robot is not aware of this and this can create a feedback loop where the motors just speed up and eventually can't keep up and the robot falls over. No amount of tuning the PID loop will help here. This is why I added encoders to my robot. Add encoders, then add a second PID loop that controls the speed of the robot. So the goal of this robot is not only to balance, but also to maintain a set speed, say of zero. The speed PID controller controls the angle of the robot to bring the robot speed to zero and prevent runaway. As a side-effect, this is also the first step to getting the robot to drive forwards and backwards. Hope that helps!
@a.sanusinazareth9213
@a.sanusinazareth9213 2 года назад
@@ShaySackett nice. I'll check it out
@ConsultingjoeOnline
@ConsultingjoeOnline 2 года назад
If you were to restart this project what would you change? Motor-wise mostly?
@ShaySackett
@ShaySackett 2 года назад
If I was willing to spend more money, I would have bought motors with better encoders, or bought dedicated encoders that had more resolution. I think what was is limiting the quality of the balancing right now is largely the fact the the encoders are cheap and the DC motors with their gearboxes have a fair amount of backlash.
@ConsultingjoeOnline
@ConsultingjoeOnline 2 года назад
@@ShaySackett Thanks for the advice!
@tsimonge7175
@tsimonge7175 4 года назад
Hello, I am working on the same project. Could you share the code? Thanks.
@ShaySackett
@ShaySackett 4 года назад
Yup! Better late than never I hope, I added all the files related to this project in a link in the description. I haven't looked at it in a while so I hope its ok. Have fun! Good luck with your project I learned a lot with mine.
@hindu4life
@hindu4life 2 года назад
How did you auto balance it
@ShaySackett
@ShaySackett 2 года назад
If you want more detail I would recommend checking out my blog post I linked to in the description. It's too much to explain in a single comment.
@FilmRiggers
@FilmRiggers 2 года назад
I have an application for something just like this that o would like some help with.
@ShaySackett
@ShaySackett 2 года назад
Shoot me an email, I have it listed both on my about page on my youtube channel, and on my contact page on my website. I'll see if I can help you out. I apologize for the late reply
@introvideo5064
@introvideo5064 2 года назад
Hey bro, which engineering major did you pick up?
@ShaySackett
@ShaySackett 2 года назад
Mechanical Engineering!
@ashishgupta7849
@ashishgupta7849 2 года назад
pid or machine learning ?
@ShaySackett
@ShaySackett 2 года назад
In this project I used two PID controllers.
@zrmsraggot
@zrmsraggot 2 года назад
By the amount of wine you put in your glass I can tell you're not from France. Cool stuff tho
@ShaySackett
@ShaySackett 2 года назад
🤣HA thank you for the comment and the cultural lesson! I'll keep that in mind when I visit France in the future, wouldn't want to have a faux pas.
Далее
Self Righting Balancing Robot
14:25
Просмотров 11 тыс.
🌊🌊🌊
01:01
Просмотров 924 тыс.
ROCKET that LITERALLY BURNS WATER as FUEL
19:00
Просмотров 1,8 млн
Cart-Double-Pendulum Swing-up
1:52
Просмотров 8 тыс.
BalancingWii 1.0 - self balancing robot
3:48
Просмотров 48 тыс.
How the portal illusion works
9:42
Просмотров 6 млн
Balancing robot final year project
8:36
Просмотров 219 тыс.
How Robots Use Maths to Move
15:54
Просмотров 443 тыс.