M235i power curve fixes

Neilski

Staff
Premium
Those of you who remember Aris' tutorial video about getting the most out of the engine might recall that one of the cars he talked about was the M235i.

At about 4m30s into the video:
he talks about not really gaining anything by accelerating beyond about 6000 rpm. Now, this didn't seem quite right to me at the time, because the power curve he's showing actually peaks at 6000 rpm, so clearly you need to take the revs well beyond that point to get optimum shifts. (When he then drives the car on the track, he chooses to shift at a little more than 6k - roughly 6300 rpm.)
Based on how slowly the power curve dropped after the peak, my feeling was that you would need to go pretty close to the red line to get the best shifts and that's how I was driving it myself. I later started using Sidekick (great app), which computes the optimum shift points in real time, and it also took me very close to the red line for most shifts.

When we recently decided to use the M235i as the new car for the Tuesday night social events, we considered using a restrictor to make it easier to handle (we decided against that in the end though! :)) and because of this I fired up my half-baked homegrown telemetry app and calculated the power curves with and without 'restrictor=100'.
To my surprise, I found that the stock power curve which you see in the launcher is incorrect. In essence, the true power peaks a little earlier (~ 5700 rpm) and falls much faster after the peak - see below for graphs.
The curve you see in the launcher is stored in the ui_car.json file, in the
C:\SteamLibrary\steamapps\common\assettocorsa\content\cars\ks_bmw_m235i_racing\ui
folder, and that happens to be the same file that Sidekick uses to work out the optimal shift points...

With some input from @RasmusP I have concocted a new ui_car.json file (attached) which can be dropped over the old one if you use Sidekick and want the optimal shifts to work properly (or if you just want to see the true power curve in the launcher).

tl;dr: optimal shift points for the real power curve are (gear, shift-rpm):
1 6850
2 6826
3 6285
4 6377
5 6343
6 6089
i.e. in 4th gear, you want to be shifting to 5th at about 6377 rpm. (You won't ever want to shift from 7th to 8th unless you're short of fuel (!) because the revs in 7th never even reach the power peak.)
And yeah, the irony isn't lost on me - although the logic Aris used was broken, the actual shifting RPM he used on track (~6300 rpm) was more or less bang on, once you're out of second gear :D If you didn't know any better you'd think he somehow knew the optimum shift points! :sneaky::thumbsup:

Btw, I haven't (yet!) worked out the actual impact of shifting too late. It's likely to be only a few tenths of a second around a typical lap though... :D

For the original (aka wrong) power curve, the optimal shift points would have been:
1 limiter
2 limiter
3 6868
4 6951
5 6919
6 6630

Some comparison curves below...
NB: I scaled up the measured power by around 17% to make the old and new curves have roughly the same peak power. (This means the peak torque is significantly different though.)

In the curve below, you can see (for example) that the acceleration in 4th gear drops below the acceleration in 5th long before you reach the limiter in 4th. You'd want to be shifting to 5th at around 153 kph.
upload_2018-3-12_22-36-33.png

upload_2018-3-9_0-25-28.png

upload_2018-3-9_0-26-16.png

upload_2018-3-12_22-37-30.png

upload_2018-3-12_22-37-39.png
 

Attachments

  • ui_car.json
    3.8 KB · Views: 313
Last edited:
Hmm, I can't make your kW figures match with any of the values in any file I can find.

That is possibly correct. Since I am only concerned with relative power I wouldn't have noticed if I goofed somewhere. I'll review the code.

What did you use for boost pressure? I presume you used the power.lut file directly, instead of the ui_car.json?

power.lut and the turbo values from engine.ini

Well I still can't make any sense of why you'd use that formula. That's equivalent to minimising:
2*max_power - power_in_current_gear - power_in_next_gear
which is equivalent to maximising
power_in_current_gear + power_in_next_gear
(because max_power is a constant).

Correct.

Why would that be a useful thing to maximise?

I contend that what you really need to maximise is instantaneous power. So as soon as power_in_next_gear is bigger than power_in_current_gear, you shift. End of story.

You are right.

I oversimplified by going for a single point. What I should have done instead of calculating individual shift points' single losses is accumulate total losses before and after a shift point, then move the shift point to minimize the sum (of losses).

Just shifting when next-gear-power is greater than current gear power is a bit oversimplifying, too. It is valid when the power curve has a single peak and otherwise goes monotonously down from there in both directions. And if want to make sure that this-gear is past the peak. If next-gear-power is bigger than current-gear-power, but both are before their peaks then you need to calculate further and evaluate which of the two peaks is the more valuable to go through.
 
Had a quick look around the git and from what I can tell it's fully open source. Read the license or check the AppVeyor buildlog if in doubt (Or better yet, try to build it yourself). In the Build notes he just mentions some DirectX shaders that he included prebuild because they take long to rebuild.
Yeah, my impression (but I will go and re-check) was that (pretty much by definition) anything within the github version was fully open source, but I understood - perhaps wrongly - that the bit you get if you contribute money (a) was not on github and (b) didn't come with source code.

I oversimplified by going for a single point. What I should have done instead of calculating individual shift points' single losses is accumulate total losses before and after a shift point, then move the shift point to minimize the sum (of losses).
I thought the second thing is what your formula already represents - minimising the sum of the gaps between instantaneous power in each gear and the peak power.
Just shifting when next-gear-power is greater than current gear power is a bit oversimplifying, too. It is valid when the power curve has a single peak and otherwise goes monotonously down from there in both directions. And if want to make sure that this-gear is past the peak. If next-gear-power is bigger than current-gear-power, but both are before their peaks then you need to calculate further and evaluate which of the two peaks is the more valuable to go through.
Hmm, fair point about my approach not being valid for sufficiently funky power curves. However, I've never seen a power curve with more than one distinct peak (in the useful zone, at least). Also, if a car did have a really crazy power curve, I think you'd need to perform integration on it to optimise the shifts - i.e. a simple solution simply wouldn't work.
 
The curve you see in the launcher is stored in the ui_car.json file, in the
C:\SteamLibrary\steamapps\common\assettocorsa\content\cars\ks_bmw_m235i_racing\ui
folder, and that happens to be the same file that Sidekick uses to work out the optimal shift points...

With some input from @RasmusP I have concocted a new ui_car.json file (attached) which can be dropped over the old one if you use Sidekick and want the optimal shifts to work properly (or if you just want to see the true power curve in the launcher).

Thanks for spending your time and sharing this with us.
I'm no expert at all, so please excuse my maybe dumb question.
Wouldn't changing the file cause some kind of error joining the server?
 
Like Ronnie, I thank you guys for this. So Neilski is this why you absolutely destroyed me and everyone else in Tuesday's BMW race:O_o::D I seriously doubt it. It's probably because I'm :poop:, but to see the knowledge you guys extract is very interesting to me. This is the stuff a guy like me needs. Do everything you can to make the car quicker before you ever start it. Great job guys:thumbsup:
 
I think it is only used for the graphical user interface and pobably by some additional apps. Should be no problem. Otherwise these guys had not suggested it or had put a warning. (They know what they do :) )
Yes - sorry for slow reply - that's correct. It's only the AC UI that uses that file (to display the power curve that you can see in the launcher) and indeed apps can access it too (Sidekick for sure, dunno about others).

So Neilski is this why you absolutely destroyed me and everyone else in Tuesday's BMW race
Well, I think I was only about 0.5 seconds clear, which is a pretty slim margin on a 2+ minute lap ;)
 

Latest News

Are you buying car setups?

  • Yes

  • No


Results are only viewable after voting.
Back
Top