VERTICAL PENDULUM
INTRODUCTION
This project consists in the implementation of a controller that is able to keep a pendulum in vertical position restricted by just one degree of freedom: The inclination angle. The model is built using the carriage from an old printer. The pendulum is mounted over the print head including the sensor in order to return the inclination angle like a voltage level depending of the deviation from the vertical.
Moving the printer head across the x axis in order to correct the inclination angle using a few movements, system is capable of avoid the falling of the pendulum, keeping it in vertical position.
![Vertical pendulum Vertical pendulum](/img/vertical-pendulum/vertical-pendulum.jpg)
The system has as restriction the rail length and the top speed from the stepper motor of the printer. Those are the reason why the system only can keep the pendulum in vertical position when the deviation angle theta is very low.
The starting state of the system is with the pendulum in vertical position, so sensor calibration is mandatory in order to the controller be able to recognize this state like the desired. Then, the system is started and it is left to work by itself. When a deviation from the initially calibrated position happens, the system will try to recover the vertical position, moving the printer head in the opposite way of the inclination.
There are two end of stroke switches to keep the printer head inside of the guide rail limits avoiding collisions. Finally, the the dumping of telemetry was added in order to receive and analyse the printer head position, inclination angle and the corrective action from the controller. With this data will be possible monitoring the system behaviour.
![Diagram of the vertical pendulum Diagram of the vertical pendulum](/img/vertical-pendulum/diagram.png)
DEVELOPMENT
The development of this project consists in the design and mounting of the electronic circuit as well as the design of the controller software. To explain each stage of the project, this article is divided in the following parts: The design and mounting of the power circuit to drive the stepper motor, the controller implementation using the PIC18F4520 Microchip's microcontroller, the link with the computer through RS232 serial port, to transmit the system telemetry in real time, the conclusions and the summing-up with all the documentation involved in project.
![Schema of the controller developed Schema of the controller developed](/img/vertical-pendulum/controller-schemata.png)