top of page

Double Pendulum Control and Simulation

This was a project I did to experience and learn more about the implementation of controls. It was sponsored by my Control Theory professor, and I presented it to him to confirm my understandings. It was a very worthwhile project, and it taught me the practical side of a very theoretical field!

​

I derived the equations of motion by hand then with MATLAB from the model. I then created a nonlinear state space to control the pendulum. I linearized certain parts (not explicitly shown) to decrease the computational time (~50sec reduction or ~62%). It did slightly increase state error (~11%).

​

​

Pend1.png
Pendulum Model.png

Using the model, I defined the X and Y axes as shown, along with the angles as shown. Using this information, I derived the positions in cartesian X-Y vectors and their respective velocities.

Assumptions:
- Connections between masses are rigid (not rope-like)
- Masses are constant
- Air Resistance is negligible
- No energy is lost in the system

Pend2.png

Once the cartesian velocities and positions were found, an energy approach to dynamics modeling was taken, as seen.
PE = Potential Energy
KE = Kinetic Energy

Once the PE and KE were determined, the energies were placed into the Euler - Lagrange equation that was provided (seen in figure 4). I used it to calculate the angular accelerations for theta1 and theta2 by utilizing the partial derivatives of theta1 and theta2. 

Pend3.png

Don't Worry! It gets prettier!

Let's convert the EoM to nonlinear state space using the following form:

------->

Pend4.png

Using the following relation equation (seen in Figure 9), I solved for q_acceleration.

Then, I created a new nonlinear state space for q, seen in Figure 10 and 11. The output state space is seen in Figures 12 and 13.

Pend5.png
Pend6.png

Heading 3

Pend7.png

The Pendulum Function in MATLAB uses the state space seen in Figures 10, 11, 12, 13. Code is shown at the end(as well as MATLAB Derivations)!

RESULTS:

Plots are the observed values of theta1,theta2,theta1_dot, and theta2_dot over time with the initial conditions listed at the top of each plot

Video at the end demonstrates these values within the pendulum simulation! Each IC is ~30 seconds.

Pend8.png
Pend9.png

Reminder: Air resistance is ignored, so the energy never dissipates, leading to the pendulum never stopping

Pend11.png
Pend12.png
Pend13.png
Pend10.png
bottom of page