Aarit Gupta
All projects

Autonomous Control Board

My Purdue Electric Racing onboarding challenge: a control board that lets the PER26 race car work its own brake, steering, and throttle.

The challenge

New members of the Low Voltage team get a design challenge. Mine was to help the mechanical team retrofit the PER26 car to drive itself. A pneumatic piston would press the brake, a motor commanded over CAN would turn the steering wheel, and how to control the throttle was up to me. I chose to send the throttle over CAN too.

I designed the board in between: a schematic and PCB layout in Altium around an STM32G474 microcontroller.

Braking with air

The brake piston runs on compressed air. One MOSFET (PMPB14XNX) switches the 24 V compressor through XT60 connectors, and a second (AO3400A) switches the four 5 V solenoid valve outputs together from one microcontroller pin. The compressor’s signal line comes back through a 30 kΩ / 10 kΩ divider into an ADC so the firmware can see it.

Steering and throttle over CAN

Both the steering motor and the throttle are commanded over CAN, so one bus carries everything but the brake. The STM32’s FDCAN peripheral talks to the bus through a TJA1057GT transceiver, with ESD protection on both CAN lines where they leave the board.

Reading the pedals

The throttle and brake pedal signals arrive on the same connector as the CAN bus. Each passes through a 10 kΩ / 100 nF low-pass filter, about a 160 Hz cutoff, and an op-amp buffer. A divider then scales the 5 V throttle signal into the microcontroller’s 3.3 V ADC range.

The brake signal goes to a comparator instead, which gives a clean “brake pressed” input once it crosses about 1.5 V.

Catching a broken sensor

A pedal sensor that comes unplugged or shorts tends to sit at one rail. Two more comparators watch the brake signal for that: one trips below 0.3 V, the other above 4.7 V, and an OR gate combines them into a single “brake error” input. The firmware can stop trusting the brake reading the moment either happens.

Altium schematic: pedal filters and buffers, brake comparators and error logic, compressor and solenoid MOSFETs, CAN transceiver, and the STM32G474
The schematic. Pedal filtering and the brake fault comparators on the left, the compressor and solenoid switches in the middle, CAN and the microcontroller on the right. Open it full size to read the values.
STM32CubeMX pinout of the STM32G474: ADC inputs on PA0 and PA4, GPIO on PA1 to PA3 and PA5, FDCAN1 on PA11 and PA12
Pin assignments in STM32CubeMX: two ADC inputs, the brake inputs, the valve and compressor outputs, and FDCAN1.
PCB layout in Altium with red top and blue bottom traces, XT60 power connectors along the bottom edge and solenoid connectors at the right
The board layout. Power comes in through the XT60 connectors along the bottom, and the solenoid valves plug in at the lower right.