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

Looking for some one that can with arduino code

Discussion in 'New users start here - FAQ' started by Anguspogo, Apr 21, 2014.

  1. Anguspogo

    Anguspogo New Member

    Joined:
    Jan 28, 2014
    Messages:
    9
    Balance:
    409Coins
    Ratings:
    +14 / 0 / -0
    My Motion Simulator:
    AC motor, SimAxe, Arduino, 4DOF
    Hi to all this is my first post
    I am no programmer and i learn by example i am good with my hands but not much between my ears if you no what i mean
    Ok i have an arduino leonardo connected to a stepper driver (microstep driver DQ542Ma)[​IMG]
    which is connected to a Nema 23 stepper motor
    I can make my stepper motor move with this code

    int Distance = 0; //record the numder of steps we've taken

    void setup() {

    pinMode(8, OUTPUT); //dir
    pinMode(9, OUTPUT); //pul
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    }
    void loop () {
    digitalWrite(9, HIGH);
    delayMicroseconds(33); // change value for speed fast 33 to 10000 slow
    digitalWrite(9, LOW);
    delayMicroseconds(33); // change value for speed fast 33 to 10000 slow
    Distance = Distance + 1; //record this step
    // check to see if we are at the end of our move

    if (Distance == 2000) //2000 steps = 1 complete turn
    {
    //we are Reverse direction (invert DIR signal)
    if (digitalRead(8) == LOW)
    {
    digitalWrite(8, HIGH);
    }
    else
    {
    digitalWrite(8, LOW);
    }

    Distance = 0;

    delay (500);
    }
    }

    which works fine motor can go back and forth one full turn and i can change value in the delayMicroseconds(33) to slow the speed down and also control the amount of turns by changing my distance value
    simtools works fine with the falcon4 bms plugin
    In the tuning center on the first box Roll the numbers go up and down as they should when i play the game the range of numbers is max 32767 to min -32767
    I am only trying to get 1 axis to work the rest will come later If i can get it to work i will be buying a bigger stepper motor to run my sim i am looking to build some think like this
    www.youtube.com/watch?v=-JrvLWvcMhc
    i know i have to use code like
    Serial.begin(9600);
    if (Serial.available())
    and i have been trying for about 2 weeks now to make my motor to turn but with no joy
    so any help would be most welcome
    Thank you for your time in reading my post

    Attached Files:

    • Winner Winner x 1
  2. Ads Master

    Ads Master

    Balance:
    Coins
    Ratings:
    +0 / 0 / -0
  3. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,691
    Occupation:
    Retired
    Location:
    Newcastle Australia
    Balance:
    28,518Coins
    Ratings:
    +2,973 / 37 / -0
    My Motion Simulator:
    AC motor, Arduino, Motion platform, 6DOF
    I cannot help you, but that sim in the video is nuts..:D
  4. kermit76

    kermit76 New Member

    Joined:
    Mar 22, 2012
    Messages:
    19
    Location:
    The Netherlands (Zwolle)
    Balance:
    311Coins
    Ratings:
    +0 / 1 / -0
    Hello,

    I hope to build somthing like that with the Arduino uno.
    I will follow this thread for information for the project i want to start.

    I believe that you need the simtool and the plugin for flightsimulator.
    I downloaded simtool but I didn' t have the time jet to find out how it works.
  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,059Coins
    Ratings:
    +1,664 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Im just finishing a motion capture code for the ard to capture 6dof motion for a new coming app.
    I have a basic code for driving a simular setup that I can share.
    What is needed to be adapted to your code is to be able to read the serial port , which SimTools can send the info too. Then it needs to decide how far and how fast it needs to move the lever to the correct position.

    Check this code we did a while back, very effective in reading the data from simtools.
    SimTools is set to output Rxxx~Lxxx~ where xxx is a value of 0-255. The can be ramped up to 16 bit 0 - 32767 to allow for finer resolution too, just needs to read 5 values and not 3.

    Hope that helps you along, if needed I can look more into it for you tomorrow.

    Attached Files:

  6. 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,059Coins
    Ratings:
    +1,664 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    ps lookup the AccelStepper library for the Ard much easier to use.
  7. Anguspogo

    Anguspogo New Member

    Joined:
    Jan 28, 2014
    Messages:
    9
    Balance:
    409Coins
    Ratings:
    +14 / 0 / -0
    My Motion Simulator:
    AC motor, SimAxe, Arduino, 4DOF
    Thank you for your help I cannot look at it at the moment as I am away on a 3 day holiday with my wife and I am typing this on my iPhone
    Will reply in a few days when I can open on my PC
    Thank you again for your time in helping me Just cannot what to get back now to try it out
  8. kermit76

    kermit76 New Member

    Joined:
    Mar 22, 2012
    Messages:
    19
    Location:
    The Netherlands (Zwolle)
    Balance:
    311Coins
    Ratings:
    +0 / 1 / -0
    Hello eaorobbie,

    Do you have a link to the post where you use the simtest?
  9. BADDERICK

    BADDERICK Another Member

    Joined:
    Mar 13, 2014
    Messages:
    34
    Location:
    Sunny California
    Balance:
    319Coins
    Ratings:
    +20 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Joyrider, Motion platform
    That simulator in the video is awesome! :thumbs
  10. 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,059Coins
    Ratings:
    +1,664 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
  11. 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,059Coins
    Ratings:
    +1,664 / 22 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    How did we go mate, any news, any problem need fixing. ?
  12. kermit76

    kermit76 New Member

    Joined:
    Mar 22, 2012
    Messages:
    19
    Location:
    The Netherlands (Zwolle)
    Balance:
    311Coins
    Ratings:
    +0 / 1 / -0