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

My RC Servo MG90S 6DOF Test

Discussion in 'DIY Motion Simulator Projects' started by RaaR, May 12, 2025 at 10:21.

  1. RaaR

    RaaR New Member

    Joined:
    Apr 25, 2025
    Messages:
    1
    Balance:
    - 54Coins
    Ratings:
    +1 / 0 / -0
    Hi, I've been working on a 6DOF scaled-down model to really see what I'm getting myself into. I've been obsessed with building a full-size one but didn’t want to fully commit until I could get a scale model working.

    There were a couple of other examples floating around, but I had a hard time following them. As someone who has never coded or worked with a circuit board before, I stumbled through this quite a bit. Hopefully, this will help someone else. I wrote this somewhat as a guide, but I'm still figuring it all out—so feel free to let me know if I’m wrong. FYI, I have not optimized this by any means; I was simply looking for in-game motion.

    I have a little youtube short, but i think i need 3 posts to link it.



    1000008588.jpg

    The basic model is 3d printed. I am using the following parts
    - 3D printer & PLA
    - (3) M3 all thread rods 350mm cut in half
    - (12) M3 tie rod end or ball joint
    - (6) MG90S Servo motors
    - M3 bolt and nut set
    - Dupont jumper set Male to Males
    - Bread Board
    - Elegoo Uno R3 (arduino clone)
    - DC power supply
    - Simtools v3
    -Live for Speed
    -FreeCAD

    Other Misc tools and notes:

    If you buy all-thread rods that need cutting, a hacksaw is tough to use since the small threads bounce the blade around. I ended up using an angle grinder, then spent a good amount of time filing the ends so they would thread smoothly into the M3 ball joints. Wear safety glasses!

    For the servos, you want the metal gear ones (MG). The plastic ones (SG) are junk—you can probably guess how I figured that out.

    A set of calipers is helpful if you need to make adjustments. The USB-B (printer-style) cable that comes with the Elegoo is comically short. If you don’t have one lying around, it’s worth grabbing one.

    I didn’t use one, but a tiny wrench or M3 socket would have made life easier. I was able to pinch the nuts hard enough to tighten them with a screwdriver—that was a fun sentence.

    The bolts I used all take a PH1 head; you can make a normal Phillips screwdriver work. This project also gave me an excuse to buy an electric hobby screwdriver.

    Also getting the first few rod connections made is frustrating, take a few tries. May be easier to thread the holes with a M3 bolt then try with everything connected.

    Base and Horns:
    I uploaded a ZIP with some FreeCAD files and STL versions. The FreeCAD files are helpful if your printer prints a bit “fatter” than mine or if your slicer software differs. You may need to adjust hole sizes for the bolts, MG90 holders, and M3 slots.

    You’ll want to ensure the holes in the printed parts can thread an M3 bolt.

    • Top Plate
    • Bottom Plate
    • A Clamping Horn
    • MG90S Vertical Holder (You may want to test this before printing the base plate; the base plate took over an hour for me.)


    Screenshot 2025-05-11 224532.png

    Assembly:
    1. Start with the base plate. Screw in the servos using the screws they came with. The base plate should have holes small enough to catch the threads.

    2. Power up the Arduino and upload the code. This should position all servos to 90 degrees, allowing you to clamp on the horns. It will be easier to attach the ball joints before clamping.

    3. Screw in the rods and ball joints for the top plate.

    4. Screw through the ball joints into each top plate starter hole.

    5. Decide which way you want it to face. It should point with two horns facing each other—see my first picture. I drew a triangle on the base plate to indicate the direction. You’ll have one set of rods at the back and two sets on the front sides.

    6. Label your servos with the pin numbers they’re attached to. It’s easier to change the Arduino code than to move physical pins around.

    1000008563.jpg

    Arduino
    :
    I used the code below after a lot of time with ChatGPT and reading what others did. I got stuck for about three days figuring out that arrays don’t work well with SimTools. Every time I clicked "Test," it would assign a random servo to a random axis.

    The gist of the code is that it names each of the six servos A–F. A being the Axis1a on the simtools diagram, front right.

    You connect the yellow command wire from each MG90S to the Elegoo Uno R3 digital pins (3, 5, 6, 9, 10, 11).

    The Code then Assigns A-F servo to your pin number. If you need to change the servo pin to match the correct axis. all you do is change the number in the code on these lines "servoA.attach(6);"

    When laying out the servos in SimTools, start from the front right as Axis 1 and go clockwise around the hexagon, ending at the front left, as if you are driving. I didnt notice this in a Axis diagram at first.

    Also, I noticed in my picture the jumper for pin 10 fell out when I moved it.


    1000008599.jpg

    You’ll need external power to run all six servos. Basically, you need a “bench power supply”—just an adjustable DC power supply set to 5 volts. As the servos move, they’ll draw current, and you can watch the amps being pulled.

    On the breadboard, the servo power and ground come in directly. The two orange wires connect to the Arduino’s 5V and Ground pins. The bottom two red and brown wires are the incoming power supply.


    1000008600.jpg 1000008601.jpg

    Code:
    #include <Servo.h>
    
    // Define servos
    Servo servoA;
    Servo servoB;
    Servo servoC;
    Servo servoD;
    Servo servoE;
    Servo servoF;
    
    void setup() {
      Serial.begin(115200);
    
      // Attach servos to specific pins
      servoA.attach(6);
      servoB.attach(5);
      servoC.attach(3);
      servoD.attach(10);
      servoE.attach(11);
      servoF.attach(9);
    
      // Neutral startup
      servoA.write(90);
      servoB.write(90);
      servoC.write(90);
      servoD.write(90);
      servoE.write(90);
      servoF.write(90);
    }
    
    void loop() {
      while (Serial.available() >= 2) {
        char servoName = Serial.read();   // Expecting 'A', 'B', 'C', etc.
        byte value = Serial.read();       // Value from 0 to 255
    
        int angle = map(value, 0, 255, 0, 180);
    
        switch (servoName) {
          case 'A': servoA.write(angle); break;
          case 'B': servoB.write(angle); break;
          case 'C': servoC.write(angle); break;
          case 'D': servoD.write(angle); break;
          case 'E': servoE.write(angle); break;
          case 'F': servoF.write(angle); break;
          default: /* Unknown identifier, ignore */ break;
        }
      }
    }
    SIMTOOLS v3:

    I want to preface this by saying I’m not an expert, and some of this might not be 100% correct. Feel free to correct me. This was the hardest step for me, as most documentation out there is for older versions of simtools.

    You’ll need to download the serial plugin and Live for Speed. FYI: You need to run Live for Speed and finish a race to create a config file before installing the plugin. I’m not sure if that’s still required, but I did it just in case.

    For the interface output: A<Axis1a>B<Axis2a>C<Axis3a>D<Axis4a>E<Axis5a>F<Axis6a>
    This is feeding your Arduino output for Axis1a to servo A, and so on.

    I have the startup and shutdown set to R0 to reset the horns to 90degree.
    ChatGPT told me to do it, it works, im not sure why, may link back to the Servo.H library

    You should now be able to click Test Settings and move Axis 1—the correct motor should move. If not, change the Arduino code for servo A to match to correct pin.

    For example, on my setup, Servo pin 6 is Axis 1. Axis 1a-6a comes from the SimTools diagram. SimTools takes Axis1a and sends it to Servo A in the Arduino code.

    Screenshot 2025-05-11 215338.jpg


    Once you get Axis1a through Axis6a matched correctly:

    1. Click the House Icon (top right) > Hover over Live for Speed (LFS) > Click the three wavy lines.
    2. Enter in your dimensions, should be the same.
    3. Click the "Sim Config" Cogwheel to access the Axis DOF assignment, use the drop downs to assign, see my picture.
    4. Save and test. You can now move the sliders for roll, pitch, etc.
    Write down the motions you observe. For example, if you slide "Roll" and it “heaves,” make a note of it. Go through each axis slider this way.

    If something doesn’t match, you’ll need to reassign forces. For instance, if you slid “Roll” but the platform heaved, go back to the Axis assignment and swap them until everything behaves as expected.

    Also, note that I reversed the direction on all my axis settings because the movements were initially backward.

    Finally, launch LFS, start a race, and click the Play button in SimTool, it should be moving with the game.

    Screenshot 2025-05-11 215420.jpg

    Screenshot 2025-05-11 215404.jpg

    Some Final Thoughts
    If I were to do it again, I’d raise the baseplate to allow more motion and clearance. I’d also add a hole in the center to run wires underneath. Right now, my base plate is just sitting on a screwdriver box.



    Attached Files:

    • Like Like x 1