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 gets stuck in turns

Discussion in 'Troubleshooting: Bugs, Questions and Support' started by vmlinuz, Feb 14, 2021.

  1. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    At low speeds and at moderate steering angles, the ESC grinds the car to a halt and completely cancels the throttle. I have reported this numerous times. It occurs ON A CLEAN INSTALL OF BEAMNG, ON A CLEAN INSTALL OF WINDOWS, NO MODS, SAFE MODE, CACHE CLEARED TWICE, STOCK CONFIGS despite having been told otherwise. Here is a video, since nobody seems to believe me.
     

    Attached Files:

    • Agree Agree x 1
  2. Rainvest

    Rainvest
    Expand Collapse

    Joined:
    Dec 26, 2014
    Messages:
    1,902
    I believe you, because it's happened to me as well. I find that driving up mountain in the Automation Test Track map with an ESC equipped vehicle will easily reproduce the issues that you're having right now. Not sure what causes it, but it'll burn up the brakes pretty easily, and it makes me want to turn it off.
     
  3. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    THANK

    YOU
     
  4. Rainvest

    Rainvest
    Expand Collapse

    Joined:
    Dec 26, 2014
    Messages:
    1,902
    Not a problem. I can also provide a supplemental video as to provide some visual element as for what I was saying. It's an extremely inherent issue that absolutely nobody has pointed out for some odd reason.
     
  5. vmlinuz

    vmlinuz
    Expand Collapse

    Joined:
    Mar 2, 2014
    Messages:
    2,409
    > Location: Male

    Epic
     
  6. P_enta

    P_enta
    Expand Collapse

    Joined:
    Jan 11, 2020
    Messages:
    3,029
    happens all the time to me.
     
    • Agree Agree x 1
  7. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    The complexity of the new DSE is too much, the ESC is currently bugged and the TCS in DSE still compares diagonal wheelspeed(unrealistic) and the devs remedied the problem by introducing an additional logic called eDiff. Vehicles IRL don't compare diagonal wheelspeed in their TCS, and the TCS can reduce throttle and brake the slipping wheel or only brake the slipping wheel(ESC-OFF mode).
    The complexity of the new DSE really made bugfix difficult

    The older ESC logic is also very easy to mod and tune by players. Watch the video in the attachment, I actually tuned the ESC on the Sunburst to brake very aggressively upon understeer, effectively making the vehicle an electronic-assisted powerslider(feels like Burnout or Need for Speed) without defying any law of physics(note I still did use open diffs in the video).
    In the newer DSE, I can't even remedy this problem(and possible make a mod about it)

    IMO, the devs should have fixed the diagonal wheelspeed TCS problem
    And continue to use the older, simpler ESC.
     

    Attached Files:

    #7 default0.0player, Feb 15, 2021
    Last edited: Feb 16, 2021
  8. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    I'm sorry you feel that way, unfortunately these systems simply are complex. DSE is based on the newest available ideas in research and real cars from around 2015ish.

    I'm not sure where you are getting that from. The diagonal wheelspeed comparision does not exist in DSE.

    They actually do. That's why the first implemenation of TC did that, it's not like I just invented this. It works very reliable for 2WD and non overly powerful AWD vehicles and was used in the past in real vehicles.

    That is certainly true. However, it was also pretty bad in terms of doing what it's supposed to do. The math behind it was way too simple and did not match reality too well.
     
    • Like Like x 3
  9. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    This is actually the most confusing, that means they are two channel but use four sensors. IIRC ABS appears before TCS, and TCS uses the wheel sensors used in ABS(no additional sensor is required), and in the Wiki there is a "Two-channel, four-sensor ABS", but "the control module pulses the valve for both wheels on that end of the car." not specify diagonal. But if you put that on the Pickup/Sunburst 2WD is somewhat better than AWD. Anyway if that TCS does exist in many vehicle IRL I won't complain about that again.
    BTW is there anyway to "separate" brake control and throttle control? When the wheel starts to spin, the TCS cuts throttle and brakes the slipping wheel at the same time, according to the rate in the jbeam. How to(in an FWD)tune the TCS to only brake when FL & FR wheel speed difference too much, and only cut throttle when FL & RL wheel speed difference too much?
    --- Post updated ---
    Thanks for your clarification, I won't spread that misinformation again.
     
  10. atv_123

    atv_123
    Expand Collapse

    Joined:
    Aug 5, 2012
    Messages:
    1,710
    You can actually set these things up in the JBeam for the traction control rather easily. Granted I am only 2 days into playing with it... but from what I currently understand, it goes like this.

    You have a .stat.jason file that defines which wheels will be monitored and have systems applied to them that simply looks like this.

    Code:
    {
    "vehicleData":{
      "skewStiffnessRear":156000,
      "cornerWheels":[
        "FR",
        "FL",
        "RR",
        "RL"
      ],
      "skewStiffnessFront":145000
    }
    }
    You could probably just have the front left and front right only definer in this file, and that would probably limit the system to only monitor those two wheels... for example.

    Next, you hop down into the _dse_drivemodes.jbeam file which has each drive mode laid out similarly to this:

    Code:
    "offroad": {
                        "name": "Offroad",
                        "order": 40,
                        "settings": [
                            ["type"]
                            ["controller", {"controllerName":"electronicSplitShaftLock", "minimumLock":1.0}]
    
                            ["controller", {"controllerName":"adaptiveFrontDamper", "damperMode":"soft"}]
                            ["controller", {"controllerName":"adaptiveRearDamper", "damperMode":"soft"}]
    
                            ["controller", {"controllerName":"tractionControl", "isEnabled":false}]
                            ["controller", {"controllerName":"motorTorqueControl", "tractionControl.isEnabled":false}]
                            ["controller", {"controllerName":"brakeControl", "tractionControl.isEnabled":false}]
    
                            ["controller", {"controllerName":"gauge", "modeName": "OFFROAD", "modeColor": "#EC6B00"}]
                            ["controller", {"controllerName":"CMU", "uiDisplayData.simplePowertrainApp.activeColor": "EC6B00"}]
                        ],
                    },                
    I stole the offroad one as the example here... but just bear with me.

    So as you can see, you have several different sections here... the ones we are interested in though are these three...

    Code:
                            ["controller", {"controllerName":"tractionControl", "isEnabled":false}]
                            ["controller", {"controllerName":"motorTorqueControl", "tractionControl.isEnabled":false}]
                            ["controller", {"controllerName":"brakeControl", "tractionControl.isEnabled":false}]
    as you can see here, in the offroad section the traction control, torque control, and brake control is all disabled by them just setting "isEnabled" to false. Simply switching any one of these to true will enable this controller for this particular driving mode.

    Naturally, you can go a bit further... lets look at sport mode to see some of our options.

    Code:
                    "sport": {
                        "name": "Sport",
                        "order": 20,
                        "settings": [
                            ["type"]
                            ["exhaust", {"name": "mainEngine", "mufflingOffset": -0.15, "gainOffset": 0}],
                            ["transmission", {"defaultForwardMode": "S"}],
    
                            ["controller", {"controllerName":"electronicSplitShaftLock", "isEnabled":true, "minimumLock":0.25}]
    
                            ["controller", {"controllerName":"adaptiveFrontDamper", "damperMode":"hard"}]
                            ["controller", {"controllerName":"adaptiveRearDamper", "damperMode":"hard"}]
    
                            ["controller", {"controllerName":"motorTorqueControl",
                                "tractionControl.isEnabled":true,
                                "tractionControl.wheelGroupSettings.mainEngine.slipThreshold": 0.3,
                                "yawControl.isEnabled":true,
                            }]
                            ["controller", {"controllerName":"brakeControl",
                                "tractionControl.isEnabled":true,
                                "tractionControl.wheelGroupSettings.mainEngine.slipThreshold": 0.2,
                                "yawControl.isEnabled":true,
                                "yawControl.slipAngleThreshold": 0.1,
                                "yawControl.yawAvThreshold": 0.6
                            }]
    
                            ["controller", {"controllerName":"CMU", "uiDisplayData.simplePowertrainApp.activeColor": "DA0C0C"}]
                        ],
                    },
    as can be seen here, the motor control and the brake control are split into 2 different sections with some options enabled to allow for some tunability. I don't know how many options there are, or how in depth this goes, but as you can see in sport mode, we now can set yaw control individually under not just the motor controller, but the brake controller as well. So if you set "yawControl.isEnabled":true, to false under the motor controller, I would assume that it would then disable throttle cut from pitching the car sideways (granted the traction control would still but in when it sees wheel slippage, but you get my point.)

    So yeah, messing around with the driving modes and building your own really isn't that difficult... the hard part is figuring out what your options are, and what actually works and how to implement it correctly.
     
    • Like Like x 2
  11. Agent_Y

    Agent_Y
    Expand Collapse
    Jbeam/QA support
    BeamNG Team

    Joined:
    Jul 10, 2020
    Messages:
    10,058
    Tbh to me this new system seems WAY more self-explanatory than the old one, just the amount of possible options can be confusing, but this is much easier to understand what each drivemode does exactly. I like this better than the old one.
     
    • Like Like x 1
  12. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    Looks like Offroad mode disables traction control brake control, thus you cannot offroad effectively without eDiff
    My guess is the eDiff(braking, active locking and torque vectoring) use the functions in the eDiff library and the TCS uses the modern ESC library and the modern ESC & eDiff are in the DSE, thus this is simpler than "brake-only TCS"(which requires different ESC with different diffs).
    Absolutely no offense to BeamNG developers(including but not limited to DSE devs), but I'm really concerned about some modern vehicles safety IRL. We know that ESC is not a performance enhancement and aggressive driving is not encouraged on public roads. However, the driver may inadvertently encounters dangerous situations
    I actually crashed numerous time on tarmac, only have used gravel to screenshot because it was easier to replicate
    ESCp.png
    Thus if the ESC prioritizes slip angle over yaw, then the handling in some situation might become much worse.

    Anyway I won't rant again either way because I no longer interpret it as a bug after Diamondback's explanation.


    Edit: Updated explanation
     
    #12 default0.0player, Feb 17, 2021
    Last edited: May 27, 2022
    • Like Like x 1
  13. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Well, the ESC doesn't simply prioritize one over the other, it basically looks at which system wants to do the most drastic adjustments and then favors that.
    One thing that is really difficult to get right (and certainly is not at the moment) is understeer prevention. The math behind the expected yaw rates is too coarse to be really useful (DSE uses largely the same math here as the old ESC, just better calibrated to specific cars). I have plans for actually _recording_ expected yaw rates during safe driving situations, but the actual automation part of that is much more complicated than one might assume.
    Just like IRL, the finer you calibrate such systems to a specific car, the less it's possible to change that car though. Perfectly calibrated base model car with aftermarket slicks on it? ESC will get confused... Stuff like that.
     
    • Like Like x 3
    • Agree Agree x 1
  14. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Btw, that picture does not really repliacte the game's logic. The calculated slip angle (at speed) does not change with steering inputs, so in the lower part, the slip angle logic wouldn't see anything wrong and simply wouldn't do anything.
     
    • Like Like x 2
  15. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    After digging into the LUA files, I finally discovered the understeer cause.

    ↓↓↓This is not the cause↓↓↓
    In the "\BeamNG.drive\lua\vehicle\controller\drivingDynamics\supervisors\components\brakeControl.lua" line 93 to 127
    Code:
      local avBrakeFactor = yawControlAVBrakingPID:get(-abs(yawDifference), -controlParameters.yawControl.yawAvThreshold, dt)
      local slipAngleBrakeFactor = yawControlSlipAngleBrakingPID:get(-abs(bodySlipAngle), -controlParameters.yawControl.slipAngleThreshold, dt)
    
      local wheelToBrake
      if avBrakeFactor > slipAngleBrakeFactor then
        if yawDifference > 0 then --Oversteer
          if measuredYaw > 0 then
            wheelToBrake = wheelAccess.frontLeft
          else
            wheelToBrake = wheelAccess.frontRight
          end
        else --Understeer
          if measuredYaw > 0 then
            wheelToBrake = wheelAccess.rearRight
          else
            wheelToBrake = wheelAccess.rearLeft
          end
        end
      else
        local bsaControlSign = sign(measuredYaw) * sign(bodySlipAngle)
        if bsaControlSign < 0 then --Oversteer
          if measuredYaw < 0 then
            wheelToBrake = wheelAccess.frontRight
          else
            wheelToBrake = wheelAccess.frontLeft
          end
        else
          -- if measuredYaw < 0 then
          --   wheelToBrake = wheelAccess.rearLeft
          -- else
          --   wheelToBrake = wheelAccess.rearRight
          -- end
          return false
        end
      end
    To elaborate. The ESC compare the slip angle and required yaw/angular velocity correction. If the slip angle is too large compared to yaw difference, the ESC will interpret as oversteer to straighten the car. For example, if the car is sliding sideways but not turning, both the yaw rate and the steering wheel is zero but the slip is significant, the ESC will try to straighten the car. If the vehicle's actual yaw and driver's intended yaw differs too much, more than slip. The ESC will try to correct understeering/oversteering first.
    ↑↑↑This is not the cause↑↑↑

    Thus, if the driver desperately tries to turn the vehicle(large between desired yaw and actual yaw), the ESC should still interprets this as understeer instead of mistaken this as oversteer. The reason of the ESC misinterpretation lies within another file.

    ↓↓↓This is probably the cause↓↓↓
    The "\BeamNG.drive\lua\vehicle\controller\drivingDynamics\supervisors\yawProviders\STMEstimate.lua" line 75
    Code:
      controlParameters.maxLateralAcceleration = jbeamData.maxLateralAcceleration or 12
    This is the whole reason why ESC often mistaken large steering input as oversteer.
    @atv_123 As you can see, non of the BeamNG-offical car with DSE defines the "jbeamData.maxLateralAcceleration", non of them, so they use 12 as default. This means if the lateral acceleration caused by driver's input reaches 12m/s^2, the ESC will simply ignore further steering input.

    --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------​
    This game simulates ESC realistically since there are few games that demonstrate the actual limitations of ESC.
     
    #15 default0.0player, May 27, 2022
    Last edited: May 27, 2022
    • Like Like x 3
  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