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. TSHracing

    TSHracing New Member

    Joined:
    Dec 14, 2017
    Messages:
    26
    Location:
    Canada
    Balance:
    329Coins
    Ratings:
    +5 / 0 / -0
    Yes I even ran a simple test sketch that does simple math and montiored that on the serial monitor to see if comunicating with the borad is good.
    I have one question about the UDP port setting in the ini file, where can find that (if it needs to be changes?)
  2. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    AFAIK you do not need to change the UDP port. Try another USB port, do not use usb hubs, unplug all other not needed usb devices, set all parameters in the device manager correctly, it should work without changing any parameters of SMC.
  3. thecures

    thecures New Member

    Joined:
    Oct 22, 2013
    Messages:
    28
    Balance:
    68Coins
    Ratings:
    +3 / 2 / -0
    My Motion Simulator:
    3DOF
    hello .... the syren 50 is not mentioned .... how should i set the dip-switch?...tks
  4. FredBasset

    FredBasset Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    30
    Balance:
    461Coins
    Ratings:
    +13 / 0 / -0
    Ignore below, worked it out. :)

    Can I ask a simple question, before I get into this too much. I have everything wired up on the bench and I think its working. However my target position is always the centre of the graph, if I manually move the motor it will recenter and stop. I'm probably being dense but I can't see how to change the target, the three buttons to the right of the graph don't do anything.

    As I say, probably being dense, what am I missing.

    Regards
    Fred
    Last edited: Jul 2, 2020
  5. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    to use this function out mode must be manual
  6. FredBasset

    FredBasset Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    30
    Balance:
    461Coins
    Ratings:
    +13 / 0 / -0
    Thanks, yeah I worked it out.

    I've got my motor nicely dialled in now, however although values are being written from the SMC3Utils program to the arduino for kp, kd and deadzone for example and being retained when its powered down, this isn't the case for PWM Max, this value is never retained, should it be?

    Thanks
    Fred
  7. MarkusB

    MarkusB Well-Known Member Gold Contributor

    Joined:
    Jun 30, 2015
    Messages:
    552
    Location:
    Germany
    Balance:
    4,213Coins
    Ratings:
    +596 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Exactly this topic already has its own thread:
    https://www.xsimulator.net/community/threads/smc3-saving-settings.14963/
    • Informative Informative x 1
  8. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    yes it should, obviously a new bug of Windowsneverendingstory...I had never ever any issues.
  9. FredBasset

    FredBasset Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    30
    Balance:
    461Coins
    Ratings:
    +13 / 0 / -0
    lol, weird its not affecting all values.

    Can I modify the arduino code to use the value I've worked out and not read from the eprom?
  10. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    With additional feedback received from many people vs only one I now know where the issue resides and I'm looking into a fix for it.
    • Like Like x 1
  11. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Untested fix but have high confidence :). Let me know!

    Attached Files:

    • Like Like x 3
  12. FredBasset

    FredBasset Member Gold Contributor

    Joined:
    Dec 17, 2013
    Messages:
    30
    Balance:
    461Coins
    Ratings:
    +13 / 0 / -0
    Thanks BlazinH, only time for a quick test this morning but it solved my problem with PWM Max not being retained.

    Thanks so much.
    Fred
    • Winner Winner x 1
  13. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    Great. Can someone else confirm the fix works for them also so I can move the sketch to the first post?
  14. bbb8cd

    bbb8cd New Member

    Joined:
    Jul 23, 2018
    Messages:
    28
    Location:
    St. Louis, MO, US
    Balance:
    107Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I was having the same issue as @Reece152 and @FredBasset with the version in the first post; rewrote the Arduino with your 8.2 sketch and it seems to have fixed the problem.
  15. Jorge de Marchena

    Jorge de Marchena Hobbiest Gold Contributor

    Joined:
    Jul 13, 2020
    Messages:
    26
    Occupation:
    Electronic Engineer
    Location:
    Estados Unidos
    Balance:
    187Coins
    Ratings:
    +2 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    @Pit and @noorbeast

    If i use SABERTOOTH 2x32 i don't need to connect the pot to the motor shaft?
    How many motors could i drive with each SABERTOOTH?

    Using @RufusDufus SMC3 which will be the wiring diagram for 3 motors? How many SABERTOOTH i will require? How many ARDUINOS?

    You both are the BIBLE, your comments will be highly appreciated.

    Thanks
  16. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,147
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    148,578Coins
    Ratings:
    +10,903 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Use @BlazinH's modified SMC3 code for Sabertooth, with 2 motors per Sabertooth: https://www.xsimulator.net/communit...ket-serial-pid-motor-driver-for-arduino.9277/
  17. jknajfkae

    jknajfkae New Member

    Joined:
    Sep 28, 2020
    Messages:
    2
    Balance:
    41Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, Arduino
    Hello. I follow this method, but the two motors cannot rotate in the same direction. Is the potentiometer welding wrong?:(
  18. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,147
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    148,578Coins
    Ratings:
    +10,903 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Sound like you need to either reverse the wires to the motor being tested –OR– reverse the +5V and GND wires to your feedback pot for the motor being tested (do not do both).
    • Like Like x 1
    • Informative Informative x 1
  19. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,621Coins
    Ratings:
    +1,835 / 32 / -1
    If both motors follow pots correctly then use simtools to reverse motor. Otherwise reverse leads to the motor going opposite.
  20. iLLuac4

    iLLuac4 Active Member

    Joined:
    Jun 19, 2019
    Messages:
    130
    Balance:
    884Coins
    Ratings:
    +53 / 0 / -0
    My Motion Simulator:
    2DOF
    Hi. I am ooking into the code and from what i can see this is the one I can use for all the modes. Am i right?
    I can define eather mode 1, 2 or. 3 for motor drivers?
    Because this is the one that has fixed the write values. So basically this is the latest one with all modes defined.