Drive function in MicroPython for LEGO EV3

361 views Asked by At

I'm trying to understand the functions from DriveBase class from MicroPython for EV3. I instantiate the DriveBase object like this

robot = DriveBase(left_motor, right_motor, wheel_diameter=55.5, axle_track=104)

When I run robot.drive(speed, angle) with a higher speed the robot does not accelerate smoothly like when using robot.straight(distance) function and almost always is changing slightly the direction when the robot starts.

Have you got any suggestions?

1

There are 1 answers

1
paxq On

I don't think the DriveBase class has any acceleration settings for .drive() You might be able to create your own function for acceleration on .drive() or you could use a PID controller with a gyro sensor to keep the robot driving in you desired angle/direction. Hope this helps some!