Make sure your car wheels are not touching the ground. Prop it up using a shoebox, or in my case, an eGPU dock. We will be calibrating the throttle which means your car will start accelerating very fast, without warning, so you wouldn't want it slamming into a wall at full throttle.
First, you'll need to turn on your car; the actual RC, not the Nano.
Depending on your RC, it'll probably beep because it's turned on and the controller isn't connected to it, but don't worry, it'll stop once we connect to it via the I2C bus.
Run the following:
donkey calibrate --channel YOUR_ESC\THROTTLE_CHANNEL --bus=YOUR_I2C_PCA_BUS
The output should look like:
using donkey v3.1.1 ...
init PCA9685 on channel 0 address 0x40 bus 0
Using PWM freq: 60
Enter a PWM setting to test ('q' for quit) (0-1500):
If you're using the wrong bus, you'll probably get a OSError: [Errno 121] Remote I/O error
Type in 370
and press enter. The ESC should stop beeping, indicating it is calibrated to the neutral throttle position.
To detect your forward values for the throttle:
To detect your reverse values for the throttle:
In order to go in reverse, the RC needs to get a reverse throttle value, followed by the neutral throttle value, followed by the reverse throttle value again.
If your forward values were larger than 370:
If your forward values were smaller than 370:
After confirming how to get your car in reverse throttle, once again start from 370 and enter values +/- 10 and choose a value that you'd like your max reverse throttle to be, and write it down.
You can now enter q to finish the throttle calibration procedure.
donkey calibrate --channel YOUR_STEERING_CHANNEL --bus=YOUR_I2C_PCA_BUS
You can now enter q to finish the steering calibration procedure.
Open up the myconfig.py
in the editor of your choice:
nano ~/mycar/myconfig.py
Find the THROTTLE
and STEERING
sections and enter the values you wrote down during calibration:
Save the file and exit the editor and you're done!