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

Differences in 2DOF tutorials?

Discussion in 'DIY Motion Simulator Building Q&A / FAQ' started by James Robbie, Jun 14, 2017.

  1. James Robbie

    James Robbie Active Member

    Joined:
    May 23, 2017
    Messages:
    111
    Occupation:
    IT Specialist
    Location:
    New Zealand
    Balance:
    538Coins
    Ratings:
    +64 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hi all,

    I am completing my first 2DOF build (https://www.xsimulator.net/community/threads/first-diy-2dof-attempt.10333/) and making the dive into motion. Once question i have wondered is can there be end performance gains based on coding?

    The two tutorials I am referencing in particular are:
    1. https://www.xsimulator.net/community/marketplace/arduino-code-2dof-and-2-pins-direction-hbridge.67/
    2. https://www.xsimulator.net/communit...3dof-motor-driver-and-windows-utilities.4957/

    Yes I understand the 2nd thread is based on a 3DOF build but I am basing my build off this as it seems to be the most popular and if I want to expand, I have the choice. But with a slightly different wiring schematic between the two, that obviously means different code and a potential for things to communicate differently.

    Obviously any game will always output the same information and I understand hardware is the biggest variable but, if all hardware was equal, can there be a noticeable end performance difference based on arduino code?
  2. RandomCoder

    RandomCoder Active Member Gold Contributor

    Joined:
    Feb 19, 2017
    Messages:
    185
    Occupation:
    Control Engineer
    Location:
    UK
    Balance:
    1,674Coins
    Ratings:
    +142 / 0 / -0
    The short and simple answer is yes, the way in which the program is written can have a significant impact on the performance of your motion sim.
    I haven't compared the two programs you have referenced and so my answer is not targeted toward them in any way.

    The processor has several operations that must be performed repeatedly every loop of the program. It has to manage communications (game data), process a variety of inputs including positional feedback from the drives and control the outputs accordingly.
    Some programs may have additional features such as controlling the accel/decel of the motor output, range limiting, filtering of the positional feedback etc.

    The main loop should be kept as clean as possible so that the code remains responsive e.g some optimised code might only check for new serial data every 'x' number of scans instead of every scan for example.