DonkeyCar for Jetson Nano-Calibrate DonkeyCar

From Waveshare Wiki
Revision as of 01:57, 18 May 2023 by Eng52 (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Guides of DonkeyCar

Calibrate the DonkeyCar

In order to accurately control the DonkeyCar steering needs. It needs to be calibrated in both hardware and software.
First of all, it needs to be assembled correctly to ensure the correct steering control of the servo in the hardware, when assembling, the length of the long tie rod is determined first, and the length of the long tie rod is adjusted just so that the two front wheels are facing forward at the same time.
After determining the length of the long tie rod and then adjusting the length of the short tie rod, adjust the length of the short tie rod so that the rudder turns to the middle position when the two front wheels are facing forward at the same time. At this point, the rudder should be 90 degrees.

  • Open the terminal and run the following commands to calibrate the metal gear servo.
cd ~/mycar
donkey calibrate --channel 0 --bus=1
  • Input 360, at this time, you should see the rotation of many servos. If there is no rotation, input 400 or 300 and try it.

DonkeyCar for Jetson Nano 4-3.png.png

  • Slowly adjust from the initial value, so that the servo turns to the middle position, and click the current value a few times. For example 330. This value +/- 100 will give roughly the left and right values 230 and 430.
  • Enter these two values to see if the servo can turn to the corresponding position. If it cannot be turned to the corresponding position, it may be that the initial angle of the servo is not 90 degrees during assembly. Loosen the screw of the servo and turn the servo to 90 degrees (for example, input the position of 360), and then install the servo. Find the following section in the file and change the values of STEERING_LEFT_PWM and STEERING_RIGHT_PWM to the actual calibrated values.

DonkeyCar for Jetson Nano 4-6.png.png
In addition, when adjusting the value need to pay attention to avoid setting the steering value as too small or too large, the steering range as too large, and the maximum steering is about the following chart.
DonkeyCar for Jetson Nano 4-8.png.png
If you set the steering range as too large as shown below it may affect the steering accuracy, or steering too large to cause the DonkeyCar resistance to be too large and stuck immobile.
DonkeyCar for Jetson Nano70.png
Also need to see if the DonkeyCar setting in the file is the same as below, if not change it to the same value.
DonkeyCar for Jetson Nano 4-7.png.png