Knowledge Base

Set Wheel Speed Block

output-onlinepngtools__10_.png This block works for Ruby Robot!

The Set Wheel Speed block sets a target speed for the robot's two wheels. It differs from the Set Motor Power block in that it performs a constant closed-loop control system behind the scenes, maintaining a steady speed for the robot's wheels by applying the right motor power in order to reach and maintain the target speed applied.

mceclip0.png

Each wheel's speed can be set individually. 

 

Driving Straight

In order to drive the robot in a straight line, both motors must turn at the same power and in the same direction:

mceclip0.png
driving_forwards.gif

Positive values will turn the motor forward, while negative values will turn the motor backward.

Turning

In order to turn, apply different values to wheels.
Here are some examples:

Different values of the same sign (positive or negative) will result in a smooth turn in the direction of the lower value:

mceclip1.png 
smooth_turn_left__20_50.gif

 

Values of the same number but the opposite sign (positive and negative) will result in a screw turn (sometimes also called a point turn, or a turn on the spot) in the direction of the motor turning backward.

mceclip2.png
right_screw_turn_20.gif

 

A 0 value in one of the motors will result in a pivot turn, where the robot spins on the axle of the wheel who's motor is at 0 power:

mceclip3.png
pivot_right.gif

Was this article helpful?
0 out of 0 found this helpful

Comments

Please sign in to leave a comment.

Powered by Zendesk