Difference between revisions of "Pedal Interceptor"

From Tinkla: Tinkering with Tesla
m (Flashing the firmware for Tesla Pedal)
m (Wiring a Tesla Pedal)
 
(61 intermediate revisions by 3 users not shown)
Line 1: Line 1:
The Comma Pedal is used to provide acceleration and regen braking capability on Tesla cars running Openpilot that do not have iBooster installed.
+
This page is describing the usage of the Tesla Pedal Interceptor with Tesla Unity. If you are looking to use the Pedal Interceptor with the older version of Tesla OP that works on EON, please look at the [[Pedal Interceptor EON|Pedal Interceptor for EON]] page.
 +
The Comma Pedal is used to provide advanced acceleration and regen braking capability on Tesla cars running Openpilot that do not have iBooster installed.
  
The Comma Pedal is an accelerator pedal interceptor. It is a device that is inserted between a car's electronic accelerator pedal and the DU (Drive Unit). It detects the voltage from the accelerator pedal which represents the pedal's position. It then writes that same voltage back out to the DU as if the accelerator pedal had produced it. When Openpilot is engaged, Openpilot sends the virtual acceleration position through the Comma Pedal instead.
+
Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for sudden slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.
 +
[[File:Pedal.jpg|300px|border|right]]
  
Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for suddent slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.
+
=== What it Does ===
 +
The Comma Pedal is an accelerator pedal interceptor. It is a device that is inserted between a car's electronic accelerator pedal and the DU (Drive Unit). It detects the voltage from the accelerator pedal which represents the pedal's position. It then writes that same voltage back out to the DU as if the accelerator pedal had produced it.
  
The Comma Pedal is connected to the [[Tesla Giraffe|Giraffe]] on CAN3-EPAS usually using a Y adapter (that you have to make).
 
 
=== What it Does ===
 
 
The Comma Pedal has 4 main systems:
 
The Comma Pedal has 4 main systems:
 
# 2 Analog to Digital Convertors
 
# 2 Analog to Digital Convertors
Line 14: Line 14:
 
#* This is used to send voltage back to the car's DU as if the accelerator pedal had produced it.
 
#* This is used to send voltage back to the car's DU as if the accelerator pedal had produced it.
 
# 1 CAN Bus  
 
# 1 CAN Bus  
#* The CAN Bus is the car's communication network. The Comma Pedal communicates with Openpilot using the CAN Bus. It connects to the Tesla Giraffe on CAN3.
+
#* The CAN Bus is the car's communication network. The Comma Pedal communicates with Openpilot using the CAN Bus. It connects to the Tinkla OBD-C Adapter.
 
# 1 USB
 
# 1 USB
 
#* This is used to program and monitor the Comma Pedal, itself.
 
#* This is used to program and monitor the Comma Pedal, itself.
Line 20: Line 20:
 
When Openpilot is NOT engaged, the Comma Pedal reads the voltage from the accelerator pedal and just passes it along to the DU.  
 
When Openpilot is NOT engaged, the Comma Pedal reads the voltage from the accelerator pedal and just passes it along to the DU.  
  
When Openpilot IS engaged with [[Longitudinal Control: ACC|longitudinal control]], the Comma Pedal gets accelerator commands from Openpilot and emulates a accelerator pedal to the DU.  
+
When Openpilot IS engaged with [[Longitudinal Control: ACC|longitudinal control]], it gets the virtual accelerator pedal position from Openpilot and passes it on to the DU.
  
The Comma Pedal is constantly sending the physical accelerator pedal's position to the CAN bus for Openpilot to read.
+
The Comma Pedal is also constantly sending the physical accelerator pedal's position to the CAN bus for Openpilot to read. This way you can increase speed temporarily without having to adjust max speed or disengage longitudinal control.
  
 
=== Obtaining a Comma Pedal ===
 
