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

    sci666 Active Member Gold Contributor

    Joined:
    Mar 18, 2021
    Messages:
    186
    Location:
    Germany
    Balance:
    1,146Coins
    Ratings:
    +70 / 0 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Dont reinvent the wheel if uno r3 works flawless.... It's Just 15 Euro for an r3.... So take this one
  2. Raysinred

    Raysinred New Member

    Joined:
    Jul 7, 2023
    Messages:
    5
    Balance:
    26Coins
    Ratings:
    +1 / 0 / -0
    Agree, which is why I ordered the R3 last night and I'm sending the R4 back today.

    Thanks all for the help.

    Regards,
    Ray
    • Agree Agree x 1
  3. miaziol

    miaziol New Member

    Joined:
    Dec 20, 2020
    Messages:
    29
    Location:
    Poland
    Balance:
    - 77Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Hello
    I madę some upgrades in my rig so I have a little question. Im read everything here and I don't find answer. Change my drivers from cheap Chinese to sabertooth. I buy 2x32A I have two motors, 24V 350W each.
    My motors have a maximum operating current of 20A. I want to use an old power supply from telecoms for the power supply. Specifically, it is an ericsson 27.2V 1200W. The braking resistors calculated are 3.3Ohm this should dissipate about 200W of power for me. The output supports a maximum of 8A so there is no point in fitting larger ones. My question is will this power supply cope with these motors? Will it be necessary to use batteries? I wouldn't want to do this because the whole thing is supposed to be compact and such batteries take up a lot of space. After changing the gearboxes from cheap Chinese ones to SFU from DofReality the drivers and motors are cold after a few hours of operation it doesn't heat up at all. Now I have two cheap Chinese 24V 600W power supplies but I have the impression that they lack power when rapidly lowering or raising the platform because I can hear the fans inside the case slowing down to practically nothing. I don't know if it's the return current or the lack of power. On the graph in smc3 this manifests itself as a peak down past the clip and climbing to the set position. The motors are not braking fast enough. Is this a fault related to an incorrect pid loop setting or perhaps a power shortage?
    I now have the parameters as shown in the screenshot and generally everything is correct in the tests.
    411173737_754529053244349_1816730846384152514_n (2).jpg
  4. 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
    Fan behavior is not a definitive measure, grab a multi-meter and a friend then check the PSU output under load.

    It is hard to say for sure but my guess is that kp could likely be higher and PWMmax and PWMrev refined.
  5. miaziol

    miaziol New Member

    Joined:
    Dec 20, 2020
    Messages:
    29
    Location:
    Poland
    Balance:
    - 77Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Ok I must try, I take this settings from dof manual. I use this same motor Transtecno EC240.250.
  6. 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
    To get the best out of hardware settings should be tuned to those actually being used, as there is manufacturing variation even in the same product line.
  7. miaziol

    miaziol New Member

    Joined:
    Dec 20, 2020
    Messages:
    29
    Location:
    Poland
    Balance:
    - 77Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    I have a strange problem, sometimes once in a while, the driver controls the motors one by one. Instead of lowering or raising both arms, it lowers first one then the other, which is a noticeable delay. I have something like this for example when testing in simtools. what can this be caused by? Some kind of timeout? The power supply is 2x 24V 600W. Of course there are braking resistors. This only happens sometimes, but it is quite annoying
  8. Kevinski

    Kevinski If it doesn't fit, hit it until it does.

    Joined:
    Feb 17, 2023
    Messages:
    181
    Occupation:
    Jack of many trades, mastering some.
    Location:
    Australia
    Balance:
    315Coins
    Ratings:
    +95 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform
    I have a question regarding sim tools interface BitsPerSec vs Arduino Uno vs sabretooth baud rates. The default setting in windows device manager usb serial port settings the Arduino is connected to, is only setup for 9600 BPS. Sabre Tooth Baud is set to 115200. There is no mention I can find anywhere about changing the windows USB serial port settings from it's default 9600 BPS to match the sabretooth 115200 settings.

    And then in Sim Tools interface setup the BPS it's setup up by default at 500000 BPS. Everything is working with my rig as it has for many months now, but am I missing something here with all the mismatched BPS? In the windows port settings I can select 115200 as an option for the BPS. Should I do this, or will this create a conflict with the Arduino code that has been written by BlazinH for sabretooth to Arduino? Just seems a bit strange that the default windows port settings are only allowing 9600 BPS, but the sabretooth is setup to use 115200 BPS. That's quite a bit more.

    EDIT: I did a little research and see now that Baud rate and Bits Per Second are not the same. In any case, is there any advantage to increasing the Bits per second in the windows port settings from 9600 BPS to be higher? And if so, would this mean the RufusDufus SMC3 code would need to be changed to reflect a port setting change? Anyone out there know about this stuff I'm rambling on about? It looks from what I've read on the Arduino site that indeed the defaul 9600 BPS can be increased on an UNo. Just not sure in the scheme of things, if it would make any noticeable difference with actual in game data transfer.
    • Like Like x 1
    Last edited: Apr 1, 2024
  9. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    Hello, I post a few weeks ago asking for help but seems nobody see my last post in my thread. Anyway, My build was done in January and since then I'm fighting first with cheap drivers that I solved buying and installing a couple of Sabertooth 2x60 and now with some strange noisy behavior that makes the rig unusable.

    Here is a link to a video showing what is happening with the motors. In this video I only show the behavior of one of the motors but all of them suffer the same problem.



    As you can see, when the motor lift me up run smooth, not perfect but good enough but the problem is when the motor drives me down it start to bounce. It happens as soon as the Kp start to be big enough to move the motor. I tried all the possible combinations with Kp, PWM max, Kd (nothing changes with this value), I even start with PWMax to 255 and then increase Kp and when it is around 80 the motor starts to move and start to do that bounces.

    And next I show you what is happening in SMC Utils

    smc_noise_Down.PNG

    There is the yellow line that (AFAK) shows how it is sending "force" to the motor to drive it forward or backwards and we can notice that when the arduino send the signal to move the motor up (squared in black) that signa is not perfect but as I said is tolerable. If we see the signal when the motor drives down (with a red arrow) that signa is very dirt.
    Don't care about the SMC values because it happens whatever the SMC values be, this is an example but it reproduces always.

    I was convinced that it was noise from the motors, then noise from the hall sensors and I tried everything:

    • Shielded cable for the hall sensor
    • Bought a better hall sensor with shielded cable and EMI protection.
    • Shield the motor cables with a kind of metal mesh
    • I'm using batteries (also tested with power supplies and it add the problem that the PSs burned)
    • I use the Sabertooth in a separate box of the Arduino
    • I try to connect the Arduino with an ADUM 3160 (USB noise supressor)
    • Tweaked SMC in all the ways
    • Installed a capacitor between the motor cables and between the cable and the motor chasis
    • I don't remember if I tried to do something more because I'm starting to be tired of this project
    Nothing of that, NOTHING works at all. It hasn't even improve it a little the problem so I'm stuck because I don't know what is happening and how to solve it.

    If anyone knows and can help me I will be very grateful.

    Thanks in advance
    Last edited: Apr 17, 2024
  10. 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
    What does the graph look like with the kp at 400?
  11. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    Thanks for the reply. As far as the Kp increase the problem get worse:

    smc_noise_Down_Kp400.PNG

    The red arrows indicate when the motor is driving up and when down. I also tried decreasing the PWMax but the problem stills. As soon as Kp is able to get the motor moving the problem appears.
  12. 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
    With kp at 400 at what vale of PWMax does the rig start to move?
  13. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    It starts to move at PWMax=17 without load
    image.jpg

    To start moving if I sit on PWMax needs to be 70 (at this point the motor only moves a little not following the sine wave). If I live the rig without load it starts to bounce as crazy.

    image.jpg
    Last edited: Apr 18, 2024
  14. 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
    And with PWMax at 100 and Fpwm at 25Khz?
  15. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    Bad :confused:

    image.jpg

  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
    And Fpwm at 30Khz?

    What is the current CTC distance on the levers?

    Also is this the point at which the rig is level, at its rest position, as it should be but does not look like it in the video:
    Level.jpg
  17. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    The current lever distance is 125mm. When the rig is level the levers are parallel to the floor.

    Changing the Fpwm does not make any changes with the problem even how the rig moves, seems like it is not affected by Fpwm (same behavior from 5 KHz to 35 KHz)
  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
    Design wise the levers should be at 90 degrees to the rods when the rig is at its level rest position. The reason being that a lever is at its maximum torque efficiency at that position.

    Not doing so means the effective lever torque utilisation when going down, with the aid of both gravity and rig mass, is significantly less than when going up.
  19. Josh_Possa

    Josh_Possa Active Member

    Joined:
    Jan 25, 2021
    Messages:
    118
    Location:
    Catalunya
    Balance:
    556Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Motion platform
    Yes, it is, but it stills makes no sense that behavior when the rig is empty. I can understand some weird behavior when the rig is full load and there is a error in the design but now the rig is running without load so...IDK. When this problem will be solved I'll modify the motor position to match the lever-rod angle to the max efficiency

    As you can notice the union between the motor axis and the hall sensor axis is an elastic rubber (I checked at first if it was the problem but it doesn't and the behavior is the same if a toothed belt is installed instead the elastic rubber). That makes me able to modify manually the sensor position and makes the motor correct the position. Well, in this case that is not SMC (or FlyPT) sending commands the motor movements completely clean, why? I don't know.

  20. 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
    I direct drive my Hall sensors from the motor shaft, so there is a 1:1 no slop connection. That you can move your Hall sensor so easily by hand may mean it is also affected by vibration and or inertia.

    Electrical interference is another possibility.
    • Like Like x 1