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

Question First Simulator 2DOF for flying games

Discussion in 'DIY Motion Simulator Projects' started by Diego Efrain Quintero, Mar 24, 2017.

  1. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi to the community i'm a little bit new in the world of simulators, i'm an electronics engineer and have been contacted by a friend to build a flying simulator, my friend is a mechatronic engineer, but till the moment i'm on charge of extracting data from simtools, i've been researching some similar projects at the forums and get some firmwares for arduino but can never stablish the connection between simtools and arduino even when i'm trying with the most knowledge like SMC3, so i decide to write my own code from zero, i do a simple code that read the roll and pitch but i can't get any data from simtools yet, i attach the image of my code and configuration, and add the code here, if someone can help me would be great, our goal is to build a simulator to play star wars videogames and flying simulators. Sorry for the comments in spanish is just our mother language so we can understand better the work. i hope to build my complete code and later release here at the forum, till the moment we are trying with an arduino uno r3, but maybe in a future could be use a fpga.

    CODE:
    //Declaracion de Variables
    char inchar; //Caracter lectura
    String string=""; //Cadena de lectura
    char O[8]; //Cadena para roll
    char I[8]; //Cadena para pitch
    int L=0; //Valor entero de roll
    int T=0; //Valor entero de pitch
    //Configuración del puerto serial y reservación de la variable String
    void setup() {
    // put your setup code here, to run once:
    Serial.begin(9600);
    string.reserve(48);
    }

    void loop() {
    // put your main code here, to run repeatedly:
    while (Serial.available()){
    //Lectura de caracteres
    //inchar=Serial.read() ;
    for (int x=0; x<3; x++){
    inchar=Serial.read();
    if (inchar=='R'){
    Serial.readBytes(O,2); //Lee los bytes de la variable Roll
    Serial.print("Roll:");
    L=atoi(O); //Lo convierte a entero
    Serial.println(L);
    }else if (inchar=='P'){
    Serial.readBytes(I,2); //Lee los bytes de la variable Pitch
    Serial.print("Pitch:");
    T=atoi(I); //Lo convierte a entero
    Serial.println(T);
    };
    };
    };
    }

    Attached Files:

  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,535
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,034Coins
    Ratings:
    +10,776 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    There are already plugins for the major flight sim games and guides to building plugins for SimTools.

    Can you explain further what you are aiming to do and why?
  3. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    First i'm trying to get the data (roll and pitch) from the simtools software to my arduino so i can later design my own code at the arduino a manage my motors with encoders but the simtools it seems to doesn't anything to my arduino, the rx led doesn't even blink while simtools is working even having the same rate in bauds and configuration, thanks for your reply noorbeast
  4. stevemontuno

    stevemontuno Active Member

    Joined:
    Apr 24, 2015
    Messages:
    316
    Location:
    UK
    Balance:
    1,721Coins
    Ratings:
    +335 / 0 / -0
    My Motion Simulator:
    2DOF
    What motor controllers are you using?
  5. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi Stevemontuno thanks for your interest we don't have any motor control until now we need to view the data on our serial monitor with the arduino and from that moment work in some controller or buy one but we have to be available to do the conection with the simtools and arduino, we write that minimal code but can't get the connection workings or see any data from the game
  6. stevemontuno

    stevemontuno Active Member

    Joined:
    Apr 24, 2015
    Messages:
    316
    Location:
    UK
    Balance:
    1,721Coins
    Ratings:
    +335 / 0 / -0
    My Motion Simulator:
    2DOF
    If your just using an arduino without motor controllers to test simtools you'll probably have more joy using a couple of RC servo's and @eaorobbie 's Arduino code.
    https://www.xsimulator.net/community/threads/rc-model-for-motion-simulation.4600/
    • Like Like x 1
  7. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    But the problem is that i can't get the data into my arduino with simtools, my arduino leds rx doesn't even blink when lfs and simtools are working, i need to get the data so i can start work with this data in the way to build my own way to control de motors that would be DC motors no steppers it's a requeriment from my partner, it's for a big structure. I would check that code too but i'm still trying to get the data in my arduino thanks for the link stevemontuno.
  8. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 38 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Are you building a sim for yourself, or a commercial build? I also cannot believe both a Electronics and Mechatronics Engineer cannot get an Arduino with SMC3 loaded talking with simtoolso_O.
    • Agree Agree x 2
    Last edited: Mar 27, 2017
  9. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,917Coins
    Ratings:
    +1,285 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    If you're using SimTools 2.x then the usual error comes again and the output settings should be like this buddy ...

    Configuracion.png
    • Agree Agree x 2
    • Informative Informative x 1
  10. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    We are building a sim for ourselves maybe if we get something really really good will be considered to use it for commercial but till the moment is a project for ourselves, i know it's hilarious we couldn't get the smc3 working, i'm just the only one working with the arduino and i don't have a lot of experience with them i'm more into fpga world and vhdl, i will test the speedy answer and comeback to comment my results thanks again to the both for your support
  11. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hey Speedy that information is what i was searching now i can get the data on my arduino thanks a lot really really cool answer my error was the 'a'. I hope to get news soon when i'll improve the code and begin the control, i hope to bring the improvements this week my friend would build a small prototype of the mechanics parts
  12. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi everyone it´s been a long time since the last update i submit i get my complete code working but for my work i couldn´t improve or work in the project i´ll take it again and continue, talking with my partner we decide to use sabertooth drivers for two dc motors with encoders and we´re waiting for the encoders to arrive, we choose the following encoder:

    http://www.mouser.mx/ProductDetail/Bourns/EAW0J-B24-CE0128L/?qs=sGAEpiMZZMt7FrWooXVB1yP2kS7qMrXo

    and i´ll add my code, the next step is to add the sabertooth way of control to our code so we can get the motors working and start testing a prototype, hope that this could be of some help for other people interesting in the development. I´ll try to keep all the updates in this thread so we can keep the continuity, thanks again to everyone

    Attached Files:

  13. Diego Efrain Quintero

    Diego Efrain Quintero New Member

    Joined:
    Feb 16, 2017
    Messages:
    14
    Location:
    Santiago de Querétaro, México
    Balance:
    209Coins
    Ratings:
    +2 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    It's almost here the encoders and try to test it just the motors for the first time with and H-bridge 298, hope that is everything is ok, we could procede to the sabertooth conecction and test with a real framework that my friend is building hope to get a video with test soon, i know i haven't add so much in the last days but hope my code help someone else in future projects
    • Like Like x 1