After completing a guided construction of a differential op-amp circuit to measure the current in a motor and optical control in an encoder, I was given the freedom to explore motor control.

I decided to present a showcase of various control methods, developing scripts in Arduino IDE to develop a state machine switching between P, PI, and PID control.

As controlled by the switch, the motor switches between a P, PI, and PID position control method, serving as a showcase of error and response time.

The sensors track the contrast between the white and black portions of the wheel, keeping a running count to try and move to a desired number of rotations.