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

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

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

  1. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    27
    Balance:
    227Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    Solved... The problem was the output string...

    [​IMG]
    • Like Like x 1
    • Winner Winner x 1
  2. Rolo F

    Rolo F New Member

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

    Help, please!

    Every time I connect the board, the servo motor spins for a few turns... This is my belt servo.. it makes a mess!
    How can I do so when I connect it, it stays just where it is?

    Thanks a lot, my body and hands appreciate your help!
  3. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    351
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,550Coins
    Ratings:
    +207 / 2 / -0
    My Motion Simulator:
    2DOF
    I can get the enable pin to work... I follow your schematic, PN003 = 0, but nothing happen with a basic digitalwrite high then low :

    #define EnablePin A0 //used to control put the servo on

    void setup() {
    pinMode(EnablePin, OUTPUT);
    digitalWrite(EnablePin,LOW);
    analogWriteResolution(12);
    pinMode(DAC1, OUTPUT);
    analogWriteResolution(12);
    }
    void loop() {
    digitalWrite(EnablePin,LOW);
    delay(3000);
    digitalWrite(EnablePin,HIGH);
    delay(1000);
    analogWrite(DAC1,1000);
    }

    I am using an Arduino DUE BTW
  4. wingert

    wingert Active Member

    Joined:
    Aug 10, 2020
    Messages:
    112
    Balance:
    642Coins
    Ratings:
    +89 / 0 / -0
    My Motion Simulator:
    4DOF
    the e-stop signal should be static, holding the output pin high until FlyPT sends data and the arduino recognized the start mark it switch to low.
    • Informative Informative x 1
    • Useful Useful x 1
  5. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    351
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    2,550Coins
    Ratings:
    +207 / 2 / -0
    My Motion Simulator:
    2DOF
    I agree with that @wingert , but my test code seems to be unable to enable the driver :/
  6. Eagletrike

    Eagletrike New Member SimAxe Beta Tester Gold Contributor

    Joined:
    Jun 4, 2015
    Messages:
    15
    Occupation:
    Let you know when I grow up
    Location:
    Central Western, New South Wales, Australia
    Balance:
    363Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    DC motor, AC motor, Arduino, Motion platform, 4DOF
    Hi @Rolo F, from my understanding of it is that is what it is designed to do as, go from its parked position to home position which is the center of the 100 mm actuator travel. I have only just finished reading the thread because I'm planning on using the code in my design and not actually used it yet or looked into the code but I would say that is where you would have to modify to achieve what yor wanting to do, just my two bobs worth.
  7. Rolo F

    Rolo F New Member

    Joined:
    Oct 28, 2020
    Messages:
    27
    Balance:
    227Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    Arduino
    I guess I should change the arduino code... but I dont underatand about coding... but I could follow instructions :)

    For now what I do... connect Flypt, and just then power up the servo...
  8. Nujj

    Nujj New Member

    Joined:
    Apr 16, 2016
    Messages:
    3
    Location:
    USA
    Balance:
    331Coins
    Ratings:
    +0 / 0 / -0
    Just completed converting my RSeat S1 to a 3dof rig by adding 4 SFX-150 actuators.
    I'm using your v2 version (many thanks for sharing the code). I'm also using FlyPT to control the rig.

    I have a couple of questions:
    1. Since I'm using 150mm actuators, what parameters needs to change: Stroke_Limit to 150 any others..
    2. When powering up, the Arduino code is moving the rig to the home position. When I click connect Serial output in FlyPT, the rig drops to zero and then FlyPT is again moving it to home position. So, is there a way to bypass the Arduino home position at power up or let it go home and go back down to zero.
    Last edited by a moderator: Jul 14, 2022
  9. Daboh

    Daboh New Member

    Joined:
    Aug 16, 2022
    Messages:
    4
    Balance:
    35Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino
    I am currently testing the eh-msc-4dof controller. I do not have the problem you describe. As soon as I plug in the arduino the actuators start up. When I then connect FlyPT to the controller the RIG stops like this. Did you set all parameters as shown in the pictures in Github?
    How do you shut down your rig? I have not found out how to drive the rig down again in a controlled manner. Currently I just turn off the power and the rig "falls" down. ;)
  10. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    Sorry, somehow I missed this and wasn't notified either.
    1. STROKE_LIMIT 150 is enough, considering you also configured your AASD15-A controller parameters as stated in the README
    2. You should be able to use start and stop position for this but unfortunately I cannot test this being away from my rig. Instead of <Axis1a><Axis2a><Axis3a><Axis4a> you should send zero (4 times) for stop and 32768(4 times) for start position. Remember to start with "P4" and end with "!!" There may be other ways to tell FlyPT your starting position but I can't verify now.
    I'll report back as soon as I can.
  11. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    Try using stop position as above, with something like: P4<0><0><0><0>!!
    I'm hoping that's the way to tell FlyPT to send 0 position as I cannot currently test this.

    Note that because of the end dead zones (the Arduino code will protect the actuator by not going all the way to the end), you may still feel a bit of a 'drop' to physical zero, but it should be very little.
  12. Daboh

    Daboh New Member

    Joined:
    Aug 16, 2022
    Messages:
    4
    Balance:
    35Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino
    Thank you for your reply. Your tip with P4<0><0><0>!! works somehow. Then the rig does not go down in a controlled way but at maximum speed. That's scary ;) It would be great if there was a special code like for example P1!! which initiates the homeing and a code like for example P2!! which deactivates the rig and slowly drives into the position 0 0 0. The advantage of this would also be that I don't have to disconnect the Arduino from the computer so that the next time it is connected to the computer it will start homeing again. So I could switch the rig on and off with my switch socket without having to disconnect the Arduino from the computer. I hope that was somehow understandable... ;)

    How do you guys do this? Do you have a usb-hub with which USB devices can be activated and deactivated?
  13. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    Sorry about the scare. I’ll think of something maybe using 2 speeds.

    I use the kill switch connected o Arduino Reset signal and the rig goes down.
  14. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    added changes to the development branch to allow using command Ph<0><0><0><0>!!
    https://github.com/ehmotion/eh-msc-4dof/tree/dev/eh-msc-4dof_v2
    this command uses 'homing' speed to drive the actuator to the requested position.
    give it a try and let me know if it works as expected.
    careful if you made other changes to your code, like stroke length!!
    use this only for STOP sequence.
  15. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    96
    Balance:
    320Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    upload_2022-9-9_22-8-11.png
    Brother, set, very fast return 20mm
  16. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
    make sure you deploy the correct code from the 'dev' branch.
    it works fine on my side and you can test it from Arduino IDE Serial Monitor but be careful if you're not using the 10uF capacitor on reset since Arduino IDE will reinit the board when you open the Serial Monitor.
    use the following commands, with "No line ending"
    -go towards end point
    Phzzzzzzzz!!
    -go towards zero point
    Ph########!!
    -go towards the middle point
    Ph????????!!

    using P4 instead of Ph should have the same effect but uses fastest speed.
  17. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    96
    Balance:
    320Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    upload_2022-9-10_0-7-47.png
  18. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    96
    Balance:
    320Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor
    Can you upload your setup map?
  19. d4m

    d4m New Member

    Joined:
    Nov 23, 2021
    Messages:
    14
    Balance:
    51Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    AC motor, Arduino, 4DOF
  20. zhai1987

    zhai1987 Member

    Joined:
    Sep 7, 2021
    Messages:
    96
    Balance:
    320Coins
    Ratings:
    +11 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, AC motor

    Attached Files:

    Last edited by a moderator: Sep 9, 2022