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

New XPID software for Arduino UNO/Mega and Sabertooth (with LCD !!)

Discussion in 'SimTools compatible interfaces' started by vthinsel, Apr 1, 2015.

  1. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I am using the same settings you posted above in this posting

    K= 1
    p = 5
    i = 0.2
    d =0.2

    BTW the motors are very quiet now while not moving
  2. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    You should set P to 1. And then increase until you get instability.
    I'll maybe implement auto PID tuning someday.....
    The settings need to be tuned for each setup as everyone is using different motors, pots, .... a possible reason can be also on deadzone. If the pots are too noisy (meaning the value is fluctuating when there is no movement) deadzone should be increased as well.
    We are touching here the empiric part of tuning !
  3. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    OK, tried to reduce p to 3 (before you posted the information above), the swinging was stopping, already some great success and almost at the finish line.
    Please :cheers if you have more time to add the information about these values, where to begin (important for beginners), the available range of the values and their function generally speaking. Already IMO you created a very powerful and complex motor driver platform which I am exploring and hopefully pushing to the limits (of my rig).
  4. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    shit. The rig is damaged. The game LFS was crashing and the rig was shooting to the right at full speed. The emergency flip switches worked but the speed was so high that the right screen crashed to the wall and the sway table was bumping the motors.
    Although the axis have been limited by SimTools this crash happened :-/
    I will examine now the parts...I hope the pots and the motors are not damaged.
  5. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    I'll check but I'm pretty sure I saw somewhere some docs/tutorial on the site. Especially the "PID without a PHD" which brought me up-to-speed with those famous letters.
    My software makes visible what the others hide (the values), allowing fine tuning. I'll try to give some generic advices, with conservative values, the idea would then be to go from sluggish sim to a great one thus avoiding vibration, instability, etc.
  6. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Arghhhh. LFS only crashed or LFS + SimEngine ? Normally, if the game completely diseappears, SimEngine should detect it and send the end command which would put the standby value as the target.
  7. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,047
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,980Coins
    Ratings:
    +10,884 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
  8. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    A much more reliable method of limiting axis would be to set PotMin and PotMax in the controller software to a lesser range.
    • Like Like x 1
  9. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Totally agree.

    @vthinsel if I limit the min max pot settings within the menu the sabertooth will not overshot?

    BTW the pot is not damaged, the motors seem to be fine (no axle broken, but dunno the gears), I will test later. The rig itself seems not to be damaged. My safety arrangements are working! Only a small hole on the wall :)
    • Like Like x 1
  10. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    While the question was not directed to me, your rig can still overshoot min-max pot settings. The amount of overshoot depends on its inertia and how fast motor braking can kick in once they are reached.
  11. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I agree with you, thank you for responding. Heretofore I was using SMC3. This tool allows the limiting and breaking of the motors, if they overshot a certain line. That works for me, the rig was never crashing even if any software was crashing. Now I am new to the code by @vthinsel and I hope we can sort it out.
  12. BlazinH

    BlazinH Well-Known Member

    Joined:
    Oct 19, 2013
    Messages:
    2,145
    Location:
    Oklahoma City, USA
    Balance:
    16,613Coins
    Ratings:
    +1,835 / 32 / -1
    Since the SMC3 software was working good for you already is there a reason way you aren't using the sabertooth version of it now @Pit?
    Last edited: Oct 13, 2015
  13. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I am using 24V motors...the VNH5019's have been too weak to handle the high currents (SMC3), so I was happy that vthinsel was optimizing the code of wanegain wherefore I bought a Sabertooth.

    @vthinsel: limiting the MaxFeedback does not change anything - I can turn the pot to the end (position 1023), despite of the new settings (limited to 1000) the motors continue moving after the new value. Probably I misinterpreted this option?
  14. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    All is working...the Sabertooth combo works like a charm. After the crash today and repairing a few things (fortunately no hardware has been really damaged, maybe one gearbox could have some issues but it is still working, I have two in reserve.)
    I played with the parameters and already after a short time I got better results then using the VNH5019/SMC3 combination. It is much smoother showing a better resolution of the forces.
    Speed Ramping: 0.2s (Describe Software) - very helpful for long accelerations on rails as my rig is doing
    K =0.30
    Prop = 3.00
    INt = 0.20
    Der = 0.20
    Furthermore I extended the safety zone - the flip switches are now 5cm displaced.
    Last edited: Oct 13, 2015
  15. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Glad to hear nothing is broken, except your wall :D and that my code is usefull ;)
    Now you can order a TFT-LCD :p to benefit from the upcoming new release (not before a two or three weeks, so take your time to order to dx.com ....)
    • Like Like x 1
  16. zigzag49

    zigzag49 Active Member

    Joined:
    May 27, 2014
    Messages:
    251
    Balance:
    712Coins
    Ratings:
    +220 / 3 / -0
    My Motion Simulator:
    2DOF, Arduino
    Thank you for your back, having recently that the screen will be very useful, being novice details on these settings are worth taking;)
  17. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,900Coins
    Ratings:
    +1,016 / 10 / -1
    @BlazingH was referring to special sabretooth version of SMC3 in this post if you weren't aware of it. http://www.xsimulator.net/community/threads/smc3-sabretooth-test-version.6236/#post-69349
  18. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,439Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
  19. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Missed this post.
    No, you didn't misinterpreted. It looks like I have a bug to correct :eek:. I'll check if I can make a patch easily.
    • Like Like x 1
    • Friendly Friendly x 1
  20. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    439
    Location:
    FRANCE
    Balance:
    6,010Coins
    Ratings:
    +564 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    Well, if you want I have updated the 3.12 I also ported this update to the 3.13 I'm working on with TFT
    Do you wan to try the 3.12 portion which should fix that ?
    It should be as simple as changing the SetPWM function with that one:
    EDIT : code removed, as will not produce the expected result
    Last edited: Oct 16, 2015