1. 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 Download Package Now!
  2. 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
  3. 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 here. Do not following these rules will lead to permanent exclusion from this website: Read the forum 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 - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Not really related to this thread but since today there is no more red LED. After the first tests (testing unit and using multimeter) on the 12V line all seems OK, but when I connected the 24V PSU one channel output was not working. I will continue tomorrow with the tests, probably there was an issue with the pots or something was not correctly wired. We will see...
  2. Wanegain

    Wanegain Active Member

    Joined:
    Nov 6, 2013
    Messages:
    549
    Location:
    Bruxelles
    Balance:
    1,384Coins
    Ratings:
    +275 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    What is the output not working ?
    What kind of power supply are you using for 12V and 24V ? If you are using a battery you need to change the state of DIP 3.
  3. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    yesterday I got successfully working 12v today I will check that out again with 24v outside of the rig. Probably I did something wrong, I will report later. I'm using only psu's
  4. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    so all is up ad running. But - far away from being perfect. Jerky, rough - all forces available but not drivable ;)

    So I kindly ask you to write a short documentation of all available settings or please post the 2 or 3 most important settings and which value you suggest. If there are any settings which have not to be changed on the fly while the motors are running please inform.

    I have the following issues:

    1) Too much Kp, but dunno how much PWMmax I have...
    2) Deadzone - there are dead zones for the motors and under general settings - which one is to be used?
    3) After shutting down the game manager the motors are very nervous, they jerk a little bit in every direction for 2 or 3 seconds which make me nervous :)

    Anyway the LCD display is very helpful, but it would be more helpful, if I can modify any settings by using the PC (this has some reasons because I am sitting in the rig and for every change I'd have to leave the rig and push some buttons.
    Last edited: Oct 12, 2015
  5. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    PS: in the .ino file there is a startup code:

    XL~a01~CXR~a02~C

    In the video there is no code - so what shall I use?
  6. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    huhu? Guys I would like to continue but can't without your help :)
  7. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Oups.... sorry for not answering earlier. Been busy all WE with rugby kids tournament and so on. Now I'm on "vacation" in a business trip , so I have done some code :grin
    Looks like you made good progress and you are near to succedd. I'll edit the post according to your findings so others do not have the same issue. As a security you can also limit current using describe software if I'm correct
    On my side, I have progressed on the TFT:
    [​IMG]
    It is flashy/old school/colorful :p

    The issue is that the refresh of the target/current/power took a long long time.... around 400ms (first clear by writing the same data using background color, etc etc). With some optimizations I brought it down to 100ms :eek:
    So I took another approach: a graph displayed when you hit the "p2" button.
    [​IMG]
    Displaying a line takes less than 4ms, which is acceptable for a debug visualization and I find it in fact more informative than pure text.
    Now I need to code the editing of the values and the next release will become closer......
  8. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    I use XL<Axis1>CXR<Axis2>C in the interface settings
    upload_2015-10-12_23-34-17.png

    Next code will have correct info about that
    For deadzone, I have removed the general one in the upcoming version. My advice: general = 0, and use the individual.
    And for the value control from a PC, I'm considering another alternative.... more on that soon ....
  9. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    @vthinsel so many information thanks a lot!

    The last one is not clear to me while it is very simple for sure :) :

    k
    p
    i
    d

    What do this values mean? k is 1.00 but what happens if I change it to 2? The problem: the rig is assembled and if any experiments fail I can begin from the very first beginning ;)
  10. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    If you change K to 2, the response will be stronger, which may create oscillations, which would be make some rumble. You should increase it only if you feel the seat is really late compared to what you expect.
  11. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    so decimal digits like 0.5 are possible?

    K= ?
    p = prop= ?
    i = int = ?
    d = der = ?

    I edited the values because I did not have a look exactly to the endings.
    Last edited: Oct 13, 2015
  12. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Describe software - Speed ramping
    In all analog modes except Single Direction, an analog signal sent to the A1 auxiliary input controls the
    ramp rate for both channels of the motor driver. This is useful to make gentle motions or limit peak
    currents due to acceleration.
    For example, a ride-on electric skateboard that started at full power
    immediately will throw its rider off, but one with a several second ramp rate is easy to ride. If thisinput
    is not connected, the input’s internal pull-down will automatically set the fastest response. If adjustable
    ramping is not desired, leave the A1 input disconnected. The ramp rate can also be set using the
    DEScribe PC software.


    Very important - IMO very usefull for the tables I'll try it out.
  13. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Short review:
    The pro:
    I tested the Speed ramping - which - in deed - softens the beginning of the acceleration. Not too harsh at the beginning but immediately accelerating at full speed.
    Now the con: At the end of the acceleration the motors are stopping but swinging like a swing set :) - forward - backward - forward and then they stop (0.500 s)

    Reducing the Speed Ramping makes it better but already too aggressive (0.200 s) .

    I have to wait now until @vthinsel would kindly post some useful information about the

    MenuItem menu_motor2 = MenuItem("Motor 2");
    MenuItem menu_K_motor_2 = MenuItem("M2 K");
    MenuItem menu_proportional1_motor_2 = MenuItem("M2 Prop");
    MenuItem menu_integral1_motor_2 = MenuItem("M2 Int");
    MenuItem menu_derivative1_motor_2 = MenuItem("M2 Der");
    MenuItem menu_stdby_motor_2 = MenuItem("M2 Stdby");
    MenuItem menu_FeedbackPotDeadZone2 = MenuItem("M2 DeadZone");

    Thanks :)
  14. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    But we are not using analog mode. We are using serial.
    Interesting though
  15. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Yes, of course!

    "If adjustable ramping is not desired, leave the A1 input disconnected. The ramp rate can also be set using the
    DEScribe PC software
    . "
  16. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    What do you want to know about that ? It is the LCD menu objects that are used in the sketch. All this will diseappear with TFTLCD anyway :)
    If it swings it probably mens you K is too high. What is your current value ?
  17. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I do not know what these settings are doing - I am a noob :)

    K =1.00
  18. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    No we are not. Analog mode is when you apply a voltage between 0-5V on S1 and S2
    From the 2x32 manual:
    Analog Analog control uses analog voltages to send commands to the Sabertooth 2x32. This is the simplest way to control a Sabertooth. These voltages can be generated by potentiometers, switches, joysticks or digital to analog converters. The input voltage range is 0 volts to 5 volts. Custom ranges can be set using the DEScribe PC software. In Analog the S1, S2, A1 and A2 terminals are analog inputs. They are internally pulled down to 0V if not connected to a signal.

    It is strange that you are able to apply a ramp-up using serial.
  19. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    373
    Location:
    FRANCE
    Balance:
    4,897Coins
    Ratings:
    +470 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    So K=1, what is your P, I and D ?
    Try decreasing P to reduce the strength. IT should ct more or less like the ramping parameter for analog.
  20. Pit

    Pit - - - - - - - - - - - - - - - - Staff Member Moderator Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    2,995
    Location:
    Switzerland
    Balance:
    29,434Coins
    Ratings:
    +3,007 / 30 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    ah ok - I construed this fact as an additional option - even w/o analog input I can change the ramping and it works.