You are on page 1of 8

JOWETT MILLAN PADAYAO

VICTOR COLIN TAN

BS ME 4 12/05/16
ROBOTICS: Car-Bot

Experiment No. 4: Car-Bot


The main objective of the experiment is to create or build a car-bot that
basically requires the knowledge from the previous experiments, which uses the
same color and ultrasonic sensors and servo motors for different functions and
operations. It also serves as an application when it comes to the operation and parts
of the Lego Mindstorms NXT 2.0 kit. This includes learning about the program
interface, to be familiar and perform different types of tools and functions to create
a program, and to load the program to the NXT controller. The experiment used the
following materials: one Lego Mindstorms NXT 2.0 Brick Controller, Lego Mindstorms
NXT 2.0 kit, timer, ruler, electric (black) tape and test pad.
In this experiment, a robot is actually built that requires more complex
linkages and program functions. Particularly, a car robot is created, that has
wheels as legs, and can move regardless of the terrain path. As one of the most
innovated machines, this experiment deals with the interaction and the resulting
effects of each program function that is initiated on the brick controller.

Summary
From the carbot experiment, the initial activities that were conducted help
student to be familiar and gain knowledge about the controllers and sensors, the
program and the mechanical parts of the Lego Mindstorms 2.0 Kit. Moreover, the
activities were conducted in order to deal with the complex systems of the kit,
through a relatively complex mechatronic car robot.
Particularly, the firsthand activities deal with the move block and motor block
functions that use ultrasonic and color sensors. As the activities were conducted,
different types of problems and exercises were presented, in order for the students
to be able to fix the certain problems through examination and analysis of the
movement and the given program function. These individual sets of exercises
presented in the initial activities lead to the main objective of the experiment, as
applied in anti-collision activity and line-following activity of the carbot.
As inferred, the activities helped us to be familiar and knowledgeable about
the kit and the program (which refer specifically to their function and operation),
beginning from simple to complex systems, as presented from the carbot
experiment.

Conclusion
As conclusion, as we built and examined the carbot, it is a great mechatronic
robot to start and practice with. The carbot is vitally dependent on the program

made by human, and so it will systematically move according to its function and
operation initiated from the program. It will have unlikely or undesired actions if
there are wrong programmed functions. The operations of the carbot are directly
dependent to the mechanical linkages and program it contains.
Moreover, for us, the motor block function is more desirable than move block
function. We discovered that move block is like the automatic function of the
program, while motor block provides a manual and intermittent sense of function for
the carbot. Motor block has advantages from move block and also otherwise, but
specific, innovative and creative functions cannot be programmed using move
block, and so we prefer to motor block function.
Particularly, different sensors are used in different types of application. In the
experiment, in anti-collision activity, the sensors can be ultrasonic or color sensor,
because it provides the same function, which is to provide vision for the carbot, to
systematically avoid the carbot from getting hit by any obstruction. The type of
vision sensor is determined by the given parameters, and the limitations of both
sensors. For the line-following activity, ultrasonic sensor cannot be used because it
is impractical, due to the fact that it uses frequency waves to function properly.
Therefore, color sensor is used because it just needs light reflection to process
information. This activity also implies that in order for the carbot to follow rules and
different parameters, there should be a systematic way or program that is in the
carbot.

Answers
Activity 1 (Building the Car-Bot)
Car-bot is assembled through a manual guide from Lego Mindstorms NXT 2.0.

Activity 2 (Move Block)


[2 Power]
Create a new program and add a move block. Load programs varying the power
rating of the move block. What do you observe while varying the power?
The power rating input in the program tells us the speed of the carbot; the greater
power rating, the greater carbot speed.
[4 Direction: Exercise]
Create a new program and add a Move Block. Set the Direction setting to UP
ARROW and leave the rest of the settings. Load and Run the program. If the
direction is set to UP ARROW, which direction does the Car-Bot move? Forward

JOWETT MILLAN PADAYAO


VICTOR COLIN TAN

BS ME 4 12/05/16
ROBOTICS: Car-Bot

Change the Move Blocks direction setting to DOWN ARROW and leave the rest of
the settings. Which direction does the Car-Bot move now? Backward
While the program is still running (unlimited breaking), try to nudge the wheels and
feel how hard it turns (Warning: DO NOT USE TOO MUCH FORCE). Stop the program
and
nudge
the
wheels
again.
Note
the
difference.
There's a greater resistance on the wheels after the wheels stopped turning while
the program is still running.
[5 Duration]
Create a new program and add a move block. Make sure the duration is set to
rotations, and vary the value of the number of rotations. Load and run the program.
What do you observe with the rotation setting? One rotation means one complete
revolution of a wheel.
Change the duration to seconds. Get a timer. Load and run the program. Time the
movement of the car-bot with the timer with respect to the number of seconds you
input in the program. Is it consistent? Yes.
If you want to vary the distance traveled without changing the duration, what would
you
do? Change the power setting to increase or decrease the speed of the car-bot.
Change the duration to degrees and set the value to 360. Compare this with 1
rotation. Are they the same? Yes.
Change the value of the degrees to 90, 180, 270 and 720. From these experiments,
how can you relate the rotation value and degree value? 1/360 revolutions in a
degree.
Can you say that the rotation is
The duration settings are interchangeable.

