HOMEUPFORUMLINKSGUESTBOOKSkytopia GalleryLeisure ZoneWhirlpool of KnowledgeHome
Skytopia > Projects > Tesla > Testing for input lag in a Tesla Model 3 Performance (created 2022-09-20)

Testing for Input Lag in a Tesla Model 3 Performance




It's been over a decade since we last wrote about the perils of input lag and latency in our everyday devices and computers. Since then, we've seen numerous examples of evolution (LED bulb startup time or the latest 120Hz+ TVs/monitors) and devolution (Windows 10/11 and numerous web sites) when it comes to how snappy user input is, but for this article, we want to focus on one of the greatest technological marvels of the 21st century - the Tesla Model 3, the Performance version (late 2019 model) in particular.
            Can this otherwise incredible vehicle with cutting edge tech, also fall prey to the scourge of input lag? We'll be scrutinizing not just the hardware angle (pedal lag & gear stick), but also testing Tesla's touchscreen to see how responsive the various buttons, menus, sliders and scroll widgets are. Tesla is renowned for its snappy interface, at least on its newer cars, but is there any room for improvement?


Testing for pedal latency
Testing for touchscreen latency
Testing startup to Drive mode latency
Conclusions



PART 1: Testing for pedal lag


I
n the car world, high torque, power and great handling are desirable traits to have in a sports car, but there's an important and often overlooked factor that rears its ugly head, even in the electric vehicle world. You could call it "Pedal lag" or "Electronic/motor lag", and it's important to note this doesn't necessarily equate to throttle response - which is more accurately described as the "time rate of change of power levels".

Nope, we're looking explicitly for the time gap between pressing on the accelerator pedal, and when any amount of power is applied physically, i.e. when the car starts to move. With electric cars, this may even become primarily a software problem, rather than necessarily a hardware issue (where motors are renowned for their 'instant torque').

