Self Balancing Robot Using Arduino
HTML-код
- Опубликовано: 10 сен 2024
- In this video we are going to learn how to make Balancing Robot using Arduino Nano and dc gear motors.
This video contains in depth code explanation of balancing robot code and calibration of mpu6050 in very easy way.
*Important** : Please note that there is some issue in the connection diagram shown in video.
So I have corrected it and please refer the connection diagram from git repository link github.com/un0...
👉Please subscribe:
www.youtube.co...
👉Components List
✅ Arduino Nano
✅ MPU6050 sensor
✅ DC TT Gear motors - 2
✅ L298N motor driver module
✅ DC Battery 7-12 V (in our case 11.1 3S lipo)
✅ Foam board
✅ Wooden Sticks
✅ Glue Gun
✅ PCB
✅ Jumper wires
👉 Shorts Channel :
/ ujwalnandanwar
👉Code/library and diagram:
github.com/un0...
👉mpu6050 library credit - Jeff Rowberg
👉 Obstacle avoiding Robot
• Arduino Obstacle Avoid...
👉 Camera Car
• Surveillance Car using...
👉 Wi-Fi Car
• Smartphone controlled ...
👉 Hand Gesture controlled car
• Hand Gesture Controlle...
👉 Bluetooth car
• How to make Bluetooth ...
👉 Arduino RC car using nrf24l01+ module
• Arduino RC car using N...
👉Watch more videos:
/ hashincludeelectronics
👉Follow us on Instagram:
/ hashincludeelectronics
#selfbalancingrobot #mpu6050 #hashincludeelectronics #arduino
**Important*** : Guys please note that there is some issue in the connection diagram shown in video.
So I have corrected it and please refer the connection diagram from git repository link github.com/un0038998/BalancedRobot/tree/main/Diagrams
Very nice bro. Self balancing robot is surely a model which can be used to build lot of useful tools
Thank you very much 🙂👍🏻
hello! what do the values KP, KI, and KD do and how do i know which ones to change in order to calibrate it. The current issue with my robot is that as soon as it's turned on, both wheels spin at maximum speed and i'm not sure what the issue is ):
It’s really tricky to set these values . It varies based on robot. You need to set it as suitable for your robot. Please check videos on how we can set PID values correctly . 👍🏻👏🏻
Hi, I coppy your code but it wrong.’analogWrite’ was not declared in this scope
Please follow the exact steps in video 👍🏻👏🏻
sir how to get the values of Kp Ki and Kd for pitch and SETPOINT PITCH ANGLE OFFSET for my robot. Please help. My submission deadline is 3 days from now.
Its not easy to get these values. Its most challenging part. You need to follow the steps which i have suggested at the end of the video . However still it depends upon many factors.
i am getting this msg while compiling the Balanced Robot code " no matching function for call to 'PID::Compute(bool)". Help please
You need get the library from the folder I provided in the code link. Please check .
I have entered the library but still "no matching function for call to 'PID::Compute(bool)'
"
Please install the library from the code link provided by me .
Yours is like mine, won't balance on a smooth surface without runnng away. Can't figure out how to get it to balance on smooth surface and stay in one place.
Yeah I can understand . It depends upon the the robot body motors used and PID values as well 👍🏻👏🏻
I am getting a error of "Error: 13 INTERNAL: Library install failed: moving extracted archive to destination dir: library not valid" when I try to include the zip folder for libraries into the Arduino. Can I talk with you on instagram?
Please use the code from the link provided 👍🏻👏🏻
Can you please tell
HOW TO SET SETPOINT_PUTCH_ANGLE_OFFSET
and how did you got the value as -2.2
Does that value show during the mpu6050 calibration or randomly we must set please let me know
The ideal value is 0. However you need to adjust it if robot runs in either direction . So it might vary based on your robot design .
Hello, There is an error when compiling the code in thi line "yawPID.Compute(true);" . the error is "exit status 1
no matching function for call to 'PID::Compute(bool)'
". Please help to solve the issue.
You need to take the library from my code folder . 👍🏻
Congratulations for 100 subs❤️❤️❤️❤️
I got problem in code rotateMotor was not declared in scop
Can you send the screen shot of error on Instagram? @hashincludeelectronics
Im building a balancing robot myself, but i am having issues with the electrical noise from the motors interfering with the MPU. This makes the (in my case) ESP32 not being able to read from the MPU all the time. Did you have any troubles like this?
Good you are trying to make it with esp32 👌🏻 I never faced such issue with this robot . I was able to read mpu values using Arduino nano .
Superb robo 😘😘 .nice idea 💡💡👍
Thank you so much 😀
it run too fast to balace at some point how can i adjust the motor speed?
You have to adjust the PID values which is little bit complicated. Please check the video and try to follow the step 👍🏻👏🏻
I have tried this project but the motors rotate in only one direction...can help me out?
Same problem
Is it solved
@@WHITE_222 yess
@@YashJain-nh8nh please help me
@@WHITE_222Earlier i used the same motor which they have shown in the video.Then I changed the motor & used 12v Geared DC motor
what is your gyro and accelerometer sensitivity?
My accelerometer sensitivity is +/-2g and gyro is 250. will the code work fine for me?
Yes it’s should work . Give it a try .
Very nice .. very informative
Thanks a lot
Bro pls make a model of Self balancing + Obsacle avoiding robot. Pls i have to go for my zonal science exibhition and pls use a arduino Uno instead of nano.Pls make this model a Humble request.🙏🙏🙏🙏🙏
how did u control the motion of the robo. did u make a controller or ?
As of now we are not controlling it with any controller 👍🏻👏🏻
I have a question: How to connect it using RX and TX Flysky?
It will be a different project altogether . I haven’t tried it yet.
Compiler showing error in undeclared 'rotatemotor'
Please copy paste the code properly 👍🏻👏🏻
Okay but in the code there is also written "rotatemotor" and it is showing compiled completeld but in diagnosis it is showing that
And thankyou for your precious time 😄
@@TIRTHKANDOI please send the screen shot or paste the whole error here 👍🏻👏🏻
@@hashincludeelectronics okay
Very detailed video..
Thank you 🙏. Please stay tuned for more such interesting stuff 🙂
What should be the pid max limit and pid min limit
There is no such limit but you need to find the approximate values for your robot 👍🏻👏🏻
awesome stuffs :)
Thanks 😀
Very Nice👍🏻
Thank you! Cheers!
Can i use arduino uno instead of nano
Yes you can 👍🏻👏🏻
@@hashincludeelectronics will there be any change in connection or code
Why is the MPU 6050 X,Y,Z ,X ,Y ,Z code different from the Balanced_Robot code?
Thanks for checking out the video . However I did not get your question properly. Could you please tell me more about this query?
@@hashincludeelectronics What do you mean the code in the mpu 6050 part shows a different value than the code in the robot's value?
@@hashincludeelectronics If you still don't understand the question you can contact me through this Facebook so I can better explain the problem I'm havingfacebook.com/anhlinh6789sbtc
@@hashincludeelectronics where the minute 9.06 and the minute 11.03 are different values in the axes?
@@servers.LinhIT connected on Facebook .
how do you determine the pitch angle offset???
This you need to do manually by placing the robot vertical . If it tilts one side then change it other way +ve or -ve . Give it a try and also check video 👍🏻
Tell me for controlling which android app are u use ?
We don’t use mobile app to control it . 👍🏻👏🏻
@@hashincludeelectronics so how can control it ?
Great work man! I got a question, What were the criteria used in evaluating the control algorithm?
Thanks for checking out the video 👍🏻 there were many factors I considered . Motors max speed , batteries used , robot frame etc .
thank you for this video. sorry I have a question, how can I write this code for a neural controller, I'm talking about the arduino code that will imitate the PID controller?
Thanks for checking out the video 👍🏻
Very clever! Now here’s a question. Is it possible to combine this robot with using the PS3 controller in a recent video of yours?
Not exactly . In that video I used esp32 with ps3controller. Will have to make lot of changes for it . Better to make this robot with esp32 then.
Awesome
Hi prabhat. How do you manage to find the best videos on RUclips?
Thank you 🙂
Nice robot!
Thank you 🤗
Good Work Bro
Thank you very much 👍🏻👏🏻
Can I use Arduino Uno instead of namo and is code same
Yup . You can use Arduino uno and same code will work .
@@hashincludeelectronics and can I use a single stack insted of double stack design where u use a single whole compartment for battery in down the wheel and moter driver will be there in top Arduino , battery ,and accelerometer sensor will be ther in a compartment will I face any issues ?
Should not be a problem . it’s good to keep battery at the top for proper balancing.
@@hashincludeelectronics can I send u a pic in Instagram?
@@TARUN__46 sure . You can send me email as well un0038998@gmail.com
that is awesome can we implement it into a Segway and remotely control the Segway from the phone
Yes we can . Actually need to use stepper motor for that . Will try to make one in future .
@@hashincludeelectronics i can't wait plz tag me when u do it
Where do you buy your components from?
I buy all these components mostly from Amazon . Also sometimes i buy it from local store here called Abra . I will definitely add components links in description going forward . 👍🏻
How are you controlling it buddy?
It is not controlled by any remote 👏🏻👍🏻
Goood job bro
Thank you very much . Stay tuned 👍🏻
Hi is 9v battery good? Also, can I use Arduino Uno R3?
Please do not use that non rechargeable 9v battery . Use only rechargeable battery . Also you can use Arduino Uno 👏🏻👍🏻
@@hashincludeelectronics Which battery do you recommend?
@@zainhassan2564 use LiOn or LiPo battery 👍🏻
How many Volts?
@@zainhassan2564 7-12 V
How do we find set point for our robot?
You need to figure it out using the few steps which I have provided at the end of the video .
Actually I was talking about SET_POINT_PITCH_ANGLE_OFFSET. Which is -2.2 in your case.
While moving , does your robot leans -2.2 degrees? If yes than how did you calculate the angle for a moving robot?
If you could tell than it would be of great help brother.
Hello sir can you help i follow your steps but my robo can't move 😢😢
Please help sir I have to submit project tomorrow please 😢😢😢
Help sir
Can it be used with n20 gear motor ?
You can give it a try . However as I see rpm of this motor is very low , you might have to adjust PID values accordingly.
@@hashincludeelectronics Thanks brother, what ratio of tt gear motor do you use 1 : 48 or 1 : 200 ?
@@peerapongseangkhuntee6450 I used 1:48 gear ratio motor . It’s very cheap. I will make sure to add links of components in the description so that it will be useful. Let me know if you need more info .
PCB single hai ya double use kara hai?
It’s single sided .
May i use your project ? for my final year project
I am very glad that you liked this video 🙂. I would be very happy if this is helpful in your project . Please go ahead and it would be nice if you could give credit to my channel.
Please don’t forget to like , subscribe and share among your friends too 👍🏻all the best .
Yay
👏🏻👏🏻👍🏻
where do you live
India 🙂👏🏻👍🏻
Bro pls reply
Motor rpm?
Thanks for checking out video 👍🏻these motors have gear ratio of 1:48 . Max rpm would reach around 150-200 rpm with lipo 3s battery .
@@hashincludeelectronics can we use 300rpm motors?
@@haterlog8825 yup we can use it .
@@hashincludeelectronics thanks bro 😊
Are you Indian?
Yup. Happy Independence Day 👍🏻👏🏻
@@hashincludeelectronics 🇮🇳🥰😊
Bro check your email again..sorry to disturb you
No problem. I have already replied .
I had sent you mail please check it
Hi thanks for writing to me . I have replied you at my best 👍🏻
Problem in coding
1) mpu.dmpGetCurrentFIFOPacket(fifoBuffer))
2)pitchPID.Compute(true)
3) yawPID.Compute(true)
This problem is arising while compiling the code, what is the reason.
Please use the library from my code folder .
Sir i want this project how can we contact you
Awesome
Thank you very much 🙂