1. 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 Download Package Now!
  2. 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
  3. 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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

my 2DOF +/-30 degrees tilting chair mosim

Discussion in 'DIY Motion Simulator Projects' started by steveh2112, Oct 14, 2016.

  1. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,482
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    101,790Coins
    Ratings:
    +8,478 / 41 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Now that you have it working once you get the basic motion profile done for DCS you can start to explore some of the more advanced things like filters, as they are really useful for flight sims.

    Normally you would use the Washout filter to assist simulating doing something that your rig can't actually do, like a full roll or loop. But personally I have found I have more control how the rig reacts using Smoothing.

    I know you are messing with DCS but it is also worth giving FSX or Prepar3D a go, as @value1 kindly modified the plugin to have pitch and roll be continuous, which is way better in VR, see @Archie's guide to getting the most out of the settings options: https://www.xsimulator.net/community/faq/prepar3d-guide-to-realistic-motion-settings.144/
  2. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    thanks. i like FSX for one big reason, i wrote a really cool mission, an air race around yosemite park in an extra300 aero plane. problem is, FSX doesn't run in VR without that flyinside addon thing right? i tried it a while ago and was not impressed with the graphics, maybe its better now. how is prepar3d and VR?

    i guess not good https://www.reddit.com/r/oculus/comments/3na3mb/how_is_the_native_oculus_mode_of_prepar3d_v3/
    seems like flyinside is the only way to go at the moment
  3. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,482
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    101,790Coins
    Ratings:
    +8,478 / 41 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    FlyInside is the way to go for VR support and Prepar3D is my pick, but FSX works well also.

    What is great is how the plugin works for VR flight simming, much like it does for Elite Dangerous.
  4. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF


    i'll make another video later showing the details and how i configured it all

    notice that the oculus sensor is fixed to the rig and its working perfectly, my VR view is spot on, no weird effects at all, really feels like in in the real world in there

    UPDATE:

    so i've had a bit of time to fly around and a couple of things i notice. first off, awesome! well worth the effort to build this thing.

    i'm flying my vegas air race which i made a video about a while ago


    you can see on the mosim video, when i go vertical climb, at some point the roll starts reacting strange. i'm sure this is DCS that's detecting roll in a near vertical is not very specific, but the motion sim doesn't know that, so it shakes me around, which isn't very realistic.

    however, when i come over the top of the loop and pull a positive G to head straight down, it feels very realistic, so overall, pretty good.

    the other thing is when i'm doing a tight banking turn, the mosim is banking (rolling) as its supposed to, but in real life of course, you wouldn't feel that, you would feel g forces pushing you down hard into the seat.

    now obviously, i have no way to simulate 5 G of downward force, so i guess there is no answer for this problem.

    just wonder if any setup advice? maybe instead of using roll in the axis assignment, i use something else?

    and the other thing is, you know if you've been on a boat for a while and you get on dry land and you feel like you are still moving? we'll i'm sitting at my desk now and i feel like i'm still flying!

    UPDATE, i fixed these issues here
    https://www.xsimulator.net/communit...s-tilting-chair-mosim.9181/page-3#post-118497
    Last edited: Nov 22, 2016
  5. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,482
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    101,790Coins
    Ratings:
    +8,478 / 41 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Great to see you got it moving.

    The VR after effects are likely caused by the sim motion not being fast and accurate enough to match what your brain expects. You could try less total axis travel.
  6. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    i like the range of travel especially on the pitch axis, when you are heading straight up or down it feels very realistic.

    roll doesn't feel as realistic as i mentioned above, and is also a bit uncomfortable. but its not so much that i need the seat belt i put on there, turns out that was a bit of overkill.

    also, no motion slickness at all, but i'm usually ok with DCS anyhow, i guess i'm just used to it in VR.

    i got a steering wheel and dirt rally a couple of weeks ago but after 5 mins of play i'm usually sick as a dog. can't really say i enjoy it in VR to be honest, but i guess my next trick is to mount the wheel to the mosim and see how that feels.
  7. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    i just tried smoothing, the thing is, in normal flight with pitch less than +/- 45 degrees it feels great already without smoothing. the problem seems to kick in at extreme pitch angles of about +/- 60 deg pitch and above (i mean airplane pitch, obviously the sim can't do that).

    is there a way to smooth or limit the roll axis only when the pitch is in the extreme range?

    i could probably mod the exports.lua file that gets installed by the DCS pluging, but it would be easier if there was a configuration options somewhere
  8. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,482
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    101,790Coins
    Ratings:
    +8,478 / 41 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  9. obobo

    obobo Active Member

    Joined:
    Nov 8, 2016
    Messages:
    248
    Location:
    France
    Balance:
    1,262Coins
    Ratings:
    +76 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    It is impressive to see the result of the angles taken
  10. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    i just spent some time on that but i'm not sure its what i want.

    anyhow, i ended up modding the export.lua from the original plugin and so far i'm happy with the results

    i added the following lines

    if pitch > 30/57.295779 then
    bank = bank*0.5
    elseif pitch > 60/57.295779 then
    bank = 0
    end

    right after local pitch, bank, yaw = LoGetADIPitchBankYaw() in AfterNextFrame

    the effect is to reduce roll by half above 30 degree pitch and remove roll all together above 60 degree pitch

    it improves the feeling when going into a vertical climb

    anyhow, i have more stuff to try but i have to go work on my paying job for a while so back later

    steve
  11. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    hi everybody, i've fixed all the jumping and jerking around problems at extreme pitch and roll (for DCS)

    if you want to try it, install the standard DCS plugin, not the one from riftflyer, then go to your DCS scripts directory, mine is at C:\Users\me\Saved Games\DCS.openalpha\Scripts

    exit your export.lua and change the body of AfterNextFrame to this

    *******************************
    AfterNextFrame=function(self)

    local altRad = LoGetAltitudeAboveGroundLevel()
    local pitch, roll, yaw = LoGetADIPitchBankYaw()
    local accel = LoGetAccelerationUnits()

    -- convert to degrees to make the math easier
    pitch = pitch * 57.295779;
    roll = roll * 57.295779;

    --dbg_file:write(string.format( "p=%.1f r=%.1f ", pitch, roll))

    -- STEVE reduce roll by when pitch > 45deg
    if pitch > 45 then
    local multiplier = 1- (pitch-45)/30
    if multiplier < 0 then
    multiplier = 0;
    end
    roll = roll*multiplier
    --dbg_file:write(string.format("PITCH>45: p=%.1f r=%.1f m=%.3f ", pitch, roll, multiplier))
    end

    -- STEVE returns roll back to zero as it passes +/- 90 degrees to avoiding the -179 to 179 flip that occurs in a full roll
    if roll > 90 then
    roll = 180 - roll
    --dbg_file:write(string.format("ROLL>90: p=%.1f r=%.1f ", pitch, roll))
    elseif roll < -90 then
    roll = -(180 + roll)
    --dbg_file:write(string.format("ROLL<-90: p=%.1f r=%.1f ", pitch, roll))
    end

    --dbg_file:write(string.format("\n"))

    -- reduce forces on ground
    if altRad < 3 then
    accel.x = accel.x * 0.25
    accel.y = accel.y * 0.25
    accel.z = accel.z * 0.25
    end

    my_send = socket.protect(function()
    if c then
    -- socket.try(c1:send(string.format("%.3f; %.3f; %.3f; %.3f; %.3f; %.3f;\n", pitch*1000.0, bank*1000.0, yaw*1000.0, accel.x*1000.0, accel.y*1000.0, accel.z*1000.0)))
    socket.try(c:send(string.format("%.4f; %.4f; %.4f; %.4f; %.4f; %.4f;\n", pitch/57.295779, roll/57.295779, yaw, accel.x, accel.y, accel.z)))

    end
    end)
    my_send()

    end,

    *******************************

    if you want to run the debug printouts, add this to the Start function
    dbg_file = io.open(lfs.writedir()..[[Logs\dbg.txt]], "w")
    dbg_file:write(string.format("start ok\n"))

    so what this does, is when pitch goes over 45 degrees it attenuates the roll factor, which as you can see from the log file below, goes a bit nuts when pitch is over 60+ degrees. this makes vertical climbs and loops much smoother

    then the next bit fixes the flip that occurs when doing a 360 degree rolls. when roll goes past +/- 90 deg, it rolls it back to zero at 180, so there is a smooth transition from +179 to -179 deg

    with a VR headset on, both fixes feel quite natural. i've done about 40 hours of aerobatic flying in real life so i have an idea how it feels, and this feels pretty good (- the G forces. maybe my next fix, a G seat)



    in the axis setup in game engine i originally limited the pitch and roll scaling at 40% because of those extreme pitch and roll jerky issues, but now that its much smoother, i can use 60%, so i get a bit more range and aggressiveness than that video now

    i just added the .lua file here but because i can't upload .lua files i called it .lua.txt. to use this, change your export.lua to export.bak or whatever then change export.lua.txt to exports.lua

    this is a major improvement over the standard DCS plugin

    Attached Files:

    • Creative Creative x 1
    Last edited: Nov 22, 2016
  12. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    here is the description of how i built it and set it up


    its working great now so time for some flying, until my next project!

    most of the build time was waiting for china post, and most of that, the Arduino board. i would say the mechanical work was about 4 days, the electronics, 1/2 a day and software setup and tuning, 2 days.

    of course, had i seen my video before had, i could have cut that in half

    steve
    • Like Like x 1
    Last edited: Nov 24, 2016
  13. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    hi, i'm back, my sim is running fine but i've noticed one motor has a lot of play in the worm drive. this is powered down, not connected to anything, i can wiggle the shaft about 10 degrees with almost no resistance before i feel the torque from the worm drive. my other motor doesn't do that at all.

    do you think it a manufacturing problem or something i maybe did? it should be resilient to been driven against a dead stop (which happened a few times during set up) right?

    https://www.motiondynamics.com.au/worm-drive-motor-12v-24v-200w-180-rpm-20nm-torque.html
  14. noorbeast

    noorbeast VR - The Next Generation Staff Member Moderator

    Joined:
    Jul 13, 2014
    Messages:
    13,482
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    101,790Coins
    Ratings:
    +8,478 / 41 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    I have had one 60:1 wormdrive gearbox spread teeth on the metal gears, resulting in unwanted play above what is normal. The 25:1s have plastic gears and it is pretty easy to pop one open to check for damage.

    All wormdrives have a little play and this is what normal play looks like, in this case with 50 & 60:1s:

  15. steveh2112

    steveh2112 Member

    Joined:
    May 12, 2014
    Messages:
    104
    Occupation:
    semi retired
    Location:
    Phuket, Thailand
    Balance:
    1,023Coins
    Ratings:
    +21 / 0 / -0
    My Motion Simulator:
    2DOF
    ok, thanks, i'll open it when i have time. i contacted the supplier but they basically said 'fair dinkum mate', i think that means shit happens
    • Like Like x 1
  16. Brennan

    Brennan New Member

    Joined:
    Nov 14, 2017
    Messages:
    10
    Location:
    Virginia
    Balance:
    163Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi SteveH, I installed your export.lua in my DCS saved games script folder, but I am still getting jerky motion when flying in DCS 2.1. Do you have any other tips for fixing this issue?

    Not sure if it is a axis setting issue, filter issue, or .lua

    Thanks for any help!
  17. Moe Colontonio

    Moe Colontonio Member Gold Contributor

    Joined:
    Dec 9, 2017
    Messages:
    32
    Location:
    New Jersey USA
    Balance:
    276Coins
    Ratings:
    +5 / 0 / -0
    My Motion Simulator:
    3DOF
    Man I cannot thank you enough! I have been searching all over to find a workable plugin for DCS that doesn't throw me out of the seat when I roll or loop! I used your export.lua you posted and it's great. I still have no YAW, were you able to make that work?