## Introduction

This post presents the model of an inverted pendulum. This device is composed of an activated trolley and a pendulum which has its center of mass above its pivot point.

In this post, we will assume the following hypotheses:

- is the mass of the trolley.

- is the mass of the pendulum.

- is the moment of inertia of the trolley.

- is the moment of inertia of the pendulum.

- is the distance between the pivot and the center of mass of the pendulum.

- is the angle of inclination of the pendulum.

- and are the coordinates of the center of mass of the trolley .

- is the orientations of the trolley.

- and are the coordinates of the center of mass of the pendulum.

- is the orientations of the pendulum.

The following notation will be used in this article to avoid too complex equations for the derivatives:

And for the second derivative:

## Constraints

As the trolley and the pendulum are linked by a pivot, the following equations can be written. This equations expresses the coordinate and orientation of each body of our system. For the trolley (body 1):

For the pendulum (body 2):

Let’s define the vector

, the position of our system :

Let’s define the constraints on position:

Let’s calculate the constraints on velocity:

Let’s calculate the constraints on acceleration:

## Dynamics

For the pendulum (body 2):

Where

,

,

,

,

and

are the Lagrange’s coefficients. These coefficients represent the interaction between bodies. In the present system, this is the interaction between the pendulum and the trolley.

## Interactions

We will now solve the system in order to eliminate the interactions between bodies (

). It is proven that:

Where :

Applied to our system, this gives:

and:

## Solving the system

Based on the previous equations, we can formulate

and

:

The previous equations become:

Thanks to the previous constraints on acceleration:

Rewriting the previous equation gives us:

And:

The general equation of the system is:

Where:

## State space representation

Based on the previous result, it is now possible to write the state space model of the system. Let’s define

the state of the system:

The state space representation is:

## Acknowledgements

I want to thank Sébastien Lagrange from the University of Angers for his help and explanations.