My Undergraduate Project — Inverted Pendulum

September 23, 2007 at 10:18 pm | Posted in Uni Project | 24 Comments

This was my final year undergraduate thesis project in 2003.

Aim: To bring the pendulum from downright to upright and maintain the upright position.


RSS feed for comments on this post. TrackBack URI

  1. sir ,
    my undergraduate proj is also inverted pend.’m facing some difficulties in the implementation part.could u please help me out.

  2. Sure, what difficulties are you facing at the moment Rohan?

  3. Sir,
    My undergraduate project is also on inverted pendulum. I need some ideas for designing inverted pendulum. What was the mechanical setup that you used?
    Is it available ready made? If so where is it available?

  4. The one that I used was bought by the University from Quanser.
    Here is the link

    If you want to built yourself, you need to consider how you would like to measure the position of the cart and the angle of the pendulum. Quanser use position encoders for both position and angle.

  5. Sir I do have the same quanser device , but i can’t get my pendulum to get stabilized :S
    I’m using sisotool but no luck

  6. Do you have a guide or manual from Quanser? The manual would definitely help you for start. If you don’t have the book, the following is a brief steps in control designs:

    1. You need to derive the mathematical model for the inverted pendulum. The model is definitely non-linear system. But, you can linearized it with some assumptions. By the nature, the inverted pendulum model is a highly unstable system (open loop).
    2. Once you have the model, you can start designing for the controller. The controller can be either a PID or optimal controller or even more complicated controller. So, you need to decide what type of controller you want to implement.
    3. The aim of the controller design is to make the closed-loop system (controller and plant) stable. Stable meaning all poles are on the left hand side of the s-plane if you consider a linear system.

    I suggest you doing some simulations (e.g. using Matlab) first before you start implementing the controller. Make sure the simulations give you a good result.

    Good luck!

  7. i want ti start this project of inverted pendulum…..can u help me start it. how to do it in simulation?

  8. kindly also tell me what to do if i want to do if i wana start with hardware too…?

  9. Once you have the mathematical model and the controller, you can write the equations on the Matlab code. Alternatively, you can build up some simulation block on the Simulink. Don’t forget to set the sampling frequency and the simulation time.

    Ali, are you using the similar hardware from Quanser? If you are, read the user manual that come with it.

    Good luck!!

  10. hi i have started a project on self balancing of plate mounted inverted pendulum mean a pendulum would be directly attached with the motor shaft through plate or pulley. we have to use a digital pid controller but i dont know how to design a digital pid although i have a bit knowledge of analogue pid and i also want ur email plz

    • If your frequency is fast enough, you can try applying the analogue technique on the digital domain.

  11. Hi, I’ve just found your site, and video, via Google.

    Are you using a state-space controller? the control certainly looks good.


    • The model was a state space model and the controller was LQG optimal control.

      • Thanks for the reply.

        I finished my implementation of LQR optimal control with a state space model, and swing-up, about 2 weeks ago.


  12. sir,
    i’m a student of NIT,durgapur.I’ve to make Inverted Pendulum down to upright and stabilize at that position of the instrument by FEEDBACK. for that i’ve designed a pd in MATLAB. when i run my program the cart goes beyond its limit and stop the simulation. what should be the problem? pls enlight me.

    • There are two aims in designing the controller for inverted pendulum.

      The first one is to control the angle of the pendulum, i.e. set it upright.

      The second one is to control the position of the cart.
      To achieve this aim, you need to reduce / eliminate the error between your reference position and the position of the cart; i.e. minimise e = r – x.
      Integral controller can reduce this error. Try add I-controller.

  13. Hello Sir,
    I am also doing this Inverted Pendulum project. I am using the state feedback controller technique. But I am facing a problem that how to swing the pendulum up, I mean what swing – up control strategy shall I use? And you have mentioned that PID controller can stabilize the pendulum………Will PID controller be able to stabilize the pendulum once the angle is large? I mean the pendulum is out of the linearized zone?

  14. Dear Sir,
    I am trying the to apply PID controller on my inverted pendulum project.However, my simulation result showed the pendulum will move over limit of the cart and the pendulum is directed keep upright, after few second, the pendulum start not stable, the result showed is totally reverse, what is the problem I should take note? and how do set the constraint/stopper for pendulum so that wont move outward from the cart?

    • Hi Elaine,
      Cart move outside the limit means it is not stable.
      Your controller aim should be stabilizing both pendulum upright and cart position centered.
      Try tune your controller to achieve this and you would see the cart stays on the center of the track.

      • Hi Sir,
        I am using SimMechanics model to replace the transfer function, but it seem only can control a single output. The input using impulse signal,but still cannot control it. How many PID controller use to control it? It’s really tune the controller until achieve the result?

      • Hi Elaine,
        You might have single output. But, depending on your model, your internal state may have cart position information ‘x’. If so, you can try to control this ‘x’ to always stays at zero position.
        You can manually tune the controller until you achieve the result. But unless you are lucky, if you can spend a long time to get it. I suggest spending time reading the optimal control theory and design the controller for your model. Good luck.

  15. Sir, in the LQR/ LQG implementation what is basis for choosing the elements of Q- matrix. Also, if some design specs is given how do we relate them to the elements of Q (in the formulation of cost function J)?

  16. Sir,
    I am using Fuzzy Logic to control inverted pendulum, but i don’t know to measure angular velocity and cart’s velocity. I just know how to measure the position of the cart and the angular of the pendulum by using incremental encoder. Can you give me some advices ? Thanks.

  17. hi Rudi. my final year project is about inverted pendulum which controlled by LQG. right now i have problem with the controller. i do not know how to start..could you help me.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog at
Entries and comments feeds.

%d bloggers like this: