Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

On the topic of "Tuning" a Model S

This site may earn commission on affiliate links.

lolachampcar

Well-Known Member
Nov 26, 2012
6,471
9,378
WPB Florida
Someone was asking about when we would see aftermarket "Tuners" hoping up the Model S. Here is how I responded.

You capture a full car software update including inverter firmware update. Reverse the firmware update or otherwise hack it so that you can bypass Tesla's firmware validation process*. Disassemble the inverter firmware and locate the torque demand mapping table. This is where the inverter takes the throttle pedal input (the potentiometers on the throttle pedal go directly to the inverter and not through any other device thus the inverter is managing pedal integrity - validating that all three pedal potentiometers agree - and directly developing driver torque demand input) and maps it to power applied to the motor. You then modify that table to provide more power to the motor like you would increasing allowable boost at an operating point in an ICE boost control table. Now that you have the throttle pedal system requesting more torque, you will need to identify fail safes and safeties within the inverter firmware that limit maximum torque. These are simply known as torque limits in the biz. Anyway, you need to find and defeat all of these limits that might intervene to limit maximum motor power.

Simple really provided you have the time and energy to do it. The number of people outside the Electronic Control Module manufacturers that truly understand ICE ECUs is small. The number of people outside Tesla that understand the MS' inverter firmware is like still near zero :)


* Automotive ECU firmware updates are more and more being protected by file signing. The manufacturer performs a cryptographic checksum on the new or updated firmware region. Bosch uses RipeMD160 on a lot of their stuff. This checksum is then encrypted in an RSA message using a private key.

The encrypted message is sent after the firmware update to the ECU. The ECU then checksums the region of interest then decrypts the RSA message using the public key and, if the comparison does not match, refuses to allow the new code to run. Change just one bit in the firmware update and it will not take.
 
I guess you could intercept the input from the potentiometers before it feeds into the CAN and replace the data, but then you would be putting your map on top of Tesla's map, which may not be such a good idea.

Has anyone ever managed to improve the drivetrain cooling? I would have thought that was one area where some tuning effort would pay dividends.
 
"Tuning" assumes that the manufacturer has not already tuned the vehicle to your liking. Are people actually dissatisfied with the Tesla's performance (other than taking issue with horsepower claims in the performance models)? Wow. The cars can already beat almost everything else that is street-legal.
 
J1,
The three throttle pedal potentiometers go directly into the inverter and are not resolved to a CAN message along the way. This is done so that the primary power train component responsible for moving the car has a redundant element constantly comparing two potentiometers sweeping one direct and a third sweeping the opposite direction. If the three do not agree, drive is shut down. Normal ICE ECUs have the throttle function resident in the primary controller and on board a separate micro controller so that two independent sources must agree that all three pots are working correctly.
 
You know i'm all about that bass (monkey) and it's more fun when nobody thinks it can be done. i have a reverse engineering col-leak in Oz who has written a boomerang program that you can throw at a compiled executable and it comes back to you with the source code. We are looking forward to the challenge.
 
I've had a quick peek at the encryption on the firmware downloads themselves. If you are capable of breaking it, there are some much more lucrative things you could do with that ability.

There may be avenues of attack that would allow you to gain access to the installed, unencrypted stuff, but it is not a trivial challenge. Some pretty serious guys have tried and failed. I'm not in the league required to do it myself.
 
This was my thought, as you could make a quicker 0-60, but I'm guessing the 1/4 mile would suffer.

When I look at this from a European perspective, I believe Tesla would be able to sell more cars in Germany if the performance would be better at highway speeds. Here in Europe we don't have dragstrips and don't do 1/4 mile runs. We can drive faster on the highway and can legally max the car out on some parts of the autobahn. Or we can take it to a track and do some laps, which I have done. IMO, the current performance "profile" of the Model S is a better fit for the US market than it is for the European market. So tuning it, as lolachampcar suggests, is not a crazy idea. It could give the car better characteristics for specific markets or purposes.
 
