Skip to content
bradybus edited this page Jun 12, 2018 · 7 revisions

Intro

Welcome to the Kiss Brigham Hackathon! The goal is to build a self-driving car to be able to drive autonomously across campus and back.

Hardware

The vehicles consist of an Exceed-RC Short Course Truck 1/16 truck with a 3D printed equipment platform.

The processing is done with an on-board Jetson TX2, and the only sensors available are an Intel Realsense D400 series depth camera, a wheel encoder (mounted upstream of the differential), and a rear-facing sonar.

The TX2 interfaces to the car (including the encoder and sonar) via a Teensy 3.2 microcontroller, programmed using the Arduino IDE for simplicity.

ROS Wrapper

The Python script "kb_driver.py" is a ROS node that translates between ROS and the Teensy. You shouldn't need to mess with the following protocol. Instead, this node listens to Command messages and publishes Encoder and Sonar messages when it receives data from the Teensy (currently 50Hz).

Teensy Communication

For simplicity, the Teensy is controlled using ASCII commands and provides sensor data via ASCII as well. Here is a description of the commands using Python's f-string syntax for clarity:

Command Description Arguments
f"<r>" Reset the encoder distance counter. None
f"<c:{str},{thr}>" Command new servo/throttle values. str: Steering command, 1.0 is full right, -1.0 is full left
thr: Throttle command, 1.0 is full forward, -1.0 is full reverse

Sensor data is streamed at 50 Hz and is formatted as (again using Python f-string syntax):

f"[{dist:.3f},{vel:.3f},{sonar:.3f},{steer_pwm},{throttle_pwm},{checksum:03d}]"
  • dist: Distance, measured in meters, since last encoder reset
  • vel: Velocity, in m/s
  • sonar: Distance to rear obstacles, measured in meters, accurate to about 0.05 m. Usable range of about 0.2 m to 4 m.
  • steer_pwm: Pulse width measured from the on-board RC receiver, steering channel, measured in microseconds.
  • throttle_pwm: Pulse width measured from the on-board RC receiver, throttle channel, measured in microseconds.
  • checksum: Byte-wise xor of all of the bytes of the values.

Speed Control

It is left up to the teams to implement their own speed control. The only logic in the Teensy is a state-machine that circumvents the "brake" feature of the car's ESC, so that when you command reverse, the car will actually start to go backward.

Breakout Board

The breakout board the Teensy is plugged into is used to interface to the rest of the car.

teensy pinout

Suggested Hardware Changes

  • Enlarge 3D-printed platform, allowing more room for the jumpers and connections.
  • Also enlarge the footprint of the roll cage on the platform, allowing the camera to be more protected, as well as built in routing/storage for the camera USB cord, while maintaining ease of removal of the cord
    • Make sure it is large enough for access to all ports on the Orbity
  • Use better suited screws or bolts for holding the platform to the roll cage
  • Raise the platform in an step command type shape, to make it easier to remove and attach the camera without having to remove the platform from the chassis, and hence avoiding changing the signal wire routing from platform to chassis
    • maybe the camera could be mounted upside down? This would make it trivial to attach and detach without messing with anything else on the car.
  • Mount the receiver on the platform, moved up from the chassis
    • This would enable less wires to be attached to both platform and chassis (only the opto-isolated servo and drive motor signals, as well as the encoder line)
  • Make a spot for the receiver antenna straw to be used on the platform
  • Thicken the posts from the chassis up to the platform, for better screw grip if we don't move to a bolt-nut fastener
  • Thicken the platform, except for in vicinity of the Wi-Fi antenna hole, where the current thickness is about perfect
  • All screws used to fasten plastic should have lower thread counts (or higher thread pitch, if using metric), or move to a bolt-nut fastener
  • Use metal fasteners and standoffs (as opposed to plastic standoffs)
  • Don't 3D-print the encoder gear, see if the correct size could be ordered online or manufactured on campus by a different method, allowing for higher precision on the co-axial-ness of the pitch circle and encoder axis.
    • This would allow for better set-screw threads (the set-screw on kbcar2 is already stripped)
  • Some of the platform holes could be moved, and extra holes added, to make wire routing a little bit easier.
  • Add dedicated hole for Wi-Fi antenna
  • Swap location of Jetson and Teensy breakout board
  • Create a dedicated mount point for the Inertial Sense, allowing for UART connection to Jetson, and access to the reboot button on top
    • Orbity Carrier has 2x UART, so one rx/tx set would be used for the Teensy, and one for the Inertial Sense
  • Separate the Jetson power system from the chassis power system by using opto-isolators for the pwm commands from the Teensy to the steering servo and drive motor
    • This would place the override receiver, sonar, encoder, Inertial Sense, and Teensy on the 5V rail from the Orbity board.
    • Two pwm signals from the Teensy to the chassis would need the isolators
  • 1500-2000 mAh 2S Li-Po for the chassis power system (or maybe 2000 mAh Ni-MH)
    • these capacities could maybe be lowered if the course was moved in doors, and/or made shorter
  • 2200-3000 mAh 3S Li-Po for the Jetson

Software Suggestions

  • Change firmware such that if velocity from the encoder is measured at 0 m/s, override/kill any non-zero throttle command after a short delay (from anecdotal ESC and Motor burnouts, maybe have the delay be between 0.25-0.5 seconds. Need to balance this with startup delay on grassy terrain, for example)