Dear Community:
The Openpilot Community needs your help to continue to keep's lights on and support the path to Workbench v0.2. With only a one person crew and without commercial funding it's not always financially feasible to fund these services out of pocket. Please consider becoming a Patreon supporter of the Openpilot Community project and receive exclusive perks and benefits!
Become a patreon Learn more Maybe Later

Vasily Tarasov
Sep 07, 2018·2 min read

Custom DIY Steering Actuator


Demo video

The brain of the system is a legacy NEO hardware. It's capable of both lane keep assist and adaptive cruise control, but I only used it for LKA. Check out project's source code, which is a fork of now out-of-date v0.2.9 release of openpilot. I added rotary encoder to measure steering wheel angle, and control the motor driver (one pin for direction and one for PWM speed). Extra inputs/outputs to the microcontroller are put into a standalone connector:

Rotary encoder input pins are PB15 (configures as an external interrupt 15) and PB14. Motor driver's direction pin is connected to PC6. PC7 is configured similar to fan speed controller: it outputs PWM with variable duty cycle:

I should've learned how to use EagleCad and have ordered a modified board. As a one-time thing, I just soldered wires directly to the microcontroller. It's an easy way to burn the STM32, by introducing an accidental short between pins. Don't do what I did, just find someone to modify and print proper PCB boards for you instead. You might want to add 10k resistors inline to all GPIO inputs/outputs (instead of having them outside of the board), and put a hardware debouncer for the rotary encoder on the board as well. Note that the diagram for the debouncer says 5v, which is misleading. I actually burned one of the boards by putting 5v to rotary encoder's input pins, exceeding 3.3v limit. Power rotary encoder by 3.3v power line instead.