RobotWheelCalibration

Tune the wheels to perform even better.

Wheel Calibration

Use this sketch to calibrate the wheels of your robot. Your robot should move in a straight line when putting both motors at the same speed.

Run the software and follow the on-screen instructions. Use the potentiometer on the bottom board to adjust the calibration.

Hardware Required

  • Arduino Robot

  • A long thin screwdriver

Instruction

  1. Upload the example, unplug USB and turn on power

  2. Find a flat surface, on the ground. Have a screwdriver that fits into the pot on the Motor Board ready.

  3. After the starting screen, a list of instructions will show up.

  4. You can change the robot speed by adjusting the knob on Control Board.

  5. Put the robot on the flat surface, and see if it's going a straight line

  6. If the robot goes in a curve, you need to adjust the morto board's trimmer potentiometer with screwdriver.

  7. If the robot is turning left, screw it clockwise

  8. If it's turning right, screw it counter-clockwise

  9. If the robot is still turning, repeat the process until it's moving in a straight line.

  10. The number on the bottom-right corner of the LCD screen is the calibration value, ranging from -30% to 30%. It can help keep track of your process.

Try it out

Calibrate the robot's wheels
Calibrate the robot's wheels

Code

1/* 6 Wheel Calibration
2
3*
4
5* Use this sketch to calibrate the wheels in your robot.
6
7* Your robot should drive as straight as possible when
8
9* putting both motors at the same speed.
10
11*
12
13* Run the software and follow the on-screen instructions.
14
15* Use the trimmer on the bottom board to make sure the
16
17* robot is working at its best!
18
19*
20
21* (c) 2013 X. Yang
22
23*/
24#include "scripts_library.h"
25
26#include <ArduinoRobot.h>
27#include <Wire.h>
28
29void setup() {
30
31 Serial.begin(9600);
32
33 Robot.begin();
34
35 Robot.beginTFT();
36
37 Robot.beginSD();
38
39 Robot.setTextWrap(false);
40
41 Robot.displayLogos();
42
43 writeAllScripts();
44
45}
46void loop() {
47
48 int val = map(Robot.knobRead(), 0, 1023, -255, 255);
49
50 Serial.println(val);
51
52 Robot.motorsWrite(val, val);
53
54 int WC = map(Robot.trimRead(), 0, 1023, -20, 20);
55
56 Robot.debugPrint(WC, 108, 149);
57
58 delay(40);
59
60}

Contribute to Arduino

Join the community and suggest improvements to this article via GitHub. Make sure to read out contribution policy before making your pull request.

Missing something?

Check out our store and get what you need to follow this tutorial.

Suggest Changes

The content on docs.arduino.cc is facilitated through a public GitHub repository. You can read more on how to contribute in the contribution policy.