DriveBase vs Move Steering

The DriveBase provided by Pybricks can be useful in some cases. Some benefits of the DriveBase includes...

All of these can be replicated using just the normal Motor class, but the third one can take a bit more work to do.

When using the drive method in DriveBase, you specify the speed and rate of turn (deg/s). This causes a few problems...

These can be compensated by slowing down the robot when making a turn, but to fully compensate for all the problems will require some rather complicated code.

Move Steering

The Move Steering function is available in EV3Dev_Python, EV3Lab, EV3Classroom, and Spike Prime (v3 only). Unlike the drive method in DriveBase, the Move Steering functions takes a speed (%) and a "steering" value (-100 to 100) as input.

The "steering" value control the ratio of speed between the left and right wheel, as illustrated below

Steering Left Wheel Right Wheel
0 100% 100%
25 100% 50%
50 100% 0%
75 100% -50%
100 100% -100%

The equation for the Move Steering function is...

def move_steering(speed, steer):
    if steer > 0:
        left_motor.dc(speed)
        right_motor.dc(speed - steer * speed / 50)
    else:
        left_motor.dc(speed + steer * speed / 50)
        right_motor.dc(speed)

Advantages of the Move Steering function includes...

Note that the above function changes the duty cycle (ie. power) of the motor, and not the speed. One advantage is that this avoid Pybrick's internal speed control loop, allowing a faster response.