⏪ Test 2: Rear Wheel Motion Test Copy | Betabox

⏪ Test 2: Rear Wheel Motion Test Copy

Time to test those rear wheels! This is an important process to do because sometimes the motors in the rear are inserted backwards…

Before you start this step, put your car on the ground with at least 5 feet of space in front of and behind it…you have been warned!

First, make sure you are in the root directory of the Pi. That looks like:

Then, type in:

picar rear-wheel-test

Watch with eagerness as your car does something like this:

Did yours do that? Looks like it is working, yeah? To be sure, look more closely at the debug code.

Notice anything amiss?

The car should be driving forward firstly and then driving backwards.

If yours went forward first, then you’ve got it right and you can move on. However, if your car went backwards or went in a circular pattern, keep reading this page to fix your car.

To get things back on track, we need to edit a file that is on the Pi.

Type the following into your terminal:

cd ~/SunFounder_PiCar

Now type:

cd picar

Finally, type:

sudo nano config 

What this code means is that you are opening a file named config with administrative privileges (sudo) so that you can make edits in the text editor nano.

You will see the files contents:

Our goal is to get the back wheels to start moving in the right direction (if they were not already) once we are inside this file. Check out the video below to see how that is done.

You need to edit that file to fix your wheels. You will notice that there are three variables in the file and each one is set to an integer.

turning_offset = 0

forward_A = 1

forward_B = 1

To fix the back wheels, you will need to edit the forward_A and/or the forward_B variable.

  • If the car went backwards firstly and then forwards, change both of the 1s to 0s
  • If it went in a circle, change one of them to a 0.

Use the arrow keys to move down the file. Make your edits. Then, hit Ctrl + O to save and then Ctrl + X to exit Nano.

Rerun the test and see if your car performs like it’s supposed to!

picar rear-wheel-test

When complete, move to the next page.