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

4Dof-Controller code for arduino mega for AASD-15A and similar driver

Discussion in 'SimTools compatible interfaces' started by cubexxx, Mar 19, 2020.

  1. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    3
    Balance:
    30Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    For the DIY heads, the adaptation is ready https://github.com/ehmotion/eh-mfc tested with native telemetry on PC and PS4/PS5 as well as 'extrapolated telemetry' from the wheel/console controller data.

    There is also a v2 for the Arduino controller which uses preset stroke length, check the details https://github.com/ehmotion/eh-msc-4dof
    • Like Like x 1
  2. Lebois

    Lebois (maybe I am wrong, but who knows...)

    Joined:
    Dec 10, 2018
    Messages:
    319
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,344Coins
    Ratings:
    +187 / 2 / -0
    My Motion Simulator:
    2DOF
    @cubexxx I am adapting your code to my stepper motors. I need 48800 pulses from low to high.
    Can you confirm those parameters will work :
    const unsigned int minPos = 0;
    const unsigned int centerPos = 22400;
    const unsigned int maxPos = 48800;
  3. Lebois

    Lebois (maybe I am wrong, but who knows...)

    Joined:
    Dec 10, 2018
    Messages:
    319
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,344Coins
    Ratings:
    +187 / 2 / -0
    My Motion Simulator:
    2DOF
    I tried your code with something as close as possible from your settings, but the actuator reacts with something like a 60 seconds delay...
    [​IMG]
  4. Ryton_

    Ryton_ New Member

    Joined:
    Aug 12, 2019
    Messages:
    2
    Balance:
    84Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    SCN6
    Hello everyone

    Being totally new to all the Arduino and motion simulator fields, I come to you for a few questions. I want to fly a 90St with the AASD 15a controller. The ram will have Surge use.

    First question which may seem silly but why not use Simfeedback to drive an Arduino Leonardo as specified in the Sfx manufacturing instructions? Because it looks like an easy solution to implement. (but if you do your own code I guess there are advantages)

    Second question, will your code be functional to be used for a surge?

    Thank you
  5. cubexxx

    cubexxx Member

    Joined:
    Oct 4, 2019
    Messages:
    69
    Balance:
    501Coins
    Ratings:
    +37 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, 4DOF
    The arduino code used for Simfeedback is not open source and only works together with the simfeedback windows app, but this is quite restricted in comparision with e.g. FlyPT mover. Also I think my code is better because it generates better timed pulses leading to smoother motion. The code can be used for any kind of motion (e.g. surge), it's a general 4-channel pulse generator, the 4 channels are independent of each other
    • Like Like x 1
  6. cubexxx

    cubexxx Member

    Joined:
    Oct 4, 2019
    Messages:
    69
    Balance:
    501Coins
    Ratings:
    +37 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, 4DOF
    Your screenshot is a little bit low-res, I can see the "interval loops" beeing 0.5 ms which seems very low, that is 2kHz, why so fast? That may be too fast for the baud rate, you may have to adapt the code for that. I never used less than 2ms, not much to be gained by going lower as the servos don't react that fast anyway
  7. Ryton_

    Ryton_ New Member

    Joined:
    Aug 12, 2019
    Messages:
    2
    Balance:
    84Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    SCN6
    ok that's what i thought about Simfeedback. I saw that you were not using a mechanical limit switch because you have a vertical use of the cylinder, so your zero point is always good. On the other hand for the surge, to avoid moving the chassis backwards to have a zero point, will it be possible to have an automatic calibration when the system starts? (with limit switch)
    And one last question which is more of a service if I can afford to ask you. Would it be possible to have your code modified to just operate 1 cylinder (with limit switch if that and possible) because I am afraid to modify your code because I think I would do more nonsense than good. And with just the program for 1 cylinder it will be easier for me to understand how it works.

    Thank you very much for helping me
  8. GerritSTI

    GerritSTI New Member

    Joined:
    Feb 10, 2021
    Messages:
    3
    Balance:
    - 31Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino
    I need a little help i made a 3 dof and i want to use 1 arduino per servo to make it move smoothly I used servoControllerContinuousRotation16bitOneChannel code. it works but not well.
    when i start it up it runs too far.
    I have an 80 ratio reducer with a 80pcs m02430 servo.

    - Where can i adjust it to make the arm go from below 0 degrees off to 90 degrees at start up?
    - is servoControllerContinuousRotation16bitOneChannel the right code?
    Inventor_5zTi5OKztI.png
  9. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    48
    Balance:
    134Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    Can you share your settings···
  10. cfischer

    cfischer Active Member Gold Contributor

    Joined:
    Sep 7, 2015
    Messages:
    301
    Location:
    Colorado
    Balance:
    2,126Coins
    Ratings:
    +210 / 0 / -0

    This is the wrong code for your needs. This code is for a continuous rotation axis like continuous yaw.

    For a 3 dof rig use the servo controller ino file. This code can do 4 axis motion, just send 3 axis data and it will work great. It will be smooth, cubexxx did a excellent job using timers etc.
  11. GerritSTI

    GerritSTI New Member

    Joined:
    Feb 10, 2021
    Messages:
    3
    Balance:
    - 31Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino
    Thanks i'll give it a try. Here my settings .

    Attached Files:

  12. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    48
    Balance:
    134Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    Sir, can you tell me how to set it up? Flypt Filter Research
  13. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    24
    Balance:
    207Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    Hello!
    Long story short I have a 90 ST motor and the AASD controller. I have built all the hardware for the belt, and now I need to connect the AASD controller to a board that can "talk" with my PC.

    I have found 2 SW that could "control" the belt, one is FlyPt and the other is simtools, SRS does not work because I can't limit the "travel" under acceleration, it will get "lose"

    I have read about 2 options, but I'm not sure if it is what I need, and here comes where I ask for your help. I could buy a Thanos board (a bit overkill for only an active belt) or I could use Arduino to connect it to Flypt or Simtools.

    I think the most reliable and cost-effective thing I could do if there exist a way, is to build an Arduino Leonardo, connect it to a DB25 serial port and connect the Arduino to the PC.... But here comes my questions...

    (The belt is not an actuator like the SFX type, it uses a belt to make the belt move)

    -How should I connect the Arduino mega to the DB25?
    -Would the sketch that you have to work with FlyPt and one port?
    -I don't know anything about coding, should be done a lot of changes?


    I just want the belt working, I will not have in the near future more servo motors (shipping is in the sky, and with all the world shortage...), and... I have some very strong transducers that help with some immersion

    Any help or guidance I will appreciate.
  14. wingert

    wingert Member

    Joined:
    Aug 10, 2020
    Messages:
    56
    Balance:
    284Coins
    Ratings:
    +61 / 0 / -0
    My Motion Simulator:
    4DOF
    the mega supports up to four motors if you need only one leave the other spare.
    the AASD DB25 pin assigment is step=3, dir=4, enable=6, 5V=9, GND=5,10,14,
    the mega assigment for motor 1 to 4 is step=digital pin 12,2,7,45 dir=digital pin 30,31,32,33
    e.g. connect 3 to 12, 4 to 30, 6 to GND, 9 to 5V, 5-10-14 to GND
    • Like Like x 1
  15. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    24
    Balance:
    207Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    Thanks!!

    The sketch is just copy/paste and the AASD parameters are the same?
  16. wingert

    wingert Member

    Joined:
    Aug 10, 2020
    Messages:
    56
    Balance:
    284Coins
    Ratings:
    +61 / 0 / -0
    My Motion Simulator:
    4DOF
    yes, copy and paste the parameter are the same except P98=10.
    • Like Like x 1
  17. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    24
    Balance:
    207Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    Hello!
    Got a few basic questions... cant make this work..

    I have connected this:
    3 to 12, 4 to 30, 6 to GND, 9 to 5V, 5-10-14 to GND (Mega to DB25)

    But I cant make it talk to flypt when I hit connect

    I also found this... Are 2 pins missing or maybe my problem is on another subject?
    pin 23 SigOUT2 (Treach)
    pin 11 SigOUT1 (Servo Ready)

    My first goal is to make the belt servo to work (move)... I will also need to understand Flypt but first.. connect it

    Thanks!
  18. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    24
    Balance:
    207Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
  19. hooshang

    hooshang Active Member

    Joined:
    Jul 6, 2011
    Messages:
    271
    Balance:
    287Coins
    Ratings:
    +155 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, AC motor, Arduino, 6DOF
    need to have some pics from the wiring and pinout
  20. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    24
    Balance:
    207Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    Hello!!!

    Here goes the pics...

    [​IMG]

    [​IMG]

    [​IMG]


    https://postimg.cc/gallery/2VL6FrZ

    It's clear I'm doing something wrong... but I don't figure out what....

    Thanks for your help!!