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

Tutorial SPS - Sabertooth Packet Serial PID motor driver sketch w/SoftStart

Discussion in 'SimTools compatible interfaces' started by BlazinH, Nov 10, 2016.

  1. Deane

    Deane Old Fart

    Joined:
    Aug 25, 2018
    Messages:
    212
    Occupation:
    Retired
    Location:
    Wirrina Cove, South Australia
    Balance:
    793Coins
    Ratings:
    +89 / 3 / -0
    My Motion Simulator:
    2DOF
    After many failed attempts and late nights.
    I think I have solved it but I dare not jink myself as I thought I had it right before and fell on my sword.
    I removed the suspect Hall Effect Pots which I think one is stuffed and replaced it with some garden variety 10K Linear Pots
    I can now get each axis moving in the SMC3 Utility by selecting each mode .
    So hopefully it is now onto the setup of SimTools which looks like more reading and I hope there is a Simple Tutorial for Dummies on the subject .
    I am using your Soft Start Packet Serial Sketch edited to 38400 baud rate, Baud Rate or 38400 also set in DEScribe software
    Sabertooth 2X25 V2 dip switch settings 1, 2-Off 3,4,5,6-On

    So for the moment I am a happy camper and have put Mr. Ruger to bed ;);)
    • Like Like x 2
  2. Neo_One

    Neo_One Member Gold Contributor

    Joined:
    Oct 20, 2017
    Messages:
    34
    Location:
    Obersulm
    Balance:
    198Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino
    Kann mir jemand sagen an was dieser Ausschlag liegen kann?
    die Potis sind neu es sind die Magnetpotis


    Can someone tell me what this rash can be?
    the pots are new they are the magnet pots


    IMG_20181031_185143_978.jpg
  3. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    Possibilities include bad solder joints, bad wire connections, magnetic interference, and faulty pots. If its not any of those though it may only be Gremlims so whatever you do don't get anything wet. :rolleyes:
    • Like Like x 1
  4. Neo_One

    Neo_One Member Gold Contributor

    Joined:
    Oct 20, 2017
    Messages:
    34
    Location:
    Obersulm
    Balance:
    198Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    2DOF, AC motor, Arduino
    alles klar, dann werde ich mal alle Kontakte direkt mit dem Arduino verlöten die töpfe sind neu also dürften es diese nicht sein denn das beide den selben fehler haben denke ich nicht


    All right, then I'll solder all the contacts directly with the Arduino the pots are new so it should not be this because both have the same error I do not think so
  5. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    https://www.xsimulator.net/community/threads/diy-2dof-budget-build.12377/
  6. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    More or less the same thing less one motor driver. The main thing is they are both 38400 max. If I recall you had issues with your syren50 at 38400 so why do you expect the syren25 to be any different?
    In any case this thread is for supported controllers not unsupported ones from here on. It has enough clutter already with syren50 and 2x25 crap.
    So please delete the post you posted with code and begin your own thread if you wish to start your own crusade. Thank you.
  7. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    You have a short in your motor wiring or motor it appears. Make sure everything is isolated. The fan on the 2x60 should not run at all except briefly at power up and during high current draws. If you need more assistance though start a thread and state your issues there. Good luck.
  8. Vitalius

    Vitalius Active Member Gold Contributor

    Joined:
    Jul 2, 2018
    Messages:
    151
    Location:
    Bonn
    Balance:
    586Coins
    Ratings:
    +74 / 1 / -0
    My Motion Simulator:
    Motion platform, 6DOF
  9. FoxHound.92

    FoxHound.92 2DOF seat mover Gold Contributor

    Joined:
    Jan 11, 2018
    Messages:
    69
    Location:
    Germany
    Balance:
    38Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino

    May I suggest to update this post with the explanation of the Tuning parameters as it is easy to miss out that part when you only read the headline of the original thread?
    Also the Axis Parameter settings for SimTools? It might be almost the same thread but then you would have everything at one and don't have to jump between two threads.

    This really confused me as I thought I don't need the original thread.
  10. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi Guys mr warts and all back again after a layoff and decided to tackle this Interfacing option at the same time as im getting good results with my Encoder2pos Tetsing as well ..

    Anyway in the spirit of giving you guys a laugh and me with my Homer simpson Duff hat on I set up this Great Utility and for the last 3 day have read through this thread like crazy man... OK all connected up wiring checked, Software steps Followed ,2 brand new sabertooth 2x60 bought and ready to go .....Er Zip Nicht Nadda at the output No movement from test motor, SMC utility works A treat .Pot seen , Pwm seen all good that end .. three days of head scratching . describe using , more post reading . Rewiring check/ head sctratching and loads of Expletives mainly because I know this works but could not see the wood for the trees as to why mine was not working as it should ... 3 more Ards Bought same Issue ....ARRRRGGGGHHHH I know ive been away but dam this was crazy ..

    ok heres the Bit that made me look like the doofuss I am but at least I found MY MISTAKE Grrrr .. turns out in my efforts to do the simplest operation I forgot a key step. remember "Cant see the wood for the trees" saying .. Don't laugh too hard guys ( well at least try not to ) ...

    It seems I Validated the SMC sps code and seeing as the screen did not show any error message I thought the program was ok .........Stop laughing Guys ....did anyone see what I missed .......Er ya need to press the download icon ya dam fool man ..

    I knew all 4 ards I had could not be faulty and I also knew the utility works . so that left just the Operator .... serous amounts of humble pie being swallowed ..

    Blow me the Dam setup works like a charm .. Gotta say massive Thanks @ blazzinH for a great option .. now the next step ... will post an update on my other tests Ref Optical encoder /Sabertooth /Amc on my Posts ..

    Sorry to Ramble on @BlazinH but was just great to get this working the way you intended ...Happy chappy Cheers
    • Like Like x 2
    • Friendly Friendly x 1
  11. FoxHound.92

    FoxHound.92 2DOF seat mover Gold Contributor

    Joined:
    Jan 11, 2018
    Messages:
    69
    Location:
    Germany
    Balance:
    38Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I'm currently in the middle of tweaking my SMC3 settings but some reference values would be great! I don't really know if these values make sense?

    My setup:
    Sabertooth 2x32 (obviously) with 2x 24V 25W motors with 250rpm

    My current settings:
    SMC3_seetings_2018-11-15.JPG

    My motors get pretty hot in-game (not glowing but hardly touchable) so I tried smaller power output.
    With this settings I have a smooth motion so far in SMC3. In Game with only Sway as dof output it still feels like a "stepping" motion.

    Do you have a similar setup and can share your settings and experiences with me?
  12. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,415Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    You could use lower PWMmax and higher Kp values (i.e. Kp=300 and PWMmax=150), Kd should be zero as a first attempt. PWMrev should be higher if overshooting the motors over the clip limit. I use the same value of PWMmax.
  13. FoxHound.92

    FoxHound.92 2DOF seat mover Gold Contributor

    Joined:
    Jan 11, 2018
    Messages:
    69
    Location:
    Germany
    Balance:
    38Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thank you. I did as you say but this results in a heavy jerking if you give the seat a little push to bring it out of balance. One motor overshoot directly and broke my potentiometer mount. :eek:
    I tried Kp = 160, Kd=0 and PWMmax = 160
  14. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,415Coins
    Ratings:
    +3,088 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    For that reason we should add an emergency stop push button.
    I regret that you have broken a part of your rig, honestly, better now under testing than later under racing. Kp is important when I want hard and direct motion coming from the racing car, as lower the values are, as softer and indifferent the motion.
    And - by all means - testing means step by step raising - not beginning at the end of the road.
  15. FoxHound.92

    FoxHound.92 2DOF seat mover Gold Contributor

    Joined:
    Jan 11, 2018
    Messages:
    69
    Location:
    Germany
    Balance:
    38Coins
    Ratings:
    +30 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Nothing to worry about, I'm glad you are trying to help.

    I just wonder if this is by any means hardware related or if this is purely due to bad settings by me. I was planning to redo the mounts anyway.
    Up until now the lever could only go about 60 degrees upwards before reaching the mount - that it finally surpassed just now. :D

    And you are absolutely right with the step by step process. Honestly I tend to be a little lightheaded with the SMC3 tool. It happened every now and then my rig started to jump around on the floor because I forgot to lower the PWMmax before switching from monitoring to sine wave... :roll
  16. Peacemaker105

    Peacemaker105 Active Member Gold Contributor

    Joined:
    Jul 18, 2017
    Messages:
    197
    Location:
    Perth, Aus
    Balance:
    1,977Coins
    Ratings:
    +352 / 2 / -0
    My Motion Simulator:
    6DOF
    Hey guys, not sure if anyone has a solution, but i am having a floating issue with my pots. the pots have a slight deviation when sitting still which force the motors to constantly chase the center. It seems like nothing i do smooths out this problem. tried raising the Fpid which makes it worse at low pwmmax values but better at higher values. Tried some PID tuning but dont think i'm going to smooth it out that much as its so erratic. I'm using shielded cable for the pots.

    Now... i am using 50k ohm pots... will that be my cause by any chance? will they be more sensitive then 10k pots thta ppl use? i ordered these a year ago and was going to try get away with using them. Is there some code i could use to filter it out at all? or should i use resistors to bring my pot ohms down? or i dunno.. anything would be nice right now haha.

    Cheers, Chris

    simutils1.jpg
  17. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,574Coins
    Ratings:
    +1,831 / 32 / -1
    Its possible its the 50k pots. It's recommended to use 10k or less with arduino.
    • Like Like x 1
  18. Peacemaker105

    Peacemaker105 Active Member Gold Contributor

    Joined:
    Jul 18, 2017
    Messages:
    197
    Location:
    Perth, Aus
    Balance:
    1,977Coins
    Ratings:
    +352 / 2 / -0
    My Motion Simulator:
    6DOF
    OK so after a bit of research i found my fix! just in case anyone has similar issue. A 30 cent 100Nf capacitor between the ground and the wiper pins fixed it straight up. :) phew! motor holds steady and pot output is near flawless.

    20181130_103753.jpg simutils2.jpg
    • Like Like x 3
    • Informative Informative x 1
    • Useful Useful x 1
  19. wannabeaflyer2

    wannabeaflyer2 Well-Known Member

    Joined:
    Jun 12, 2015
    Messages:
    724
    Location:
    london uk
    Balance:
    8,287Coins
    Ratings:
    +950 / 7 / -0
    My Motion Simulator:
    2DOF, Arduino, Motion platform, 6DOF
    Hi @BlazinH hope you don't mind my adding this little tit bit of info ( not prematurely I hope ) as another string to the SMC3 bow :)
    I have started to post the findings of a wee experiment I did today ( I may not have been the 1st so if this is already out there im sorry guys ...did not see those posts ) anyways I was able to replace multi turn pots with Optical encoder and use your program to verify that the susbstituation could work ..

    im Trialing Thanos's Encoder2pos Interface as one of my system setup options was my original AMC128USB controllers anyways but really want to maximize and use Simtools V2 soon , Long story short ( my posts are always Yawn roll eyes long :) ) I thought about the optical ens=coder option using your program and it seems on the face of my initial tests that I can indeed Feed the Output for the Optical encoder interface into your SMC/Ard setup and get the correct feedback and tracking ..

    Early days yet guys ( WAKE UP lol ) but once I post the video you may be able to point out any issue .. Cheers @BlazinH

    again I have to admit if this has already been done I have not seen the posts and just had a light bulb moment whilst tinkering today feel free to delete this if its old news :)

    Attached Files:

  20. SeatTime

    SeatTime Well-Known Member

    Joined:
    Dec 27, 2013
    Messages:
    2,574
    Occupation:
    Retired
    Location:
    Brisbane Australia
    Balance:
    28,370Coins
    Ratings:
    +2,844 / 38 / -0
    My Motion Simulator:
    AC motor, Motion platform
    Good to hear that your sorting it out, but have you noticed any improvements in operation Vs a normal pot setup? Apart from the obvious longevity improvement.