WIP Beta released Torque curve spreadsheet, Update 5/2019 V5 experimental

Discussion in 'Content Creation' started by fufsgfen, Feb 15, 2018.

?

Is this useful to you

Poll closed Jun 8, 2018.
  1. Yes

    4 vote(s)
    100.0%
  2. No

    0 vote(s)
    0.0%
  1. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    25th May 2019 UPDATE V5, includes exhaust loss calculation
    DO NOT USE Turbo calculation, does not work right!



    I have been doing this little thing, it is attempt of getting real turbo car torque curve bit easier to BeamNG.

    It does work with NA engines too, just don't fill anything for PSI or turbo efficiency and it uses NA mode.

    NOTE, this is very WIP, there is probably bugs, also it is not easy to make turbo engine.

    In my tests it has made quite reasonably accurate torque curve for BeamNG, wastegate is bit of factor of course, you get bit of variability because of that.

    So it should work, I would need someone or several people to test how it works for them and to flush out bugs.

    Requirement is that you understand and know how to create accurate turbo engine without the tool, because exhaust power, compressor map etc. needs to be adjusted to get correct boost per rpm.

    Some helpful words here:
    upload_2018-2-15_0-44-0.png

    Basic idea is that you write flywheel torque to green torque column, you need to know boost per rpm. Also have friction values set up.

    After that you can look graphs on left and probably see torque going up and down with efficiency you have in jbeam, that is NA torque curve of turbo engine.

    Then you adjust efficiency so that torque curve is smooth and logical, that is best way I have found out for this to work. I have not found explanation for this turbo efficiency, but I know it affects how much turbo you have.

    Efficiency of 1 is 6% increase of torque for every PSI of boost, 0.5 would be half of that.

    However when calculating for jbeam input torque, things get ugly really fast, only way to keep NA curve somewhat beliveable seems to be with adjusting efficiency.

    What I have seen in official vehicles is that turbo efficiency goes up and down, with different cars very differently, so I'm just guessing here that it is adjusted this way. If not, then it is back to drawing board for me, but you tell about that then.

    Here is turbo efficiency which I'm talking about, also exhaust factor:
    //engineRPM, efficiency, exhaustFactor
    [0, 0.0, 0.0],
    [500, 0.45, 0.07],
    [1000, 0.68, 0.14],
    [1500, 0.68, 0.21],
    [2000, 0.85, 0.29],
    [2500, 0.85, 0.66],
    [3000, 0.85, 0.83],

    Exhaust factor is percentage of exhaust power, so you set exhaust power and use then exhaust factor to alter how well spooled your turbo is, has to be tuned ingame I believe, but that and compressor map part of the turbo defines how much boost you will have at given rpm (we talk about full throttle only here).

    Use brakes, wind app, creative torque converter settings, to get constant rpm for engine at full throttle, steady rpm, that is only way to get max boost for rpm, then tune exhaust power to get same boost you entered to spreadsheet.

    I just want to make this tool to be useful for community so we could see better and more mods, maybe we can get this thing to be something useful.

    Update: There was small bug with torque value calculation for NA engine, which caused only 0.00 values, so made a fix.
    ODS version is for open office / libre office and XLSX is for Excel.
    Also added Inertia calculation, you need to know flywheel weight and diameter for that, also you need to fiddle with inertia values, can't use direct values, but gives you starting point.

    Update 2: There is more helpful information posted later in thread, also another tool to help you to make turbo engines.

    This helps me to get real world torque curve to table faster:
    https://www.beamng.com/threads/torque-curve-to-table-helper-tool.52528/
     
    #1 fufsgfen, Feb 15, 2018
    Last edited: May 25, 2019
    • Like Like x 2
  2. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    I'm assuming I can't use it if I don't have Excel?
     
  3. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Try if this works, I don't have open office to test, but it might work, saved from Excel (insider fast, so very latest version) to ODS format.

    Update: file in first post
     
    #3 fufsgfen, Feb 15, 2018
    Last edited: Feb 15, 2018
  4. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    I can view it, but not edit it.
     
  5. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    This one is without protection, maybe that was causing impossibility to edit?

    There is no password for protection though, so it is easy to remove, it is just for avoiding accidents.
     
  6. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    Nope, but that's alright
     
  7. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    I did download Libre Office and it works fine in there, maybe you have some settings so that files from internet are not opening or maybe you need to click some announcement to get it to work?

    Excel blocks editing until enable editing button is clicked.

    Protected version did work too as I tested so files are now at first post.
     
  8. SebastianJDM

    SebastianJDM
    Expand Collapse

    Joined:
    Apr 9, 2017
    Messages:
    856
    Downloaded Libre Office, works great. I'll do some toying around with it tomorrow, thanks for the help.
    I'll be sure to give my feedback!
     
  9. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Have you managed to find time to play with it?

    It's oddly quiet in here, eerie quiet, maybe tool is bad but everybody is too afraid to point foolish mistake I have made? Don't worry, if it is broken, then I just need to figure out way to fix it :D
     
  10. BombBoy4

    BombBoy4
    Expand Collapse

    Joined:
    May 16, 2015
    Messages:
    1,601
    So let me get this straight, you enter in the torque values of a turbocharged vehicle, then you enter in the boost pressure and efficiency, then copy in the export jBeam into a new engine and add a new turbocharger with the pressure/efficiency values you entered in?
     
  11. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Yes, more or less, but for pressure there is no place in jbeam, pressure is function of turbo map, turbo rpm and exhaust power.

    Exhaust power must be tuned in game at full throttle with constant rpm so that you get pressure you entered in spreadsheet.

    This is where you set maximum boost you will get, wastegate tries to keep boost at set maximum:
    "wastegateStart":10,
    "wastegateLimit":12,

    Then this is where you define at which rpm turbo is able to produce which maximum boost, it is just a compressor map of turbo, but instead of pressure ratio it has PSI as a unit, translating compressor map to jbeam is similar to translating torque curve, but it needs some extra steps, which I probably need to make tutorial about (where to get time for everything?):
    "pressurePSI":[
    //turbineRPM, pressure(PSI), T3 turbine map
    [0, -2.5],
    [30000, -0.5],
    [56400, 3],
    [79000, 6],
    [96500, 10],
    [109700, 14],
    [122200, 18],
    [132800, 21],
    [143500, 26],
    [153500, 30],

    Then how many rpm turbo can spin is defined by exhaust power, which is max exhaust power times exhaust multiplier
    "maxExhaustPower": 28000, // max volume of exhaust to propel exhaust turbine

    Here last is exhaust multiplier, middle number is efficiency from spreadsheet and first is engine rpm. These values below are a mess as it is WIP middle of tuning process, but mostly it is this last value that needs to be tuned in game.
    "engineDef":[
    //engineRPM, efficiency, exhaustFactor
    [0, 0.31, 0.0],
    [650, 0.39, 0.17],
    [1400, 0.44, 0.55],
    [1800, 0.53, 0.57],
    [2000, 0.58, 0.58],
    [2500, 0.53, 0.59],
    [3000, 0.62, 0.70],
    [4000, 0.78, 0.95],
    [5000, 1.0, 0.98],
    [6000, 0.9, 1.0],
    [6500, 0.85, 1.0],
    [7000, 0.8, 1.0],
    [8000, 0.75, 1.0],

    Best way to get constant rpm is to make automatic transmission and torque converter, set torque converter so that you can adjust it in game, just add new variable like so:
    "variables": [
    ["name", "type", "unit", "category", "default", "min", "max", "title", "description"],
    ["$size_TC", "range", "", "Size(m)", 0.19, 0.14, 0.28, "Torque converter size", "Percentage of adjustment range"],
    ],

    "converterDiameter": "$size_TC",

    Remember that you might need bigger diameter for max value depending how strong your engine is.

    Then long gearing or/and strong brakes, put it on drive, floor it while brake applied, then adjust TC size and do it again until desired constant rpm is reached, check turbo rpm and boost and keep repeating that, adjusting exhaust multiplier as needed. If maxExhaustPower is too small, then maximum boost is not achieved, if it is too much, then there will be difficulties getting enough low boost with 0.1 multiplier. Of course you can do 0.001 multipliers too, not sure if you can go past 1.0 without code going berserk.

    If something is unclear, don't hesitate to ask, it is rather complex topic with many variables and this is just quick and rough explanation.


    I have been thinking about wheels that would have tow hook nodes and platform that would have tow hitch nodes, I did read about ropables too, but UI app for adjusting TC size is big mystery, that would be closest to dyno we could easily make and for turbo testing purposes it would speed up the process a bit.

    If someone can cook up UI app for adjusting that TC diameter variable on the fly, that would be really nice modding tool for the game.
     
  12. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    @BombBoy4 here is yet another tool for turbo building, this is what I use to get compressor map to jbeam and when evaluating if turbo is appropriate size for engine in fist place.

    It is quite simple to use as there is only few inputs, it gives you required turbo flow, but for different rpm and boost one ends up with different efficiency and it takes many calculations to get somewhat good understanding if the specific turbo would be ok for the engine and how it would behave.
    upload_2018-2-20_11-0-1.png

    So, for example values in spreadsheet, I get this (red is flow, blue is pressure):
    upload_2018-2-20_11-5-28.png
    So that is the point in compressor map, now I can see that it is not efficiency of 75% it is between 72% and 73%, closer to 72% so I write that to turbo efficiency (let's decide it being 72.5%)

    As you can see flow changes a bit, but as percentage change was not too great required flow did not change a lot, doing this for several engine rpm will give you then good idea how turbo size is matching to engine, also you will get pressure ratio to PSI table with the spreadsheet which you can use to build compressor table to jbeam.
    upload_2018-2-20_11-33-14.png

    You need to do above step to get idea if turbo really is usable with the engine and how to set exhaust multiplier, but you don't need to do it necessarily.

    Next what I do is write compressor map to jbeam. Each rpm line has maximum pressure ratio, so I find maximum pressure ratio for given rpm line and that is my point of data to jbeam, for this example it would be 69500rpm and 1.48PR which translates to 7PSIg.
    upload_2018-2-20_11-19-11.png
    "pressurePSI":[
    [69500, 7],

    Then just fill in for each rpm line, pay attention to flow values too and you get the idea how that complicated unnecessary step before this last step helps a lot of exhaust power multiplier tuning step.

    Sadly tool is very rough and I really haven't planned releasing it, but figured out that you guys might need this info to be able to do turbo engines in first place.

    @atv_123 mentioned he did not know how to make turbos, so this might be something interesting to read for him too. There is of course lot more to it, but this should get you started at least, or maybe makes it easier to ask if something is unclear.

    Formulas are from real world car guys who have been building engines, so figuring out if turbo would work with engine with this method should work in real life too, but of course there are even more variables, turbine maps to consider etc.

    Goosah and Diamondback probably are laughing to my overly complex methods, but so far none has been able to point out flaws of this method, if there are flaws of course would like to hear about them.

    Also it should be possible to make similar tool as I did for torque curves which counts exact values from pixels that should improve accuracy and speed, but haven't got around of that, maybe I do some day and combine all these tools to one book, but first I would like to know that they are worth of the trouble. I can perfectly well think being right and having some fundamental stupid flaw in front of me without seeing it, so don't be afraid to point it.
     

    Attached Files:

  13. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    This is just an example of how to get same function as you would get with a real dyno in Beam. Adapt transmission and torque converter to your needs.

    Select dyno transmission and adjustable torque converter.

    Apply parking brake, put on drive and keep throttle floored until turbo rpm stabilizes, that is your maximum boost for that rpm. Video shows testing:


    You need to change TC size few times to get exactly wanted rpm.

    To make this automated you could have LUA for manual throttle like @Darren9 's helicopter, also maybe it would be possible to have LUA code to adjust TC size on the fly so that it would attempt to keep specific rpm. That would mean you just set rpm and set throttle to full, it would be handy, not sure if I can figure out how to make such though, some more clever person would be needed for that.

    Anyway, this method helps to get correct boost much easier than attempting to drive around.

    You might want to use wind app to keep enough cooling airflow.

    Update: You might want to spawn traffic cone or whatever to scene in addition to your vehicle, then when you apply parking brake and put throttle to 100%, hit tab, don't touch controls anymore and hit tab again.

    Now car is running at 100% throttle while staying on place, you can go to read mail, cook, make coffee whatever, it doubles as thermals stress test, with wind app you can set desired speed to simulate and get cooling system tested without needing to spend your own time for it.

    If I could make UI apps, I would make something that shows grams of fuel burned per kWh as that is fuel consumption data I sometimes find and this method could be used to tune fuel consumption easily too.

    So there you have a crude dyno and it can be used to all things real dyno can be used to.
     

    Attached Files:

    #13 fufsgfen, Feb 20, 2018
    Last edited: Feb 20, 2018
    • Informative Informative x 1
  14. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    *BUMP*

    Only small addition, it seems developers of BeamNG had added exhaust resistance to exhaust parameters, which needs to be taken into account now, so added that.

    Not sure if there is also something else new that is needed to be added, but I need to have a look around.

    Also fixed little bug that would of happen only when using nearly all of the bins.

    V3 has sample data from tuned SR20EV motor and Hopper stock exhaust. You can see from sample data how I did add more bins to exhaust data manually.

    You do add only basic version of exhaust to spreadsheet, then for sport exhaust you just reduce restriction values (less negative torque) in exhaust.jbeam to get more power with tuning exhaust.

    As developers did add a lot of interesting new features for engine power and part selection in latest game version, that needs further studying of what and how, I'll add more stuff if I need.


    Update: Sorry there is no ODS version of V3 right now, I will upload that when V3 is tested bit more.
     
  15. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    I've been using this tool for a while toto make my own engines, and it's pretty great. I actually made my own exhaust loss calculator, but it wasn't automated (you had to do some copy pasting). This looks perfect though, and should make it much easier to do engines in v12.
     
    • Like Like x 1
  16. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    I'm happy that tool has been useful for you :)

    I did little fiddling with formulas and I got turbo torque calculation to be better, but it still needs a lot of testing. Most thing I'm uncertain is that I had to add dynamic friction twice to get proper values, so there probably is something that still needs more fiddling. It does give bit easier starting point though, but with turbo everything is so variable that it takes lot of experimenting.

    For example back pressure is mentioned as 0.0005 in https://wiki.beamng.com/Turbocharger however I like to have it 0.00005 and reduce exhaust power accordingly, less trouble with boost spiking etc. Generally exhaust power I find better to be tuned smallest possible.

    I have been testing with this a bit, it gets close and all, but I feel there is still some variable that waits finding of itself:
    upload_2018-6-3_14-2-47.png upload_2018-6-3_14-12-12.png

    Probably NA torque curve ends up a tad high with v4, but need to test that more. What I want to achieve is to be able to get real world turbo torque curve into Beam without too much of time spent tuning and for that this is quite close already.

    That torque curve is from here http://www.fourwheeler.com/how-to/1308-banks-4-0l-sidewinder-turbo-system/ my attempt to recreate that is still pretty WIP, but attached for anyone interested.

    I'm not putting this spreadsheet to tools until I know it will work properly.
     

    Attached Files:

  17. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Okay, here is the problem I'm having with this tool.

    Turbo adds 6% power per PSI, when turbo efficiency is 1, so that means torque in jbeam needs to be reduced by PSI x efficiency x 6%.

    Trouble is that while it is no trouble calculate that power increase, I have not been able to inverse that calculation, where 1 would be 0 power added and any power added would be less than 1.

    So in practice 0 psi would be multiplier 1, while 16.67psi would be 0.5 as it is 100% power added that means torque in jbeam needs to be halved.

    Even that I got right moment ago multiplier calculated I seem to end up with too much power, so even this is close, still there is something more to be figured out.

    So frustrating, when I do tests and it works perfectly, but change in boost and nothing works at all, so it was just a mirage. However I know it can be done and I will do it, just takes few more attempts, I guess, but there will be way to calculate torque values for turbo engine, no matter how many fails it takes.

    Update: There you can see 72Nm too much of torque, it comes from somewhere, just need to find out where, also need to figure out why shape is so different, technically shape should be same, but dip comes from spreadsheet from time when boost comes up, increase in boost causes need to have lower torque in jbeam and from some reason calculation does not quite match or then ingame boost build up is not enough at that rpm, need to examine that:
    upload_2018-6-6_8-28-1.png upload_2018-6-6_8-28-10.png

    Still where that extra power comes from troubles me, it should now calculate very closely same way as game calculates, so this requires more investigating, sorry that there is no working version of this this time.
     

    Attached Files:

    • upload_2018-6-6_8-26-58.png
    #17 fufsgfen, Jun 6, 2018
    Last edited: Jun 6, 2018
  18. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Big BUMP, just so that you know, there is again download available, but please do not use turbo calculation, it really tends to be off and sometimes by big margin, but play around with that if you want.

    For NA engines it should work fine and also gives you copy pasta table for exhaust as well, using friction values you input in spreadsheet and exhaust table with engine torque curve table gives you correct power for the engine.

    If I sometime figure out how to get real world turbo torque curve based calculation to work, I will update the thing, but there might be some variable affecting torque curve that I just haven't found.
     
  19. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    I just realized something. What altitude is gridmap at. It might affect how much pressure the turbo can build it it's far enough away from sea level.
     
  20. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Afaik, 0m and to my understanding turbo should just work harder to keep the pressure at higher altitudes, but in BeamNG this might not be the case.

    I haven't even tested turbo calculation in 0.16, but before it sometimes was spot on, but with other engine not so close. I did use same math that I found in game lua files, but not sure if there is some variable I had missed or if I made error in formula etc.
    Some day I will look into it again, as if it is possible to add power by formula, then it should be possible to do calculation to reverse direction too and get torque curve at 0 boost for game so turbo then would add power to real world curve level.

    Somehow that has not worked perfectly before at least, but if some day we find a way, that would be really big help for making turbo engines.
     
  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