Notes on Building a Self-Driving Car
Sharing some notes on choosing and hacking a vehicle in order to build your own self-driving car
When I first learned of Udacity’s self-driving car Nanodegree program, I decided to stop what I was doing and dive right in. I wanted to build my own self-driving car along the way. So what vehicle should I choose? How would I control it?
Note: Udacity does not recommend you do this!
BIG DISCLAIMER
Altering your vehicle or connecting to your can-bus system can kill you or others. At a minimum, it can void your warranty. This is educational information and not a recommendation.
Vehicle Options
The most common vehicle choices for small startups are the Ford Fusion, Lincoln MKZ, and the Kia Soul. The MKZ is more prevalent due to it being the first to come as a complete drive-by-wire platform from a couple of companies.
Ford Fusion and Lincoln MKZ
The Ford Fusion and Lincoln MKZ are so similar electrically and mechanically that they have the same repair manual. As the primary supplier of vehicle platforms for self-driving startups, autonomoustuff.com provides both Ford Fusion and Lincoln MKZ completely wired for autonomous operation using DataSpeed’s ADAS kit. I will concentrate on the Ford Fusion in this article because I own this vehicle. I will try to point out any differences in the MKZ. The 2013 Ford Fusion may have — Check your options — Lane Keep Assist (LKAS), Active Park Assist, aka “Parallel Parking Assist“, blind spot warning, and ultrasonic collision sensors for nearby objects. Models made after 2013 may also have Adaptive Cruise Control (ACC). The MKZ also has these options, and models 2013 and newer will have shift-by-wire.
The Kia Soul
The 2014 and later Kia Soul comes equipped with steering-by-wire and throttle-by-wire. No LKAS or ACC that I could find until the 2016 Exclaim version. PolySync uses this vehicle. They sell a Kia Soul autonomous platform and also created and maintain the do-it-yourself, self-driving car project OSCC.
Vehicle Control Methods
LKAS & LDW - Lane Keep Assist and Lane Departure Warning
The Lane Keep Assist (LKAS) is a safety system that detects a left and right lane line using a camera mounted on the windshield behind the rearview mirror. The system applies a small amount of torque to the steering column to keep you inside those lines. Lane Departure Warning (LDW) vibrates the steering wheel by applying a rapid succession of torque signals to the steering column if you start to drift over a lane line. LKAS and LDW are disabled when you activate your turn signal.
LKAS also detects if you have your hands on the steering wheel! When your hands are on the steering wheel, you are resisting small movements of the steering column, and this resistance is picked up by the steering column torque sensor. If this resistance is missing for a period of time a (HandsOffStatus) message is generated.
In the case of the Ford Fusion, a circuit board inside the mirror called “Image Processing Module-A” (IPMA), processes the camera information and sends road curvature and calculated steering angle through high speed (HS2) can-bus to the Power Steering Control Module (PSCM). The PSCM uses this data to calculate and generate a torque to apply to the steering column.
Controlling the vehicle through the LKAS system is not easy. On the Ford Fusion, this system is only enabled when you are going over 40mph. Other vehicles have lower speed requirements.
You could create your own system to generate the steering angle and lane curvature values. The autopilot type systems often tie into LKAS. See the comma.ai openpilot that works with 2016 Acura ILX with AcuraWatch Plus, the 2016 Honda Civic with Honda Sensing, and the 2015–2016 Honda CR-V Touring.
Active Park Assist
The active park assist once enabled will notify you when you are in the proper position to parallel park and then take over the steering while your car moves in reverse. You have to be moving below a certain speed for this system to operate, and you have to apply the brake manually. Not a good control option.
Starting from scratch
If I were starting from scratch and couldn’t afford one of the pre-built vehicle platforms, I would choose a basic vehicle with the most drive-by-wire options. I would tie into those systems directly in the same way that DataSpeed and PolySync do. You can get a feel for how this is done by looking at their schematics and connection diagrams.
If you find inaccuracies in this article or just want to reach out to me you can send me a message on Twitter or connect with me on LinkedIn. I plan to include a can-bus hacking video soon! Thanks for reading.