Smart Car Controller  1.0
Library to manage a two wheeled robotic vehicle (DC Motors)
Measure Physical Constants

An application using the library needs to pass a few physical constants to the MD_SmartCar::begin() method that allows the library to configure vehicle control parameters.

Note that the units of length are specified in millimeters. However, alternative units (eg inches or centimeters) may be used AS LONG AS ALL LENGTHS ARE SPECIFIED IN THE SAME UNITS, as the units all cancel out in the calculations.

Two physical constants need to be directly measured from the vehicle:

  • The wheel diameter in mm. This is measured to the outer edge of the wheel tyre.
  • The base length (distance between wheel centers) in mm. Inside edge of one wheel to the inside edge of the other wheel.

These two constants are shown as 2r and B in the figure below.

SmartCar Unicycle

  • The number of encoder pulses per wheel revolution. This is measured by counting the gaps, or white spaces, of the encoder wheel and doubling the count, as one pulse is received for each edge transition of the encoder.

  • The maximum number of encoder pulses per second at top speed (100% velocity). This can be measured later, with the motors running, in the steps verifying the correctness of motor wiring and setup.

Next: Confirming Motor Setup