Front Force Feedback not working with 4 wheel steering

Discussion in 'Programming' started by Olivier80, Sep 15, 2024.

  1. Olivier80

    Olivier80
    Expand Collapse

    Joined:
    Aug 20, 2024
    Messages:
    47

    When using 4 wheel steering with control modes, fully implemented, i did not find a solution to get force feedback working, for front axle.


    Let me explain first 4 wheel steering a bit as it is not something common :

    4 Wheel steering with control modes use two separate electrics values for steering inputs, one for front and one for rear. Those new signals are defined in a custom_4ws.lua file.

    We have :

    electrics.values.fw_steering_input (for front axle steering input)
    electrics.values.rw_steering_input (for rear axle steering input)


    Those signals take their values from :

    "electrics.values.steering_input"
    This is the main steering input, defined in BeamNG.


    and from

    "electrics.values.rear_steering"
    This is an auxiliary steering input, normally used for rear steering, but could be used too for front steering according to the selected steering mode. It is defined in a custom input json file.



    Then we have something that can be as simple as this inside custom_4ws.lua :

    electrics.values.fw_steering_input = electrics.values.steering_input * ffactor
    electrics.values.rw_steering_input = electrics.values.rear_steering * rfactor


    Where ffactor and rfactor are coefficients used to define steering modes.


    For 2 Wheel front steering, vehicles are not using those 4 wheel steering electrics signals, i have seen those two solutions in the front axle steering racks, hydros or torsionHydros :

    First solution :


    ["st2","st3","st4","f3ll", {"factor":-0.9,"steeringWheelLock":600,"inRate":5,"outRate":5,"inputSource":"steering_input"}],

    Second solution :


    ["st2l","st1r", {"factor":0.2, "steeringWheelLock":600, "inRate":1.0,"outRate":1.0}],


    Then if i want to implement 4 wheel steering with control modes, i need to modify the front axle steering hydros so that they can receive input from this signal :

    electrics.values.fw_steering_input.


    The problem is that if i try to replace "inputSource":"steering_input" by "inputSource":"fw_steering_input", Front steering is still working but loose Force Feedback.

    Same problem if i add "inputSource":"fw_steering_input" to this line :

    ["st2l","st1r", {"factor":0.2, "inputSource":"fw_steering_input", "steeringWheelLock":600, "inRate":1.0,"outRate":1.0}],

    Again in this case Front steering is working, but loose Force Feedback.


    How to send force feedback signal back to steering_input when using an intermediary electrics.values.fw_steering_input signal ?

    Thanks for helping







     
    #1 Olivier80, Sep 15, 2024
    Last edited: Sep 30, 2024
  2. Olivier80

    Olivier80
    Expand Collapse

    Joined:
    Aug 20, 2024
    Messages:
    47
    Seems that hydros.lua (inside BeamNG.drive\lua\vehicle) watch only for "steering_input" source input name to classify hydros as steering hydro and allow Force Feedback as well as steeringWheelLock input angle adjusts on them.

    Then i did modify hydros.lua, ligne 570 :

    Code:
    --h.inputSource = h.inputSource == "steering" and "steering_input" or h.inputSource
    replaced by :

    Code:
        h.inputSource = (h.inputSource == "fw_steering_input" or h.inputSource == "fw_left_steering_input" or
        h.inputSource == "fw_right_steering_input") and "steering_input" or h.inputSource
    FFB is working with this modification but source Input signal is lost : if the electrical signal fw_steering_input is set in the jbeam file, it is replaced by the steering_input signal.

    Any idea to get that working ? (FFB and 4 wheel steering).
     
    #2 Olivier80, Sep 29, 2024
    Last edited: Sep 30, 2024
  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