Todays goal is to make the fastest robot on the track.
Additional “Optional” Goals
- Calibrate a flawless victory OR
- Something that can best be described as what Ayrton Senna did at Imola in 1994.
This week we are going to build Max N00b into a robot racer to drive through an Alishan Trace Track, as shown in figure 1.
The rules have been simplified and are as explained here:
- The car must start from the start area. No part of the car is allowed to exceed the start area.
- A push on ENTER starts the car and the car should then follow the track to the retrace area, the top platform. From the retrace area the car should drive back until the car drives into the start area again. When the car is in the start area again it should stop and time elapsed since start should be shown in the LCD. The car should be completely inside the start area before it stops.
- When on the top the car should be completely inside the retrace area before going back.
Furthermore, we are allowed to use any LEGO elements we want.
The code will only be provided for the final shape of Max.
Max’ First Form
This first racer was very focused on speed and lightness. It used big wheels which was geared for more speed. This design has only a single light sensor, as shown in Figure 2.
This racer was used to test our line follower PID using a light sensor. We will also test what speed we can achieve by using the geared motors.
Max was very fast in this setup, but had some problem controlling him. The light sensor worked fine as a line follower but was not great at stopping in the green zone. Max was able to achieve great speed because of the gearing. So we decided to construct something new.
Max’ Second Form
Our plan in this version was to construct a vehicle which would be guided by long arms that could grip the edge of the track. We wanted to create a fun – and different – robot which was programmed to drive slightly away from the edge and had the arms keeping it driving straight. This robot can be seen in figure 3, and it is noticeable that the insect-like “feelers” are actually arms gripping the edge of the track when driving straight.
We wanted to experiment with the option of using long arms to grip the edge of the track to keep Max driving straight. The arms were attached to a motor which would turn either clockwise or counterclockwise – depending on which slope Max was driving on. Also, we used two color sensors spaced apart to register when Max comes to an even surface and has to turn. Furthermore, we chose to use color sensors instead of light sensors to easily register (see Lesson 4) when Max is in the start-zone (where he has to end up). The way it would work was that when Max registers he is on a flat surface, the motor with the long arms would turn 180 degrees, so that the arms were on the other side from before while making Max turn based on the motors tacho counter.
We found that using arms is a fun, but not viable solution (at least not the way we did it). This is because of the construction which made Max bounce when driving up the slopes, which consequenctly made Max reach the platforms in a different position and direction every time, making it improbable to make the turns correctly using the tacho counter. A video of our trial run with it can be found here.
Other issues with this version was that the arms would sometimes break off, or the end of the arms would get stuck. Also, making the arms attach on the inner side of the track (when driving down) was also a problem. Furthermore, Max became very heavy causing him to drive quite slowly. For those reasons, we chose to build yet another version.
Max’ Third Shape
This robot was aiming for speed and used a new front wheel, and the entire construction can be seen in figure 4.
This time we want to put a third motor on Max to achieve maximum speed.
This time there was a new feature on Max’ construction; the motorized front wheel. We believed that if we motorized the front wheel, we could achieve a faster acceleration. Another challenge here, however, was motorizing the front wheels. To overcome this, we used special rotacaster wheels, as seen in Figure 5.
By using rotacaster wheels, it is possible to make sharp corners with a minimal amount of friction from the front wheels when being forced sideways. The back of the robot has two geared motors attached to the same wheels we have used in the other forms. Furthermore, we have this time attached two color sensors underneath Max, in the middle of the body. We think that by attaching the light sensors there, it is possible to register in time when Max has to turn – regardless of him driving up or down the track (which will be forwards and backwards).
We managed to make Max drive with this setup, as seen in this video. We realized, however, that the placement of the color sensors did not make sense with the current setup – it was not possible for Max to react in time when driving downhill (as the color sensors were placed behind the motors used for steering). Also, the construction was too large to make Max capable of turning around in the endzone. As such, with what we have learned, we chose to construct a fourth robot.
Max’ Fourth Shape
In this fourth, and final, robot, we have combined what we learned from the previous robot forms:
- Using geared wheels, as first seen in robot 1.
- Using colour sensors and avoid a heavy construction, as first seen in robot 2.
- Using rotacaster wheels, as seen in robot 3. We now believe we are ready to take on the track!
This time, we built Max to have attached the motorized wheels geared to two motors, and the front wheel being a rotacaster wheel (not motorized). Also, we have attached two color sensors in the front of Max, so he can register where he is on the track (and when events happens, such as when to turn a corner). We have constructed Max so that he is small enough to be able to turn when he has reached the top of the track (which he will do very quickly because of the rotacaster wheels – see 3rd robot for explanation of how they work).
The final code can be downloaded here (PIDLinerFollower).
With this setup, it was possible to make Max drive extremely fast up and the racetrack, as seen here where he did it in a whopping 9.2 seconds.
Also, we ended up completing the track in a whopping 15.7 seconds, as seen in this video. The timer can be seen in Figure 7. At the end of the video, Max takes a shortcut, leaping out from the platform above the goal and he lands gracefully inside the goal zone. There was shown valid results from previous record holders and honorable mentions who also made their robots drive over the same edge as we did (such as this one), so we find our end time valid.
We did have a lot of issues with the PID controller for this racing shape because of the track changing environmental variables (such as background light and the track itself being crooked) which resulted in us not being able to complete the competition at the given deadline. However, we still wanted to beat the record which we did an hour after the deadline.
It was a lot of fun trying to make Max race the entire track up and down. However, we did not manage to make him finish in the time we had at hand (we were a bit behind on the previous lessons, so we had to use time catching up instead), meaning we had Max do the record an hour later than the competition’s deadline. However, we did manage to make a very viable solution for racing this track.