For one of my final-year projects, I was tasked with developing an inverted pendulum system with a pendulum mass of 100 grams and a length between 40 to 50 cm. The project began with deriving the equations of motion for the system, which were then used to simulate the dynamics in Python. I developed a graphical user interface (GUI) using the Pygame library to visualize the system in real-time. The control strategy involved implementing both a PID controller and a pole placement controller to stabilize the pendulum and maintain its upright position.
After completing the simulation individually, as a group, we were tasked with building a working prototype within two weeks and under a $100 budget. To reduce costs, I repurposed various components I already had on hand, including an Arduino Uno, a NEMA 17 stepper motor, a TB6600 stepper driver, aluminum extrusion, nylon roller bearings, a GT2 belt with pulley and idler, self-levelling feet, fasteners, and several 3D-printed parts. As a result, the only components I needed to purchase were a power supply and an absolute encoder, which together cost approximately $30. The total estimated cost of the entire build was around $80 before tax.
The belt-driven linear actuator was salvaged from an old Ender 3 Pro 3D printer. A custom 3D-printed mount secured the actuator to the self-levelling feet, while additional mounts attached the encoder to the gantry and coupled the inverted pendulum to the encoder. A custom weight carrier was also designed to hold washers used as adjustable masses. The electronics enclosure was 3D-printed and designed to house two buttons, four LEDs, the Arduino Uno, and the TB6600 driver, with built-in cooling and labels made possible through multi-colour 3D printing.
Using the original simulation code as a reference, we translated the control logic into an Arduino C program. This final version included selectable modes for both PID and pole placement control, as well as start/stop button functionality and digital outputs for the corresponding LED indicators.