## Pi Wars week 5: The Canyons of Mars

29th Oct 2018

The new maze course has been revealed for Pi Wars:

The actual course being revealed is a little of a surprise, as the challenge description initially said the design would be a surprise, encouraging either a generic approach (like wall following) or a ‘maze solving’ strategy. Now the actual course is known, a more specific and optimised solution will probably be faster and more reliable.

Last year we looked at different approaches to the course, to see which might give the fastest or safest route. This year we’re expecting to have a better handle on where we are on the course (using the encoders and IMU, as well as distance sensors), so that may open up some faster and more sophisticated lines. We thought it was worthwhile to sketch the options out and see how the theoretical times compare, to see how worthwhile it might be to do the development.

First up we have the simplest planned route, one that’s relatively easy to program using only information from two or three distance sensors and is fairly safe: the straight, centre line course, turning on the spot in the corners:

This is the strategy we started with last year (see test video here: https://youtu.be/EV7YIHr5feg?t=518) Like in previous years, we’ve also developed a simple model of how fast we expect our robot to accelerate:

Previously this approach has been fairly accurate at predicting times in the straightline speed challenge, so we’re fairly confident in using it to estimate performance for the maze.

Using this model, we can combine the acceleration profile and the distance of each straight line segment of the approach above and estimate the transit times. Adding on a time to turn 90 degrees at each corner (we’re assuming 0.1 seconds, as that’s about what Piradigm needed to turn 90) gives a predicted total time of 5.3 seconds to complete the maze. If you’d attended previous Pi wars, you may think this was a ridiculous prediction, as most competitors took 20-30 seconds. This was mainly because they take a very tentative approach to the maze. Last year in practice Piradigm could fairly repeatably achieve 10second times whilst not running “full throttle”: (https://youtu.be/EV7YIHr5feg?t=541) and we did achieve one ~6 second time, so its certainly possible.

Can we do any better than the straight line route though? As you may have seen in the video linked above, a slight variation is to do smooth turns for the corners instead of stopping and turning on the spot:

Last year we found this to be much faster and no more risky. Predicted time: 4.3 seconds, a handy saving. This is assuming each corner is taken at 1.6m/s, which is at approximately the limit of traction of the tyres. Hopefully the IMU will allow us to stably and repeatably skid a little in the corners, otherwise we’d have to go a little slower to retain control.

So that’s good, but can we do any better? It still doesn’t look much like a ‘racing line’ as you’d see in motor sport. If we know where we are on the course at all times, can we corner faster? or tighter? We can approximate something like a racing line by increasing the turn radius (but keeping it a constant radius) and clipping the apexes on key corners:

(note this isn’t a true racing line, usually drivers won’t drive at a constant radius through all corners, it will be a different parabola-like shape with a late apex, starting accelerating before finishing the corner.)

With the larger radius turns, we think they could be taken at more like 2.3m/s, and the distance travelled is a fair bit shorter than the second course, so the predicted time plummets to 3.2 seconds!

That is a nice target number but in reality we wouldn’t plan a route taking us so close to the sides, we’re unlikely to be perfectly positioned and hitting a wall can disorientate the robot and end the run. How much longer would it take if we take a racing line with a safety margin? say 75mm clearance?

The ‘safer’ racing line is ~0.3m longer and the slightly tighter corners mean going a little slower at 2m/s, but the predicted time is still only 3.6 seconds.

That’s all great, but the above predictions were assuming no downforce. As we discussed in our week 3 update, we’re intending to fit a vortex downforce generator. So how much faster can we go with that?

For the ‘safer’ racing line we’re predicting a 3.1 second time, and the faster, riskier line a bonkers 2.6 seconds.

Some crazy numbers, lets hope the software and electronics can give us the control needed to get the hardware to deliver the times its capable of.