1. Trouble with the game?
    Try the troubleshooter!

    Dismiss Notice
  2. Issues with the game?
    Check the Known Issues list before reporting!

    Dismiss Notice
  3. Before reporting issues or bugs, please check the up-to-date Bug Reporting Thread for the current version.
    0.30 Bug Reporting thread
    Solutions and more information may already be available.

ESC settings do not have a parameter for the throttle.

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by EpicSlayer7.666, Apr 12, 2019.

  1. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    i have been a bit hesitant to where to post this as my first post, 1st if the feature exist, it is documented nowhere.

    2nd if it exist i cannot ask for it as a feature

    3rd if it does not and should exist and it can be a bug(by not existing while it should by being forgotten)

    4th i need the help and an answer

    5th no one can help me in modding something that is not documented since they would have documented it if it were known.

    so i would be fine with a simple warning and a thread moved to the more acceptable place.

    i have been modding the setting for the car all day and cannot find the ESC setting that affects the throttle. right now i have found the brakes and disabled the Traction control without problem but there is no documentation online on what the parameters do and trying the ones that were in the file never affect the throttle directly.

    effectively "escThreshold" is the overall effectiveness and is the only one that worked but it also affects the brakes while i wish to tune them separately (and know how "brakeForceMultiplier")

    the problem is that it almost makes the car stall, even when i put it in null or lift the clutch, when i turn the car the engine is not receiving gas input (drives like all the torque and horsepower disappear.) so to "tune down" this effect i would like to know what parameter affects it. (throttleForceMultiplier? ;P like set it at 0.60 and the throttle will be 60% of your input?)

    any how i know what ESC does but i want to tune how it does it per Vehicle. so a fast Vehicle uses more brakes to stabilize(less high speed wobble from input) while slower ones lift on the throttle more (no sense power grinding the brakes with a 3 ton vehicle), also traction control should be the thing that plays with the throttle.
     
  2. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    it has been a few days since and all tho it might be due to the post not being seen, it may also be unclear as to what i am asking so in case, i will put a clarification:

    ESC is the "Electronic Stability Control" that helps the car stay strait when no steering is applied or helps turn when turning by comparing wheel angle to wheel spin difference and perceived torque effectively applied to the pave. so if a wheel turns too fast compared to what it should be at current steering, the system applies the brake on only that wheel.

    TC or Traction Control is what helps your car not spin by releasing the throttle a bit and applying a bit of brakes to make the wheels spin within a range that is closer to what they should be turning at the current speed. (if wheel spin greater than traction, it release the gas, if greater than a certain ratio, it applies the brakes on top until below that ratio while keeping off the accelerator then gives 100% gas when traction is available.)

    right now the ESC does TC when i turn but i do not want it to. now i know that the ESC needs to lift a bit off the throttle to help turning by giving back some tire traction to turning, but right now turning the joystick or pressing a key on the keyboard locks the engine.

    the current system works well for it's intended purpose BUT it needs a parameter for the throttle just like it has for brakes. ("brakeForceMultiplier") i currently put the TC throttle Value to 0.01 so in a strait line the throttle is not affected, but if i turn it goes from 99% applied to near 0%. i stalled my car with the gas pressed on while in "null gear" on a flat surface... adding a minimum throttle value and a target throttle reduction in conjunction would help the behavior a lot! with the minimum, it would prevent near 0% output, and with a targeted reduction, it would drop to at least this much. (minimum 0.30, target 0.60 so it starts at 0.60 but can go lower as needed to 0.30 by example. or target 0.95 to not affect the car on every minor corrections.)

    any how every thing needed for this looks to be there but simply do not appears to have a parameter available for us to tweak in this case. (in other words, it applies a hard coded value instead of a changeable variable trough a parameter.)

    my goal is to be told if that value has a parameter and that i may have just missed it or, if there is none and that it would be possible to implement. (adding a parameter would not break things since they would still default to the default if left undefined within the vehicles. just like how the "Limited Slip Differentials" has Default Values if you do not specify them.) anyhow i hope i have not been rude! ;P
     
  3. Capkirk

    Capkirk
    Expand Collapse

    Joined:
    Nov 19, 2017
    Messages:
    673
    "minThrottleFactor" is what you are looking for I believe, it does exactly what it says, using a value between 0 and 1. I would suggest looking at esc.lua if you want to get a better idea how the ESC works, it's located under (steamapps\common\BeamNG.drive\lua\vehicle\controller).
     
  4. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    isn't that only for the traction control? i set that at 0.99 hence why i can spin in a strait line but if i turn the car it can even stall in null... thanks anyways tho the second part about the file will let me know if there are other parameters for the ESC part unlike the separate TC part! at least the TC was extremely easy to deal with, did not need 2 tries, tho i spent 18 hours strait trying different values to make my ESC work but not bog down since "escThreshold" was the only value that directly affected the throttle... more like the entire system.

    i will work on reading the LUA file and add any parameters that might be missing one at the time and try values to make it work! or maybe the ESC and TC is not 2 parts but one system and cannot be separated... that would drown my plans in a vat of poisoned burning acid! sorry ;P let me speak "human", that would completely prevent me from achieving my goals while putting my previous efforts to waste.
    --- Post updated ---
    came back from reading it a bit (at half right now) and found:


    if reduceThrottle then
    local slipError = peakSlipError
    throttleFactorIntegral = max(min(throttleFactorIntegral + slipError * dt, 1), 0)
    local throttleFactorPI = slipError * currentESCConfiguration.throttleProportionalFactor + throttleFactorIntegral * currentESCConfiguration.throttleIntegralFactor
    throttleFactor = min(max(1 - throttleFactorPI, currentESCConfiguration.minThrottleFactor), 1)
    else
    throttleFactorIntegral = max(min(throttleFactorIntegral - currentESCConfiguration.slipThreshold * dt, 1), 0)
    throttleFactor = min(max(1 - (throttleFactorIntegral * currentESCConfiguration.throttleIntegralFactor), currentESCConfiguration.minThrottleFactor), 1)
    end

    the throttleFactor contains "currentESCConfiguration.minThrottleFactor" but in this math even if i do not know how the line is processed logically, i can guess there is a max and minimum supposed to be defined as a ceiling and floor for the values but they obviously are not passing trough to the ESC and only the TC. the thing might need to not be one line and have a "min" be defined with a bigger or equal sign... like "min >= currentESCConfiguration.minThrottleFactor" then max = "maximum value" (that they know better than me), THEN "throttleFactor..."

    anyways i will simply put a "throttleFactorIntegral" and make it equal near 0 to see if it reduce it or increase it. then put a value that "tones it down" accordingly. and maybe rewrite a part to use "minThrottleFactorESC" for ESC. all tho i cannot code, modifying a pre-written script is quite a lot easier! (tho modifying the script will only fix the problem on my end and not on vehicles i would upload...)

    also i needed the ESC for a rear engine car and put strict ESC without traction control to keep it from swinging it's engine(rear) out from minor inputs. (anyhow the fact that it is not hard coded and a LUA file, at least values could be tweaked or math could be evolved like making certain values scale with Velocity within a min/max could help high speed stability while letting it be agile at low speeds!)

    so thanks for pointing this file out!
     
  5. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    -------------------------------------------------------------------------UPDATE


    ok update i found out what does that, it is the "rev Limiter"

    i changed :

    if tempRevLimiterTimer > previousTempRevLimiterTimer then
    tempRevLimiterActive = true
    for i = 1, revLimiterEngineCount, 1 do
    local engine = revLimiterEngines
    engine:setTempRevLimiter(engine.outputAV1)
    end
    elseif tempRevLimiterTimer <= 0 and tempRevLimiterActive then
    tempRevLimiterActive = false
    for i = 1, revLimiterEngineCount, 1 do
    revLimiterEngines:resetTempRevLimiter()
    end
    end

    tempRevLimiterTimer = tempRevLimiterTimer - dt

    to:

    if tempRevLimiterTimer > previousTempRevLimiterTimer then
    tempRevLimiterActive = true
    if speed < 7 then
    for i = 1, revLimiterEngineCount, 1 do
    local engine = revLimiterEngines
    engine:setTempRevLimiter(engine.outputAV1)
    end
    else
    throttleFactor = throttleFactor * 0.5
    end
    elseif tempRevLimiterTimer <= 0 and tempRevLimiterActive then
    tempRevLimiterActive = false
    for i = 1, revLimiterEngineCount, 1 do
    revLimiterEngines:resetTempRevLimiter()
    end
    throttleFactor = min(max(1 - (throttleFactorIntegral * currentESCConfiguration.throttleIntegralFactor), currentESCConfiguration.minThrottleFactor), 1)
    end

    tempRevLimiterTimer = tempRevLimiterTimer - dt


    and all the cars became drivable! this way at low speed and RPM with the use of ESC for rock climbing, the car behaves like they set it up BUT when racing above 25km/h (15.6 mph) the throttle is set at 50% instead of rev limiter killing the engine. (if they officially updated this, they could use "currentESCConfiguration.this_value" in car configs or Default!)

    is any Dev looking this thread up? if so, you can use this code and modify from there since it is actually all YOUR code, i just copy and pasted existing part and changed values. (and i do not know how to code so a "professional" would be best at revising this.

    the problem in dept is that the Rev Limiter acts too strongly and for too long. i made a rear engined Porsche and a F1 car in Automation that was near undrivable and totally unstable, with this modded code it drives totally natural! (no rear swing and spin outs AND full acceleration PLUS stable when doing so!) so i would consider at least test driving a car with this modified version of the ESC code!

    EDIT: this post keeps messing up the text here is the file
     

    Attached Files:

    #5 EpicSlayer7.666, Apr 21, 2019
    Last edited: Apr 21, 2019
    • Informative Informative x 1
  6. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
  7. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    The ESC controller is meant to replicate real world usage for normal cars. This means that it prefers added safety due to throttle cuts/limited rpm over the fastest lap times or the least intrusive feeling.
    It also means that weird corner cases like rock crawling are definitely not meant to be supported.
    Stabilit control and in general driving dynamics is a huge and complicated topic, we can't possibly support every niche case (especially not with one code base), so feel free to publish your mod if you think it adds to certain cars :)
     
  8. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
  9. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    well the thread is a month old so if the normal release "not beta" has not been patched yet then i would imagine i am dealing with old news but otherwise i think one guy mentioned the problem and in my "normal" updated version it is not fixed. the rev limiter in the ESC hangs on for full 1.5 to 2 seconds on any amount of turning the car does. anyways i only want the ESC to work on my brakes mostly and leave the traction control to the traction control. (tho reducing the throttle leaves more traction to turn and thus why i did not just "turn it off" but replaced it with a throttle reduction)

    also they were working primarily on the traction controller having a problem that was letting the wheel spin randomly and tried to get the process to check more often to mitigate that lagging behavior. (might even be what caused the issue i have who knows, i have only gotten the game this month. but anyhow, i figured out the revlimiter was at the cause.)
     
  10. fufsgfen

    fufsgfen
    Expand Collapse

    Joined:
    Jan 10, 2017
    Messages:
    6,782
    Ah, but they do share bits, I think?
    Then again ESC goes over my head, I like simple 80's tech and 90's is a hightech for my poor brain. These modern stuff gets rather confusing :p

    I wonder if TC or ESC is used in real world rock crawling though, might be bit difficult to make work in such.

    When I made my race TC, that was because I could not get enough fast response from vanilla ESC/TC, with race TC I made kinda cavemen TC, very basic thing, but kinda reasons were similar, only I got too little intervention, while you are experience too strong intervention.


    Generally they release such big improvements with new updates that occur between 3 to 4 months, between those updates there is then hotfixes mostly.
     
  11. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    well a simply value to set when the ESC stops relying on rev limiter and a throttle cut value that can be set from the car config might help balancing things out by leaving default values making it real, and leaving those setting available for people to "fine tune" for special cases. like literally the ESC you guys made works wonders on rock climbing and climbing up slippery hills. but when ever i start turning left and right repeatedly, the car stalls even in null...

    but if i can put the mod up, what section does that even belongs to? (mods of mods?)

    i made a rear Engine 1000kg formula one type car with the weight 70% at the back drive and drift like it was nothing with the settings i made, with no ESC it is 100% undrivable (any speeds 0 km/h to 400km/h!) so if i can put this mod out, then i imagine a few nutcase cars i made will find it self here! (and some other people might need that barrier out of the way to make their insanities go strait!)
     
  12. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Tbh, this sounds like a badly configured ESC to me. Just like IRL, ESC uses a model that predicts expected yaw rates and compares that to what actually happens with the car. Within the linear region of tire behavior this is remarkly accurate and works really well. However, this is only true if 1) the ESC is actually configured correctly (most importantly the skew stiffness values ) and 2) There is no jbeam instability in the car as that throws off all readings from the physics.
    How did you calibrate the stiffness values for the ESC on the cars you are mentioning?
     
  13. EpicSlayer7.666

    EpicSlayer7.666
    Expand Collapse

    Joined:
    Apr 12, 2019
    Messages:
    59
    me or fufsgfen? in my case :

    ESC of the rear engine Porsche

    "maxSideAcceleration":12.06
    "escThreshold":0.035
    "skewStiffnessFront":107130.83936566
    "skewStiffnessRear":177763.93905586
    "desiredYawRateSmoothing":25

    and for TC
    "minThrottleFactor": 0.19 (was 0.99 before my mod)
    "maxBrakingFactor": 0.01

    for the Formula one car:

    ESC
    "maxSideAcceleration":15.66,
    "escThreshold":0.15,
    "skewStiffnessFront":89785.659640033,
    "skewStiffnessRear":250596.81123028, (the car as 10 spring and 10 damp on Automation settings on back and about 4 to 5 front)
    "desiredYawRateSmoothing":50,

    TC:

    "minThrottleFactor": 0.3
    "maxBrakingFactor": 0.9

    then there is the fake Jeep

    ESC:

    "maxSideAcceleration":10.26
    "brakeForceMultiplier":0.64806531300846
    "escThreshold":0.15 (Default Automation Values)
    "skewStiffnessFront":56783.174854104
    "skewStiffnessRear":43150.986296479
    "desiredYawRateSmoothing":250 (default Automation values for all cars)

    TC:

    "minThrottleFactor": 0.1
    "maxBrakingFactor": 1.0

    when i make the ESC app do the test on the grid map, all those values are pretty much in the ball park of 95% on so... i simply trusted that Automation exported with meaningful values.
     
  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