This post is automatically translated to English by Google Translate.

Bättre filtrering gör all skillnad på självbalanserande robot

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.

Posted in Självbalanserande robot
20 Comments »Bättre filtrering gör all skillnad på självbalanserande robot
  1. geejay says:

    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.

  2. geejay says:


    are these files to be loaded into one arduino only? thanks.

  3. geejay says:

    i think I'll just add the files under sketch before compiling..

  4. Nice project and impressive robot!

  5. Mark says:

    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?

  6. Aubrey Remington says:

    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?

    • sebnil says:

      Sorry I do not have an simple answer. Read some literature about control systems and especially PID controllers. Then start experimenting.

  7. Kim says:

    Hi,your robot can balanced on a inclined surface?

    • sebnil says:

      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.

  8. Kim says:

    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.

  9. sebnil says:

    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

  10. Jawad Hashmi says:

    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 🙂

  11. Abdul waiz says:

    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

  12. hamed says:

    can u help me in my balacing robot with avr microcontroller

  13. hamed says:

    can u help me in my balacing robot with avr microcontroller


  14. tfb says:

    Nice robot. I made a selfbalancing robot to, here is my blogpost http://www.thefabricationbay.com/2016/11/12/self-balancing-robot/

1 Pings/Trackbacks for "Bättre filtrering gör all skillnad på självbalanserande robot"
  1. […] 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 […]

Leave a Reply

Your email address will not be published. Required fields are marked *