Show your driving skills

At last years R2UK event, the driving course was introduced. Originally by Colin Barker and Lee Towersey, built out of wood with 3d printed bumpers it went down a storm. It got rolled out a few times over the course of the year and I added the times to the MOT site.

I’m not one to let things lie tho. Times were manually entered into a spreadsheet, with any penalties added in by hand.

Not only that, the course took quite a while to strip down and put up due to all the power cables needed for the bumpers and gates.

This was where I come in. I was sure that I could help streamline the process and it was a nice project to work on. Along with my work, Mark Leigh and his brother started working on rebuilding the course out of aluminium box section to make things a bit sturdier.

I at least wanted to remove the need for all the cables going to the sensors, as this was a big pain in the setup, and was a bit of a mess. Whilst I was at it I came up with the idea that we could easily make them wireless so that when they’re triggered it automatically reports back to a central hub.

From there the ideas expanded! I didn’t want to have to redesign and reprint all the parts so everything had to reuse the physical bits. A Raspberry Pi would be used as a central hub to keep track of the times.

In the end I used a Wemos D1 Mini for all the sensors, as they were cheap and had more than enough I/O pins for what was needed. Both the bumpers and the slalom gates have the same electronics in them. The timing gates that start/stop the clock were microswitches but had to be reset each run so I switched these for ultrasonic range finders.

Finally, the clock got a major upgrade. Initially it just sent a signal to the Pi to say that the clock had started, but I quickly ran into latency issues. Due to this, the main timer for everything is not the Pi but the big clock itself. The timing gates are hardwired in and when they are triggered the clock sends the time back to the Pi in its API call.

So the Pi is using the same Flask python module that r2_control is using, I was already fairly familiar with it and it made creating an API very easy. The Pi is responsible for displaying and storing all the details about the runs, with Pi Zeros being used to display the various pages on monitors around the course.

As a final touch, I went really fancy! To register what droid and driver are about to do the course, they can now swipe an RFID tag. I built a simple reader with screen so that once the droid is ready to start they just swipe their tag over the reader. At R2UK there were some issues with writing tags which have since been solved. Even better, the new Builders ID cards have RFID chips built in.

Video courtesy of Rob Howdle

It took a couple of hours to work out some bugs on the course, some my own fault and others hardware limitations (seems the Pi’s onboard wifi wouldn’t allow more than 10 clients) but I worked around them and after that the course seemed quite popular again. Just need to write some better documentation and program up everyone’s ID cards.

Next step is to add another type of sensor… a shock sensors. Some people started getting quite competitive and the course was starting to take a few knocks. So a couple of accelerometers will hopefully make it back into a driving accuracy course!

All code is in the Builder’s github repository:

https://github.com/uk-r2-builders-club/droid_driving_course

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.