Projects
Inverted Pendulum
Proportional Integral
Derivative Controller
Constructed and programmed a bi-wheeled robot to balance itself upon the positive Z-axis by using Proportional Integral Derivative (PID) control
Control Loop Schematic:
Circuit Schematic:
Parts List
Name | Manufacturer | Part Number | Purpose |
2 x NEMA 17 Stepper Motor | StepperOnline | 17HS16-2004S | Moves the wheels on the robots |
2 x 100mm Wheels | N/A | N/A | Allows the robot to move around and recover from pushes |
1 x MPU 6050 | FTCBlock | GY-521 | Calculates the angle of the robot’s frame relative to the ground |
1 x Arduino Nano | N/A | N/A | Calculates the changes in the wheels to make according to the internal PID and the Gyro readings |
Initialization
int gyro_address = 0x68; //MPU-6050 I2C address |
PID Calculations
pid_error_temp = angle_gyro – self_balance_pid_setpoint – pid_setpoint; |