About this video
A short walkthrough of the motor block and move block in a robotics programming environment. The motor block powers one motor, while the move block controls several motors through selected ports, with options for power, steering, duration, rotation and the Brake or Coast end behaviour.
You'll be able to
- choose between the motor block and the move block for a given build.
- set direction, power and steering for multiple motors.
- explain the difference between Brake and Coast at the end of a block.
Key words
- Motor block
- The block used to power a single motor.
- Move block
- The block that controls multiple motors together by selecting their ports.
- Steering
- A setting that adjusts how much power goes to each motor so the vehicle turns.
- Brake
- A Next Action setting in which the motors shut off immediately when the block ends.
- Coast
- A Next Action setting in which the power ramps down slowly for a smoother stop.
Transcript
To power a single motor, you use the motor block, which is under your output here. However, this only works when you're powering a single motor. However, if you are building some sort of vehicle and you have multiple motors attached-- let's say you have a motor plugged into A and B-- you need to use the move block, which is under the common area, and the move block allows you to control multiple motors.
And you do so by selecting the port your motors are plugged into, so in this example, I have A and B checked, and that's where my motors are plugged into. And now I can easily adjust the direction to both those motors here. And I can also adjust the steering to favor either towards A or B, and what steering does is it just adjusts the power being sent to those motors.
And you also have an overall power setting for all motors that are plugged in. You can go to max power and all the way to 0. And the duration is how long you want this block to execute for. So you can do unlimited, and this will just continue running and you won't even need a loop in this case.
You can also do some fine adjustments and say, I want my motors to turn five degrees, and because of the internal rotation sensor, it can do a very fine adjustment. You can also set it to do rotations, such as, I want my motors to rotate three times. There. And the last option is you can set the duration, so you can have your motors run for 2.5 seconds if that's what you need in your application.
The final setting is Next Action, and what this does is it allows you to select Brake or Coast. Brake means when this block ends, the motors immediately shut off. And, however, you can also select Coast, which means the power ramps off slowly and you get this smoother response.
So that's how you can control either multiple motors, or the same thing applies if you're using a single motor. It's all the same settings, except it only applies to a single motor port.
Video © Khan Academy, used under CC BY-NC-SA. Watch on Khan Academy. Puzzicle is not affiliated with Khan Academy.