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 Download Package Now!
  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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum rules.

My 2DOF with stepper motors

Discussion in 'DIY Motion Simulator Projects' started by Lebois, Jun 28, 2019.

  1. thefost

    thefost New Member

    Joined:
    Sep 20, 2019
    Messages:
    19
    Balance:
    101Coins
    Ratings:
    +8 / 0 / -0
    Wow, fantastic work here! Thank you so much for sharing your stepper motor code, I'm seriously interested in using it to try making a gseat, but I'm a complete beginner at everything here on xsimulator. I'm just trying to learn as fast as possible. .
    Could I ask what was your reason for deciding to go with the 350W DC motor for the seatbelt tension instead of another stepper motor?
  2. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    First I bought this motor to build a mmos steering wheel. I did let go this idea. So I had this motor lying around ready to be used...
    Now the main reason you don't want to use a stepper motor to build a seatbelt is the stepper motor won't like to fail to reach a position. Depending on the stepper behaviour it will likely stop moving, go into safe mode, miss steps etc... The DC motor won't care (even if it makes a noise like it doesn't like to not move)...

    On top of that it's not natural to use a stepper... How will you drive it ? The more you brake, further the motor should turn ?
    With the dc motor it's easy, the more you brake, the more current goes into the motor, the more the belt is pulled...

    BTW : the motor is too strong for its purpose... I am not sure but in Simhub we put around 50% power..
    Then in idle state (when you don't brake), there always was around 5% power (through a simple potentiometer) so the belt was auto adjusting, very usefull for the drivers shift. The problem is that IMO you are consumming power all the time... that's not very economic considering we made a 24H race... Next time I will add a spring system to have the auto-adjust feature.
  3. My.stAr

    My.stAr Active Member

    Joined:
    Sep 7, 2012
    Messages:
    151
    Occupation:
    Engineer
    Location:
    Germany
    Balance:
    1,026Coins
    Ratings:
    +58 / 0 / -0
    My Motion Simulator:
    DC motor
    Hey @Lebois

    Thank you for your input.
    I cannot see a feedback for your seat belt tensioner. How is the setup? Maybe you can help me here.
    My.srAr
  4. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi ! Why do you mean by feedback ? How it goes back in place ?
  5. My.stAr

    My.stAr Active Member

    Joined:
    Sep 7, 2012
    Messages:
    151
    Occupation:
    Engineer
    Location:
    Germany
    Balance:
    1,026Coins
    Ratings:
    +58 / 0 / -0
    My Motion Simulator:
    DC motor
    I mean how does the Controller know where the Motor is, and how much to turn. Potentiometer, Encoder... such a thing
  6. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    It's driven with torque.

    It doesn't know where the seatbelt is, but it doesn't need to because the seat belt is meant to be already closed to you. When it stops pushing, the seatbelt comes naturally back in place.
  7. Death Race

    Death Race New Member

    Joined:
    Jan 21, 2020
    Messages:
    7
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    Thanks @Lebois for this project .. am a new here and i need to build my own simulator with stepper.. i need the final working code from you and wiring between motors and driver and Arduino,, and simtools setting ..


    Thanks in advance ..
  8. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    The code is in the first page and you will found the wiring in it :
    int const StepPin1 = 2, DirPin1 = 3, StepPin2 = 4, DirPin2 = 5; //Step or pulse pin

    Then nothing special. You should find the driver's wiring diagram on the manufacturer's side.
    I added the simtools settings in attachment in the first post.

    I won't detail more this project because I work on another motion rig that will be much more advanced.
    Otherwise :
    1) Anyway, you need to understand how everything work. You won't have anything moving if you don't understand the simtools settings, the arduino baseline code, the way a stepper motor is driven.
    2) You should try to make simple code work before trying the whole one. Try a communication code, a moving code, etc.
    3) Use reliable connectors to do the testings. I wasted too much time working with messed wires.
    4) The code should be working as it, but check if the Simtools "output - range" match the arduino "max pitch, max roll", and driver microstepping settings. 10 bits = 2^10 = 0 to 1023
  9. Death Race

    Death Race New Member

    Joined:
    Jan 21, 2020
    Messages:
    7
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF

    Thanks for quick replying ..
    first i will use small stepper motor to test first before buying a bigger one :D to reduce the cost
    how many wires comes form your stepper motor ? and the motion is smoothing at the final ?
  10. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    I also forgot to say that you can ask everything you want ^^.

    I think there is 4 to the stepper driver for power supply. And 6 for the position encoder.

    Yeah quite smooth. Very detailed. There problem is that there is a lot of play in the pivot, so you loose a lot of details... I am planning to upgrade to a 3 DOf, so no pivot, and no play.
  11. Death Race

    Death Race New Member

    Joined:
    Jan 21, 2020
    Messages:
    7
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    you mean 2 and 3 for each motor ? that is right ?
  12. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    2 and 3 what ? :)
  13. Death Race

    Death Race New Member

    Joined:
    Jan 21, 2020
    Messages:
    7
    Balance:
    28Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    wires comes out from the motor ?
  14. Lebois

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

    Joined:
    Dec 10, 2018
    Messages:
    72
    Occupation:
    Math teacher
    Location:
    France
    Balance:
    544Coins
    Ratings:
    +35 / 0 / -0
    My Motion Simulator:
    2DOF
    http://www.astrosurf.com/jd85/ESA/HBS-90-8.2.PDF

    1 A+ O Motor Phase A+
    2 A- O Motor Phase A
    3 B+ O Motor Phase B+
    4 B- O Motor Phase B


    1 EB+ I Encoder channel B+ input
    2 EB- I Encoder channel B- input
    3 EA+ I Encoder channel A+ input
    4 EA- I Encoder channel A- input
    5 VCC O +5V @ 100 mAmax.
    6 EGND GND Signal ground