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

Starting a classical 2DOF Arduino/Sabertooth/24V DC

Discussion in 'DIY Motion Simulator Projects' started by vthinsel, Feb 26, 2015.

  1. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Soooooooo...
    It has finally started :) I have now almost everything I need to add motion to my static cockpit.
    I received today the arduino board and I started a few tests. Thanks to the code of racingmat, everything worked out-of-the-box. Great job.
    I added a LCD display I had lying around to get visual information on what the arduino gets from the game engine, what it sends to the sabertooth, and what it reads from the pots.
    It looks nice :
    [​IMG]

    I did a first test with LFS and thanks to the various presets on the community I saw the L and R value moving. Sweet beginning. :thumbs
    I have also started to modify server PSU to get 24V:

    [​IMG]

    Only one has ground connected. The metallic cases will have to be properly isolated. Those PSU are fanless. I'll try to find some with built-in fan, so it also cools down the sabertooth.

    The other bits and pieces:

    [​IMG]

    I'll continue posting in that thread my progress.

    V.
  2. Archie

    Archie Eternal tinkerer

    Joined:
    Dec 31, 2014
    Messages:
    1,081
    Location:
    Wollongong, NSW, AU
    Balance:
    3,796Coins
    Ratings:
    +1,379 / 4 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Nice! I like the LCD Shield. I need to get out my Ard and see what data I can read!

    Not that I doubt your wiring skills, but is there any way you can wire the Kill Switch to the Pins (PS_KILL) of the Power supplies??
    If you mount it as is, you have the scary potential to introduce mains voltage on your frame should your Emergency switch give up the ghost...
  3. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    571
    Location:
    Bruxelles
    Balance:
    1,946Coins
    Ratings:
    +297 / 2 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 4DOF
    Salut !

    Ca s'annonce plutôt bien :thumbs

    Je vais suivre ça :p
  4. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    I'll be checking very carefully the voltage between the wipers/PSU/boards and ground/earth.
  5. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Here is the progress of the day : work on new PSU, which include a fan.
    [​IMG]


    The thin wires are here to calm down the fan. Even at low speed, there is a decent airflow going through the unit: hear by yourself :grin


    I'll probably put a LM34DZ to regulate the fan automatically.

    Now I'll check the ground isolation. I'll see if the sabertooth GND is shortened to earth, which should be the case I think. Only one PSU will be connected to earth, so it will be that one that will have the minus connected to the sabertooth.
    While I wait for the LCD shield to make its way to me, I'll start building the rig.
    BTW, the LCD shield seems to use pin 8, so I moved the arduino/sabertooth communication to pin 10.

    Something else I found on the arduino: the motor commands is between -127 and 127. Pot is between 0 and 1022. Motor = 127 between pot=0 to 444, then motor goes from 127 to -127 in the pot range 444 to 560, and stays at -127 from 560 to 1022. Is it a normal variation for the motor command ?

    Next update soon.
    • Like Like x 2
    • Informative Informative x 1
  6. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,890Coins
    Ratings:
    +2,083 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    be careful with your 2 PSU in serial and earth short-circuit! but you look like you know your subject ;)
  7. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    571
    Location:
    Bruxelles
    Balance:
    1,946Coins
    Ratings:
    +297 / 2 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 4DOF
    You drive your motor from - 127/127 with a speed! Pot are for position...
    Speed is calculated with a pid using pot position ;)
    • Agree Agree x 1
  8. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,398Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    Just beware running lcd on ard, the time it needs to refresh lcd , etc will eventually show up as lag in high speed motion,
    pays to have a switch to promote the code to stop updating and when you want to test and check position you can press the button to turn on the updates to the lcd.

    Nice job so far. Coming together.
    • Informative Informative x 1
  9. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Yep, I have a switch on a pin that is probed by the code that stops LCD refresh . The goal of the LCD is between debugging (to make sure data is received from game engine, and pots value in case a pot has a problem) and eye-candy feature :).
    • Like Like x 1
  10. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    571
    Location:
    Bruxelles
    Balance:
    1,946Coins
    Ratings:
    +297 / 2 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 4DOF
    that's a good idea which can be very useful !
  11. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Well... not much time spent on the sim the last days. Starting slowly to prepare the DC motors mounts

    [​IMG] [​IMG]
    More pics of the mounts, which will be completed I hope sometime this week.
  12. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    571
    Location:
    Bruxelles
    Balance:
    1,946Coins
    Ratings:
    +297 / 2 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 4DOF
    It's a good start :thumbs
  13. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    So, I started to mount the DC wipers to make some tests. Juste temporary pot mounted in a way I can disconnect them easily using some silicon hose.
    [​IMG]
    Second mount will be ready soon, so I'll start making noise and getting everything in motion soon :)
    • Like Like x 1
    • Informative Informative x 1
  14. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Hello,

    So I have done the first tests with the DC wipers in 24V with the sabertooth, using pots to drive the wipers.

    I have an issue with the sabertooth: its regenerative function makes the PSU not happy : they enter security mode at some point of time. I thought of adding a diode to prevent current being sent to the PSU but dimensionengineering advised I shouldn't as it could damage the sabertooth which. They said I sould put a battery in parallel to "buffer" the regenerative current. http://help.dimensionengineering.com/knowledgebase.php?article=2

    The figures are as follow for each DOF: target position received from SimTools/calculates PID/ pot value
    The last figure on the second line is the time of the main code loop.
    I wasn't able to go above 19200 bps between the arduino and the sabertooth, and above 9600 bps between the arduino and the SimEngine.
    The LCD refresh takes 10ms (yes, there is a physical switch allowing to skip LCd refresh for normal driving)
    The main loop witjhout LCD requires 2-3 ms
    When SimEngine is running, the main took 25ms with SimEngine sending updates every 10ms. So I increased the send rate to 20ms, which allowed the main loop to go below 20ms. The conclusion is that it is no use decreasing the update rate on SIMEngine if the arduino takes too long to parse the serial data. It even makes things worse as the arduino spends most of its time parsing the SimEngine data. So timing is something critical to keep good reactivity.
    Beside this consideration, I'll try to increase the speed between SimEngine and arduino. For that I have several options, one of them is to move to arduino Mega which has 2 UARTs. That will avoid to use the software serial , which has an impact on the physical UART (UART speed < Software serial speed). Another option would be to optimize the serial dialog and parsing, especially if I can't go beyond 9600. If I can reach 115200, then optimizing the code may not be a necessity.
    So there is still some software updates rework, as well as PSU design rework..... anyway I have the impression this "hobby" is a never ending story.... :grin
    • Like Like x 2
  15. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,890Coins
    Ratings:
    +2,083 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    you can use a battery or maybe a power resistor to dissipate the current? like on our DIY wheels
    images.jpeg
  16. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Hum. Looks a good idea :) How do you wire it so it gets involved only to sink the current the DC motor is sending back ?
  17. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    571
    Location:
    Bruxelles
    Balance:
    1,946Coins
    Ratings:
    +297 / 2 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 4DOF
    Very good job using the LCD !

    With the new 2x32 2 power resistor (10W) are delivered by dimension engineering ! But this new version have 2 more pins especially for the resistors...

    Battery seems to be the best practice.
  18. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,234
    Location:
    Marseille - FRANCE
    Balance:
    20,890Coins
    Ratings:
    +2,083 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    yes, when it's possible to use dissipating resistors, you have to look into the specs for the dedicated pins.
  19. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    438
    Location:
    FRANCE
    Balance:
    5,979Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Well well well.... I opened a ticket with dimensionengineering, and we came to the conclusion that the diagram attached should be OK.
    I also asked them for a swap from my 2*25A which I ordered some weeks ago for a 2*32 which is at the same price, with many many more features (looks like a JRK , no ?). And they said YES !
    So I'm sending back my current sabertooth which will take some days, allowing me to build the rig in the mean time.

    V.

    Attached Files:

  20. kopper

    kopper Member

    Joined:
    Dec 23, 2014
    Messages:
    58
    Location:
    Kansas
    Balance:
    3,343Coins
    Ratings:
    +39 / 0 / -0
    What will keep the PS from possibly overcharging the battery?