WIP Beta released Automatic 4WD/2WD & Locking Differential

Discussion in 'Mods and Skins' started by default0.0player, Oct 20, 2021.

  1. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,926
    There are some thread suggesting about an automatic locker.
    https://www.beamng.com/threads/auto-locking-differential.67164/
    https://www.beamng.com/threads/auto-4x4-and-diff-lock.55694/

    Repo download. The automatic locker mod is somewhat based on Detroit Locker or G80 "Gov-Loc" that only has two "modes": open and locked.
    The diff is purely mechanical, no g-sensor no throttle or connections to ECU. It has a centrifugally engaged rachet-sort of thing.
    In open this differential behaves exactly the same as any other open diff or locking diff in open mode. When the input torque is positive and the wheelspeed difference between two output shaft exceeds 100RPM, it'll lock. When in Locked mode the differential is 100% locked(not an LSD), the two wheels spin at the exact same speed. After that it can't determine when to unlock since the wheelspeed are always the same when locked. To unlock it, simply lift the accelerator or stop and wait, when the input torque is gone or the vehicle is stopped for a few seconds, the diff unlocks.
    For on-road driving, this diff works OK as it stays open when driving on good traction surface. On snow and ice, it locks right after wheelspin, faster than most if not all traction control. Since you won't be using high throttle when driving on slippery surface, the diff will unlock very quickly when you reduce throttle after getting unstuck. Spirited driving on streets is not recommended as the diff may lock immediately once the inner wheel slips in a high-g turn, leading to a sudden oversteer.
    For off-road driving, this diff works great in most situations, the locking is not smooth but very effective. On dirt or mud it's as effective as a locked differential, expectantly useful when climbing steep inclines. However, this diff is not very good at rock crawling. In rock crawling the vehicle is traveling much slower than the diff lock wheelspeed threshold, the diff may suddenly unlock when the vehicle is stopped in the middle of a crawl and the wheels may spin in the opposite direction because of open differential action, which leads to rolling backwards.
    The automatic 4x4 is easier than expected, since most if not all off-road trucks/SUVs are RWD when in 2WD, and when cornering, the front axle spins faster than the rear axle, this can be used as a "freewheel" to unlock the transfercase to 2WD to prevent driveline windup(axle binding). If the rear axle spins faster than the front axle, the wheel is slipping, engage 4WD. When in 4WD and the front axle output torque is negative, the 4WD disengages right before axle binding.
    autodifflockwork.png
     

    Attached Files:

    #1 default0.0player, Oct 20, 2021
    Last edited: Oct 22, 2021
    • Like Like x 2
  2. Stevecvash

    Stevecvash
    Expand Collapse

    Joined:
    Aug 15, 2013
    Messages:
    1
    Nice, Works in reverse too. Should nickname this Slip Then Grip. Possible to get sliders for tuning and possibly an LSD ver.?
     
  3. default0.0player

    default0.0player
    Expand Collapse

    Joined:
    Nov 30, 2018
    Messages:
    1,926
    The only tunable jbeam is "diffLockThresholdAV", which determines the wheelslip before lock, too low you may get driveline binding during normal cornering and too high the diff is not effective at locking. I might update sliders in the near future.
    No, this is not, and won't be an LSD, since automatic locking LSD is not realistic. There are many other versions that does not require custom lua.
    1. Manually locking LSD
    Code:
    "powertrain" : [
            ["type", "name", "inputName", "inputIndex"]
            //rear diff
            ["differential", "myDifferential", "myDriveshaft", 1, {"diffType":["lsd","locked"], "lsdPreload":150, "lsdLockCoef":0.25, "lsdRevLockCoef":0.125, "lockTorque":10000, "gearRatio":3.0, "friction":15}]
    ],
    2. Automatic "unlocking" differential.
    This type of differential's "default" mode is Locked, and only allows freewheeling of the faster wheels during turns. This means 100% torque to the slower wheel, and the faster wheel is effectively coasting in Neutral.
    Code:
    "powertrain" : [
            ["type", "name", "inputName", "inputIndex"]
            //rear diff
            ["differential", "myDifferential", "myDriveshaft", 1, {"diffType":"lsd", "lsdPreload":0, "lsdLockCoef":0.5, "lsdRevLockCoef":0.5, "gearRatio": 3.0, "friction":15}]
    ],
    3. Electronically controlled active differential
    This is essentially an LSD which the clutch is actuated by electronics, the BeamNG ETK800's "Sport Differential" works like that.
    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,
        },
    The activeDiffLock.lua is BeamNG official content, no custom/modded lua is needed.
     
    • Like Like x 1
  4. dontbeatmeXDLEL

    dontbeatmeXDLEL
    Expand Collapse

    Joined:
    Oct 25, 2021
    Messages:
    1
    I'm honestly not sure how to properly use a forum, but I actually made my first forum account to specifically thank you for making this mod, and to say that it works beautifully. In real life I have a mudding vehicle with a detroit locker in a 9in axle, and seeing the way that the tires click together while slipping gave me chills because it was so amazing. Great job on this mod, I truly love it, and I can't wait to see where you take it if you choose to.
     
    • Like Like x 1
  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