Unsolved Calculating NA torque curve from Turbo torque curve

Discussion in 'Mod Support' started by fufsgfen, Jun 23, 2018.

  1. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    So it matches up just fine without boost, 2100rpm is exactly correct.
    upload_2018-6-23_8-6-5.png
    upload_2018-6-23_8-6-43.png


    But 3500rpm is not, clearly I have error in calculation as torque to Jbeam is what is off, but what is the error just escapes me, that should be as simple as 6% of added power per psi of boost which I'm attempting to calculate off from torque on green cells, but no avail:
    upload_2018-6-23_8-10-7.png

    So I end up too high on NA curve (331.97 vs ~308) when compared to what game shows, also turbo curve has similar problem:
    upload_2018-6-23_8-13-45.png

    Lua says like this:
    I am imagining that it is what I'm calculating here, but then again with my head everything is constantly a mess...

    Error percentage seems to be growing with rpm, 3500rpm is 7% while 5500rpm is already 15%

    If I comment out exhaust losses part from jbeam, NA curve is much closer to what I have calculated, while Turbo curve is lot higher than what I have calculated and problem is I am calculating exhaust negative torque so it should already be taken account to, but from some reason I'm not ending up to same values as the game.

    So then there is this section in Lua, exhaust and intake have modifier curves, but AFAIK I don't have intake modifier curve and AFAIK hopper does not have such in use at all?


    I would like to think there being intake modifier curve someplace which I haven't found, it would be easy explanation, but maybe I'm just calculating it all wrong?
     

    Attached Files:

  2. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Anyone has no idea? Or my error is so stupid everyone is too embarrassed to point it out? :D
     
  3. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    Perhaps we need a bit more description I guess (this is just the first time I have seen this thread though)

    What exactly are you trying to do? Well... what exactly are you trying to calculate I guess.

    How does the game calculate its torque? Does it just use an NA torque curve and then the turbo RPM and size to calculate boost? Does it take into account engine friction? How about parasitic drag from things like the water pump or alternator? The graph in game, is that Crank HP and Torque or is that at the wheels?

    There is a lot that could go into it... but those are some of the questions I have before I would know where to begin helping.
     
  4. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    Keep in mind the Torque curve app is actually pretty inaccurate when it comes to turbos. It's great for NA, but for some reason it can't handle forced induction, and I've seen errors as high as 10%. I just use the engine debug, and accelerate in high gear while in slow motion and watch the torque curve there if I really need the accuracy
     
    • Informative Informative x 1
  5. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    I put numbers to easier find answers to your questions from this mess...

    1) Game just uses 6% power increase (actually torque increase) per psi of boost, also it seems that all losses are done before turbo calculation (friction and dynamic friction).

    Technically I'm trying to calculate torque curve reduced by assignedEngine.forcedInductionCoef from this:
    assignedEngine.forcedInductionCoef = assignedEngine.forcedInductionCoef * (1 + 0.0000087 * turboPressure * (turbo.turboEfficiencyCurve[floor(assignedEngine.outputRPM)] or 0))

    That is in turbocharger.lua and combustionEngine.lua has losses calculations (friction and I think it had also exhaust).

    Essentially this should be what calulates above, but reduces by turbo effect Torque/(psi*tboEff*0.06+1) for each rpm.
    Difference is I'm calculating with psi, if I would convert psi to pascal and calculate with pascal, I would end up with same result, or should at least, so I'm using psi.

    My understanding is that I should have same calculation as in game, but I end up to wrong result, or then as Capkirk says, torque curve app is at wrong result.

    Still Engine debug shows 750Nm (torque curve app 770Nm, while I should have only 705Nm for given boost and efficiency.
    No exhaust as exhaust losses actually increases power when you use exhausmodifier in engine file, two negatives become positive thing I guess, but so I know there are no exhaust variable in there, I just have exhaust as empty and put exhaust losses into engine's definition instead.

    I just don't understand why TQ app would be off so much if that is just simple calculation as it seems to be when looking LUA.

    Also I don't understand why in game I can't end up to same values as in spreadsheet if I calculate it same as in game, or at least I think I do, that is not to say I am necessarily.



    2) All I really need is to input real world turbo torque data to spreadsheet, psi, turboefficiency and spreadsheet should calculate ingame torque just like it does for NA engine, that really should give same result as I see ingame, but no matter what I do, I seem to end up high or low, but never quite right.

    3) Exhaust power and wastegate setting affects PSI (trough turbo rpm and turbo compressor curve you specify in turbo definition) and I have adjusted ingame PSI to match what I input to spreadsheet, so that too should be ok. It really is about the same what rpm turbo has or what compressor map it has as long as you get correct PSI as engine volume is not modeled in BeamNG so lb/Hr has no place in simulation.

    It is really simple, either I or game is wrong here, probability would likely be pointing my direction, but can't find what is missing variable in this mess :p

    There is more mess about what spreadsheet is for:
    https://www.beamng.com/threads/turbo-torque-curve-helper-update-v4.52512/
     
  6. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    I believe the torque curve app has difficulty calculating the exact point at which the wastegate reaches equilibrium, and uses a simplified method which creates inaccurate results. If I recall correctly from my experimentation, setting both the wastegateStart and wastegateLimit variables to the expected pressure for a given RPM will allow the app to accurately calculate the torque curve at that RPM, although it also breaks the turbo (preventing it from generating boost entirely), which makes it a bit difficult to verify.
     
  7. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Thanks, it seems there is bit more work needed for that, as well as some other parts, in current version there are quite huge boost spikes, even with some vanilla cars, boost goes way over set value, until it stabilizes.

    Also old fashioned wastegates (not computer controlled) tended to start opening right when there was even a little boost, which made turbo to build up boost bit slowly, currently exhaust power needs to be manipulated to achieve that behavior.
     
  8. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Yep, can't put it any better. The smaller the range between start and end, the smaller the error will be.
     
  9. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    That error comes from turbo psi being different from what TQ app estimating, I believe?

    Sadly error I'm getting with calculation is something else as engine debug app is still showing something around 6% more than I should be getting, also peak torque seems to shift 1000rpm higher, which is odd, there must be some fault in my calculation, but can't figure out what.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice