Nxt robot tracks


The robot is based on the new HiTechnic Trike Base. Future articles will demonstrate the WallBot in other languages too. The Trike only uses parts that are available in both sets with the note that some part colors are different and the tires are a different size. Either the tires from the 1. The building instructions show the model using the part colors that are included in the 2.

You can download the building instructions here: HiTechnic Trike Base Instructions. The Trike is a simple three wheeled robot base with one drive motor for each side plus a caster wheel in the back. Feel free to use this robot base for your own projects. If you publish anything, either in print or on the Internet using this robot base, all we ask is that you give credit back to HiTechnic. In way it is a little like both of those sensors. Like the Ultrasonic sensor, it can measure distance though with light and not sound.

How it measures distance, though, is very different than the Ultrasonic sensor, I will discuss that in a different post. So what exactly is the EOPD sensor? Without dwelling on what that those words mean, let me explain how it works. As the LED comes on, the electronics in the sensor measures how much more light comes into the sensor element.

Since it is looking for the change in light as the LED comes on, ambient light has very little effect on the value of the sensor. It is this light that comes back into the sensor that the EOPD measures. That means the value is dependent on not just what it shines on, but also how far away it is.

There are really two things that determine what value the EOPD sensor will return. One is the reflective nature of the surface it is pointing at. If it is pointing at something light colored, then more light comes back and you get a higher value.

The other thing that determines the value is the distance to the surface. If the surface is close to the sensor, then more light comes back than if the surface is further away. I think of these as two variables in an equation. If you can control one of these two variables, then you can use the EOPD sensor to determine the other. For this project we are going to use the ability to measure distance to build a wall follower. The goal will be for the robot to drive along a wall, a few centimeters away, and not touch it.

It should handle sharp corners, both inside ones and outside corners. The EOPD sensor is used to track the wall while the robot is driving trying to keep it at a safe distance from the wall.

The Ultrasonic sensor is used to detect inside corners. If the robot approaches an inside corner, then the Ultrasonic sensor will detect the upcoming wall and the robot will turn sharply to the left to avoid the wall. HTWallBotView is just a sensor view so you can see the values of the two sensors. This will be useful in understanding how the program works.

HTWallBot is the main wall following robot. I will talk more about it below. The basic strategy for wall following with the EOPD sensor to determine where the robot is relative to the wall. If the robot is too close, steer away and if it is too far away then turn closer to the wall. To make it smooth the amount that the robot turns will be based on the value of the sensor, in other words, the amount that the robot turns will be proportional to the error.

In the simplest form, the Wall Follwer program can look this:. If you want, you can try this program and see how it works. It also may not handle inside corners very well because it is likely to either turn too late or too sharp and hitting one or both of the walls. You notice that the program above consists of a loop and three main parts: Lets take these instructions one at a time to make sense of this program.

Here is what the whole program looks like:. The best way to view this program is in the LEGO Mindstorms Software so you can click on the tabs of the Switch structures to see the code for each condition.

The view above is what it looks like under normal wall tracking when it is not approaching either an inside or outside corner. Just like the simple version, it starts by reading the EOPD Sensor and subtracting the raw value from to get an error, then things get a little more complicated. Before it uses the error value it does a little more advanced processing. First it saves this error into a variable called Steer.

Then it compares the EOPD value to see if it is less than 30, this is the condition that can happen if the robot is approaching an outside corner where the wall just appears to go away. Assuming normal wall tracking, it will take the false case of that first switch statement. This will happen every time through the loop while there is a wall on the side of the robot that the EOPD sensor can see. This will be used for outside corners where the wall goes away and we want to measure the distance since the last time the wall was seen.

After the motor reset, the Steer variable is compared with For the steer value to be this low, the EOPD sensor must be very close to the wall, most likely in the middle of inside corner. The True case for this swich simply sets the Steer value to so that even if the EOPD sensor is very close, the Steer value is limited to and will not go beyond that. I found that if the robot turned to sharply in an inside corner, the back wheel would often hit the wall that the robot had been tracking.

Under normal wall tracking conditions, the program will go to the False case of the second Switch statement. Here two things are examined: Basically what is happening here is that if the Ultrasonic sensor detects a wall of an inside corner, I want to set the Steering value toa fairly sharp left It will work out to be a turn where the inside wheel is stopped and the outside wheel goes full power.

If at the same time the EOPD sensor detects a distance so close to the wall that it warrants a sharper turn than that, then that will take precedence and it will go for the sharper turn. At the end the Steer variable is used to set the power of the two drive motors.

I found that using two Motor commands gave me better performance than setting the Steering value of a single Move command so that is what this code does. Since the Motor commands always take the absolute value of the Power value, in order to get the motor to go backwards for a negative power it is necessary to set the Direction value based on the sign of the desired power.

That is what the Comparison blocks before each of the Motor commands is all about. The EOPD sensor can be used to measure short distances when the nature of the wall is known. During the video, for example, you can see that the robot tracks the wall just as well when it is on the illuminated side as on the dark, back, side of the wall.

Another feature of the EOPD sensos is that as an analog sensor, it is very fast. A new value of the EOPD sensor can be read every 3 milliseconds. This entry was posted on Tuesday, February 2nd, at 8: You can follow any responses to this entry through the RSS 2. You can skip to the end and leave a response. Pinging is currently not allowed. This is wonderful, my son really loves star wars lego and regularly annoying me regarding it — this post has clarified some of my doubts.

Time for lots more browsing! Mail will not be published required. HiTechnic Trike Base Instructions The Trike is a simple three wheeled robot base with one drive motor for each side plus a caster wheel in the back.

The EOPD sensor can opertate in either a short range or a long range mode. Short range is less sensitive and best for ranges less then 5cm. For the WallBot, it is best to use Long Range which can handle distance of more than 20cm.

March 20, at 3: March 23, at September 29, at 6: September 29, at 9: Leave a Reply Click here to cancel reply.