just

based

off

of

degrees?

From this experiment, how does the motor know how much degrees have elapsed?
Servo motors have internal gear system that can detect the degrees or rotations
that have elapsed.
Now change the duration to unlimited. Run and load the program. What can you say
about the unlimited duration? It will not stop.
Now, add about 5 to 10 Sound Blocks (choose whatever sound you would like) and
put
them
after
the
move
block.
What
do
you
observe?
While the car-bot is running, the sounds are simultaneously played. It also stops
when the program is not running.
Change the move blocks duration to about 3 rotations, still with the sound blocks in
place.
What
do
you
observe?

The sounds do not play simultaneously anymore. The next sound plays right after
every 3 rotations.
In order to fix this problem, we need to put the unlimited function into a LOOP block.
Add a loop block, set control to forever. Put the move block in it and set to unlimited
function. What do you observe now? The sounds will not play, because the move
block is inside the loop block.

Now change the move blocks duration to rotation, set to a low value (about 1 or 2
rotations). The move block should still be in the forever loop. Load and run the
program, what do you notice? From this, what can you say about unlimited?
The car-bot will run for a while depending on the value, then stops and then run
again, but the sounds will still not play unless move block is outside the loop block.
[6-Steering]
Add a loop block and set to forever. Insert a move block into the loop block with
duration set to UNLIMITED. Set the duration to forever. Change the steering value to
right or left, but not full left nor full right. Load the program. Make sure to detach
the USB programming cable when running. What do you observe after a certain
distance? The car-bot will steer at the desired direction after certain time and
distance.
Change the steering and what can you comment on the acuteness of going more to
a certain direction? The acuteness of going to a certain direction is desirable. It
doesn't stop instantly when turning, and the greater value of steering, would mean
faster time to turn the car-bot.
Now go for full left or full right of the steering. Load and run the program. What is
your observation with the setting? The car-bot will just rotate in its place.
Why do you think that this car-bot doesnt follow the normal steering of a car? The
normal steering of a car is different from the car-bot because, normal cars have
wheels that can turn by differential drive mechanism, compared to car-bot that
turns by virtue of power differential.
[7- Next Action]
This time, change the Next Action to Coast then load the program. Remember to life
the carbot and run the program. Observe its wheels again. What difference do you
observe from coast and brake? The brake action would mean more instantaneous
than coast action. The brake action depends on the force applied to the gears, while
coast
relies
on
the
braking
of
internal
gears.
The brake action would mean more instantaneous than coast action. The brake
action depends on the force applied to the gears, while coast relies on the braking
of internal gears.

JOWETT MILLAN PADAYAO


VICTOR COLIN TAN

BS ME 4 12/05/16
ROBOTICS: Car-Bot

Activity 2 (Motor Function)


[4 Action]
This dictates an acceleration that the motor will take. There are 3 options: constant
(no acceleration), ramp up (accelerating), ramp down (decelerating). The
acceleration/deceleration will be until the motor reaches its desired value.
Create a program. Add a move block and set the duration to 10 rotations. Set Action
to Constant. Load and Run the Program. What do you observe? From the term
constant, setting the action to constant would give a constant speed output from
the servomotors.
Change the Action to Ramp Up. Run and Load the program. What do you observe?
When using ramp up the servo motor would accelerate until it reaches the set or
desired power/speed.
Change the Power to 100. Run and Load the program. What do you observe?
Changing the power to 100 would give a faster acceleration and faster speed.
Change number of rotations in the duration to 3. Load, run and observe. Change the
number of rotations back to 10. Load, run and observe. What do you observe with
the acceleration? When the rotation was set to 3, the motor was not able to run or
reach the desired power/ speed which is 100.
Create a new program, that add 2 motor blocks. Set the first motor block port to B,
duration to 3 rotations, direction to UP ARROW, action to constant, check wait for
completion, power to 100 and next action to brake. Set the second motor block port
to B, duration to 5 rotations, direction to UP ARROW, action to ramp down, power to
10. And next action to brake. Load and run the program, just lift the car-bot instead
of letting it run and observe motor B. Did the motor decelerate or came to full-stop?
The motor came to a full stop.
To fix this problem, change the first motor blocks next action to coast. Load and run
the program. What do you observe with the motor now? The motor decelerated
before coming into a full stop.
Change the second motor blocks duration to 20 rotations. Load and run the
program. What happened to the deceleration? The deceleration of the motor
became slower.
As the name implies, ramp up or ramp down is acceleration/deceleration. Suggest a
way to accelerate/decelerate and maintain that final speed. A way to decelerate and
accelerate and maintaining the final speed would be to have two motor blocks one
with a ramp up/down function and the other with a constant function. The power of
both blocks should be the same.
[8 Wait Function]

