Motor calibration
This code example helps you to precisely set the bias of your Joy-Car's motors. The bias is used to compensate for differences in the rotational speed of the motors, which can be caused by wear and tear or manufacturing tolerances. In order for the speed sensor measurements to be accurate enough, a Joy-Car with a revision higher than 1.3 is required, as older revisions have less precise readings.
Before the code is executed, the Joy-Car should be placed on a straight, long track so that it can drive freely during the test. Alternatively, the Joy-Car can be placed on a parking bracket, although actual driving is preferred as this provides more accurate results.
During the program, the engine speeds are measured over a period of 100 seconds. A total of 10 measurements are carried out for each motor in order to create a sufficient data basis. The average value is then calculated from these measurements in order to compensate for possible fluctuations in the individual measured values. Based on the mean values, the resulting bias is determined, which optimally matches the motors to each other.
During the process, the microcontroller's LED display shows which motor is currently being adjusted. The calculated bias is also displayed so that corrections can be made easily. This process ensures optimum adjustment of the motors and significantly improves the driving performance of the Joy-Car.
Attention
This code example is only compatible with Joy-Car revision 1.3 and higher. In older revisions, the speed sensor measurements are not precise enough, which means that reliable speed detection is not guaranteed.
Download
Here you can download the code example in your preferred programming language. Simply select the language you want to use and download the corresponding file to get started right away.