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 Now a Download Plan!
  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. 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

6 DOF from scratch

Discussion in 'DIY Motion Simulator Projects' started by Pierre Lalancette, Dec 18, 2016.

  1. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,167
    Location:
    Oklahoma City, USA
    Balance:
    16,036Coins
    Ratings:
    +1,830 / 32 / -1
    If removing the heating system is an issue a solution is to move the house to Florida or the like :D.
    • Funny Funny x 1
  2. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Of course, why didn't I thought about it before?
    Maybe instead, the sim could heat up the basement?
    No, if I run on 220V, it is so it produce less heat.
    There is no easy solution.
  3. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    I always get hot while in the sim wearing a VR headset, so just don't run both at the same time. Problem solved :). But why do you need 220V?
  4. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    220v are using less current than 110V.
    But motors are running on DC current, so, this running joke is pretty useless.
    Motor do run back and forth, but then, it's DC 24V.
    So I guess, 220v is really useless, but funny.

    I did a few run with Dirt Rally.
    Calibration ain't too bad.
    Motion Cancellation did not work because it took me a sweet time to find the seat reset (space + left crt). Motion cancellation on the seat is right behind my head. No good. Have to find a better way to attach it on the side, without obstructing my controls.
  5. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    Why does it not work near your head? I though the closer you could get it to your head the better?. I have only done some simple tests with my pimax controllers 'Valve' (seemed to work fine) as I did not need cancellation on my G sim and did not have any controllers before that.
  6. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    When I said behind my head, I meaned my head is between it and the base station. No good for tracking
    Also, on a test a long time ago, I found out that the seat induce quite a lot of vibration into it, because it is a flexible component.

    The best way is on my side, seen by the 2 bases station, locked tight on the carbone fiber platform.

    But it hard to find a solid structure that will not interfere with my controls. If it's not execively strong, it will induce vibration.
  7. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    That makes sense. I plan to mount my controller on a substantial rigid steel support at head height just behind my seat. The exclusive support will be directly attached to the rear actuator attachment point. Hopefully this will minimise any unwanted vibration. Not that far away from testing it out.
  8. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    If this is with a double bases Lighthouse Vive system, I recommend to put it on the side of you at about shoulder height. Somehow, when I tested behind me, near the platform, even if both station saw the controller, it gave me poor result compare at my side. My only guess is that more detectors were seen by the bases.

    Then again, if both bases see it and plenty of its detectors are seen, you should be fine.
  9. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    Yes the new V2 lighhouse. The controller will sit slightly above the seat and should have a clear view to both bases - so hopefully all will go OK... we will see.
  10. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Spend the owl evening setup to set up Dirt Rally and Mover for it. I followed the instruction video made by pmvcda (Thanks @Flymen ).

    FlyPT Mover

    It is by far the best calibration I ever had so far with my sim. Need to do a video to see how much beating it takes while I play.

    dirt3.jpg
    • Like Like x 1
  11. sallerding

    sallerding New Member

    Joined:
    Jul 12, 2019
    Messages:
    15
    Balance:
    69Coins
    Ratings:
    +4 / 0 / -0
    Hi @flypt @pmvcda. Did you ever produce an Arduino sketch to interface between the flyptmover and serial (Arduino) boards? I searched but could only find one you prepared for wind for a fan output. I have recently started using the mover software and it’s very intuitive and have managed to setup so the 3D model moves perfectly in unison with LFS & Xplane 11. But when connecting a 6dof prototype with small Servos using Robert Lindsay’s sketch (modified for 6dof) I get erratic results which don’t seem to coordinate with the data output. BTW thx for such a brilliant piece of software.
  12. pmvcda

    pmvcda aka FlyPT

    Joined:
    Nov 3, 2010
    Messages:
    1,394
    Location:
    Portugal
    Balance:
    10,879Coins
    Ratings:
    +1,461 / 13 / -0
    My Motion Simulator:
    6DOF

    There's many people that don't understand how it works. Sorry if that's not your case and I misunderstood it.
    I will try to explain it somehow:

    The Arduino or the other controllers receive data by serial.

    The software (Mover, SimTools and others) on the pc generates and sends an array of bytes through the serial port, to the controller.

    Bytes are 8 bit values, that means a value between 0 and 255.
    Characters in the PC fit inside those 255 bytes you can see the ASCII table here, that relates a value (decimal) to a char.

    So, when you send data, you can write it just like plain text called decimal in Mover.
    But the most efficient way is in binary mode.
    What is the difference?
    In decimal if I want to send the value 200, I need 3 bytes, one for each char. Looking at the ASCII table, that would be 50, 48, 48
    In binary format, 200 fits in one byte. We just send one byte with value 200.
    Now imagine I want to send a big value in binary. If the value is bigger than 8 bits, it will use 2 bytes.
    If bigger than 16 bits, 3 bytes, and so on.
    Look at how binary is converted to decimal to better understand how it works.

    So the difference is already big here. We have two methods to send/receive data, and we need completely different ways to interpret it.

    Mover (and SimTools) allow the user to generate a string to define the way the data is sent.
    Actuators are identified by <Axis#> by default. So if you make a string like this:

    <Axis1a><Axis2a><Axis3a>

    and each axis uses a two byte size value, you would send 6 bytes to define the position in binary, or an amount of bytes that depends on the size of the numbers in ASCII chars.

    But we have a problem here!
    If the Arduino receives this data sequentially, how does he know what each byte means?

    If axis1 =1024, axis2=600 and axis3=12, we would receive in ASCII:

    102460012

    We need to send something to let the Arduino know where each value starts.
    So one of the usual ways to do it in ASCII is to send this:

    [a1024][b600][c12]

    Now, when the Arduino receives one byte, he adds it to it's string until he recognises it to pick the value.
    In binary, we can use other ways.
    For example, in my rig controller, I use 15 bits values for positioning. That uses 2 bytes.
    It would be the following bytes:

    4, 0, 2, 88, 0, 12

    Again, we don't know where it starts when we receive it in serial.
    I do it this way:
    Maximum value for 15 bits is those two bytes 32768, or the bytes:
    128, 0

    So the trick I do is to use 2 bytes with value 255.
    They can never happen on the values, so I use it as marker for the start of the data:

    255, 255, 4, 0, 2, 88, 0, 12

    So, if I receive two times 255, I know the next two bytes are axis1, next two more for axis2 and two more for axis3.

    Now we have to make the code on the controller to detect those starts and when they detect it, to read the values.

    So, resuming, it all depends on what controller you are using.
    You need to send the data in the format recognised by the controller.
    The sample I made for wind is pretty basic, because it uses just one byte for speed, so at each received byte, we read the speed, and there's no need to detect the start of info.

    If you want to see code with that detection, look at the code of my controller to detect the two 255 bytes here.

    Specifically this part:
    Code:
    // ===========================
    // Main loop running on core 1
    // ===========================
    // Here we get the simtools commands and make the actuator move
    void loop()
    {
      if (Serial.available())
      {
        bufferPrevious = bufferCurrent; // Store previous byte
        bufferCurrent = Serial.read(); // Get the new byte
        bufferCommand[bufferCount] = bufferCurrent; // Put the new byte in the array
        bufferCount++; // Change to next position in the array
        if(bufferCurrent==255 && bufferPrevious==255) bufferCount = 0; // Two 255 in sequence are the start of the position info
        if(bufferCount==NUMBERACTUATORS*2) // Having 6 bytes means we have the 3 positions and that we can update the pretended position
        {
          for (int n = 0; n < NUMBERACTUATORS; n++)
          {
            actuator[n][PRETENDED_POSITION] = map((bufferCommand[n*2] * 256) + bufferCommand[n*2+1], 0, MAXIMUM_BIT_VALUE, actuator[n][MINIMUM_POSITION], actuator[n][MAXIMUM_POSITION]);
          }
          bufferCount=0;
        }
      }
    
      // Update orders sent to motor driver
      for (int n = 0; n < NUMBERACTUATORS; n++) updateActuatorSpeed(n);
    }

    Sorry for such a long post in your thread @Pierre Lalancette
    • Informative Informative x 3
    • Like Like x 1
    Last edited: Oct 25, 2020
  13. sallerding

    sallerding New Member

    Joined:
    Jul 12, 2019
    Messages:
    15
    Balance:
    69Coins
    Ratings:
    +4 / 0 / -0
    Thx @pmvcda. I feel like I keep learning new concepts everyday . And thank you for your patience in putting together that very detailed and helpful response. On the prototype with the mini servos I don’t have a separate motor controller. It all runs through the Arduino (other than power). That’s why I was using @eaorobbie sketch which just seems to assimilate the serial data from the game to Simtools/Mover and allocates that data to each axis which are each assigned a separate pin on the Arduino. That explains why I sometimes see <255> in the axis string.

    so sorry @Pierre Lalancette for interrupting your thread. I will take the ideas from @pmvcda and if I look for further divine intervention I will shift to a different thread
  14. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    This is my thread? I was sure I was on the MOVER thread. LOL
    @sallerding , check out MOVER`s thread too! It's full of useful informations.

    https://www.xsimulator.net/community/threads/flypt-mover.13464/

    Since I'm here, as well talk about my rig.

    When doing the calibration of Dirt, I noticed a vibration in one of my actuator. Checking it out, I found out that a few of it screws were loose. So started a heavy search of every screws and bolt on the rig to find any loose part. It turned out there was quite a few. I will check it more often (than once after 2 years of use).

    And before anyone ask me, no I do not use lock tight on them. There is alway a high chance that I may have to service any of the actuator anytime. So I keep them easy to disasemble.
  15. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    I use either nyloc nuts or Loctite on every fastener in my rig, Note that Loctile comes in different strengths and is designed to be removed for maintenance. You could also drill and wire lock the fastener as well. Either method highly recommend for something that shakes as much as our rigs do.
    • Like Like x 1
  16. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Once again, I feel bad not doing things the right way. I will look into some Loctile to secure my rig.

    Yesterday, I did a video of Dirt Rally. I tried to do videos before with all Mover's information, but the videos were a 5fps. So, only my bad driving in my pyj.

    • Like Like x 2
  17. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,599
    Location:
    Newcastle Australia
    Balance:
    27,834Coins
    Ratings:
    +2,865 / 37 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 6DOF
    You should not feel bad, not everyone has knowledge on everything including myself - still learning :), especially if you did not work in industries that use all these products. It's really what this site is all about - gaining knowledge to build a better sim.
    • Agree Agree x 2
  18. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    No, I feel bad, because I had the knowledge, and the lazyness.:oops:
  19. C1500

    C1500 Active Member

    Joined:
    Nov 19, 2018
    Messages:
    109
    Location:
    Germany
    Balance:
    625Coins
    Ratings:
    +60 / 1 / -0
    My Motion Simulator:
    AC motor, 6DOF
    but that is also what makes you so sympathetic ;)
  20. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    817
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    6,648Coins
    Ratings:
    +791 / 6 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    What do you mean? Get out of my thread! I don't want to see you anymore!

    What? Not Pathetic? Ah! Sympathetic.

    Man, you're the best!