To be clear, I'm not suggesting the MS needs to be tuned. I was just asked why someone has not gone out and done it already so I responded with some insight on the innards of automotive electronic control modules. LGF added some information wrt the over the air downloads being equally daunting an element.

Also, tuning a MS is basically over riding Tesla's power limits. It is the same for ICE but OEMs are terribly conservative when it comes to protecting product and making warranty life terms without major failure. I think there is a lot more room to manipulate ICE calibrations than there is for Tesla's calibrations. I suspect there are significant longevity consequences for pulling more power from the pack especially more sustained high power draw.

I would not do it on my MS.
 
Apparently, Saleen did some tuning on their "GTX" version of the P85D:

Propelling the new GTX is the 3-phase, four pole AC induction motor and copper rotor with the upgraded Saleen drivetrain including an all-new 11.39:1 final gear ratio for quicker acceleration. Also new for the GTX is a Saleen specific MAXGRIP locking differential that allows each wheel to efficiently apply rotational force and maximize traction and grip in performance environments. All of the Saleen engineered driveline components increase efficiencies in torque management, give a track capable throttle response, and provide faster acceleration. Overall the GTX is a well-balanced vehicle and sounds great too!

Electric motor cooling has also been made more productive from the Saleen high-efficiency drivetrain cooling system. Comprising the system is a larger volume radiator, upsampled cooling fans, and a high-flow water pump to help maintain consistent temperatures in more stressful performance applications.

Saleen | GTX
 
Apparently, Saleen did some tuning on their "GTX" version of the P85D:

Propelling the new GTX is the 3-phase, four pole AC induction motor and copper rotor with the upgraded Saleen drivetrain including an all-new 11.39:1 final gear ratio for quicker acceleration. Also new for the GTX is a Saleen specific MAXGRIP locking differential that allows each wheel to efficiently apply rotational force and maximize traction and grip in performance environments. All of the Saleen engineered driveline components increase efficiencies in torque management, give a track capable throttle response, and provide faster acceleration. Overall the GTX is a well-balanced vehicle and sounds great too!

Electric motor cooling has also been made more productive from the Saleen high-efficiency drivetrain cooling system. Comprising the system is a larger volume radiator, upsampled cooling fans, and a high-flow water pump to help maintain consistent temperatures in more stressful performance applications.

Saleen | GTX

I looked up a video about that Saleen Tesla a while back and apparently their modifications make the car sound like an RC car :eek: Not so hot on that noise...

You can hear it at around 7:19 - Tesla Model S, Fully Tuned: Saleen ST - XCAR - YouTube
 
With my previous background of programming B&R and AB controls (automation industry), a servo controller usually has a parameter set to change the behavior of the current loop, controlled by the torque feedback loop, controlled by the velocity feedback loop and this controlled by the position loop (every loop is build on top of the 'lower' layer). Each loop with their own PID settings.
I'm not sure if Tesla uses position control in their inverters. I do suppose the invertor uses closed feedback (resolver or encoder?) and works in velocity control mode.

Faster acceleration or higher speed should imply more current draw from the battery (electronic fuse adjustment?) and more power going into the motor (> meaning more heat dissipation of the entire drive unit). The parameters involved can be typically:
- maximum current limit
- maximum velocity limit
- increase temperature limit, this in the calculated software temperature model (I²x t)
- ACC/DCC time (minimum time to reach max speed from zero or the opposite)
- Jerk control (derative from acceleration): I assume that the acceleration rate is build up, instead of being maximum from start. Keeping mechanical stress under control.
- PID settings. Proportional gains increased for example...
 
Last edited:
It seems to me that the Tesla has to major challenges when it comes to "racing": cooling and current draw. Cooling could be solved using LN2 and current draw with some ultracapacitors. The PxxD(L) should then be able to output its 700 hp and do it confidently over time. If you also start swapping out body panels for carbon fibre you might get a resaonably much quicker car.