Mihai
Mihai

Reputation: 11

Drive function in MicroPython for LEGO EV3

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?

Upvotes: 1

Views: 491

Answers (1)

paxq
paxq

Reputation: 1

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!

Upvotes: 0

Related Questions