Dear Community:
The Openpilot Community needs your help to continue to keep opc.ai'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

DISCLAIMER: This website is maintained by openpilot users and contributors. The content found here (including Workbench and Oppey the Bot) are not approved, supported, affiliated or funded by Comma.ai, Inc. Please DO NOT contact Comma.ai, Inc. staff about these things as they WILL NOT provide support. For support on openpilot, opc.ai, oppey, workbench, etc. please contact a community member on Discord.

openpilot.robertcotran.com
Sep 10, 2018·5 min read

Making comma.ai's Openpilot work on Classic Tesla Model S

The following instructions describe how to get comma.ai's Openpilot working on a "Classic" Tesla Model S. The classic Model S does not have autopilot hardware but does have the same steering control system and servo as the autopilot Model S and therefore can be controlled through electrical signaling (specifically one of the car's CAN buses).

These instructions would also work on an autopilot Model S, but the controls for engaging openpilot vs. the car's autopilot could be confused so caution is advised. To get openpilot working on an autopilot Tesla Model S, omit the section on Bypassing the EPAS kill signal.

It is assumed that the reader has built a Neo and all software is installed.

Please read the instructions in their entirety before starting as the sections aren't necessarily written in chronological order.

Definitions
EPAS : Electric Power Assisted Steering
CAN bus: Controller Area Network

DISCLAIMER: The author of this document takes no responsiblity for the content of these instructions and anyone following these instructions does so at their own risk and is responsible for complying with any applicable local laws and regulations.

The car has 5 CAN buses. A connection to only one -- the chassis bus (also known as CAN bus 5)-- is necessary to get openpilot to work. CAN bus 5 will be connected to the "Car CAN" pins of the Neo board (pins 3 and 6 of the RJ45 connector).

neo_wiring

The car has a diagnostic connector located behind the "cubby" which is underneath the center console. You will need to build an interface to that diagnostic connector in order to tap in to the chassis CAN. This page has a good explanation of how that is done and what parts are necessary. You will need to have wires going to pins 4, 9, 10 and 11 of the diagnostic connector (+/- power and a connection to the chassis can -- called "CAN 6 chassis" on that page)

The AMP connector that plugs into the diagnostic port can be ordered from Digikey.

Connect the pins as follows:

Signal name Pin on diagnostic connector Pin on Neo RJ45 connector
Ground 9 1
+12V 10 2
Chassis CAN low 11 3
Chassis CAN high 4 6

The control systems on a classic Model S periodically send a "kill" signal to the EPAS control module which is located on the EPAS servo which is connected directly to the steering rack. This kill signal is only sent on non autopilot cars.

epas_location

To bypass this kill signal, all communication with the EPAS module needs to be proxied through the Neo board. The Neo firmware will be programmed to proxy all CAN messages to and from the EPAS control module with one exception. It will rewrite the message that disables control of the EPAS servo with one that enables it. This is absolutely necessary and steering control will not work without doing this.

The connector you need to unplug from the EPAS is located as show in the above picture and looks like the following:

epas_connector

The wiring specifications for connector X164 are:

epas_connections

You will unplug connector X164 and plug it into a connector/harness that you'll need to build.

The harness has two functions.

  • It maintains the ignition on line from the stock X164 and feeds it into the EPAS so that the EPAS knows when the car is "on".
  • It brings the proxied chassis CAN lines from the Neo board to the EPAS.

To make the harness, you will need:

Cut a small 10" piece of wire and strip only one of the conductors. Connect pins 6 on the two AMP connectors with that wire.

With the rest of the wire, using one of the twisted pairs, connect one end to pins 2 and 5 of the 967616 connector, leave the other end free for now.

Close up the AMP connectors following the manufacturer's instructions and put some silicone into each of the pin holes that are unused.

The harness you've made will look like this when finished:

epas_harness

You'll need to run the other end of the harness into the cabin to where you've created the connections for the Neo board. The twisted pair you've used to plug into the EPAS will connect to the Neo through the RJ45 as follows:

Signal name Pin on EPAS connector Pin on Neo RJ45 connector
EPAS Chassis CAN low 2 8
EPAS Chassis CAN high 5 7

You will need to make a hole in the firewall at the back of the "frunk" once you've removed all of the frunk pieces. This picture shows a hole but it is 1-inch TOO LOW, so make the hole where the red circle is:

firewall_hole

When finished, your overall wiring will look like this:

wiring_diagram

Here's a good reference for the diagnostic connector to make sure you get the rights pins

diag_connector
https://cnet2.cbsistatic.com/img/yJe-IRV3E1sKUT0y2IiJdlVOEns=/970x0/2014/07/12/c02d1699-05c1-479a-85af-8067687cbbc5/tesla-model-s-p-85-4x3-4163-040.jpg![Image](https://vehicledb-storage.s3.us-east-2.amazonaws.com/nAZoh9Je3Cpwmpk6mm2QmPLB?response-content-disposition=inline%3B%20filename%3D%22image-1536638720933.png%22%3B%20filename%2A%3DUTF-8%27%27image-1536638720933.png&response-content-type=image%2Fpng&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJMTHVXTTOC5Y3IMA%2F20180911%2Fus-east-2%2Fs3%2Faws4_request&X-Amz-Date=20180911T040525Z&X-Amz-Expires=300&X-Amz-SignedHeaders=host&X-Amz-Signature=32142244d0936b1e6c167f02d5afd76c32b5d3b9b1ffbba1103b05d2b7cdb235)