If you look at the properties of the move block and the motor block LEGO Mindstorms NXT, you will see that they have much in common. Still they have several differences. You should be aware of these differences in order to choose the appropriate block for your needs.
- 04 May 2013
A useful formula we have reached in the video tutorial is as follows:
D = b * (PR + PL)/(PR-PL),
- D is the diameter of the turn the robot would make;
- b is the distance between the wheels of the robot;
- PR and PL are the power set to the right and to the left motors respectively.
If the diameter is a negative number, then the robot will turn right; otherwise the robot will turn left. Note that if you set the power of both motors to be equal, then the D becomes an infinite value (a straight line).
Basic LEGO Mindstorms NXT Tutorials
The next episode of this series is Episode 22, where we make an overview of the sound block.
In the next few videos I will go through all of the blocks in nxt-g. I will comment on their adjustments and show some of their basic application. I will use the Complete palette, which is divided in six subpalettes. The first one is called Common and here are the most commonly used blocks. I would not stop on that palette, but I will talk about the next five palettes. In this video I will talk about the differences between the Motor Block and the Move block in the nxt-g.
The motor block vs. the move Block
If you look at the adjustments of the two block you can find that they have much in common. Still they have several differences. You should be aware of those differences in order to choose the appropriate block for your purpose.
The motor block has several advantages, like acceleration and using acceleration you can make the movement of the robot more smooth. Another thing is that you can control the power Also the motor block has one big disadvantage, that you can control only one motor at a time so the program, using motor block, is bigger, so it takes screen space and also it takes more brick's memory. The move block has exactly the same ADVANTAGE, because it takes less screen space and brick's memory and also it is very appropriate for straight lines, because the block control the two motors together and makes sure that the robot goes in straight line.
Making programs for moving in a straight line
Now let's make two programs for moving three rotations forward. The first one will use the motor blocks and the second one will use the move blocks. So I take motor block, choose motor B and leave it to unlimited. Then take again motor block, but this time choose motor C and leave it unlimited. Then I take orange rotation sensor and set it to 3 rotations of motor B. So now the program will do the following thing: It will turn on motor B and motor C and they will go forward until motor B has made three rotations. Afterward I want to stop the two motors. Okay, so that's how looks a simple program for going in a straight line with the motor blocks. Now let's make the same program using the move block and it looks like this.
Moving in a straight line
Now I will try the programs. First I will download the program with the motor blocks. I will return the motor back and I will try the program with the move blocks. As you can see, the program with the move blocks is more like a curve instead of a straight line. Now I will add a weight to the robot and I will run the same test. I will return the robot. As you can see the movement of the robot is away different from straight line. Now I will run the program with the move block. As you can see again the move block is like a curve, constantly moving faster the B or the C motor, but still the two lines are parallel one to another.
Using formula to calculate the turn.
Let's take a look at the adjustments of the blocks. As you may remember, there is a steering option in the move block. You can use it to make the robot turn left or right. The problem with the steering option is that you can not precisely control the turn of the robot. You can use the motor block to do that. Using the motor blocks and checking the control motor power you can constantly control the power of the motor. There is a formula in the description of this video, using which you can calculate what is the diameter of the turn, the robot will make, depending on the power of the two motors and the distance between the two wheels. I will give you simple example. The distance between the wheels of our robot is 11 centimeters. I will set motor B to move at 50% power and motor C to move at 75% power. Using the formula you can calculate that the diameter of the turn will be 55 centimeters. Let's make the program and see whether the formula is correct or not. So I choose motor B and set the power to 50. Than I choose motor C and leave the power to 75 and let's say I want to make 4 rotations.
Making Precalculated turn
Now I will download the program to the robot. There is some initial difference and that's because we did not use acceleration. I will use a meter to find what is the diameter of the turn. It is 60 centimeters, which is good approximation to the 55.