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

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,281Coins
    Ratings:
    +1,115 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Did you check the pot? Maybe it got broken/disconnected and didn't reach the limit to make the motor stop so it kept moving
    • Friendly Friendly x 1
  2. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    The Pot is working fine, I disconnected the motor leads and moved it back around to the normal position with a spare battery.

    I tested the pot while moving it with just the battery and it was responding normally.

    I had some spare fuses so I replaced the fuse and reconnected the motor and it is all running perfectly normal now in SMC3.

    I don't really want to try it again in game until I figure out what went wrong. The motors feel really powerful so I think I need to detune it even more.
  3. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,281Coins
    Ratings:
    +1,115 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I know how you feel, it happened to me twice but always because of pots (using jrks)
    I would try lowering the power as much as you could with the stop button in your hand and check if it stops once reached the limits

    Good luck!
  4. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    If I try it in SMC 3 it obeys the limits, The clipping limit kicks in if I try to move the slider past the limit in manual mode, and I tried setting the max limit the same as the clipping limit and it stopped the motors fine when I move the slider past that point. I also tried it with the sliders in SimTools and it stopped the motors fine when it got to the angle that I set it at, that is why I am really puzzled with this problem, because I fully tested all the limits before I tried it in game.

    When I am doing my testing I switch over to a killswitch with a really long 10 foot cable, I call it my roaming killswitch because I just have it in my hand the whole time while testing, just in case I get an oscillation or it goes out of control, but I wasn't fast enough to stop it, it just whipped around and blew the fuse probably about a good second or so before I hit the killswitch. When I have my rig all running perfectly then I have a killswitch next to my wheel and one at the back of the rig.
  5. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    Today I asked Dimension Engineering for clarification and this was their response.

    "You can use setbaudrate with Syren 50, but only up to 38400. Autobaud does not do anything on a Syren 50. I will add that you can set baud rate 115200 using DEscribe software, then you will be able to run code at 115200. It's just the setbaudrate command that will not work for 115200."

    It appears your SyRen 50 was shipped to you already set at 38400. It was probably a returned unit they resold. Because things like this can happen is why I included jumpers in case someone's Sabertooth is not on the factory default of 9600.

    You will need a USB to UART TTL converter if you want to connect your SyRen to DEscribe in order to set it to 115200. While its fairly simple to connect it does add complexity to making it compatible with the native SMC3-SPS sketch therefore I'm not going to include it as a supported controller.
    • Informative Informative x 1
  6. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    In that case I think I might have set the baud rate myself in some early testing, because I did try sending

    {
    mySerial.begin(9600);
    ST[0].setBaudRate(38400);
    ST[1].setBaudRate(38400);
    mySerial.end();
    }

    To the Syren, so it could have been that which set the baud rate to 38400.

    I will see if I can get a USB to UART TTL converter locally and I will try setting it to 115200

    ***EDIT***

    Would something like this work?

    https://www.jaycar.co.nz/arduino-compatible-usb-to-serial-adaptor-module/p/XC4464
  7. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    That explains it.

    Yes but you can do a lot better on ebay. This one works great.
    https://www.ebay.com/itm/USB-2-0-to...918816?hash=item28230fa1a0:g:tOAAAOSwx2dYD4KZ
    • Informative Informative x 1
  8. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
  9. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    That's your prerogative. I only showed that link because it said ships worldwide vs. ones that said US shipping only that I could get in a few days.
  10. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Thanks for the link. Living in New Zealand really sucks for shipping so if it is for little bits like that then it is easier buying it locally instead of waiting for ages. I'm just popping down to the electronics store now so I will give it a try tonight
    • Like Like x 2
  11. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Awesome!!! It worked.

    I went down and got the serial to USB converter.

    Wired it all up and connected to 38400 with DEScribe then changed the baud rate in packet serial section to 115200, then restarted the SyRen to make sure I could connect on 115200 using DEScribe.

    Then I connected the Arduino back up to the SyRen and uploaded the standard sketch and it is working perfectly running at 115200. I don't get the arduino comms error anymore either. So it is working exactly like my Sabertooth.

    Normally you would connect to 9600 in the first instance but I had changed it to 38400 using the "ST[0].setBaudRate(38400);" command.

    So anyone reading this in the future. All you need to do to get a SyRen working is buy a serial to USB converter, connect to the SyRen on 9600 using DEScribe, then go to the packet serial section and change the baud rate to 115200

    Thanks heaps for your help getting this going @BlazinH

    The SyRen makes a good controller for rear traction loss if you are doing 3DoF, use a sabertooth for the seat mover and a SyRen for the traction loss.

    This is the serial to USB converter I used, it was $19NZD ($13USD) from Jaycar using my trade card, but as @BlazinH linked above, you can get them heaps cheaper on eBay

    [​IMG]
    • Winner Winner x 2
    • Informative Informative x 2
    Last edited: Nov 4, 2017
  12. MyTPioneer

    MyTPioneer New Member Gold Contributor

    Joined:
    Jan 22, 2017
    Messages:
    23
    Occupation:
    Database Developer
    Location:
    United States
    Balance:
    301Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    I can't seem to get the motor to turn ON. If I click any of the Motor buttons, they flash ON, and then instantly go back to OFF as shown in the picture below. Any help would be greatly appreciated.

    I have set things up according to the instructions at the beginning of this post. I'm using an UNO and a Sabertooth 2x32. I've set the baud on the 2x32 to 115200 and also set the serial timeout to 100ms using DEScribe. I've set the DIP switches as 1-2 OFF, 3-6 ON. The UNO is on COM 3 and the sketch has been uploaded. I set COMM=3 in the config file for SMC3. I've wired everything up according to the drawing.

    Any thoughts on what I'm missing?

    Thanks for any suggestions.

    MyTPioneer

    upload_2017-12-16_16-57-13.png

    Attached Files:

  13. insanegr

    insanegr !N$@n€

    Joined:
    Jan 14, 2014
    Messages:
    504
    Location:
    Athens
    Balance:
    16,718Coins
    Ratings:
    +499 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @MyTPioneer green line is your potentiometer and must be between the red lines Max limits. its a safety feature in SMC3
    • Informative Informative x 1
    • Useful Useful x 1
  14. MyTPioneer

    MyTPioneer New Member Gold Contributor

    Joined:
    Jan 22, 2017
    Messages:
    23
    Occupation:
    Database Developer
    Location:
    United States
    Balance:
    301Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Thank you @insanegr

    I manually twisted the motor to get the POT back within the limits and was then able to turn the motor on! Unfortunately it ran the POT right back over the limit and shut off again, so I guess I need to figure out what I need to adjust to prevent that from happening, but at least I have some movement now. Thank you, thank you.
    • Friendly Friendly x 1
  15. MyTPioneer

    MyTPioneer New Member Gold Contributor

    Joined:
    Jan 22, 2017
    Messages:
    23
    Occupation:
    Database Developer
    Location:
    United States
    Balance:
    301Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Ah, I see the answer listed in the initial instructions.

    • If it is moving away turn off motor power immediately (or quickly reduce PWMmax again). In this case 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). Restart the test from the beginning.
  16. MyTPioneer

    MyTPioneer New Member Gold Contributor

    Joined:
    Jan 22, 2017
    Messages:
    23
    Occupation:
    Database Developer
    Location:
    United States
    Balance:
    301Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    For some reason, I thought I had read where using this setup would work with a 3DOF rig, but now it looks like I was incorrect. Can someone please confirm this for me? If that is, in fact, the case, I'll start a new build thread for recommendations on setting up a 3DOF with an arduino and a couple Sabertooth 2x32s?

    Thanks again to All
  17. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    Just use two arduino, one for each sabertooth, then set up Simtools with two interfaces.
    • Like Like x 1
  18. Avenga76

    Avenga76 Well-Known Member

    Joined:
    Jun 29, 2014
    Messages:
    518
    Occupation:
    Network Engineer
    Location:
    Auckland, New Zealand
    Balance:
    3,261Coins
    Ratings:
    +853 / 6 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Yes. That is correct. I am using this to control my 3 DoF with 2 Arduino’s and 1 sabertooth and 1 syren

    You could also do it with 2 Arduino’s and 2 Sabertooth then you would have a spare channel if you wanted to use it later for a forth DoF
    • Like Like x 1
  19. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,281Coins
    Ratings:
    +1,115 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hey guys, I got my Sabertooth 2x32 and I'm finishing wiring it.
    One (maybe stupid) question: when I connect the 2x32 to a motor, do I have to connect M1A to the + of the motor and M1B to the - or do I have to use the B- for the negative?

    Thanks
  20. MyTPioneer

    MyTPioneer New Member Gold Contributor

    Joined:
    Jan 22, 2017
    Messages:
    23
    Occupation:
    Database Developer
    Location:
    United States
    Balance:
    301Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    @Blame73 See below...The B+ and B- are for your power supply coming in, and the M1A and M1B would connect to your motor 1 while M2A and M2B would connect to motor 2.

    [​IMG]
    • Informative Informative x 2