3
u/MasterScrub90 Nov 19 '20
Thats so cool! What is the maximum weight for the object on top before the robot fails?
2
u/Juliom912 Nov 19 '20
Thank you!! Well, since the motors are being powered with 5 volts and the weight of the structure is something, I would say it can work properly with around 150 grams
2
u/Juliom912 Nov 19 '20
A way to make it able to increase that maximum amount is providing higher voltage to the motors
1
u/MasterScrub90 Nov 19 '20
Doesn’t sensor reaction time also play the part? 150 grams is pretty nice!
2
u/Juliom912 Nov 19 '20
Thanks, yeah not bad for the first time I make this kind of project, I’m still working on make it work with the proximity sensors. And yeah the reaction time also, but I have seen some similar projects and with stepper motors for the wheels and higher voltage are able to move a decent amount of weight
2
u/Cogitarius Nov 19 '20
How did you tune the PID gains? Did you use a simple inverted pendulum dynamics model?
2
u/Juliom912 Nov 19 '20
Yeah, just a simple one and took me some time changing the constants value to make the stabilization as good as possible
1
u/mewags Nov 19 '20
If you have any example of this tuning process or where your gains ended up I would be interested in reading more.
2
2
u/silverrhino43 Nov 19 '20
Great project! How did you implement the PID control in the code?
1
u/Juliom912 Nov 19 '20
Thanks! I programmed it using the library PID_v1, there are some examples on the internet for this kind of projects, and the input data is given by a gyroscope (MPU6050). The output is sent to the motor driver L298N
2
2
2
u/mewags Nov 19 '20
Hi. What PID library did you use?
Also, do you know how fast your loop is?
I'm working on something similar and it would be cool to hear a little about how you made it work.
2
0
Nov 19 '20
[deleted]
1
u/Juliom912 Nov 19 '20
Sure, the for the driver you need 6 pins (besides the power supply input) and 2 of them with PWM so you can control the speed. In my case I connected it this way: ENA = 6 IN1 = 11 IN2 = 9 IN3 = 7 IN4 = 8 ENB = 5
Depeding on the direction you need the rotation of the wheels, you can switch pins IN1 with IN2 and IN3 with IN4 you can find many examples on internet
4
u/Juliom912 Nov 18 '20
This is a self-balancing robot project programmed with PID control, it is still in progress, I made the 3D design and then got the parts from cardboard. Can be controlled via bluetooth using the phone (If you wish to see that video, check out my post at r/arduino) I will be improving the code and posting how it is going, any advice is welcome!!
Currently saving for a 3D printer to make more projects if you wish to help me, donations on paypal are welcome!