← Work / Foundations / Varden Labs

Varden Labs · Gen 2 shuttle · 2016

Shuttle embedded system & fail-safe braking

The computer and embedded architecture for Varden’s second self-driving shuttle: a Linux/ROS computer on top, real-time microcontrollers underneath, and independent watchdogs that drop a spring-loaded emergency brake if anything fails.

Role
Hardware & firmware design
Period
Feb – Apr 2016
Vehicle
Polaris Gem (Gen 2)
Silicon
3 × ATmega328P, automotive grade
Status
Main PCB rev 1 built and tested; firmware in progress at the pivot
The completed main PCB with two large automotive connectors
Main PCB, revision 1
45 days
To a working MVP demo on off-the-shelf hardware
10 ft
Full-stop distance, the core safety manoeuvre at shuttle speeds
3 MCUs
Steering, throttle/brake and peripherals on real-time silicon
2 watchdogs
Independent chains; either one can drop the e-brake

Requirements

The system had to run high-level software on a powerful Linux computer with ROS, talk to the vehicle’s custom actuators (each needing its own position, force and velocity control), and stop the vehicle safely if anything failed catastrophically.

At shuttle speeds our main safety manoeuvre was simply to brake hard and stop within 10 feet. Two mechanical brakes made that possible: a proportional main brake for normal driving, and a fully independent, spring-loaded, normally-closed emergency brake held off by an electromagnet.

MVP in 45 days

The first version had to be a working demo within 45 days, so it used an off-the-shelf ruggedized Linux computer, off-the-shelf power conditioning, RS232 motor drivers (hard to introspect and control) and PCIe I/O cards. All software, including safety, ran on that one non-real-time computer.

Open MVP enclosure in the vehicle: a finned ruggedized computer, a stepper motor driver, terminal blocks and a row of cable glands
MVP enclosure: off-the-shelf computer and stepper driver

It worked for demos and testing, with a safety driver always ready to hit an e-stop that cut power to everything, including the e-brake magnet.

In-house design

Next came the first in-house system, designed to the requirements of an initial commercial product:

  1. Real-time microcontrollers for the steering and brake drivers, for faster response and better control of position, velocity and acceleration.
  2. Watchdog monitoring by multiple independent systems, each able to fire the emergency brake or apply the main brake.
  3. Hardware reliability and isolation, so no single point of failure could disable the emergency stop.
  4. Simpler interfaces and fewer separate modules, waterproof connections, and room to expand without a new main board.

The main board carried three automotive-grade ATmega328Ps: one for steering, one for throttle and brake, and one for peripherals such as turn signals. An automotive USB hub linked all three to the Linux computer over serial, which also let us push new firmware through a bootloader. In the schematic, the hub is at the top, a USB-to-serial chip for each microcontroller sits in the middle, and the peripheral, steering and brake microcontrollers run along the bottom, left to right.

Schematic sheet: a four-port USB hub at the top, three USB-to-serial chips in the middle, and three ATmega328P microcontrollers with current-limited supplies and programming headers at the bottom
Schematic: USB hub and the three microcontrollers

Control path

  1. Compute
    Linux computerROS · high-level autonomy
  2. Bus
    Automotive USB hubSerial to every MCU · firmware updates
  3. Real-time
    Steering MCUHand-wheel angle in
    Throttle / brake MCUVelocity control on board
    Peripheral MCUTurn signals, expansion
  4. Actuators
    Steering motor driver2 rotation sensors
    Brake driver + throttle linesForce sensor · wheel encoder
    Daughterboard headerPins broken out
Computer to actuatorsSimplified

Fail-safe design

The steering and throttle/brake chips each fed a dedicated watchdog IC with a square wave. If either stopped, basic transistor logic cut power to the e-brake magnet. Either chip could also trigger the brake itself on an internal fault or if the checksum handshake between the two chips failed.

Current sensing on the magnet showed whether it was powered and whether its steel block was still seated. A triggered e-brake also pulled both throttle lines to ground, faulting the vehicle’s own controller so it shorted the motor windings for extra braking.

Fail-safe chain

  1. Monitors
    Steering MCU
    Throttle / brake MCU
  2. Watchdog
    Watchdog ICsEach fed a square wave · checksum handshake between MCUs
  3. Switch
    Transistor logicCuts magnet power on any fault
  4. Fail-safe action
    E-brake electromagnetUnpowered = full brake
    Throttle lines → groundFaults the EV controller; motor braking
Any single fault ends in brakingSimplified

Sensing & protection

A differential amplifier read the brake force sensor’s Wheatstone bridge. A counter with a selectable pick-off point down-sampled the wheel encoder to cut interrupt load. The board also hosted the GPS, which fed a PPS signal to the Velodyne lidar. In the sensor schematic, the force amplifier is top left, the encoder circuit top right and the GPS bottom right; the watchdog logic for the e-brake magnet and the throttle-grounding transistors run across the middle.

Schematic sheet: force-sensor amplifier, encoder down-sampling circuit, watchdog chips and magnet driver, throttle-grounding transistors, and the GPS module with its Velodyne PPS line
Schematic: sensor and watchdog circuits

Every microcontroller I/O had over-voltage diodes, series resistors and, where needed, ferrite beads, with independent fuses, reverse-polarity and over-current protection across the board. The board would have sat in a waterproof enclosure with the Linux computer, GPS module and motor drivers, its two large connectors passing through the wall to carry every signal to the sensors and actuators outside.

Schematic sheet: voltage regulators along the top, pin maps of the two large connectors in the middle, and rows of I/O lines each with a series resistor and a clamp diode, some with ferrite beads
Schematic: power, connectors and I/O protection

Status at the pivot

We pivoted to Embark mid-way through. By then the first revision of the main PCB was built and its subsystems tested successfully. Firmware had started (mostly a custom stepper driver with acceleration and deceleration ramps) but wasn’t yet demonstrated.

Related