Help with Traction Control and Differentials.

Discussion in 'Programming' started by Braskus, Mar 14, 2023.

  1. Braskus

    Braskus
    Expand Collapse

    Joined:
    Aug 19, 2013
    Messages:
    180
    Hi,

    I'm trying to put electronic locking and torque vectoring differentials on an offroad oriented vehicle and am having trouble getting them to lock up correctly. As far as i can tell some traction control code is required for them to function. Part of the problem being that there is no information as to what the values do and i haven't found a wiki for this stuff. I have a mod for a 4wd where it has functioning electronic locking differentials and i exported an automation vehicle with them and that also works. But both of these seem to be using pretty basic code. It's also possible i am trying to put to much torque through the differentials(up near 1,000nm) so i need more locking force but it doesn't have that line like an LSD normally has.

    Sorry for the text wall i have no idea how to word this correct. Hopefully somebody can help.
     
  2. Leo Zieger

    Leo Zieger
    Expand Collapse

    Joined:
    Jan 12, 2023
    Messages:
    828
  3. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    2,057
    You can either program the electronics yourself(without DSE)like this and this (you can borrow my code anyway), or use BeamNG existing eDiff logic like this.
    For additional information, please inspect the differentials of the FCV and modern ETKs
    If you are using BeamNG's existing eDiff logic, first you need to have DSE installed on your vehicle.
    For brake-actuated locking of open diff, you need to have an open diff and "electronicaDiffLock" controller. As shown in this FCV's example
    Code:
        "controller": [
            ["fileName"],
            ["drivingDynamics/actuators/electronicDiffLock" {"name":"lockFront", "differentialName":"differential_F"}]
        ],
        "powertrain" : [
            ["type", "name", "inputName", "inputIndex"],
            ["torsionReactor", "torsionReactorF", "transfercase", 2],
            ["differential", "differential_F", "torsionReactorF", 1, {"deformGroups":["differential_F"], "diffType":"open", "uiName":"Front Differential","defaultVirtualInertia":0.25}],
        ],
    For electronically-controlled LSD or locking diff, you'll need to have an activeLock differential and an "activeDiffLock" controller As shown in this 800's example
    Code:
        "controller": [
            ["fileName"],
            ["drivingDynamics/actuators/activeDiffLock" {"name":"lockRear", "differentialName":"differential_R"}]
        ],
        "powertrain" : [
            ["type", "name", "inputName", "inputIndex"],
            ["differential", "differential_R", "driveshaft", 1, {"deformGroups":["differential_R"], "diffType":"activeLock", "uiName":"Rear Differential","defaultVirtualInertia":0.25}],
        ],
        "differential_R": {
            "friction": 3.92,
            "dynamicFriction": 0.00184,
            "torqueLossCoef": 0.03,
        },
     
  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