The main constraint of this project was to build the inverted pendulum system at a total cost of $500, while creating a robust system that will continue to be used for future control system classes and research. After calculating system accuracy requirements, mechanical and electrical components were found to match the specifications. A full CAD (Computer Aided Design) assembly was modeled using Solidworks and engineering drawings created for individual parts. The subsections of the system are the steel base, linear guide system, motor and belt drive, pendulum arms and pivots, and electronics and sensors. After procuring materials and components, the individual parts were manufactured using 3D printing, machining, and welding. The final design allows for the system to be used as a single and double inverted pendulum without removing any parts.
A framework for an Arduino based PID controller was developed using ChatGPT, with separate PIDs for each controlled motion. PID controller outputs, encoder angles and time were collected to create graphs for tuning purposes. The encoders are calibrated by aligning the arms in a vertical position with the Arduino reading and storing the position. Safety limits are programmed that if a cart position or angle threshold is exceeded, the motor is disabled.
The controller that balances the first beam was tuned using Ziegler Nichols method2. This was done by increasing the proportional constant until the system reached continuous oscillation, with the period of oscillation and required proportional constant then used to calculate values for P, I and D. In order to tune the PID controller that centers the cart, the graphs of system and controller data were analyzed to determine values for P, I and D. The proportional constant was increased until the system responded quickly to error. The derivative constant was added to remove overshoot, and a small amount of integral was added to reduce steady state error.
A double inverted pendulum system was designed and constructed for a cost slightly over $500. A controller was successfully programmed and tuned to balance a single inverted pendulum. The controller proved successful at handling small disturbances, removing a human caused force input to the arm in less than two seconds. At point A in the graph below, the pendulum arm is given a slight push causing it to deflect. This causes the cart and arm PID controllers to ramp up their outputs, leading the cart to move significantly away from the center. The cart movement causes the arm to change its rotational direction at point B, approximately 120 milliseconds after the disturbance occurred. From here both PID outputs begin to level off and switch directions, with the cart PID output having a slight lag. Around point C, the PID outputs approach each other, the cart and arm change directions. The rate at which the cart moves back towards center causes the arm to rotate back toward the upright position in a damped path with slight overshoot. By the time point D is reached, the signals have mostly converged resulting in near steady state.
See more on EMU's github.