=== Obtaining a Comma Pedal ===
You cannot buy a pre-built comma pedal from Comma. Fortunately there are other people in the community manufacturing and selling them:
+
You cannot buy a pre-built Comma Pedal from Comma. Fortunately we have a solution for you that only requires you to strip some wires and secure them with a screwdriver:
* http://wocsor.com/buy-a-pedal/ (sold by [https://discordapp.com/invite/Wyna3qy wocsor#0313])
+
 
* https://develolab.com/products/prod_FSN6fKevhpGWE2 (sold by [https://discordapp.com/invite/Wyna3qy Chase#7213])
+
* you can find the Tinkla Pedal Interceptor [https://shop.tinkla.us/Tinkla-Pedal-p487274387 here in the Tinkla Store]
 +
* you can find the connectors (limited quantity) [https://shop.tinkla.us/Tesla-Pedal-Connectors-pair-p459771917 here in the Tinkla Store]
  
Since they're currently always sold out as soon as new ones get in stock, you could also [https://github.com/commaai/neo/tree/master/pedal build it yourself] (not recommended) or have one [https://medium.com/@joshuairl/comma-pedal-building-with-macrofab-6328bea791e8 fabricated through a service like Macrofab].  
+
You could also [https://github.com/commaai/neo/tree/master/pedal build it yourself] (not recommended) or have one [https://medium.com/@joshuairl/comma-pedal-building-with-macrofab-6328bea791e8 fabricated through a service like Macrofab].
  
 
=== Wiring a Tesla Pedal ===
 
=== Wiring a Tesla Pedal ===
[[File:Tesla pedal wiring.png|thumb]]  
+
[[File:Wired Tinkla Pedal.png|300px|border|right]]
[[File:Pedal pinout.png|thumb]]  
+
[[File:Tinkla Pedal Interceptor Back.png|300px|border|right]]
[[File:Pedal connector.png|thumb]]
+
If you purchased a Tinkla Pedal Interceptor together with the Tesla Pedal Connectors from our online store, you are in for a treat. Attaching the connectors to the pedal board is as easy as strip-twist-screw.  
[[File:Pedal CAN connection.png|thumb]]
+
The color codes for the Tesla Pedal Connectors wires are as follow:
[[File:Pedal in box.png|thumb]]
+
* Red - 5V
 +
* Black - GND
 +
* Yellow - Sensor 1
 +
* Blue - Sensor 2
 +
The above image shows the correct connections between the connectors and the Tinkla Pedal Interceptor board.
 +
 
 
In order to create your Tesla Pedal you need:
 
In order to create your Tesla Pedal you need:
* 1x Comma Pedal board
+
* 1x Comma Pedal board (for sources see above section)
* 1x [https://www.amazon.com/dp/B07GZY4ST4 set of WPT-929 connectors] w/ or w/o wires
+
* 1x [https://www.amazon.com/LeMotech-Plastic-Electrical-Junction-72x42x23mm/dp/B07F3Y8L95/ box to hold the board] if your Pedal doesn't already have a case (current ones ship with 3D printed cases). You will need to cut some [[:File:Pedal in box.png|small openings]] on the sides (and in front of the RJ45) if you use this one.
* 1x JST2 male conenctor
+
* 1x set of "WPT-929" connectors (actually [https://www.molex.com/molex/products/datasheet.jsp?part=active/0314026110_CRIMP_HOUSINGS.xml Molex]) - [https://www.amazon.com/dp/B07GZY4ST4 fast shipping], [https://de.aliexpress.com/item/32778798102.html slow shipping]
* 1x JST2 female connector (or you can [https://www.digikey.com/product-detail/en/adafruit-industries-llc/1131/1528-1494-ND/5761282?WT.srch=1&gclid=EAIaIQobChMIjO_5yJyK4gIV1gOGCh1lOAh1EAQYAiABEgLflfD_BwE buy this] and cut it and you're done)
+
* ~3ft of wire for the connectors in case your Pedal and connectors don't come with them (~AWG24)
* box to hold the board (I used [https://www.amazon.com/LeMotech-Plastic-Electrical-Junction-72x42x23mm/dp/B07F3Y8L95/ref=sr_1_fkmrnull_1?keywords=LeMotech+5+Pieces+ABS+Plastic+Electrical+Project+Case+Power+Junction+Box%2C+Project+Box+Black+2.83%22+x+1.65%22+x+0.91%22%2872x42x23mm%29&qid=1558622636&s=hi&sr=1-1-fkmrnull this one] from Amazon). You will need to cut some small openings on the sides (and in front of the RJ45) if you use this one.
+
* 1x SN-28B crimping tool (same one as used for EPAS cable - [https://www.amazon.com/Wovier-Compression-Ratcheting-0-1-1-0mm2-Wire-electrode/dp/B01CE4FAMW fast shipping], [https://www.aliexpress.com/item/32843027501.html slow shipping])
 +
* 1x ethernet cable ~2ft (not crossover)
  
Note: the two JST2s are needed only if  you chose not to use an ethernet cable to conenct your Pedal to the [[Tesla Giraffe]] rev B.
 
  
Use the diagram to conenct the female WSP-929 pedal connector to the IN side of the pedal board and the male WSP-929 connector to the OUT side of the pedal connector.  
+
Use the diagram to connect the female WPT-929 pedal connector to the IN side of the pedal board and the male WSP-929 connector to the OUT side of the pedal connector.
 +
[[File:Tesla pedal wiring.png|330px|border|right]]
 +
[[File:Pedal connector.png|left|200px]][[File:Pedal pinout.png|400px]]
  
To connect the CAN BUS from the Pedal to the [[Tesla Giraffe]] you can either use an Ethernet cable to connect the two RJ45 ports (if you have a [[Tesla Giraffe]] rev B) or you can use twised wire (preffered) to connect positions 3 and 6 of the fake-ethernet port of the pedal board to the two JST2 connectors (male and female). We need both because you will plug the female one in the [[Tesla Giraffe|Giraffe's]] EPAS connector and then the EPAS Harness into the male JSP2. Red should be CAN+ and black should be CAN- (that's the convention also used in the image showing the CAN wire soldered to pins 3 and 6 of the fake ethernet port on the pedal baord).
+
===Connecting the Pedal for Tinkla Unity===
 +
[[File:Tinkla OBD-C Adapter RJ45.jpg|thumb]]
 +
Connecting the CAN BUS from the Pedal to the [https://tinkla.us/t/tinkla_obdc Tinkla OBD-C Adapter] is done via the RJ45 port using a standard ethernet cable.
  
=== Flashing the firmware for Tesla Pedal ===
+
Plug in the ethernet cable into the RJ45 port of the Pedal and the other end into the RJ45 port of the Tinkla OBD-C Adapter.
  
  You have to use a Tesla specific firmware on the pedal in order to work for Tesla.  
+
=== Installing the Tesla Pedal ===
 +
To install the Pedal, there are two steps:
 +
# connecting the board to the accelerator pedal
 +
# connecting the board to the [https://tinkla.us/t/tinkla_obdc Tinkla OBD-C Adapter]
  
The firmware in my repo for the Tesla Pedal is located in the Panda repository under the tesla_pedal branch. You can flash the pedal from your computer or from the EON (I did it from the EON). If you have a new board, it will automatically start in DFU mode. To know which mode you're in look at the LED: no light = DFU mode, slow blink = normal flash mode, fast blink = normal operations.
+
[[File:Pedal connected.jpg|frameless|right]][[File:Pedal installed.jpg|frameless|right]]
 +
This [https://www.youtube.com/watch?v=UiQved6gt2U video] for a similar product shows you what you have to do in order to install the Pedal interceptor between the accelerator pedal and the car's existing connector. Take your time and watch the video first. The process is not complicated if you just follow it step by step.
  
First, you need to get the code from the repo:
+
Once that is complete, connect your ethernet cable to the Pedal and the other end to the RJ45 port on the [https://tinkla.us/t/tinkla_obdc Tinkla OBD-C Adapter].
  
<code>cd /data
+
=== Flashing the firmware for Tesla Pedal with Tesla Unity code ===
mkdir panda
 
git clone https://github.com/BogGyver/panda
 
cd panda
 
git checkout tesla_pedal
 
cd board/pedal</code>
 
  
For a normal flash, I usually use two USB to miniUSB cables. One you connect to the Panda and one to the Pedal. We use CAN message to put the pedal in DFU mode then we program it.  
+
===== Flashing via CAN =====
 +
With the introduction of Tesla Unity code, flashing the Tesla Pedal with the latest firmware is as easy as pressing a button in the Tesla preAP settings page. To flash the latest firmware to your Tesla Pedal:
 +
#Ensure your Pedal is installed in your vehicle and connected to the [https://tinkla.us/t/tinkla_obdc Tinkla OBD-C Adapter] or to your specific harness.
 +
#Ensure that all the [[Tesla_Unity_Configuration#Tesla_preAP|settings are configured]] correctly for your pedal, especially enabling the pedal and setting up which CAN port it is connected to.
 +
#Using the <b>Flash Pedal</b> button under the <b>Tesla preAP</b> tab of [[Tesla_Unity_Configuration#Tesla_preAP|settings]] start the firmware flashing process
 +
#Before hitting the <b>Flash</b> button, ensure your car is on (in P - Park) and continue to keep your foot on the brake throughout the process.
 +
#Hit the <b>Flash</b> button and the screen will show the progress. Your car might emit warnings and sounds during this process, which is normal.
 +
#Once process is complete, allow the car to go in "CAR OFF" mode and reboot your Comma devkit.
 +
#You are now ready to use your Tesla Pedal Interceptor.
  
First, connet the USB from the Panda to the EON. We will kill the OP instance and then we will send the DFU command via CAN:
+
===== Flashing via USB =====
 +
'''Flashing via USB involves more steps and is only necessary if flashing via CAN is not possible.'''
  
<code>tmux kill-session -t comma
+
If you built your Pedal yourself or it was shipped without any firmware, it will boot in DFU mode. To know which mode you're in look at the LED on the Pedal board: no light = DFU mode, slow blink = normal flash mode, fast blink = normal operations.
./enter_canloader.py --recover
 
</code>
 
  
In case of emergency, you can enter the DFU mode by applying 5 volts to a special point on the board while conencting the board to USB (to power it up). That usually requires at least 2 people: one to keep the jumper for 5V in place and the other to connect the USB. [https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2 Instructions on how to enter DFU mode] were create by @jfrux. Once in DFU mode, go to the pedal directory and run
+
[[File:Entering Pedal Interceptor DFU Mode (image by @jfrux).png|thumb|Entering Pedal Interceptor DFU Mode (image by @jfrux)]]
  
<code>make recover</code>
+
To enter DFU mode, you will need a [https://www.amazon.com/dp/B09FDJFJ6Z/ref=cm_sw_em_r_mt_dp_QFSM3ZZ87K5WTECKYD12?_encoding=UTF8&psc=1 USB-A to USB-A cable] and to remove the Pedal Interceptor from your car. Connect one end of the USB cable to the pedal interceptor, then jump the small pin indicated in the attached image to one of the pins labeled 5V with a small wire. While holding that jump wire, connect the Pedal Interceptor to your computer via USB. This usually takes two people, one to do the jump and one to plug the USB into the laptop. Always have the USB plugged into the Pedal first, then laptop (it makes your life a lot easier). For how to put the pedal interceptor in the DFU mode, follow the instructions for [https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2#fcdf applying 5 Volt to a special point on the board].
  
Once the firmware flash complete, just reboot the pedal and you should be ready to go.
+
While in DFU mode, and connected to your computer running MacOS or Linux, you can flash your pedal using the same Unity code from your computer.<br />
  
With 0.5.10 and beyond, there is a new way to flash the pedal via CAN messages which will be used for furture (if needed) upgrades. For now, there are no changes to the firmware for Pedal.
+
To do so you will need a local copy of the Unity code and to run few commands. Please see the sequence below that you have to run in a terminal window on your laptop.
 +
<source lang="bash">
 +
cd ~
 +
rm -rf openpilot
 +
git clone https://github.com/boggyver/openpilot.git --depth 1 -b tesla_unity_releaseC2
 +
cd openpilot/panda/board/pedal
 +
./recover.sh
 +
</source>
  
===  Installing the Tesla Pedal ===
+
Sometimes you have to issue the command multiple times until it completes successfully. With the updated bootloader you'll be able to flash future updates via CAN.
  
To install the pedal, there are two steps:
+
Once done, unplug USB from the Pedal and install in car.
# connecting the board to the accelerator pedal
 
# conencting the board to the [[Tesla Giraffe]]
 
 
 
This [https://www.youtube.com/watch?v=UiQved6gt2U video] for a similar product shows you what you have to do in order to install the pedal interceptror between the accelerator pedal and the car existing connector. Take your time and watch the video first. The process is not complicated if you just follow it step by step.
 
 
 
Once that is complete, disconnect the EPAS cable from the Tesla Giraffe and connect the female JSP2 from your pedal to the Giraffe. Then connect the EPAS cable to the male JSP2 from your pedal.
 
  
 
=== Using the Tesla Pedal ===
 
=== Using the Tesla Pedal ===
 
 
  Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for suddent slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.
 
  Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for suddent slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.
  
 
Out of the box, OP will use the Tesla CC (with stalk spamming) to control CC. This in our OP implementation is called Adaptive Cruise Control or ACC. CC on Tesla only works above 18 MPH (29 km/h).
 
Out of the box, OP will use the Tesla CC (with stalk spamming) to control CC. This in our OP implementation is called Adaptive Cruise Control or ACC. CC on Tesla only works above 18 MPH (29 km/h).
  
If you turn off the Tesla CC by pressing on the CC stalk, OP will switch to Tesla Pedal (PDL) mode. This will also provide you with adaptive cruise control by sending the right commands to your Tesla Pedal. Tesla pedal works down to 1 MPH, but be careful, regen brakes stop working at 5 MPH (8 km/h).
+
If you turn off the Tesla CC by pressing on the CC stalk, OP will switch to Tesla Pedal mode (PCC). This will provide you with smooth adaptive cruise control by sending the right commands to your Tesla Pedal. Tesla Pedal works down to 1 MPH, but be careful, regen brakes stop working at 5 MPH (8 km/h).
 
 
Once you get used to it and you don't care about ACC anymore, you can modify the [[OpenPilot Configuration File|config file]] to always use pedal
 
 
 
<code>force_pedal_over_cc = True</code>
 
 
 
=== Guides for Building / Troubleshooting Your Comma Pedal ===
 
 
 
'''[https://medium.com/@jfrux/comma-pedal-updating-the-firmware-over-can-fa438a3cf910 Comma Pedal: Updating the Firmware over CAN]''' by [https://medium.com/@jfrux @jfrux] Use this guide to update your Comma Pedal for compatibility with Openpilot v0.5.10+
 
 
 
'''[https://medium.com/@jfrux/comma-pedal-building-with-macrofab-6328bea791e8 Comma Pedal: Building with MacroFab]''' by [https://medium.com/@jfrux @jfrux]
 
 
 
'''[https://medium.com/@jfrux/flashing-the-comma-pedal-with-ubuntu-a83fb668f6e2 Comma Pedal: Flashing the Firmware]''' by [https://medium.com/@jfrux @jfrux]
 

Latest revision as of 18:11, 1 September 2022

This page is describing the usage of the Tesla Pedal Interceptor with Tesla Unity. If you are looking to use the Pedal Interceptor with the older version of Tesla OP that works on EON, please look at the Pedal Interceptor for EON page.

The Comma Pedal is used to provide advanced acceleration and regen braking capability on Tesla cars running Openpilot that do not have iBooster installed.

Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for sudden slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.
Pedal.jpg

What it Does

The Comma Pedal is an accelerator pedal interceptor. It is a device that is inserted between a car's electronic accelerator pedal and the DU (Drive Unit). It detects the voltage from the accelerator pedal which represents the pedal's position. It then writes that same voltage back out to the DU as if the accelerator pedal had produced it.

The Comma Pedal has 4 main systems:

  1. 2 Analog to Digital Convertors
    • This is used to read the voltage from the car's accelerator pedal into the Comma Pedal's processor. The accelerator pedal produces an output Voltage between 0 and 5 Volts.
  2. 2 Digital to Analog Convertors
    • This is used to send voltage back to the car's DU as if the accelerator pedal had produced it.
  3. 1 CAN Bus
    • The CAN Bus is the car's communication network. The Comma Pedal communicates with Openpilot using the CAN Bus. It connects to the Tinkla OBD-C Adapter.
  4. 1 USB
    • This is used to program and monitor the Comma Pedal, itself.

When Openpilot is NOT engaged, the Comma Pedal reads the voltage from the accelerator pedal and just passes it along to the DU.

When Openpilot IS engaged with longitudinal control, it gets the virtual accelerator pedal position from Openpilot and passes it on to the DU.

The Comma Pedal is also constantly sending the physical accelerator pedal's position to the CAN bus for Openpilot to read. This way you can increase speed temporarily without having to adjust max speed or disengage longitudinal control.

Obtaining a Comma Pedal

You cannot buy a pre-built Comma Pedal from Comma. Fortunately we have a solution for you that only requires you to strip some wires and secure them with a screwdriver:

You could also build it yourself (not recommended) or have one fabricated through a service like Macrofab.

Wiring a Tesla Pedal

Wired Tinkla Pedal.png
Tinkla Pedal Interceptor Back.png

If you purchased a Tinkla Pedal Interceptor together with the Tesla Pedal Connectors from our online store, you are in for a treat. Attaching the connectors to the pedal board is as easy as strip-twist-screw. The color codes for the Tesla Pedal Connectors wires are as follow:

  • Red - 5V
  • Black - GND
  • Yellow - Sensor 1
  • Blue - Sensor 2

The above image shows the correct connections between the connectors and the Tinkla Pedal Interceptor board.

In order to create your Tesla Pedal you need:

  • 1x Comma Pedal board (for sources see above section)
  • 1x box to hold the board if your Pedal doesn't already have a case (current ones ship with 3D printed cases). You will need to cut some small openings on the sides (and in front of the RJ45) if you use this one.
  • 1x set of "WPT-929" connectors (actually Molex) - fast shipping, slow shipping
  • ~3ft of wire for the connectors in case your Pedal and connectors don't come with them (~AWG24)
  • 1x SN-28B crimping tool (same one as used for EPAS cable - fast shipping, slow shipping)
  • 1x ethernet cable ~2ft (not crossover)


Use the diagram to connect the female WPT-929 pedal connector to the IN side of the pedal board and the male WSP-929 connector to the OUT side of the pedal connector.

Tesla pedal wiring.png
Pedal connector.png

Pedal pinout.png

Connecting the Pedal for Tinkla Unity

Tinkla OBD-C Adapter RJ45.jpg

Connecting the CAN BUS from the Pedal to the Tinkla OBD-C Adapter is done via the RJ45 port using a standard ethernet cable.

Plug in the ethernet cable into the RJ45 port of the Pedal and the other end into the RJ45 port of the Tinkla OBD-C Adapter.

Installing the Tesla Pedal

To install the Pedal, there are two steps:

  1. connecting the board to the accelerator pedal
  2. connecting the board to the Tinkla OBD-C Adapter
Pedal connected.jpg
Pedal installed.jpg

This video for a similar product shows you what you have to do in order to install the Pedal interceptor between the accelerator pedal and the car's existing connector. Take your time and watch the video first. The process is not complicated if you just follow it step by step.

Once that is complete, connect your ethernet cable to the Pedal and the other end to the RJ45 port on the Tinkla OBD-C Adapter.

Flashing the firmware for Tesla Pedal with Tesla Unity code

Flashing via CAN

With the introduction of Tesla Unity code, flashing the Tesla Pedal with the latest firmware is as easy as pressing a button in the Tesla preAP settings page. To flash the latest firmware to your Tesla Pedal:

  1. Ensure your Pedal is installed in your vehicle and connected to the Tinkla OBD-C Adapter or to your specific harness.
  2. Ensure that all the settings are configured correctly for your pedal, especially enabling the pedal and setting up which CAN port it is connected to.
  3. Using the Flash Pedal button under the Tesla preAP tab of settings start the firmware flashing process
  4. Before hitting the Flash button, ensure your car is on (in P - Park) and continue to keep your foot on the brake throughout the process.
  5. Hit the Flash button and the screen will show the progress. Your car might emit warnings and sounds during this process, which is normal.
  6. Once process is complete, allow the car to go in "CAR OFF" mode and reboot your Comma devkit.
  7. You are now ready to use your Tesla Pedal Interceptor.
Flashing via USB

Flashing via USB involves more steps and is only necessary if flashing via CAN is not possible.

If you built your Pedal yourself or it was shipped without any firmware, it will boot in DFU mode. To know which mode you're in look at the LED on the Pedal board: no light = DFU mode, slow blink = normal flash mode, fast blink = normal operations.

Entering Pedal Interceptor DFU Mode (image by @jfrux)

To enter DFU mode, you will need a USB-A to USB-A cable and to remove the Pedal Interceptor from your car. Connect one end of the USB cable to the pedal interceptor, then jump the small pin indicated in the attached image to one of the pins labeled 5V with a small wire. While holding that jump wire, connect the Pedal Interceptor to your computer via USB. This usually takes two people, one to do the jump and one to plug the USB into the laptop. Always have the USB plugged into the Pedal first, then laptop (it makes your life a lot easier). For how to put the pedal interceptor in the DFU mode, follow the instructions for applying 5 Volt to a special point on the board.

While in DFU mode, and connected to your computer running MacOS or Linux, you can flash your pedal using the same Unity code from your computer.

To do so you will need a local copy of the Unity code and to run few commands. Please see the sequence below that you have to run in a terminal window on your laptop.

cd ~
rm -rf openpilot
git clone https://github.com/boggyver/openpilot.git --depth 1 -b tesla_unity_releaseC2
cd openpilot/panda/board/pedal
./recover.sh

Sometimes you have to issue the command multiple times until it completes successfully. With the updated bootloader you'll be able to flash future updates via CAN.

Once done, unplug USB from the Pedal and install in car.

Using the Tesla Pedal

Without electric brakes (iBooster) the car only uses regenerative braking. This is not enough for suddent slowdowns. YOU MUST BE READY TO MANUALLY BRAKE AT ANY MOMENT.

Out of the box, OP will use the Tesla CC (with stalk spamming) to control CC. This in our OP implementation is called Adaptive Cruise Control or ACC. CC on Tesla only works above 18 MPH (29 km/h).

If you turn off the Tesla CC by pressing on the CC stalk, OP will switch to Tesla Pedal mode (PCC). This will provide you with smooth adaptive cruise control by sending the right commands to your Tesla Pedal. Tesla Pedal works down to 1 MPH, but be careful, regen brakes stop working at 5 MPH (8 km/h).