lucy-musicalfish / CodingForDucks

ENGR101 Project 3 Team 23
0 stars 0 forks source link

Stephen-Robot-Completion-v.0.6 #21

Open StephenThessman opened 4 years ago

StephenThessman commented 4 years ago

Got a version of the equation working. motorL = vLeft + kp error; motorR = vRight - kp error; This was the semi code Arthur provided in the lecture. I just completely missed it. And I couldn't put it in code the other day either. Sorry team.

Changes therefore are:

  1. A kp variable to Core code.
  2. Made the two equations above the main variable for motorL & motorR (instead of defining them earlier and then overwriting them which it was doing).
  3. Remove the if statement for if error > 0 or error < 0 as when error is 0 now motor speed is just vLeft or vRight. As defined by the above equation.
  4. Robot tested up to a speed of 40 (probably can go higher just need to change the kp too).
  5. Moved the robot detection line to a 10th of the space infront of it. This was what was causing the robot to turn far too early and cut track. Now only the final corner is cut and not by much either.
  6. Some testing has been done. Speed value of 40 and kp of 0.5 work quite well.

Created an excel spreadsheet of the testing up to 40 speed and kp 0.5. Have let teammates working on completion know of the change.