0

I am using a raspberry pi 4 connecting to a PCA9685 and following the instruction on the donkeycar doc site (the link can be found below). I am at the step "fine tuning calibration." When I run "python manage.py drive" the steering works using my keyboard controls but the throttle is not causing any movement with the keys. I know that the throttle is not broken because the wheels turn when I do the calibration of the throttle. How do I solve this?

https://docs.donkeycar.com/guide/calibrate/

2 Answers2

1

There can be a few explanations for this:

  1. Does your motor controller (ESC) have an on-off switch? If so, try flipping that
  2. Some ESCs need to "arm". Try going to full throttle and back and see if that makes a difference
  3. I'm assuming you have your battery plugged in ;-)
  4. Try reversing the direction in the myconfig.py file
  • Hi Chris! I have the switch on so that is not the problem and I do have the battery plugged in! When I reach about .6 throttle on local host the car starts to beep, should I push past that point? – Megan Jones May 08 '21 at 00:29
  • Looks like your calibration value is not correct. Try increasing THROTTLE_STOPPED_PWM and THROTTLE_FORWARD_PWM. When you have the right THROTTLE_STOPPED_PWM value, running python manager.py drive will produce a beep sound from the ESC – Jonathan Tse May 08 '21 at 00:40
  • when I was calibrating, 370 was when the car beeped! what should I be trying to change it to? – Megan Jones May 08 '21 at 00:46
0

There was a known bug in one version of DonkeyCar that could cause this problem. That bug has been fixed, so I would update to the latest tagged version. Open a console in your donkeycar project folder, then

git checkout $(git describe --tags `git rev-list --tags --max-count=1`)
git pull
pip3 install -e .[pi]

The fix involved changing how the drivetrain configuration was done, so you may need to update your mycar folder. I tend to create a new one, then edit the myconfig.py file base on my older version. The many of the drivetrain configurations changed from being a set of constants to a python dictionary, so you need to uncomment the appropriate dictionary. So if your drivetrain in myconfig.py is

DRIVE_TRAIN_TYPE = "PWM_STEERING_THROTTLE"

Then you want to uncomment the following lines in myconfig.py and update the values with your pin connections and calibration values.

PWM_STEERING_THROTTLE = {
"PWM_STEERING_PIN": "PCA9685.1:40.1",   # PWM output pin for steering servo
"PWM_STEERING_SCALE": 1.0,              # used to compensate for PWM frequency differents from 60hz; NOT for adjusting steering range
"PWM_STEERING_INVERTED": False,         # True if hardware requires an inverted PWM pulse
"PWM_THROTTLE_PIN": "PCA9685.1:40.0",   # PWM output pin for ESC
"PWM_THROTTLE_SCALE": 1.0,              # used to compensate for PWM frequence differences from 60hz; NOT for increasing/limiting speed
"PWM_THROTTLE_INVERTED": False,         # True if hardware requires an inverted PWM pulse
"STEERING_LEFT_PWM": 460,               #pwm value for full left steering
"STEERING_RIGHT_PWM": 290,              #pwm value for full right steering
"THROTTLE_FORWARD_PWM": 500,            #pwm value for max forward throttle
"THROTTLE_STOPPED_PWM": 370,            #pwm value for no movement
"THROTTLE_REVERSE_PWM": 220,            #pwm value for max reverse throttle
}
Ezward
  • 356
  • 1
  • 8