︎︎︎


04_ Follow Me: Proportional Controller


FALL / 2021
For a robotics lab I was instructing
Role Worked on the code with course instructor, Paul Bucci. Built physical implementation of the system


Check the code to the robot︎︎︎

           Designing systems to be dynamically responsive to their environment is a good way to create technology that feels more than just mechanical. Robots that change their behaviour in accordance to their environment can create the appearance that they possess a certain degree of sensibility.

This project, a small two-wheeled car, does so by incorporating simple feedback loops that allow the system to employ continuously modulated control. The code of the car is written based on the proportional aspect of the control loop mechanism proportional–integral–derivative controller, widely used in industrial control systems. It continuously calculates an error value as the difference between a desired setpoint and a measured process variable and applies a correction whose output is proportional to the error value. The setpoint is a specified distance between the car and the closest obstacle directly in front of it, the error value is the difference between the actual distance ahead of it and the setpoint. The output is the power that the motor of the wheels receive. As the measured distance approaches the set point, the output proportionally decreases.



The car is equipped with two ultrasonic sensors in the front, which measures the distance between itself and the surface in front of it. The robot is driven by a motor driver that controls two motors that power one wheel on each side of the robot. The left and right wheels are independent of each other, each incorporates feedback from the left and right sensors respectively.

Two levels of behaviour emerge from this:



First, the greater the error value, the faster the car moves to decrease it, and as the car approaches the setpoint distance, it will gradually slow down to an eventual stop. Second, when the car is not perpendicular to the obstacle ahead of it, the car will naturally turn to correctly align itself. This is because the two wheels and their sensors operate independently, so one side of the car will measure a greater error value and thus receive greater output, turning the car.