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
    I did some more reading and the .pdf file for the 2x25 Sabertooth advises to use an 12V 18Ah or better as the support battery for my 12V 30A 350W power supply.
    Does this sound like a good base to start with as I don't want to have to replace the battery if it's not sufficient in theory as I'm trying to stick to very tight budget if and when I can do so.
    Thanks.
  2. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Hello :)

    I have a question.

    I am running this combo with an arduino R3 and Sabertooth 2x32A
    I'm planning to ad traction loss soon.
    Know this "code" only supply 2 motors.

    The question is if any of you know if it possible to add the 3rd motor in "game engine - interface 2" and use a JRK or something similar?
    Is that do-able?

    Looking forward to hear from you :)
  3. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,461
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,596Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    You can create another entry in Game Engine Interface Settings.
    • Like Like x 1
    • Agree Agree x 1
  4. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    If you mean buying a new one I would go with something like this for example https://www.homedepot.com/p/Interstate-Battery-340-CCA-Tractor-Mower-Battery-SP-40/205754489 . You could also try what you have and see what happens but it looks a little weak if your motors need to pull more current than the supply alone can provide.
    Btw, agm is okay to use as long as the voltage is not allowed to drain below 10.5v. That's where special chargers may be needed to bring it back to life if possible.
  5. 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
    Wrong country for Home Depot here mate and I live in a rural area so I will see what I can get locally at our auto electrical.
    As or the AGM battery, yes I only recently update my 45 year old battery charger that does all battery types and I use that on my off road buggy to keep the AGM battery topped up when not in use for long periods.

    Thanks.
  6. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Dont know if it is okay to post it here?
    Else I will post it elsewhere? :)

    Using this plugin with a 2x32 Sabertooth.



    As you can see in the video my leverarms have a bit of slack?
    Is that normal?
    Know there is a little in the gearbox and the coupling.
    Everything is as tight as possible.
    In the SMC3 utilities deadzone is set to 0.
    Could it be my potentiometers?
    They are hall potentioneters from Vishay.
    But as you can see in the attached pictures there is one from SMC3 utilities showing a green bar.
    That is from min to max position.
    On the old type I had (cermet) the green bar had a bigger span?..

    Thanks in advance.
    Simon

    Attached Files:

  7. 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
    Simon,
    No Idea really.
    Naturally because of the design there has to be clearance which translates to backlash in any gear set.
    What ratio are the gearbox, the standard 25:1 or the higher 50 or 60:1
    Noorbeast had problems with the standard 25:1 motors back-driving under the weight of the sim and that was solved by going to the higher ratio.
    I myself went for the 50:1 ratio and it does not move with me in the sim playing a driving game with no motion as yet and there is a fair amount of weight
    and leverage acting on the motors.

    I just had one thought and that is did you remove the gearbox from the motor at any stage as there is a rubber X shaped bumper that fits between the motor's output
    shaft and the matching drive flange of the gearbox.
    If that was missing for any reason it would provide a large amount of backlash between the two which would create such an amount of movement ?
    I just watched your video again and I hear a definite clunk sound when it changes direction and
    that makes me feel even more that that buffer might not be present.
    BTW does it do it on both sides ?
  8. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Hi @Deane :)

    Thanks for your reply.
    Appreciated:thumbs

    My current gearboxes are 25:1s.
    Actually I had the 50:1s before those.
    They didnt have any problems, and as you write yourself cant back-drive.
    But I missed some speed and got some 25:1.
    They does the job perfect.

    But this little problem just annoys me a bit now.

    But in many ways a 37.5:1 gearbox right between would be the best fit :)

    You mean the rubber coupling between motor and gearbox. But that is fitted, and fitted correctly.
    Asume without it would sound quite awful because of the 2 aluminium parts together.

    The video is taken just beside the electronics/fan/gearboxes etc, so all the noise sounds alot worse than it really is.

    Both sides are exactly the same.

    Just curious if it is the potentiometers?
    Looks od the feedback isnt with a full 5v output.
    If it have been that perhaps the software have had a better "resolution" to see the feedback and mayby have been more precise to hold the motor/leverarm in neutral?
  9. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Hall pots don't output 5v. They output .2 to 4.8 volts.
    Last edited: Oct 2, 2018
  10. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Exactly @BlazinH..
    Thats why the bar in smc3 utility doesnt show full scale.

    Do you know if that can interfere into what I showed in the video?..
  11. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    I don't use smc3 myself so I'm not very familiar with what the graph is showing. But I would try increasing kp and adding in some ki and see how that responds.
    Last edited: Oct 2, 2018
  12. 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
    Oh well I hope you resolve the problem as I am using the same motors with 50:1, Sabertooth and Arduino and I will be using the same code and software.
    I am also going to be using Hall Effect Pots if they ever get here FFS .
    Keep us informed.
  13. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Tried adding sone Kp and Pi.. Again..
    Doesnt do any good.
    Drives back to neutral faster..
    But the leverarm moves just as much.

    Tried ordering new pots yesterday.
    The ones I have from Vishay doesnt give 5v at min or max.

    When I receive them and they are fitted I will let you know :)
  14. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    I looked up your hall pot model number and it looks like the biggest issue is they're 360 degree. Using 180 degree pots instead will double the resolution as it appears 180 is all you will use.
    • Like Like x 1
    Last edited: Oct 3, 2018
  15. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    • Like Like x 1
  16. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,210
    Location:
    Italy
    Balance:
    8,255Coins
    Ratings:
    +1,103 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    What software are you using, if I may ask?
  17. 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
    This should interesting as I am using the same Sabertooth 2X25 , same motors albeit 50:1 ratio , and the Hall sensors are the same model number from a different supplier
    I wonder if I will have the same issue :(:(:confused:
  18. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    Those motors should do better since they have more torque. In any case doubling the amount of kp that would be used with a 180 degree pot should have about the same effect since kp x error = power. The "steps" in the power will be more notched but that doesn't necessarily mean you will feel them. Since they're already ordered might as well give them a try.
    • Like Like x 1
  19. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,568Coins
    Ratings:
    +1,831 / 32 / -1
    My own. I've been using Dimension Engineering motor controllers on my rigs for 9 years now. That was before SMC3 or Simtools for that matter so I didn't have much choice except to write my own. Over time I've tweaked it to be just what I need so I have no reason to switch to something else. So with SMC3 SPS I just wanted to contribute.:cheers
    • Winner Winner x 2
    • Informative Informative x 1
    Last edited: Oct 5, 2018
  20. Simon Husum

    Simon Husum Member

    Joined:
    Oct 25, 2014
    Messages:
    84
    Occupation:
    Electrician
    Location:
    Viborg, Denmark
    Balance:
    217Coins
    Ratings:
    +59 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT
    Got my new potentiometers yesterday.
    Got them mounted and tested today.
    The slack is now very much to a minimum.
    So thats great. :)

    But when I start up the rig and the motors drive to "neutral" they start to oscillate until you put some weight on the seat.

    Have tried with adjustments of more or less everything in SMC3 utility.
    The graph shows a nice bar in smc3 utility, so doesnt look like its EMC related.

    After it has been powered up in a few minutes it doesnt oscillate anymore.
    Only just after reboot before entering windows.
    But the way it finds its neutral position at the startup seems more aggressive than after a few minutes?

    At power up it starts after the parameters in the arduino.
    After a few minutes when it doesnt oscillate, does any if you know if simtools control it and mayby havent as high values mayby?

    Remember it have done it a long time ago just after getting my ssbertooth, but it ended from one day to another rtjer quickly after and havent done it since.
    Just curious whats causing this.