Drag Racing
See this page: Worksheet 11 for the latest Drag race program.
The drag race is a special competition for line followers.
Click here to see the rules.
It has a few differences from the standard "Line Following" competition:
- It has many rounds,
- Each round is a competition between 2 robots, the faster one goes on to the next round,
- It has a short course, in a straight line, about 7 meters long,
- There's a start signal to tell you when to start,
- You must stop after the finish line, before the end buffer.
You lose points if:
- you start too early and cross the start line before the start signal,
- you hit the end buffer, or come off the line and hit a sidewall.
So, your robot must have a simple slick way of starting, and it must detect the finish line (or the correct distance)
at which point it must stop, but still follow the line.
Drag racing hints and tips
- Choose a robot with big wheels, and fast motors,
- Use the stop sensor to start the race (not the button)
- Keep track of time, by counting loops since the start,
- Use the loop count to distinguish between the start line, and the finish line.
Stop only on the finish line. Worksheet 11 - Run really fast for about quarter of a second after start. Not much need to follow the line well.
Slow down to a stable speed after that - Keep steering after the finish line , don't just switch the motors off.
See the Drag race Worksheet 11
New ideas July 2022
1) We can identify the stop line, by counting stop markers from the start of the race.
- In a drag race the stop marker will be the second one.
- In line following a larger count might be needed to ignore crossovers.
2) We need to be able to detect stop line signals lasting about 6 milliseconds.
- One method is to reduce the loop time in the race loop to about 3ms.
- Or we can use the second processor (core) in the pico to scan very quickly for stop markers,
while the main core does the steering.
- Or, we can use interrupts to make a function run whenever an input changes from 1>0 or 0>1
without the main loop having to scan.
Sample programs Drag5.py uses a second thread, Drag6.py uses interrupts to detect the stop markers.