Create a new program. Put 2 motor blocks, one in front of the other. Change both of
their duration to 10 rotations. Change the port of the first block to B and the second
to C. Uncheck the wait for completion for both of the blocks. Load and run the
program.
What
appears
to
be
the
problem
of
the
program?
The servo motors will not finish the desired duration.
To fix this problem, check the second blocks wait for completion. Load and run the
program. Does this fix the problem? Yes.
However, we have another problem here: during the stop, one motor doesnt
abruptly brake as the other one! Most notably, if the first block is set to port B, the
motor that port B controls do not do the brake next action like the other motor. To
fix this, we just set the second block from brake to coast. Change it, load and run
the program. Does this fix the problem? Yes.

Manual Steering
Because of this wait function, we can now perform manual steering instead of
relying
with
the
steering
of
the
move
block.
1.) Continuing from the previous exercise, set the power level of each block such
that one is higher than the other. How similar is it to the move blocks steering?
They
are
similar.
2.) However, in the move blocks steering, there is a full right and a full left, which
results in one of the motors turning in the opposite direction. In order to follow this,
set both the power levels of both the motor blocks to 100. However, set one of the
motors direction to DOWN ARROW. Load and run this program. What are your
observations? Same case with the move blocks' steering. But the motors run in its
fastest
speed.
3.) Based on this experiment, list the advantages and disadvantages of using the
motor
block
over
the
move
block:
Advantages: Customization of steering can be applied. With manual steering, it can
be
more
creative.
Disadvantages: Easier to program. Less complex.
Based on this experiment, which block would you prefer for movement of the car?
Manual or motor block.

Activity 4.1 (Anti-Collision Activity)


Using the ultrasonic sensor, and after following the programming instructions, the
observation
is:
The car-bot stops when there's an object in front of the ultrasonic sensor within its
vicinity.

JOWETT MILLAN PADAYAO


VICTOR COLIN TAN
While
using
the
color
sensor,
and
It functions differently with the previous one.

BS ME 4 12/05/16
ROBOTICS: Car-Bot
following

the

instructions:

While the program is running, place any object in front of the sensor. On which
colors does the carbot stop? Any color except black.
Is there a color in which the car does not stop? If yes, what? Black, yes because it
should stop when it is not color black.
Why is there a need to have a default color selected for the color sensor, specifically
black?
By using black as a default color, it enables the carbot to detect range of different
colors.
List
the
advantages
of
each
sensor
toward
the
other.
Ultrasonic doesn't depend on color, which is desirable for collision and proximity
sensors. Colors can be used to distinguish color collision commands. For example, if
you want to stop the car when there is a red object in front of it.

Activity 4.1 (Line Following Activity)


Most robots follow a set of commands, in which case, we call it a sequence of
commands; as what we are doing in programming. In the movement of robots, it is
necessary for them to follow a path, be it rails or even lines they have to track
below them. Line following is exactly the latter. Ultrasonic sensing is almost
impossible and highly impractical to use with line following so we use the color
sensor (or light sensor).
1.) Attach the color sensor to the car-bot and let it face down. Page 12 of 12
2.) Create a new program. Go to FLOW -> Loop Block. Set the loop block
control
to
forever.
Add
a switch block inside the loop block and set the switch blocks control to
sensor,
choose
COLOR SENSOR. Set the compare to be inside range, and choose black. Make
sure
to
use
port 3 in the program and attach the color sensor to port 3 of the Brick
controller.
3.) At the upper half of the switch block, add a move block. Set to port B and
C
and
set
duration
to
UNLIMITED.
4.) At the lower half of the switch block, add 2 move blocks. Set the first block
to
Port
C
only
and direction to STOP SIGN. Set the second block to Port B only and duration
to
unlimited.
5.) Use the test pad provided by the NXT 2.0 kit. Load the program and let

the
carbot
run
on
the
test pad. Make sure to properly face the color sensor directly at the black
track
line.
6.) Try the program on clockwise and counterclockwise rotation. Which
rotation
does
the
car
bot
get
lost?
Clockwise
7.) At the lower half of the switch block, change the first block from Port C to
Port
B
and
the
second block from Port B to Port C. Load and run the program on the test pad.
Which
rotation
does
the
car
bot
get
lost
now?
Counterclockwise
8.) With only one color sensor, would it be possible for the robot to be able to
dictate
the
direction it should go next? Why? No, because it needs another sensor to
change the car-bot direction.

You might also like