Greatest Team Of All Time (Team 1, ECE 5 FALL 2023)
Anthony Nguyen, Lucas Phung, Josef Marenec, Isaac Cervantes
Table of Contents:
Left to Right: Isaac Cervantes, Anthony Nguyen, Josef Marenec, Lucas Phung
Challenge 1A - Potentiometer Breadboard
Challenge 1B - Photoresistor Breadboard
Challenge 1C - Motor Driver Setup
Challenge 1D - Initial CAD Plans
Chassis Ver 2
Added rails to strap components onto the sides, a backboard behind the motors for them to rest on, and a front overhang for the photoresistor breadboard to sit on. Oriented the screws horizontally to maximize space.
Chassis Ver 3
Increased the thickness of the side rails, incorporated a photoshield as part of the chassis, created holes in the base to reduce weight, and streamlined the motor holes for greater adjustability.
Below is our prototype. The initial test code for the potentiometers, photoresistors, and the motor driver all functions individually with this model.
We upgraded the chassis by adding rails to securely strap our circuits, and to enhance reliability, we soldered the components onto protoboards.
How we figured out our PID Values:
For the PID controls on our robot, we employed a method of initially increasing the P value on the tracks we tested until the robot began oscillating back and forth. Once the robot consistently exhibited oscillations, we were able to dampen them by adjusting the I and D values, resulting in smoother line tracking. The advantage of identifying the P value that induces oscillation in our robot is that it allows for higher correction control, enabling better turns on the track. Subsequently, all that is required is to minimize the oscillations, allowing for less sporadic movement while retaining the same correction capability. This was achieved by implementing adjustments to both I and D.
PID Values for Individual Tracks:
For the drag race, the track was mostly straight, and the goal was to go as fast as possible. So, we set speed to max with a somewhat high P value and low D and I. Since the track was not completely straight, we needed some P to allow our robot to turn, and due to the high speed our robot was going at, we needed a somewhat high P value to get accurate following. We then found that we did not need high I and D values since our robot tracked the line smoothly with them at low values.
For the loop, we chose a medium speed, a moderately high P value, and low D and I. Since the loop is small with sharp turns, we wanted our robot to go slower for more accurate line tracking while still being fast enough to make lots of loops in the allotted time. This, paired with a higher P value, let our robot correct for sharper turns. We then adjusted D and I accordingly to minimize our robot's oscillations due to P, and this settled into moderately low D and I values, due to our robot's already little oscillations.
For the frequency sweep, we chose low speed with a medium P value initially. The frequency sweep features lots of sharp turns mixed with wide turns so we wanted our robot to be able to follow the track for these different types of turns. Low speed and medium P helped us precisely follow the wider turns at the start without overcorrecting, which comes with higher values of P. The medium P, however, still allowed our robot to follow part of the more narrow turns well due to its moderate turn correction. We also adjusted I and D values for oscillation prevention, and we ended up with a medium I value and a low D value, with the higher I value preventing the oscillations that come with low speed and medium P.
We increased our nominal (base) speed to enhance the robot's speed and introduced a speed-weight multiplier to heighten the sensitivity of the speed potentiometer. This was done by modifying the equation for motor speed, multiplying SpRead with our SPEEDWEIGHT multiplier. This adjustment allowed us to cover a broader range of speeds. Additionally, we implemented code to illuminate the LED strip attached to our car, enhancing visibility inside the photoshield. This code used the FastLED Arduino library.
Modified Motor Speed Equation:
LED Strip Code:
Note: This poster was made before we finalized our robot with our Version 3 Chassis.
Drag Race:
3rd place
Times (in order per round): 10.33, 9.68, 10.28, 11.45, N/A (veered off track)
Freq Sweep:
Passed
Distance: Line 8; Time: N/A; Placing: N/A
Loop:
# of loops: 6
Rank: 8-9th
A video of our robot during the Drag Race part of the competition
For the past week, we have been soldering our components (the potentiometer circuit and the photoresistor circuit) and designing a lighter chassis to better integrate all the parts. We also introduced an LED strip onto our robot to illuminate the track better for our photoresistors, and integrated a photoshield into our chassis for better photoresistor performance. We then modified the code by adding easily changeable variables for the base robot speed, potentiometer sensitivity, and LED brightness. However, we regret not spending more time working with the PID values and playing with how they directly impact our robot's performance on different tracks. Although we had an abstract understanding of each PID value, we did not delve deeply into the mathematical implications of higher coefficients for each control. Given more time, we would have picked apart the code to understand the role of error in the feedback loop for the PID coefficients. With this, we would have been able to better tune our robot for high performance on all 3 tracks (drag race, loop, and frequency sweep) in the competition, rather than having a robot that mainly specializes in the drag race.