Skip to main content Skip to navigation

The Straight And Narrrow

The Straight and Narrow

Can you make a buggy drive in a straight line?

Aim: Make a straight line test track and drive your buggy along it.

a test track for driving in a straight line

It's not as easy as it sounds! Two separate motors rarely work exactly the same so your buggy might veer off in one direction or the other when you try to drive straight.

A straight line test track in action

Why Bother?

Imagine if a car or bike didn't go straight. Even tiny differences in how well aligned the wheels are and how well they perform has a big impact on how much fuel it takes to drive.

It gets even harder when, just like these buggies, the wheels are powered by different motors. Tuning the output of each motor will make the difference between a useful vehicle and something that can only go in circles!

Hints and Tips

We've used a couple of different buggy kits for this.


Robo:Bit


A 4Tronix Robo:Bit

The Robo:Bit has a custom library built for it. Remember to click Advanced > Extensions and then search for 'robobit' and open that library to find the pre-built code blocks.

example code to drive RoboBit straight

Does this code get your buggy to drive straight?

If not, you can change the speed of each motor until they balance each other.

If it turns to the left, the left motor is working better than the right - so you can either slow down the left motor or speed the right motor up.


:MOVE Mini


A Kitronik :MOVE Mini buggy

The :MOVE Mini has a custom library built for it. Remember to click Advanced > Extensions and then search for 'kitronik-servo-lite' and open that library to find the pre-built code blocks.

Calibrating the MOVE Mini is harder. There isn't a pre-built block for setting the motor speeds separately.

Try this code first.

If this code doesn't make your buggy drive in a straight line, we will need to set the motor speeds manually.

example code to customise the speed of the Move Mini motors You can do this by telling the servo motors what speed to spin at. It's tricky!

Get in touch

Did you manage to get your robot to drive straight?

Are there other kits you'd like help with?

Have you got a better way to get these kits to drive straight?

Tell us all about it at wmgoutreach@warwick.ac.uk