If you are programming a robot with the new NXT Software, you may be wondering--What's the difference between the Motor and Move blocks? The answer to this question has a significant impact on how your robot will move.
The LEGO MINDSTORMS Education NXT software includes these two blocks for motor motion. While the Motor and Move blocks may appear very similar, they contain a few subtle but significant differences that can affect how your robotÂ’s motion .
The Motor block program video shows that the car is unable to stop directly at the pedestrian. Instead, the vehicle knocks the figure over and then corrects its motion to the one-rotation point. It ends up at the same final position as the vehicle programmed by the Move block, but only after this correction. As you can see in the "jerky" motion of the car, the motor does not slow near the target distance. The motor returns to the correct target position only after the rotation sensors have measured slightly more than the one-rotation duration.
The most important difference between the two programming blocks is the level of intelligence associated with each block.
The Motor block is designed simply to turn the motors on and off. You can input the duration of the motion (how many rotations or how many seconds you want the motors to spin), but your robot may overshoot its target. This overshooting can happen because the Motor block does not program the motors to slow down as they near their target duration so momentum can carry a robot past itÂ’s target destination.
The Move block, on the other hand, gives you more control. With the Move block, the blockÂ’s built-in control algorithm programs the NXT to monitor the motorÂ’s rotation sensors and to slow the motors as they approach the target duration. This capability is helpful when you want a car to follow a specific track or to arrive exactly at a physical target that is a known distance away.
Sample Code in Action: Â“Stopping for the PedestrianÂ”
In this program, the vehicle is programmed to turn left and then stop for the Â“pedestrianÂ” LEGO figure. The vehicle is constructed with the driving base module contained in the LEGO MINDSTORMS education booklet. The LEGO figure is placed exactly one motor rotation away from the starting position of the vehicle.
Each program accomplishes the following:
Â• Uses one block that is configured to use the motor at Port B.
Â• Sets the motor to function in the forward direction.
Â• Configures the motor to run at 75% power for one rotation.
Â• Programs the block to wait for completion of the one rotation
Â• Sets motor to prepare for braking as Â“Next ActionÂ”.
The above specifications are implemented in each of the programs below.
Motor block program:
Move block program:
Looking at the above programs, you might think the robots would act identically. The vehicle should travel in a curved path (because only one motor is used) to its target destination, lying one rotation away.
In the case of the Move block program, the vehicle is able to slow its motor when it senses the nearing of the target distance of one rotation. When the program executes, you can actually hear the slowing of the motor. The vehicle gradually decreases its speed and then and stops directly at the LEGO person. No correction factor is necessary as the Move block programs the NXT to utilize a control algorithm.
article and models by Ciera Maffei (