This project implements a GoToGoal controller for the QuickBot differential drive robot.
A screenshot of the robot successfully turning and driving towards the goal coordinate can be seen below in the first image. As seen in the recording, the robot is able to quickly and smoothly turn towards the goal position. This is controlled by the value selected for the PID gain factor obj.Kp = 2
in the GoToGoal.m constructor.
If the selected value for the PID gain is too small or large, the robot may be unable to reach the goal.
If the PID gain is too large, the robot will fluctuate and wiggle rapidly as it moves towards to goal in a non-optimal fashion. See the second screenshot.
If the PID gain is too small, the robot may completely miss the target goal as it turns too slowly, eventually resulting in a collision with the wall. See the third screenshot.
obj.theta_d = pi/4;
obj.v = 0.2;
obj.goal = [1, -1];
obj.d_stop = 0.05;
% initialize memory banks
obj.Kp = 2;
obj.Ki = 0;
obj.Kd = 0;