The task given to us consisted of four stages:
- Construct a two-wheeled robot that can balance itself. Usage of official Lego instructions for both robot design and the code was permitted, allowing us to quickly come up with a working system.
- Experiment with different variables in the PID control and analyze the robot behavior.
- Find such values in the PID control that the robot struggles to keep balance, but does not completely fall over.
- Implement either line following using an IR color sensor or obstacle avoidance using an ultrasonic sensor. We have chosen to perform the latter. The robot was redesigned to have a rotating head to scan the environment and would move where no objects were detected.
Report: Google Drive
If you would like to take a look at the code, please contact me.