1. Do not share user accounts! Any account that is shared by another person will be blocked and closed. This means: we will close not only the account that is shared, but also the main account of the user who uses another person's account. We have the ability to detect account sharing, so please do not try to cheat the system. This action will take place on 04/18/2023. Read all forum rules.
    Dismiss Notice
  2. For downloading SimTools plugins you need a Download Package. Get it with virtual coins that you receive for forum activity or Buy Download Package - We have a zero Spam tolerance so read our forum rules first.

    Buy Now a Download Plan!
  3. Do not try to cheat our system and do not post an unnecessary amount of useless posts only to earn credits here. We have a zero spam tolerance policy and this will cause a ban of your user account. Otherwise we wish you a pleasant stay here! Read the forum rules
  4. We have a few rules which you need to read and accept before posting anything here! Following these rules will keep the forum clean and your stay pleasant. Do not follow these rules can lead to permanent exclusion from this website: Read the forum rules.
    Are you a company? Read our company rules

Experimental DCS Plugin ready for testing

Discussion in 'Digital Combat Simulators (DCS)' started by Dirty, Jun 28, 2019.

  1. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    ...and no worries, I will remove the offensive language in the next version :) But I couldn't help myself and wanted to make sure that everyone seriously wanting to use Euler angles had to go through at least that semi self humiliating process of setting those variables to true themselves :)

    Try to see the funny side of it :)
    • Like Like x 2
    • Funny Funny x 1
  2. T R Para

    T R Para i make stuff up

    Joined:
    Oct 18, 2018
    Messages:
    385
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    2,436Coins
    Ratings:
    +357 / 2 / -0
    My Motion Simulator:
    AC motor, 6DOF
    Thanks Mr. Dirty. I will edit the script after dinner.. You plugin with wind is the best...:thumbs
    • Like Like x 1
  3. gianlu320

    gianlu320 Member

    Joined:
    Feb 9, 2018
    Messages:
    76
    Location:
    Crawley
    Balance:
    542Coins
    Ratings:
    +17 / 0 / -0
    Can somebody explain how is the roll supposed to work in this plugin?
    I will try to explain...
    I am using only simtools and no other motion cueing software.
    My rig is a racing cube so I have pitch, roll, heave and yaw
    I can properly set all the forces apart from roll that is giving me some headache.

    I am setting roll so when I bank left, the motion platform banks left and when I bank right the motion platform banks right.
    But I need to apply some gain and also smoothing otherwise without gain and smoothing the roll feels good but it's not very responsive at low speed.
    When I apply gain, this is what happens, I start a roll manoeuvre left or right, when I am done with the roll manoeuvre and I stop applying pressure on the stick, the motion platform will start rolling back towards the center but will overshout the center and bank the opposite direction and then I need to wait for the return to kick in and recenter the motion platform.
    The roll itself feels perfect with the right amount of gain, return and smoothing but it feels weird to be banked the opposite side at the end of the roll manoeuver waiting for the return to slowly recenter.

    anybody any idea what is happening here?
  4. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Hey :)

    the roll channel uses the angular rate of the aircraft around its longitudinal axis.

    As you start to roll into a turn, the value goes up (or negative, depending on the direction).
    As you are rolling into the turn, the value stays up.
    As you are approaching the desired bank angle, the value goes down.
    As you are banked in the turn, the value stays zero.
    As you start roll out of a turn, the value goes negative (or positive, depending on the direction).
    As you are rolling out of the turn, the value stays negative.
    As you are approaching wings level, the value goes down.
    As you are wings level, the value stays zero.

    The number you're getting represents how many degrees/s the aircraft has "rolled" during the last frame. That does not necessarily have anything to do with the bank angle. If you want to use that number in a sensible way, you should use a washout filter and a single order lowpass.

    If the rig overshoots after a roll into a turn, then there must have been a roll rate present in the opposite direction at that moment.

    I know, it sounds counter intuitive, but the end of a left roll indeed feels exactly like the entry of a right roll.

    Cheers... Dirty :)
    • Informative Informative x 1
  5. gianlu320

    gianlu320 Member

    Joined:
    Feb 9, 2018
    Messages:
    76
    Location:
    Crawley
    Balance:
    542Coins
    Ratings:
    +17 / 0 / -0
    @Dirty

    Thanks a lot for the explanation, but I still don't have it clear why my rig behaves like this on roll.
    I understand roll is an angular rate and I shouldn't have talked about bank in my post to keep things easy and not confusing.

    I am using a low pass filter, I believe smoothing in simtools is exactly this.
    I am also using washout gain (high pass) plus return to recenter.

    Now let's say I start a left roll (not a full 360 degrees roll) and the motion platform will incline to the left.
    When I reached my desired attitude into the simulator and I don't want to roll anymore I remove pressure on my stick and the stick recenters.
    In this moment the motion platform starts rolling back towards the center and this is correct.
    But My problem is that my motion rig doesn't stop in the center, it overshoots the center and initiates a bank in the opposite direction.
    This bank will be then washed out slowly by the simtools washout.

    What I don't understand is this last bit, I don't understand why the motion platform when returning to its center doesn't stop there but overshoots the center and banks the opposite direction.

    Sorry, I hope my post makes sense.
  6. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Ah, now I got it :)

    Great, then we are on the same page :thumbs

    The short answer is: What you're seeing is the intended behaviour of the roll channel. Probably just not tuned right. The reasons why it may feel odd could be that the point of rotation is not optimal or the filters are not set right. I do not use SimTools or Mover, so I really can't be of much help with those programs.

    Are you using VR or screens? I noticed that with screens, you can still see the room. So you might think it FEELS wrong when in fact it's the visuals that LOOK wrong.

    If you want to understand why it overshoots:
    The washout does it's "washing out" by gradually fading-in a bias to make the rig return to center during a constant roll. When you stop the roll, the angular rate drops to zero, but that bias is still there. It is exactly this bias which is still present that pushes you over to the "other side" until the bias itself fades back to zero.
    It makes sense: Like I said, ending a roll feels like starting a roll in the other direction. It actually feels good on my 6DOF rig with VR (no outside reference).

    Try to change the filters. Change the washout, or the smoothing. Increase it, decrease it, play around! Or start trying without any filter, then SLOWLY add in some...

    Dirty :)
  7. gianlu320

    gianlu320 Member

    Joined:
    Feb 9, 2018
    Messages:
    76
    Location:
    Crawley
    Balance:
    542Coins
    Ratings:
    +17 / 0 / -0
    Thanks a lot for that...

    Now everything is clear, you explained perfectly the difference between the angular rate and the bias!

    Yes I am using VR, and I will continue to play with the filters until it feels right.

    Thanks a lot and also thanks for this plugin, it rocks!!
    • Like Like x 1
  8. gianlu320

    gianlu320 Member

    Joined:
    Feb 9, 2018
    Messages:
    76
    Location:
    Crawley
    Balance:
    542Coins
    Ratings:
    +17 / 0 / -0
    @Dirty

    One last question, probably an obvious one to many...

    Talking about Heave,
    Which direction does the motion platform move when I apply positive G's? (pulling the stick)
    I have mine set in this way.
    I pull the stick, positive G's, my motion platform moves down, towards the floor.
    I push the stick, negative G's, my motion platform moves up, towards the room ceiling.
    Is this correct?
  9. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    No :)

    Put that question in my software thread because it is not actually related to the plugin. I will answer it there tomorrow, but gotta go now.
  10. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    I will also explain why both directions can feel somewhat plausible when the filters are set wrong :)
  11. gianlu320

    gianlu320 Member

    Joined:
    Feb 9, 2018
    Messages:
    76
    Location:
    Crawley
    Balance:
    542Coins
    Ratings:
    +17 / 0 / -0
    @Dirty

    Sorry for posting in the wrong thread
    I now posted it in your software thread

    Thanks
  12. janio

    janio janio from brazil

    Joined:
    Feb 28, 2020
    Messages:
    81
    Occupation:
    state employee
    Location:
    belo horizonte
    Balance:
    184Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    hello, somebody help me here, i have a 2 dof platform, i installed this plugin, only with sim tools and when i launch the dcs the telemetry that goes to the platform is only input data from the control, when i apply a tilt on the platform holl accompanies, but if I take the pressure of the stick the plane remains inclined as it should be, but the platform returns to the center because the entry value returned to zero.
  13. MarkusB

    MarkusB Well-Known Member Gold Contributor

    Joined:
    Jun 30, 2015
    Messages:
    552
    Location:
    Germany
    Balance:
    4,212Coins
    Ratings:
    +594 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    @Dirty has explained this behavior in much detail. See here: https://www.xsimulator.net/communit...n-ready-for-testing.13560/page-10#post-205642
    • Agree Agree x 1
  14. janio

    janio janio from brazil

    Joined:
    Feb 28, 2020
    Messages:
    81
    Occupation:
    state employee
    Location:
    belo horizonte
    Balance:
    184Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    thanks Marku B, I had read it but I did not understand the dynamics of the sampling of the values, now I understand, but I think it is not correct for the platform to return to the center if I do not have the washing filter applied. I expected the platform to remain tilted along with the plane as long as we maintain the attitude at 80º for example so that I continue to feel the g-force on my side and when I press the stick to undo the roll and return to level flight, then at that moment the platform to return to the center, along with the plane's turn.
  15. T R Para

    T R Para i make stuff up

    Joined:
    Oct 18, 2018
    Messages:
    385
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    2,436Coins
    Ratings:
    +357 / 2 / -0
    My Motion Simulator:
    AC motor, 6DOF
    you need to edit the script. Change the "false" argument to "true" .

    If you absolutely insist on using Euler angles instead, you can open the export script that resides in SavedGames/DCS/Scripts/Hooks and set these three variables to true:

    Code:
    YouAbsolutelyInsistOnUsingEulerAnglesOnYawEvenThoughThatMakesNoFuckinSense = true
    YouAbsolutelyInsistOnUsingEulerAnglesOnPitchEvenThoughThatMakesNoFuckinSense = true
    YouAbsolutelyInsistOnUsingEulerAnglesOnRollEvenThoughThatMakesNoFuckinSense = true
    It will give you Euler angles exported (Yaw, Pitch, Roll).
    • Agree Agree x 1
    • Informative Informative x 1
  16. Dirty

    Dirty Well-Known Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    736
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    7,826Coins
    Ratings:
    +859 / 2 / -0
    Hey @janio,

    At first glance it may seem like the joystick input is sent to the platform, but that is NOT the case :) It is the roll rate of the aircraft that is used to drive the rig. In normal flight those are somewhat correlated (because it is the control input that eventually generates the roll rate), still not the same.

    Option 1: (for men)
    Try to understand what a person in the cockpit actually feels. You cannot feel bank (Euler angle), at least not while flying in an aircraft. You can also not feel the angular rate of the vehicle directly. What you CAN feel very well are angular accelerations. The change of the change of the angle around the vehicle axises. Yes, there are two "changes" in that sentence :) However, this data is not directly available for export, so what a motion cueing software does is this: Use the angular rate, which is available, send it through a high pass filter (aka "washout", to get a signal that fades back to zero after a while), then use a single LP to convert the angular rate into an angular position for your rig to use. It might seem counter intuitive at first glance, I understand.

    Option 2: (for chicken)
    Go to SavedGames/DCS/Scripts/Hooks and open the export script in a proper code editor. Change the three long variables called "YouAbsolutelyInsistOnUsing......" to "true".
    Screenshot 2020-09-21 at 20.58.47.png

    It will give you Euler angles exported, so you will get the behaviour you're looking for, but at the very least you should do a full 360° roll and a full 360° loop to be aware that Euler angles come with some severe ...well... artefacts, for lack of a better word. Try it out.

    AFAIK, @value1 in his plugin has implemented some "anti-rollover" functionality, that mitigates the problem.


    Your Choice :)
    • Informative Informative x 1
  17. janio

    janio janio from brazil

    Joined:
    Feb 28, 2020
    Messages:
    81
    Occupation:
    state employee
    Location:
    belo horizonte
    Balance:
    184Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    thank you @Dirty and @T R Para, it has been hard to get things in tune, a lot to read in English and I speak Portuguese, the translation sometimes makes it difficult, I will read your software thread and see if it gets clearer, but I think your suggestion editing the script will get me on the right track. I am most grateful for your commitment to help.
  18. janio

    janio janio from brazil

    Joined:
    Feb 28, 2020
    Messages:
    81
    Occupation:
    state employee
    Location:
    belo horizonte
    Balance:
    184Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    hello, I accessed the indicated folder, which has 2 scripts, export.lua and export.simback, and none of them contain these variables.
    "-- Works just after every simulation frame.
    do
    local PrevLuaExportAfterNextFrame=LuaExportAfterNextFrame
    LuaExportAfterNextFrame=function()
    Myfunction:AfterNextFrame()
    if PrevLuaExportAfterNextFrame then
    PrevLuaExportAfterNextFrame()
    end
    end
    end "
    am i with the wrong export.lua?
  19. T R Para

    T R Para i make stuff up

    Joined:
    Oct 18, 2018
    Messages:
    385
    Occupation:
    Retired
    Location:
    Cincinnati, Oh
    Balance:
    2,436Coins
    Ratings:
    +357 / 2 / -0
    My Motion Simulator:
    AC motor, 6DOF
    Do not modify the "export.lua"
    You modify the SimTools_DCS_Exp_Hook_v009.lua script.
    It is located in the
    Hooks directory...

    Go to your "C" drive and open the" users directory".

    Double click your users name.
    When that directory opens you should find the directory "saved games"
    Open that directory and you should have a "DCS" directory.
    Open the "DCS" directory and you should have a "Scripts" directory
    Open the "Scripts" directory and you should see a "Hooks" directory.
    Open the "Hooks" directory and copy the lua script below into it.


    Be sure to unzip the file below . There is the LUA script inside.

    I have already changed the script for you...
    Good luck my friend.:thumbs

    Attached Files:

    • Informative Informative x 1
    • Friendly Friendly x 1
  20. janio

    janio janio from brazil

    Joined:
    Feb 28, 2020
    Messages:
    81
    Occupation:
    state employee
    Location:
    belo horizonte
    Balance:
    184Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    interestingly I don't have the "hooks" directory, the last folder in the hierarchy is the scripts folder and inside it is the export.lua file.
    any more options you know?