CSC 126 Robotics
Objectives
Tools and Parts Needed

Contained
in the new Lego Mindstorms NXT kit are three newly designed servo
motors. The
new NXT
motor delivers high torque because of its internal speed
reduction gear
train. Because of that, it also turns slowly and the efficiency is
somewhat reduced. Although this motor could physically be connected to
RCX with a compatibility cable, it is not recommended for use on a RCX
because the high current it consumes is too much for RCX current output.Using the NXT Rotation Encoders
A wheel (or wheel shaft) encoder sensor detects precisely how many times a motor shaft turns by having an encoder sensor monitored as the wheel shaft turns.
and the NXT SMART
rotational encoder
icons. 
.Working with Values in Containers
We have learned that a programmer use the variable to store data or any information by assigning values. As you know, in RoboLab, we store data in container by filling it with the data. In the diagram below, the red container is set to the value of 14. Simple math can be used to store data and change the values that are already stored. There are other mathematic operations like subtraction, division, and addition. So one can use any math and also any value to use with those operations. In the diagram on the right, the number 12 is being subtracted from the red container. Therefore, if this is run after the above command, the value of the red container is now 2. (14 - 12 = 2)In addition, remember that you can use the Clicks Container,
which allows the robot to count and store the number of clicks since
the Clicks Container was last reset. By using this, the robot
can count the number of "clicks" made on one touch sensor.
One
can use this for example, to count clicks made on one touch sensor
while another another
touch
sensor is not pressed. Just like any other container, it is
important to zero it before using it. Remember that we used
the following code
segment to allow the engineer to enter a count:
.
. . .| So, our
next question is how big is the exterior angle of a regular polygon? Finding the size of the each exterior angle of a polygon is actually pretty simple. It is a theorem from geometry that for all polygons, the sum of all of the exterior angles is always equal to 360º. Note that each polygon has the same number of exterior angles as it has sides. Since all the exterior angles in a regular polygon are equal in measure, to find the measure of each exterior angle that our robot must turn, we just need to divide 360º by the number of exterior angles. Thus, the turn our robot must make is just 360º / n, where n is the number entered by the engineer. Isn't that a surprisingly simple computation?? |
An observation from a student in
one of the sections:
"This
makes so much sense! If the robot is going to drive around a
triangle, it has to turn 1/3 of the way around each time. So, in
general, it has to turn 1/n of all of the way around each time. And,
you show us how to make it turn all the way around..."
|