As a lucky Model 3 Performance owner, I, like so many other owners, love driving the car, but I did wonder if there may be a degree of pedal/motor lag. From reading on various Tesla fan forums, I saw at least two instances where Tesla Roadster owners found the instant 'snappiness' of the Roadster was not quite matched by the Model 3. Ironically, the Model 3P accelerated a good deal faster (0-60 in 3.2 seconds versus the Roadster's 3.9s), but could its latency match its superior acceleration?

So in Part 1 of this this article, I set out to find what this pedal lag is. The higher the number the worse it becomes. 10-50 milliseconds is barely noticeable. 50-100, and there's arguably a feeling of disconnection for some (not all) people. Above 100-150, and especially 200-250 milliseconds and we're starting to enter irritation territory. Before we begin, special mention must go to the Jaguar I-Pace which manages a spectacularly poor 500 milliseconds (half a second) of pedal lag before the car starts to move (even in Dynamic Mode). Not good. But thanks to Bjorn Nyland for highlighting this flaw of an otherwise pretty great car (I love how quiet it is, but I digress).


Test methodology and setup

On a low-speed wind day in a safe area, I placed a modern phone camera (capable of 60 frames per second) resting in the driver side footwell, placed it against the side, and used the mat to secure it in place (see photo). I then strategically angled the phone so that it has a simultaneous view of the aluminium pedal AND the outside, assuming the door is left open.

The idea is that when I stamp on the pedal, we should see the outside move soon afterwards. Scouring the footage frame by frame, we can count this time span and effectively get a rough estimate for pedal lag.

At least in theory.

I conducted this test around five times to check for consistency, including a fake run (park mode, no acceleration, just the foot stamp) to make sure vibrations or the car rocking wasn't ruining the outcome.


Here is one of the runs. Click play and maybe set playback speed to 0.25 to better see what's going on:



Full size version of the video available here. Below are 16 (4x4) of the most important frames captured. Unfortunately, if we analyze these 1920x1080 pixel frames, even zooming in to a large degree, it can be very hard to discern even half a pixel of movement of the green bush outside, so what I did was subtract the colours of each frame from each subsequent frame. By doing this, we can build up a story of the motion. See the below and right three images to demonstrate an example of this image processing:



Here are the image subtractions for all 16 frames, and I also zoomed into the upper right corner, so we could see the green bush scenery move behind:



The brighter jagged lines as the frames progress is evidence of the car accelerating, because the white highlights the difference between the green bush from one moment to the next. The bigger the jump, the whiter/brighter the jagged lines are. Here are the first 8 individual frames in high resolution if you want to analyze them for yourself: Original frames: -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8. Difference frames: -2, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8.

Pedal lag results

We start to see a difference at around 3 frames, or 50 milliseconds, perhaps 4 frames (67 milliseconds) at the very most. These figures are upper bounds; the real latency may be even better (shorter) than 50ms, since camera resolution and noise levels are digging into the accuracy at these very fine-granular levels of time. To stress again, this test was performed at least five times for consistency, and I found very similar latencies on each occasion.

50 milliseconds is not a bad result! Quite a good one actually, and better than I originally expected. Room for improvement? Sure, though it's tricky to gauge how noticeable it would be. If we take a look at this video from a Microsoft researcher, we can see that even 10 milliseconds is noticeable in some situations, and 1ms is close to ideal.




PART 2: Testing for touchscreen lag

Hardcore gamers who try to shave milliseconds off their input lag during play will know what I mean: You feel more connected to the game, and it generally makes for a smoother and more enjoyable experience. But don't take our word for it - I have a mouse cursor lag simulator online app so you too can experience the wondrous feeling of moving your cursor through treacle. Unfortunately, touchscreens are particularly susceptible to the problem, with 50ms of lag feeling a bit off, and even 10ms of lag being noticeable. But drop that down to a single millisecond and the magic starts to happen, which this amazing video (linked earlier) demonstrates particularly well. See that if nothing else.

These short videos below demonstrate what I was testing. Each clip lasts for only a few seconds, but to obtain the numbers below, I tested around 10 times in much longer and higher quality videos, and averaged the final delay to get a final latency result. As before, I counted the number of frames from the starting point of each finger tap (or drag motion), making sure that "point zero" began at the precise moment I felt that the finger made contact with the screen. Since each frame is 1/60th of a second (0.0167 sec), I simply multiply that number by the frame count, and that gives us our final lag/latency.

Various buttons (12 frames - 200ms lag)
Climate button (11 frames - 185ms lag) Map scrolling (6.5 frames - 110ms lag) Menu select (11.2 frames - 185ms lag)
Start menu (10 frames - 170ms lag) Temperature (12.3 frames - 205ms lag) Window scroll (6.4 frames - 105ms lag) Keyboard (6.1 frames - 100ms lag)


These aren't amazing results, quite honestly, and leave a lot of room for improvement: We're regularly seeing 100 milliseconds of lag, and up to 200 milliseconds of lag for common controls. Current touchscreen technology is at least partially to blame, but Tesla can immediately improve the experience on many occasions by at least 50 milliseconds if that click is registered at the moment the finger touches the screen ("finger-down"), RATHER than when it leaves the screen ("finger-up"). This won't be ideal for some elements that are immediately draggable, but for controls like simple buttons, opening windows/menus, and changing the temperature, the opportunity is there to shorten the perceived lag by around half!

Another thing Tesla can do for future Teslas is set the screen refresh rate to 120 or 240+ frames per second. This may reduce the delay in the graphics pipeline, and thus improve the latency response.




PART 3: Testing startup to Drive mode latency

As one final test, some users at the TeslaMotors sub on Reddit (including myself) have noticed that the car frustratingly doesn't immediately allow you to switch into the Drive gear after you press the foot brake pedal. There's a short delay that you need to wait out before adjusting the gear lever. This section will determine how long you need to wait.

To test for latency, the obvious idea is to keep hammering the gear lever (approx every 0.2 sec) until we see the Tesla show the 'D' icon (Drive) change from the 'P' icon (Park). Unfortunately, for some reason, the car doesn't like this very much and as a result just causes further delay before allowing you to switch into Drive. I estimate this delay at around 3.5 seconds based on this video.

Better to use a 0.4 second delay between gear lever hammering to test for lag. The video to the right demonstrates this. To accurately keep the 0.4s interval timing, I used a metronome and timed my gear lever presses to the sound of the metronome beat (150bpm), with the first press to happen simultaneously with the foot brake push (and hold). Using this technique, I found the vehicle switched to drive mode on the 3rd lever pull. This equates to 0.8 seconds, which represents an upper bound, since in theory, it may have managed it a bit sooner.

Experimenting with other metronome timings, 84bpm specifically (which failed on the second lever pull), I found a lower bound of 0.7 seconds, so we can estimate the true lag before the car allows you to switch to Drive mode is between >0.7 and <=0.8 seconds. Let's take the average and call it 0.75 seconds. This is sometimes a painful wait, especially if you pull the gear stick too early, and find it doesn't switch at all.

Summary: Many people find this particular lag irritating, and so hopefully Tesla will perform all pre-flight checks and other tasks either more quickly, or maybe when you sit down, rather than when you push the foot brake.




Summary and Conclusions

In the first part, we looked at pedal lag, and short of somehow recording the motor itself at the same time as the pedal, we managed to estimate a latency of around 50 milliseconds. This is okay, good even, but could be improved to help make the driver feel more synchronized to the 'soul' of the car.

In the second part, we looked at touchscreen GUI lag, and found roughly 100-200 milliseconds of lag according to the specific touchscreen control. This is mediocre, and while the touchscreen hardware itself must take some of the blame, Tesla can further improve the responsiveness for many controls by redrawing on touch-down, not just touch-up.

In the third and final part, we looked at the lag incurred by switching the car on using the foot brake and saw a delay of around three quarters of a second (0.75s or 750 milliseconds) before we could engage Drive mode with the gear stick. This is irritating for many users, but can be (for example) resolved by performing pre-flight checks as the driver is sitting down.

The above three summaries are the areas where I think Tesla can most improve in regards to latency, and make using and driving the car and more pleasurable and 'snappy' experience.



Further reading:

  • Video showing we can notice lag even as low as 10 milliseconds
  • Amusing animation of hypothetical latency in real life
  • Wikipedia - Input lag
  • Gamasutra.com - Programming Responsiveness
  • Gamasutra.com - Measuring Responsiveness in Video Games
  • Human Reaction Times as a Response to Delays in Control Systems
  • Eurogamer.net - Console Gaming: The Lag Factor




    Content copyright 2011 onwards Daniel White.