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

3DOF with Pitch, Roll and 360º Yaw - Pulley Actuator System

Discussion in 'DIY Motion Simulator Projects' started by danalog, Oct 29, 2013.

  1. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    You will need to make a change to the receive routine, It expects a checksum at the end of each packet received. As far as I know SimTools doesn't support this (can someone confirm?). An easy fix is just to change the Arduino code to look for a fixed char instead of a calculated checksum.

    Change from this:
    Code:
    bool CheckChecksum() //Atmel chips have a comport error rate of 2%, so we need here a checksum
    {
        byte checksum=0;
        for(int z=0; z < 3; z++)
        {
            byte val=commandbuffer[z];
            checksum ^= val;
        }
        if(checksum==commandbuffer[3]){return true;}
        return false;
    }
    
    To This should do the trick:
    Code:
    bool CheckChecksum() // Check for "E" as the packet end byte
    {
        if(commandbuffer[3]=="E"){return true;}
        return false;
    }
    
    SimTools setup strings will then be:

    X<1><Axis1>E
    X<2><Axis2>E

    And setup Simtools to send 10bits of binary data.

    This software is very X-Sim "integrated" and as such you will need to work out alternate ways to tune your PID etc, unless you just use the defaults setup. As suggested above there is other Arduino code available that will require less customisation.

    By the way... Just to be contraversial, I disagree with the comment in code (and random comments around the site) about the Arduino coms interface to be unreliable.
    • Like Like x 1
  2. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Thanks @RufusDufus, I'm actually reworking @RacingMat's Arduino code now.

    Trying to wrap my head around that code. So far I've clean it up and started adding docblocks. The code needs better documentation and better naming of variables and functions. I'll add the Github link in a few minutes.
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    14,538Coins
    Ratings:
    +975 / 8 / -1
    Great... that will be very useful.
  4. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Here's the cleaned up code in a new repository for the "Arduino code for dynamic playseat 2DOF" code:
    https://github.com/daankortenbach/arduino-2dof-for-simtools

    If anyone likes to join in and add comments in the code to clarify what is what and rename variables and functions to more human readable names... feel welcome to fork and do a pull request.

    For my specific project I have created another Git repository here:
    https://github.com/daankortenbach/arduino-mega-3dof-pitch-roll-360-yaw-for-simtools

    In this repository I'm rewriting the code for a sliding seat mover with added 360º yaw.
    • Like Like x 2
  5. eaorobbie

    eaorobbie Well-Known Member Staff Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,582
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,087Coins
    Ratings:
    +1,666 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
  6. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Thanks @eaorobbie. Those are hex files, not usefull for my project (3DOF). I'm reading all Arduino code I can find and learning while I go. The code cleanups I'm doing are part of the learning process to get myself familiarized with coding for Arduino. Luckily it looks a lot like PHP so it's pretty easy to learn as I'm fluent in PHP. Information on all the forums is very scattered which makes it a bit more difficult. For instance the SimTools documentation is pretty good but still misses some steps. I know those steps are probably obvious for everyone who already went through the whole process but for me as first-timer it's hard to figure it out.

    I mean the steps after SimTools. Like what gets send to the Arduino, how does that work? How does the Arduino code capture what it receives. Once I know that I can program new, or rework existing, code.

    The schematic I'm working with:
    Code:
    ------------
    | SimTools |
    ------------
         |
         V
         |
    -----------     ------------
    | Arduino | -<- | Feedback | Hall effect sensors (two linear, one 360º)
    -----------     ------------
         |     One Arduino Mega - Here I need code for 3 axis (pitch, roll and 360º yaw).
         V
         |
    -------------
    | H-Brigdes | Two Monster Moto shields
    -------------
         |
         V
         |
    ----------
    | Motors | Three motors (two linear, one 360º)
    ----------
    
    Basically what I need to know is this:

    - How do I setup SimTools for pitch, roll and 360º yaw?
    - What gets send to Arduino?
    - How does the Arduino code capture what it receives?
    - How to get a 360º axis to work in Arduino?
  7. eaorobbie

    eaorobbie Well-Known Member Staff Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,582
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,087Coins
    Ratings:
    +1,666 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    All steps are contained in the docs mate, Arduino is not, that is a custom thing that is too arcade in 8 bit limits the sim motion feel, and unless you set the code properly to run it lags behind badly, Been working with them for two years, I actually prompted the use of them in xsim and found anymore than 2 dof caused major lag in code and motion, been down this road a long time ago, if wanting more than 2 dof , run 2 ards they cheap enough.
    You have some cool ideas thou and could prove me wrong, I welcome that, as I use it for dashboard contruction, where it performs , OK, but wish it was more than a 8 bit unit.
    Right to your questions, since our ard expert hasn't replied yet, he will.

    How do I setup Simtools for Pitch Roll and Yaw(which most plugins give a 360 angle or 180)
    Simple follow the Axis Assignments in the Doc, and set roll, pitch for 2 axis and Yaw on your third.

    What gets sent to the Ard.
    Well that's depends on what your code needs remembering its only 8 bit (0-255).
    As in my Servo code needs Rxxx~Lxxx~ where xxx is a value of 0-255 which simtools creates from the axis assignments and game data. R is Right servo L is Left Servo. And its protocol is 8,N,1 output is decimal and its 8 bit.
    Actual Simtools code is R<Axis1>~L<Axis2>~
    Yes my code uses a basic checksum to fix the bad ard serial interface, not that common of a problem in the Uno R3 they fixed it. Years ago it was pretty piss poor.

    How does the Arduino code capture what it receives?
    Ok the Ard receives it one char at a time hence the R as an indicator of actuator used and ~ as a checksum to let it know that's the last char. Take a gander at my Ard UNO Sim Model, should be ok as a base for ya to build off as it is expandable to 6DOF, plus it receives in Asc format ie 1 comes in as a value of 49 so you need to remove 48 or 'O' from the value to read the real value, explained in my code.

    How to get a 360º axis to work in Arduino?
    Need to use a 360 deg pot and write the code to actually receive the full values , shouldn't be hard, just never bothered myself.

    Hope that helps , please excuse my negativness on the Ard as said spent a year tearing hair trying to get it to handle axis at high speed, About the best one I found was Prilads and that was after a year of coding it myself, which I tossed in the bin in the end, Jrk beat it badly couldn't compare them at all.
  8. eaorobbie

    eaorobbie Well-Known Member Staff Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,582
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,087Coins
    Ratings:
    +1,666 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Talk to racingmat his the ard man,
    Or take a gander at my servo post.
  9. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Thanks for explaining all this. Very helpful and please feel free to criticize.

    Did you know about this simple dual pwm circuit? I didn't, but thanks to you I went googling for it :)
    With this circuit you can combine two 8-bit PWM outputs into one 16-bit PWM output. It was designed for audio applications but maybe it can be used for our kind of use as well.
    pwm_16b_sm.jpg
    It's explained here: http://www.openmusiclabs.com/learning/digital/pwm-dac/dual-pwm-circuits/

    I'll look into the costs of creating three such circuits, can't be much as the components are extremely simple.
  10. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Small update. We're still prototyping... Not much news.

    We bought a Rock 'n Ride for cheaps. We're going to test a few prototype actuators and wiper motors on it.

    rock-n-ride.jpg
    • Like Like x 1
  11. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    Forget wipers on this, another member is sorting big worm gear motors to move it and is looking at a pulley system and also 12v boat winch motors http://www.xsimulator.net/community/threads/rig-design-overloads-motor.4993/ . id be surprised if wipers even cut the mustard on this.
    • Like Like x 1
    • Agree Agree x 1
  12. RaceRay

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,654
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    25,031Coins
    Ratings:
    +1,690 / 10 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    Nevertheless good to hear that you are still working on the project!
    • Like Like x 1
  13. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    I agree regular wipers won't cut it when used directly.

    But... I've found out those worm drive motors from Motion Dynamics are also used in many types of Mercedes'. They're easily sourced from scrap yards or can be bought new with delivery times of just one day without the insane transportation costs from Australia to The Netherlands that Motion Dynamics needs to add to the base price.

    Correct me if I'm wrong as the whole Nm to Kg/cm is a bit daunting to me but the following calculation showed me that there should be enough force to do it.

    Worm Gear Motor ZD1631 max 35Nm, max 65 RPM (same as many Mercedes wiper motors, mumbling-something-about-quality-mumblemumble)
    http://www.motiondynamics.com.au/worm-drive-motor-12v-70w-45-65-rpm-6-35nm-torque.html

    35Nm to Kg/cm = ~357 Kg/cm (http://www.convertunits.com/from/N-m/to/kg-cm)
    Motor/reduction is 60 RPM (I'm rounding down the 65 RPM max to 60 RPM for easy calculation).

    We're aiming for a maximum linear speed of 20cm/s.

    So here goes:
    20 cm circumference = 6.36 cm diameter
    6.36 / 2 = 3.18 cm radius
    35Nm = 357 kg/cm
    357 / 3.18 = 112 kg

    Again, please correct me if I'm wrong with this calculation.

    There are some rounding errors in this and there are probably some losses in the gearing and such so lets be safe and reduce the 112 Kg to 100 Kg.

    That's 100 Kg force at 3.18cm from the heart of shaft.

    Now we can translate the rotational force to a linear force by several methods:
    - Pulley system
    - Gear/chain

    In theory it could push 100kg at 20 cm per second.

    Pulley system
    The experiments with pulley systems we did showed it will only work if there is enough friction on the driving pulley, which is quite hard to achieve and generates losses by itself. You need a couple of windings and/or more pulleys, which reduce the speed. In all situations it adds friction which converts power to heat and we don't want that. It is possible though but not with wiper motors (the reduction on these is too much for this method).

    Gear/chain method
    Luckily gears and chains are extremely easy to source in The Netherlands. Maybe you've heard but we Dutchies all ride bicycles and mopeds and as such there's repair shops all over the place. Moped gears and chains are strong and gears close to a 6.36 cm diameter are available.

    So, what we want to experiment with now is wiper motor rotational force to linear force with the gear/chain method. Adding a shaft to this to create a linear actuator is trivial.
    • Like Like x 3
    • Agree Agree x 1
    Last edited: Dec 28, 2013
  14. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    • Agree Agree x 1
  15. Rivelino

    Rivelino New Member

    Joined:
    Sep 28, 2013
    Messages:
    1
    Occupation:
    ENG- Automatics& Aplied Informatics
    Location:
    Popesti-Leordeni,ILFOV,ROMANIA
    Balance:
    411Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor
    Hi and Happy NewYear to everybody.
    Now i find your project , after i have that ideea too.
    I'm thinking to simple design wich is already created.
    A gyroscope:
    [​IMG]
    Starting from an ideea from the guys in Brasil.
    Computer will be under the seat,1 smal monitor(posible with 3d googles with headtracking).
    Connections will be created by customs sliprings contact(i have ideea how to create this rings).
    For 360 degree you'll need 360 degree non-contacting rotary position sensor(digital 12 bits- is good for game stop or pause to come to Zero positon slowly )
    http://www.digikey.com/product-detail/en/6127V1A360L.5/987-1389-ND/2620658
    Also i wish to make it with VFD's with magnetic brake.
    In game simulation we need X,Y,Z position extraction , not pitch ,roll,yaw , because this is only forces not positions.
    For ex: FMS in X-sim have Plane position(i see it in their plugin).
    My ideea is: Game give position->Simtools->Ardu boards or PicAxes->Sim try to corelate position based on game compared with his.
    I will order this type of rotary sensors and start to play with them.

    Hope to be usefull.
    Rivelino
    Last edited: Jan 10, 2014
  16. AceOfSpies

    AceOfSpies Living the Dream!

    Joined:
    May 8, 2012
    Messages:
    260
    Location:
    Kilwinning, Scotland
    Balance:
    19,614Coins
    Ratings:
    +243 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    Hi and Happy NewYear @Rivelino, ambitious project! I look forward to seeing your progress. Good Luck.:thumbs

    Mike
  17. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    @danalog , thanks for the info. There are lot of motor similar to the motion dynamics I have seen. Some off ebay and now the merc wiper. Now without actually buying them all and pulling them apart, it seems the Aussie sold motors are strong and especially the gearbox. A few people have stripped out the gearbox gears due to weaker material on the ebay types. Once again, without comparing them all,I cannot 100% advise. The motors themselves all seem to run similar, just the gearbox. As you have mentioned, traditional wipers are designed for wiping windows, not being harshly changed in direction, hence chomping them out. Done that myself.
    As for gearing down, good idea for sure. I must have a look into that myself for the motors I have. There is a plastics engineering place nearby, so I will price up some custom gears. Also I can get good prices at the local bearing shop for boss gears and chain .
    You theory of 20cm - 200mm persecond is a good fast speed, still suitable for racing car sims and flight.
    It will be interesting to see how this all goes.
    Cheers, David.
  18. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    Bought some new prototype stuff to figure out how to get SimTools to play nice with Arduino.

    First is a shield for the Arduino. It provides 16 PWM outputs, each 12bit. Should do the trick to offload the Arduino and bypass the limited PWMs the Arduino has.

    IMG_3287.jpg

    Second, I bought 6 miniature servos with feedback wire. Added a SD card in the picture to show how tiny these servos are.

    Why 6 servos? So I can also prototype for a 6DOF :)

    IMG_3289.jpg
    • Like Like x 1
    Last edited: Jan 18, 2014
  19. danalog

    danalog Motion Sim Wannabee

    Joined:
    Nov 28, 2012
    Messages:
    47
    Occupation:
    WordPress Geek, Virtual Reality Nut
    Location:
    Bussum, Netherlands
    Balance:
    468Coins
    Ratings:
    +39 / 0 / -0
    The reason why Mercedes has these stronger wiper motors is that some models have a single wiper, not two. I've had three 80s/90s E-Class and now a 90s/00s C-Class that also has one wiper. Both of these cars, as well as the time period S-Class have those wiper motors. I'm going to visit the Mercedes scrap yard to get a broken wiper motor, hopefully for free, to see what gears they have. I'll report back on it.
  20. bsft

    bsft

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
    The wipers gears should be fine, they may even last. I know of a wiper 2DOF that is still going after over 3 years and that was using 2nd hand wipers on it. Mind you, I did set it up so as the motors had a bit of load on them using springs to help keep the gearing in a constant mesh.
    I only suggest the Aussie motors as they have proven themselves to be incredibly strong, especially in the gearing. The ebay gearboxes have been chewed out by 2 people I know of with motion sim use.
    Wiper motors are designed to run in one direction, not being constantly changed back and forth, but give them a good thrashing anyway.