1. Trouble with the game?
    Try the troubleshooter!

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

    Dismiss Notice

Correct Traction Control Logic

Discussion in 'General Discussion' started by default0.0player, Mar 22, 2020.

  1. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    As of 0.18, the traction control compare diagonal opposed wheel, i.e FL to RR and FR to RL wheels, which is incorrect because the TCS will not work when both of the diagonal wheels lose traction that is quite common in both front and rear open differential vehicles such as the eSBR.

    look into the "D:\Program Files (x86)\Steam\steamapps\common\BeamNG.drive\lua\vehicle\controller\esc.lua", note these in line 997 to line 1000
    Code:
     --TCS
      crossWheels[frontLeftWheelId] = rearRightWheelId
      crossWheels[rearRightWheelId] = frontLeftWheelId
      crossWheels[frontRightWheelId] = rearLeftWheelId
      crossWheels[rearLeftWheelId] = frontRightWheelId
    
    To solve the problem, edit them to
    Code:
    --TCS
      crossWheels[frontLeftWheelId] = frontRightWheelId
      crossWheels[frontRightWheelId] = frontLeftWheelId
      crossWheels[rearRightWheelId] = rearLeftWheelId
      crossWheels[rearLeftWheelId] = rearRightWheelId
    Then the problem solved
    The Hirochi Sunburst Sport S AWD has a viscous tansfercase that is FWD unless wheelspin, and both the front and the rear differentials are open diffs. It can now pass AWD test that only one rear wheel has grip. BeamNGdrive-018419588-RELEASE-x642020_3_2217_57_18.png BeamNGdrive-018419588-RELEASE-x642020_3_2217_57_29.png
     

    Attached Files:

  2. Diamondback

    Diamondback
    Expand Collapse
    Vehicle Systems Lead
    BeamNG Team

    Joined:
    Apr 8, 2014
    Messages:
    1,957
    Hey,

    I appreciate you're poking around in the game files. :)
    However, this approach is in fact less "correct" than what the game ships with. The traction control is optimized to correctly control the vehicle under hard acceleration, which is something you lose this way.
    Looking at diagonal wheels for detecting slip is something that is also done IRL and it works very reliably unless you run into something that can make all 4 wheels slip equally fast (like the eSBR).

    This sort of torque can't be controlled correctly with this kind of control logic, which is why the new system I'm developing is using something more advanced most of the times.
     
    • Like Like x 1
    • Informative Informative x 1
  3. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,925
    Thanks for your reply, I understand this. It should use both of the logics.
    Speed difference between FL-RR or FR-RL wheels are too large → reduce throttle
    Speed difference between FL-FR or RR-RL wheels are too large → brake the faster wheel.
     
  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