It has been a couple of weeks since returning from Taiwan. I would have written about it sooner but things did not go quite to plan robot-wise and I wanted to find out exactly what happened.
This year, I have finally started to run a mouse with a suction fan. This is Decimus 5 (D5). Nothing terribly special or even very original by the current standards. There are many mice like it but this one is mine. In the preparation for the contest I spent a lot of time getting it set up. Not enough time – but quite a lot all the same. Mostly, I wanted to find out what kind of difference a suction fan makes to performance. The short answer is – LOTS.
Fan assisted performance.
With the fan, its motor and larger batteries to energise it, the all-up weight of the mouse is 104g. On top of that the fan is currently set to provide an additional downforce of about 150g. All that extra downforce significantly increases the grip over its predecessor. For example, forward acceleration is now set to 25m/s/s compared to 14m/s/s on D4 and that is without any of the unstable nose-lifting demonstrated by D4. Turns are much faster. On a good day and ideal conditions, D4 could run turns with centripetal acceleration of 24m/s/s. That equates to running the SS90 turn at about 1450mm/s. With the fan running on D5, that is now the starting figure for speed runs – that is, the first fast speed. So far, with the current settings, D5 can run the SS90 turn at a little over 2200mm/s.
It should be possible to improve on these figures because I have not yet set the controller constants up for this mouse. It is running with all the same parameters as D4. There is also a possible problem with the front-to-back balance of the mouse since there are signs that it oversteers and fishtails out of faster turns.
The fan also seems to change the behaviour of some turns. Drift is generally less and some turns seem to need no compensation at any speed. There is plenty of scope for proper setup and tuning and i see no fundamental reason why it should not perform as well as any other mouse out there, with the possible exception of Khiew Tzong-Yong’s Excel 9. Not to worry though. Revisions are under way.
Practice day
Mostly, the software in the mouse was ported straight from D4. The idea was that new code had been developed on D4 as it was a proven platform and the transfer to the new mouse would be relatively easy. Guess how that turned out. I had been confident that all I had to do on practice day would be calibrating the sensors and fine-tuning the turns for the (always) excellent Taiwan maze.
Within a few minutes, it was clear things would not be that easy. To cut a long as frustrating story short, D5 would not explore reliably, It ran into walls, made wrong turns, missed the goal and generally behaved very badly. Poor searching was the last thing I expected and has not been a problem for me for quite a few years. After several ours of wrong guesses and poor analysis on my part I determined that the problem was in the mouse not reliably registering walls in front. The symptoms appeared to be exactly the opposite and for several hours, I had been convinced that it was adding walls that were not there. Testing was hugely complicated by the fact that the practice maze was fixed and so it was not possible to set up small test areas in the usual way. By the time I found, and corrected the problem, there was only about 40 minutes of practice time left but D5 was able to search successfully and ran the test maze better than I had hoped. There had been no chance to improve any of the turns or do any of the other fine tuning I wanted but it was working and it was quick. The contest still had promise and at least I would not look too stupid the next day.
The contest
Contest day is always busy. There is essentially nothing you can do with or for the mouse so you get to relax and watch the other events until it is your turn to run. The day starts with a short opening ceremony with the international invitees gather on the stage. This is a great bunch of people that I have got to know at these events. There is always something to share and learn and everyone is extremely friendly and helpful.
The main hall is packed with robot contests. Too many to really describe here but new this year was a sumo tournament.
There was plenty to see but it was soon time for my event and I was keen to see what D5 could do.
The contest maze was interesting. It was pretty clear that the magenta path was the fastest but it was the same length as the cyan path. Not all mice found the optimal route and there were a couple of alternatives that differed in detail depending on the search algorithm and the thoroughness of the optimiser.
The initial search by D5 was, I thought, a really good run. It seemed not to make any mistakes and ran beautifully. In fact, it turned out to be the second fastest search run. After a quick clean of the tyres, I placed D5 back in the maze for the first speed run. When started, however, it proceeded to to do a search run again. I knew it had a solution since the indicator light had come on and it would not return to the start without a solution. It was another beautiful search. This time with full knowledge of the maze, it made no wrong turns and ‘searched’ straight to the goal and back without error. No problem, I thought, maybe there was some lingering missing cell in its tiny brain that needed checking out. No chance any more of a good score but at least I might get a couple of decent runs in to prove it worked.
Nope. And then nope again. I retired with no speed runs. Unbelievably disappointing. The only consolation was that the three direct search runs were remarkably consistent with times that were within 15ms over 18seconds – better than 0.1%. That’s something – right?
Follow up from failure
I am afraid that, after that, I was no longer paying huge attention to the rest of the event and did not even get to see the line follower finals. Instead, I spend my time trying to work out what had gone wrong and how to fix it. I even went off, retrieved my computer and re-programmed the mouse so that, after the contest but before the packed everything up, I could try it again.
The basic bug was not too hard to find. The mouse found a solution and headed back to the start ready for a speed run. On the way back, it is still, technically, searching and so can find new information in case there is an improvement. In this maze, it did. the bug had probably been there for a long time but it took this contest maze to reveal it. Because the maze had changed after a solution had been found, that solution was no longer valid and the mouse felt compelled to set out on another search. The real problem was that the code that decided there was a solution, and the code that told the mouse to carry on searching was not the same and they disagreed about the status of the maze. As I say, easy to fix and it would never have shown up on the simple test mazes I can make at home. Nor, apparently had it shown up in any other contest mazes. Lesson learned.
Multiple errors
Now I ran again after the contest, in the same maze. The search was good, the mouse returned, had its tyres cleaned and was loosed for a speedrun. It was quick, very quick, everything I could have hoped for. Until it got about halfway round, stopped and then ran off into a wall. It did this quite reliably and repeated itself twice more before I gave up and accepted that I really was not contest-ready after all.
This second bug may be new or it may not. I cannot be sure but it, too was revealed by this maze and not by others – including the practice maze of the day before. The problem here was that, after getting a solution for the maze, the pathfinder determines the best route and passes it to the code that performs a speed run. A requirement is that the path should not pass through unexplored cells. Seems reasonable. However, the mouse can actually determine the existence of walls without having to visiting a cell. In this maze, the optimal path ran through a cell where it was perfectly safe because the important walls had been mapped but, because the cell had not been visited, the mouse stopped at that cell and reverted to searching again. Since it was never intended to switch from a high-speed run to searching within one cell, it crashed. So – even if I had not suffered the search error, I would still not have managed a speed run because of this error. It did not take too long to work out what had gone wrong but I have spent the last couple of weeks working to make sure there are no other bugs in this basic mouse logic.
Fixing up
For many years, I have known that I need a mouse simulator so that I can run a virtual mouse in virtual mazes and test search and path generation algorithms. It is not really enough to run in small mazes at home where it is difficult to set up mazes complicated enough to really test the algorithms. Worse, there are definitely mazes that can cause trouble for some algorithms. I know, for example, that my code can thrash during the search. That is, it can go back and forth between two cells in an endless loop. To combat this, the code counts the number of reversals and quits if there are too many. It is rare for this to be triggered and it never happens on simple mazes. Thus far, this has never meant that I do not have a solution or that I cannot perform a speed run. Even so, it is a sign of a problem that should have been fixed a long time ago.
The Taiwan contest finally spurred me on to get this job done so now I have a simulator and it has allowed me to improve the search and path generation. Searches, including optimisation, should now be significantly quicker, path generation is more reliable and there are no issues with any of my large set of past mazes.
Not that there are any guarantees that there are not still pathological mazes out there waiting to cause trouble.
Results
For the classic micromouse, the results were:
ID | Team Name | Best score | Rank | Best Run |
---|---|---|---|---|
A1I-114 | Excel-9 | 5.159 | 1 | 5.298 |
A1I-122 | HIPPO | 5.404 | 2 | 5.211 |
A1I-120 | Red Comet | 5.648 | 3 | 4.881 |
A1U-103 | 廠廠 | 7.208 | 4 | 5.484 |
A1U-102 | 我沒有準備 | 8.204 | 5 | 6.731 |
A1U-101 | 妳看起來好好吃 | 8.651 | 6 | 7.845 |
A1I-111 | Diu-Gow 4 | 10.951 | 6.381 | |
A1U-104 | Huan Tian | 11.402 | 6.729 | |
A1I-113 | Decimus 5 | 21.035 | 18.697 | |
A1I-115 | Excel-9a | 40.137 | 37.831 | |
A1I-119 | Zeetah VII | 45.604 | 42.898 | |
A1I-121 | 紫電改 | 47.634 | 41.23 | |
A1U-108 | diu gao | 63.501 | 63.475 | |
A1U-105 | NoSpeed | 76.817 | 72.316 | |
A1I-116 | Kojumouse12 | 87.908 | 86.939 | |
A1I-118 | 緋(Vermilion) | |||
A1I-123 | (魳)Barracuda | |||
A1I-117 | Yukikaze-5.5 | |||
A1U-109 | 快跑啊笨蛋 V3 | |||
A1U-107 | Giraffe Car | |||
A1U-106 | Long Giraffe | |||
A1I-112 | MIN 7.1 |
For more results – particularly for the other contests see:
Classic Micromouse Video
Excel 9 – Khiew, Tzong-Yong – first place:
Hippo C – Liao, Huan-Jie – second place
Red Comet – Utsunomiya Masakazu – Third place
Thank you for your very detailed report. A real good source of information about the stuff I would otherwise never think about.
My pleasure. The devil is, as they say, in the details.
Great reading as always.
There’re a few interesting open simulators out there:
https://github.com/mackorone/mms
Looking forward to seeing your D5 in action.