8:30 AM Friday, April 22. I leave Los Alamos, NM, headed for Denver. The weather is blustery, but I have a good audio book to keep me entertained for the 6 hour drive. After a stop for some food and gas in Walsenberg, CO I arrive at my brother’s house in Highlands Ranch by 3:00. We load load his stuff in my xterra, and head for the sparkfun building. There are a few teams practicing the course with their ground vehicles. I see a few traxxas rustlers, and the big t-rex vehicle. A father and son team is troubleshooting their car, and a handful of sparkfun employees are setting up tents and tables. The starting ramp and barrels have not yet been placed. My brother (team Roadrunner) and I get our vehicles out and commence the testing. Roadrunner’s car (a traxxas stampede) uses GPS for navigation, and depends mainly on a compass to adjust the heading. The side of the building closest to the pond seems to be difficult for most teams to navigate due to poor gps signal quality and limited space. Roadrunner has some successful runs and he refines his code and waypoint placement.
I start testing minuteman, and have some successful runs. Minuteman is a dead reckoning system, that is unaware of it’s latitude and longitude with reference to earth. It only knows where it is in relation to where it started. It knows how far it’s gone and at what angle. Each inch or so, it updates its coordinates, and it does all of this in the background. It can be manually driven to some location, and it will take care of updating its position as it goes. At any time, it can save its current location as a waypoint in eeprom memory. Many waypoints can be saved sequentially, and later navigated automatically.
How, specifically, does it do this? Well, it uses two sensors, an optical encoder on the input shaft of the transmission, and a mems gyro. The encoder measures, very accurately, how far the wheels have turned. Its output is fed to an external interrupt on the controller (an ardupilot), and every x number of clicks, it calculates a new position. To calculate the new position, you also need the angle, which is provided by the gyro. That’s it, in a nutshell. I’ll add though, that you must always start the car at the same point and at the same angle to get repeatable runs.
So, for it to work you first have to manually drive the car to the various turning points, and set a waypoint at each one. With the ardupilot, it is simple to switch between auto and manual control, which facilitates this process. To set the waypoint, I click the 3rd channel button on my transmitter. The arupilot is programmed to recognize this action and save the x,y coordinates.
So, back to the parking lot, I map out the waypoints, and run the car a few times. At “slow” speed, the car navigates the course in about 1 minute (see, Minuteman, get it?) and at fast speed it goes around in 30-40 seconds. This is without the barrels and hoop, which will add some complexity.
Things don’t go off without a hitch, though. In fast mode, the car overshoots the points significantly. It will later course-correct by itself, provided it hasn’t already crashed into a curb. So it takes some practice to set the waypoints for high-speed runs. Usually I have to set the waypoints, then run it in auto mode a few times under close supervision. I can abort the run if it looks like it’s headed into a curb--this saves me quite a few times. Once a course is dialed-in though, it repeats it very reliably from run to run.
At the really high speeds, I had to be very cautious. Any mis-set waypoint could cause the car careen into a wall, and most likely break. The car goes much faster than I can run, so I would have to arm the car and let it sit and calibrate for about 10 seconds while I took-off sprinting around the building. I would be down at the second turn, now watching and waiting for it to come screaming around the corner. I would watch the car to make sure it was still on course, then sprint to the next turn. Minuteman would pass me right about at turn 3. I would continue to chase long enough to see it round corner 4 (now way up ahead of me), and as soon as I saw it head for the finish line, I would abort, knowing that the run was successful. I did this 4 or 5 times, until I could no longer run!
Satisfied with the testing, roadrunner and I headed back to Denver for the night. Next morning, we left at 7:20, with some foreboding clouds to the north. Small flakes of snow were falling, and soon we started passing southbound cars that were covered in snow. Not a good sign. By the time we got to sparkfun, at 8:35, the roads were wet, and a steady mix of light snow and rain was falling. We set up our gear under the tent and tried to get warm. I set up right next to the DIY drones team, so I got to hang out with the popular kids! Their quad copters gathered a lot of attention.
Around 9:00, I decided to brave the moisture, and do some practice runs. I did a setup run, then a test run at slow speed (60-second pace). On the test run, it navigated around the barrels and through the hoop and was rounding the 3rd corner, when it stopped. The LCD screen was blank, and I couldn’t get it to respond. This was really bad news, because in my many hours of testing, it had NEVER done anything like this. I hurried back to the tent, and tried to revive it. I recharged the battery and tried to blow any moisture off the controller board (there were a few small drops of water). I still couldn’t get any response. Now I was really nervous. I figured at worst case, I could probably buy a new ardupilot from sparkfun and install it, but I would probably miss a heat or two. Meanwhile, Roadrunner came by to offer help, and he tracked-down a heat gun. Fortunately, about 2 or 3 minutes of hot air solved the problem, and I wrapped the ardupilot in plastic at tape.
By now, though the heats were starting, and I wasn’t set to go. Somehow in the process, my waypoints were fouled up, and I would have to reset them by running the course. Between heats, I got in a couple of practice runs, staying out of the way of the contestants. Now, I felt pretty good about everything, and I waited for my turn.
In heat 7, just before me, was roadrunner. With high hopes, he started, and was navigating the first turn, when he was T-boned by another car. They were both stuck beyond recovery and were forced to forfeit the round.
Now it was my turn. I lined up on the end of the ramp in my designated starting position and got everything armed. The starting gun fired, and my car sped off to the first corner. Disaster soon struck, though, as a judge for one of the other cars inadvertently stepped on mine. Afterward, It looked like that kid from that bullying video on youtube who gets slammed to the ground. It just looped around in circles with a dazed look. Luckily, though, nothing was broken. As there was some time until the start of the aerial vehicles, I was permitted a do-over, as the interference was from one of the judges. This time, the car navigated the course perfectly, threading the hoop and rounding all the corners right on cue. The time was 56 seconds, plus a 30 second deduction for the hoop, made my official time 26 seconds! So far so good!
Now I had time to relax. The next-best time was around 1:20 seconds, and they didn’t make the hoop. So, I took some time to chat with the other participants, and to answer some questions about my dead-reckoning system.
While the awesome aerial vehicles were providing the entertainment, I thought about how to do the next run. I decided a medium speed would be best instead of going all-out, so I set it to about a 45 second pace. I started testing before the start of the 2nd round, but began to meet resistance from the event director. Apparently I was gaining an unfair advantage by running my repeated tests, and in general getting in the way of the event, so an announcement was made that no more test runs would be allowed.
After much begging, I was able to make a few set-up runs, but I had to line-up for my second heat without testing my newly programmed waypoints. At the start, the car rushed out to the first waypoint, and turned a HARD right--a little too hard. I had set the next waypoint back at greater than 90 degrees to get lined up for the hoop, and with the increased speed, the car spun-out--end of turn. A test run would have revealed the problem, but it wasn’t to be.
This time, tobor (my main competition) had stepped things up, and finished with an excellent time of 1:02. For the second time, he didn’t make the hoop, but if he had made it...that would only be a 6 second difference. Now my supreme confidence was melting. What if he could still go faster? What if he finally got the hoop? I knew my car was capable of really fast runs, but without being able to set it up properly, I might not make it. I went to lunch with a feeling of doom.
I got back from lunch, and while the raffle was going on I decided to try more test runs to dial-in my waypoints. I was quickly told that I would not be able to practice, because it was unfair. It was still at least another 10 minutes before the start of the final round, and there was nothing going on around the start line. I pleaded my case again, and was allowed to do a few more runs.
Now, however, there would be a wait of about 30 minutes between the start of the first heat and the final 8th heat where I could do no more practice runs. This wouldn’t be so bad except that the sun had finally come out, and things were warming-up nicely. Now, my negligence in not temperature-calibrating my gyro was starting to haunt me. Would this cause a slight change in the angular rate, causing some skew? I would find out soon enough.
Add to my worries, that the barrels had been moved and the arc was positioned a little differently. I knew my run was doomed. Maybe, though, tobor would once again miss the hoop. Or maybe his car just couldn’t go any faster.
So, as the final heat started, I had a pit in my stomach. My car got right off the line this time, and navigated the first turn nicely. But, as it sped down the straightaway, it passed the hoop just to the right. That was it. I couldn’t beat my other score without making the hoop, so the run was virtually over. The car navigated the next two corners and was on the final straightaway, when it smashed into one of the islands that stick out in to the parking lot. It broke a front suspension arm, but it didn’t matter. It’s day was already over. Meanwhile, tobor had indeed navigated the hoop--of course. It worked it’s way around the course at a good clip, but somehow it didn’t seem so fast. As it came around the final corner, a gaggle of spectators in tow, I was still hopefully confident that it hadn’t beat my 26 second time.
But, apparently my biological clock isn’t so great. 55 seconds was the reported time...and making the hoop, that was a final time of 25 seconds...one second faster the me...really? REALLY? Did he have to make the hoop on *that*one*run*? REALLY?? That was the moment I was dreading. I felt like Laurent Fignon in the final time trial of the tour de France. I saw it coming from mile away, and was helpless to avoid it.
Minuteman was easily capable of victory. It could navigate the course faster than any of the cars there--I would say probably faster than any that have run it...so why didn’t it win? For various reasons. But first off, I have to congratulate Scott of team tobor. Well played sir! Your fusion of multiple sensors using DUAL kalman filters was rock solid. You finished every heat and clinically marched to victory with each successive attempt. Great job!
So why do I make the bold claim that minuteman was capable of victory? Well, it’s just fast and stable. It can go faster than 25 mph, and it goes straight to every waypoint without hesitation. It doesn’t hunt around or veer off course or miss waypoints. When the waypoints are properly set, it will burn through the course in under 30 seconds. But, being capable of victory, doesn’t guarantee victory.
Minuteman, unfortunately, required a lot of setup and expertise to use. It was difficult to know where to set the waypoints to avoid overshoot and/or spin-out. Also, I never got around to temperature compensating the gyro, a fact that will haunt me for some time.
In the end, I have to concede that maybe mine just wasn’t the best system. Maybe dead reckoning is just too imprecise to be successful. Maybe it just requires too much set-up and testing, and is too prone to operator error. Or, maybe I just shouldn’t have slacked-off all March and April--I should have made all the little refinements that I never got around to. That’s a lot of maybes. One thing for sure, though, is that you won’t see me next year with a GPS-based vehicle!
Thanks, sparkfun, for organizing this event. I saw a lot of kids and teenagers there that were eager to get involved. Hopefully this sort of activity will inspire future generations to be as technologically innovative as generations past.
Also, as a note, roadrunner finally got a successful run of 1:18 on his last heat, putting him in 4th place overall. This was faster than any of the winning times from past years. I can vouch that a year ago, he was basically starting at zero on how to get an autonomous vehicle running. So, if you’re on the fence about competing next year, just do it. Get an arduino and an R/C car and some sensors from sparkfun, and go for it. It will be worth your time.