Skip to content

Latest commit

 

History

History
70 lines (57 loc) · 3.04 KB

README_teensy40_overdrive_beta1.md

File metadata and controls

70 lines (57 loc) · 3.04 KB

Teensy 4.0 OVERDRIVE beta1

Breakout Board


Code

teensy40_overdrive_beta1/teensy40_overdrive_beta1.ino

Wiring





Tuning

Using an oscilloscope, enter the time (in microseconds) during which the voltage is HIGH.
Important:

  • MIN is minimum pulse. You can forget which is left, right, forward, brake.
  • Enter only the neutral pulse exactly. Only 2 microseconds of neutral error is allowed to support delicate control and high power rc car. The correct neutral shows 0.0 as Joystick value. You can also use DEBUG 1 to see the pulses using a serial monitor.
  • MIN and MAX are 1000 and 2000 (us), unless facing obvious problems. However, neutral should be set really accurately. If neutral is perfect, the autonomous driving can reproduce the slowest possible driving with high power motor.

Teensy

source: teensy40_overdrive_beta1.ino

/* STEERING PULSE */
const int RECV_CH1_PULSE_LENGTH_MIN     = 1000; // maximum steering right value
const int NEUTRAL_STEERING_PULSE_LENGTH = 1509; // neutral steering value
const int RECV_CH1_PULSE_LENGTH_MAX     = 2000; // maximum steering left value

/* THROTTLE PULSE */
const int RECV_CH2_PULSE_LENGTH_MIN     = 1000; // maximum throttle forward value
const int NEUTRAL_THROTTLE_PULSE_LENGTH = 1520; // neutral throttle value
const int RECV_CH2_PULSE_LENGTH_MAX     = 2000; // maximum throttle brake value

If you use reversed throttle, then set REVERSE 1. (default 0)

#define REVERSE 1              // TS-50A ESC should be 1. This uses only for led controll.

If you want to use PCA9685 board, then set USE_PCA9685_EMULATOR 0 and use P1/P2 pin. (default 1)

#define USE_PCA9685_EMULATOR 0

If you use 3ch transmitter (Tamiya TT-02 XB's transmitter etc.), then set USE_3CH_TRANSMITTER 1. (default 0)

#define USE_3CH_TARNSMITTER 0  // 0: use 4 channel transmitter.(Futaba 7PX/4PM etc.) 1: use 3 channel transmitter.(Tamiya TTU-08 etc.)

For receivers that send a neutral signal when the transmitter is off, then set USE_RECV_CUTOFF 1. (default 0)
If the CH2(ESC) signal stays within the threshold for a certain period of time, it will be cut off.

#define USE_RECV_CUTOFF 0      // 0: For receivers that turn the signal off when the transmitter is off, like the R334SBS-E. 1: For receivers that send a neutral signal when the transmitter is off

#if USE_RECV_CUTOFF
#define RECV_CUTOFF_PULSE_MAX_THRESHOLD 1510
#define RECV_CUTOFF_PULSE_MIN_THRESHOLD 1490
unsigned long micros_cutoff = 500*1000; // 500ms
#endif

DonkeyCar

source: myconfig.py

THROTTLE_FORWARD_PWM = 250       # 1000us
THROTTLE_STOPPED_PWM = 375       # 1520us?
THROTTLE_REVERSE_PWM = 500       # 2000us