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.

Writing a motion cueing software from scratch.

Discussion in 'DIY Motion Simulator Projects' started by Dirty, Feb 28, 2019.

  1. apointner

    apointner Siddhartha

    Joined:
    Aug 16, 2014
    Messages:
    95
    Location:
    N 48° 9'0.88" E 12° 5'45.84"
    Balance:
    616Coins
    Ratings:
    +29 / 3 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    I will never understand how something like this works, without ripping everything apart! :D
    • Funny Funny x 1
  2. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    748
    Location:
    berlin
    Balance:
    4,987Coins
    Ratings:
    +215 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF
    Maybe you just allow 3 shorter legs and the kinematic should follow.

    I was considering this design back than but I am afraid the collision possibility due to hight of the gearboxes and shorter legs could gives you a pretty poor performance.
    • Informative Informative x 1
  3. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    748
    Location:
    berlin
    Balance:
    4,987Coins
    Ratings:
    +215 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF
    I would disagree.

    My experience shows me that what gives you a good performance is the ratio base / upper platform and the length of the leg.

    This „two stage“ System can’t perform well IMHO

    Also I would not put the cranked systems as less performing in general. Quiet the opposite.

    Do the test @Dirty with a base diameter of 120cm upper platform of 100cm and levers of 35cm (yes 35 yes it’s possible with AC servos from Teknic)

    You could reach almost 1 Meter heave with such cracked geometry. Imagine the size of the room you would need if you would get such performance with linear stuff.

    Best
  4. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    748
    Location:
    berlin
    Balance:
    4,987Coins
    Ratings:
    +215 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF
    I agree this sin cosine in cranked math is quite fascinating. Almost hypnotizing as a camp fire. :)
    • Agree Agree x 1
  5. Zed

    Zed VR Simming w/Index Gold Contributor

    Joined:
    Apr 4, 2017
    Messages:
    861
    Location:
    USA
    Balance:
    4,586Coins
    Ratings:
    +849 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Thanks, hexpod! Might be the easiest reason yet. I guess nothing is free.

    Cheers!
  6. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    You're right! I Agree with literally everything you said. They both have their strengths and weaknesses. And the range of motion you can achieve with crank arms is certainly impressive. In my post I was focussing on only that one single aspect of crank arm systems: There is an additional joint and that builders should be aware of that.

    I might as well phrase it the other way around: You need good (big) joints to avoid the rig from becoming shaky. Linear actuators can get away with small (cheap) balljoints , cause all forces on the actuator are always "in-line" anyways.

    If I remember correctly, you have these huuuuge 40mm-ish balljoints,.... NICE!!!!! :thumbs
    • Like Like x 1
  7. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    He there, :)

    made a little progress and put some new features in the software:
    - Softstart/stop with "cosine" crossfade
    - Crash detection and recovery working flawless (that was tricky!)
    - Rig configurations can be saved/loaded
    - Crank arm systems implemented (albeit no output to controller yet)
    - Plenty of optimisation done. That was urgently necessary.
    - View panning possible

    The crash detection and recovery was a feature that surprised me, because it was very easy to do badly, but really difficult to do good.

    Outputting the commands for crank arm systems is still on my list, but thus far what kept me from making progress is the fact that I still have absolutely no Idea what in that context a "full stroke" even is!?!
    I think I am nearing a point where the software can actually be used:thumbs My first actuator will be ready for testing late this month, I guess. The other 5 may follow early 2020 and then it's rig building time. :grin

    Cheers... :)
    • Like Like x 2
  8. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    Ups,... forgot to link the video :blush

    • Like Like x 1
    • Winner Winner x 1
  9. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,029
    Location:
    Portugal
    Balance:
    7,964Coins
    Ratings:
    +1,074 / 13 / -0
    My Motion Simulator:
    6DOF
    Hi,

    That crash detection is interesting. I'm trying to filter the spikes on crashes, I would like people to feel them, but limit the impact.

    So my idea is to remove sudden changes in values, or a low pass filter.
    So I made what I call:

    LDYNLP a linear dynamic low pass filter and a EDYNLP an exponential dynamic low pass filter.
    The logic here is to adapt the number of samples used in the low pass, to the variation of the value.
    So if we get a crash with a high value variation, the values are filtered with an higher intensity low pass filter, keeping lower variations original.
    We can define a multiplier for the number of samples. While in the linear it's just the difference between last filtered value and the new value, in the exponential that difference is ^2.
    I need to make more tests, but it seems to work good. So we can crash and we are not killed by the rig, and we can keep using it without restarting it.

    Curious to see the final rig! Those motors are powerful and fast!
    • Like Like x 1
  10. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    640
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    4,084Coins
    Ratings:
    +291 / 4 / -0
    My Motion Simulator:
    6DOF
    Great to see your progress!

    I've been thinking a lot about my rig, and the fact that we still didn't have Huey "on-ground" detection working is really bugging me since that's the main sim I'm building for. =(

    Too many things to do, my head is spinning!
  11. hexpod

    hexpod http://heXpod.xyz

    Joined:
    Apr 18, 2016
    Messages:
    748
    Location:
    berlin
    Balance:
    4,987Coins
    Ratings:
    +215 / 2 / -0
    My Motion Simulator:
    DC motor, 6DOF
    LDYNLP is a fantastic addition and works really great for “in air” heave in xplane.

    I played a bit with two values of EDYNLP but I wasn’t able to get what’s going on in there.

    What kind of application you imagine for the EDYNLP ?
  12. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    640
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    4,084Coins
    Ratings:
    +291 / 4 / -0
    My Motion Simulator:
    6DOF
    That filter sounds like a great addition. I've generally kept the crash detection turned off on my sim because it's a lot of fun sometimes! I have trusted my sim to take the punishment with the settings I was using that capped all cues at a certain threshold but sometimes it was a bit much.
  13. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    That's ambitious, but interesting!

    So far, my crash-paradigm was to conservatively "detect and cop out". I have thought about "detect and mitigate", but eventually I imagined how the guy from the German Aviation Authority (LBA) would ask me how I would ensure occupant safety. I feel a lot more confident being able to say "I block all values above a certain threshold and keep the rig in the last good state" rather than "I will give the occupant the ride of his life, making him feel as good as possible what it would feel like to crash in an airplane" :-D

    ...if I were the examiner, I'd immediately ask how that mitigation would behave if it was used to simulate the impact of a space capsule on Mars at 23km/s.

    I will certainly try out the different filters you made, and would love to learn more about them, but for the actual build I will have to stay on the conservative side.

    Those motors are powerful indeed. I actually ditched the Clearpaths for them.

    Cheers, Dirty :)
    • Like Like x 1
  14. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    I think the experience in the Huey will be great regardless of wether the devs will add an "OnGround" variable for the Helos. After all, in the sim engine they interact the landing skids with the ground and thereby generate the accelerations and angular rates needed to feel the contact.

    In my view, DCS' OnGround variable is great for "knowing" but not required for "feeling" the touchdown.

    Dirty :)
    • Informative Informative x 1
  15. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    640
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    4,084Coins
    Ratings:
    +291 / 4 / -0
    My Motion Simulator:
    6DOF
    Hello Dirty!

    I know the Huey ground detection is there because SimShaker for Aviators has a working touchdown cue in the Huey. I just need to find out what it is.

    I very definitely disagree with you on the usefulness of the on-ground detection but decided to forego the wall of text. I'll be happy to argue...erm.. debate it with you if you want! I've got plenty of examples that I'm absolutely confident in for you to debunk and prove me wrong. =D

    Edit: I agree that it's much less important in the Huey and Gazelle than every other aircraft in DCS. Still I'd very much like to disable or drastically reduce low pass filters when "on-ground".
    Last edited: Dec 2, 2019
  16. Dirty

    Dirty Active Member Gold Contributor

    Joined:
    Oct 15, 2017
    Messages:
    338
    Occupation:
    All the way up front.
    Location:
    Germany
    Balance:
    3,684Coins
    Ratings:
    +355 / 1 / -0
    Here's my reasoning, let me know if you disagree.
    1. Filters only matter in dynamic situations where values change.
    2. After touchdown the Helo is in a static situation.
    3. --> Therefore filters will not make a difference after touchdown.
    I could understand if planes needed different filters after touchdown, because there is still so much "going on" while on the runway. I guess I will have to buy a DCS Helo to see for myself in Nutkicker :)

    Cheers, Dirty :)
  17. Trip Rodriguez

    Trip Rodriguez VR Pilot

    Joined:
    May 8, 2016
    Messages:
    640
    Location:
    Lake Ariel, Pennsylvania
    Balance:
    4,084Coins
    Ratings:
    +291 / 4 / -0
    My Motion Simulator:
    6DOF
    I accept your challenge!

    For helicopters, one of the most significant things a motion simulator can do for you is let you feel exactly what the ship is doing as you "pick-up" off the ground.

    As you increase collective you input corrective control on the cyclic to try to keep her level so that when you lose contact with the ground she doesn't try to take off in any given direction.

    Being able to feel the helicopter tilt as it gets light on the skids is fantastic for maximum realism and can even help to improve your technique.

    If you are landing on somewhat uneven ground you also want to feel the skid touch the ground at one corner and feel it tilt as you lower it onto the ground. If tuned for proper feel in flight this tilting will be much too subtle.

    And lastly, there is the touchdown "bump" in general. If I touch down a little harder than I'd like I want to feel it. =) If I tune to feel that bump then turbulence or rapid collective input changes will be too 'sharp' in the air.

    These three things are some of the best parts of having a motion sim for helicopters IMO!

    Still, I agree that having the on ground/in air trigger is more important on any aircraft that taxi's with wheels on the ground (which includes the Ka-50 and upcoming Mi-24 helicopters in DCS). Due to all the above however, I won't be happy until I figure out the "on ground" trigger for the Huey!