Jag programmerade ett enkelt filter med glidande medelvärde. Detta lågpassfiltrerar bort snabba förändringar vilket gjorde roboten lugnare och med färre översvängningar.
Som man ser i videon klarar den nu av större stötar än tidigare.
Jag programmerade ett enkelt filter med glidande medelvärde. Detta lågpassfiltrerar bort snabba förändringar vilket gjorde roboten lugnare och med färre översvängningar.
Som man ser i videon klarar den nu av större stötar än tidigare.
[…] I programmed a simple moving average filter. This will remove the rapid changes and make the robot calmer and with less overshoots. It also handles pushes much better than before. Video here […]
Hi, can you give a psuedocode or a block diagram on how you made a reading on the wheel encoders and used them on the cascaded PID's... and also on how you implemented the cascaded PID's. Thanks.
The code for the wheel encoders are at https://github.com/sebnil/Selfbalancing-robot/blob/master/WheelEncodersI2C/WheelEncodersI2C.ino.
More documentation of the PIDs are at https://sebastiannilsson.com/en/projekt/selfbalancing-robot/den-sjalvbalanserande-roboten-fungerar-ganska-bra/
Connect the encoders to the interrupt pins on the arduino and count the number of pulses per time unit.
Block diagrams would perhaphs be helpful but unfortunatly I will have difficulties finding time to do them. But the arduino code is open sourced and hopefully that will be sufficient.
configurations.txt
console_communication.ino
eeprom_store.ino
motors.ino
selfbalancingrobot.ino
serial_communication.ino
are these files to be loaded into one arduino only? thanks.
No. Compile selfbalanceingrobot.ino from Arduino IDE. Some of the other files are included from that file.
i think I'll just add the files under sketch before compiling..
Imponerande!
Nice project and impressive robot!
Christophe
Hi, great project. I'm am starting to try and build one myself.
Do you think it is possible to build one without using wheel encoders?
Yes, but I would recommend using motors with encoders.
hi,
i am bulding a robot or rather its built already but its not balancing on the two wheels,i had to put two more wheels across just to get it to stay upright for now but i still want to balance it on just to,what can i do,any ideas please?
Sorry I do not have an simple answer. Read some literature about control systems and especially PID controllers. Then start experimenting.
Hi,your robot can balanced on a inclined surface?
Thank!
Sure that's no problem. Since the outer loop will have a zero wheel speed as setpoint it will stand still and balance around the tilted equilibrium. I have tested and confirmed it.
Thank for your answer!
I know in your code, you use 2 PID controller from Arduino PID library.But i wonder about that 2 PID for wheel speed and angle must be different because:
+output of PID for speed += pTerm + iTerm + dTerm (sign "+" mean when motor reach the desire speed,it must remain PID value to drive motor at that speed.Otherwise,output for PID for angle = pTerm + iTerm + dTerm (doesn't need sign "+" ).
Any opinion about that problem.
Output from the speedPID (outer loop) is an angle. This angle is the setpoint for the anglePID (inner loop).
speed setpoint 0 -> SpeedPID -> angle setpoint -> AnglePID -> motor voltage
hey friend, i am an electronic engineering student and interested in making this self balancing robot. can i have your contact email? my email is jawadahmedhaashmi@gmail.com
waiting for your reply 🙂
hi great work . i am also working on this robot i have balanced the robot but with only Tilt Angle ,
i m taking data from encoder means in form of counts but after this i don,t know how to convert it into position and implement the pid for speed.
thanks and regards
hi
can u help me in my balacing robot with avr microcontroller
hi
can u help me in my balacing robot with avr microcontroller
hamedmosavi125@gmail.com
Nice robot. I made a selfbalancing robot to, here is my blogpost http://www.thefabricationbay.com/2016/11/12/self-balancing-robot/