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

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Yes, the connection is quite loose.
    I'll attach the code with some explanations soon (especially on calibration which requires you to touch the screen when powering the TFT)
    • Like Like x 1
  2. robatik

    robatik New Member

    Joined:
    Apr 24, 2016
    Messages:
    4
    Location:
    iran
    Balance:
    81Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino
    libraries?
    is not
    SoftwareSerial.h
    LiquidCrystal.h
  3. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Those are standard arduino libs so I do not provide them. Liquidcrysyal should not be needed as the last version uses tft,not lcd.
  4. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    481
    Balance:
    4,640Coins
    Ratings:
    +174 / 2 / -0
    dear vthinsel,
    nice code, congratulations i would like to test it..

    one question and one wish/request

    question... why using sabertooh, it is a little bit expensive... does your code can be used with a moto monster driver? (that is cheaper)

    the request... i may loose it in the treat but... does your code can "learn" the pot position like the pololu jrk? i mean, in order do the tunning of pololu, you tell the polollu pc software, this is the max position of my pot, then you move the pot to the max position, and then you tell to the software, this is my lowest pot position, and you turn your pot to lower, in this way the software auto update values to the pololu card.

    does your code can do something like this via the touchpad display... if not, is it too complicated to implement...?

    best regards and again, grate improve to the community... thanks a lot.

    fer form mexico
  5. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Hello,

    I chose the sabertooth because it can be cascaded, offers a lot of possible configurations (pwm, serial, etc) and features. For the amps it delivers, I still find it to be valuable. You also get a very good support : I exchanged mine for the upper version for free (except shipping).
    My code coud be adapted to anything, like any code :D. On the learning pot stuff, it is more or less the current behavior : you setup the min/max on the TFT and you can see live the value you are setting.
    Cheers
    • Informative Informative x 1
  6. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    481
    Balance:
    4,640Coins
    Ratings:
    +174 / 2 / -0
    woow....
    but... if i just use your code with a motomonster insted of sabertoot will it work? or i have to adapt it?

    best regards

    fer
  7. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    481
    Balance:
    4,640Coins
    Ratings:
    +174 / 2 / -0
    by the way... i think that your modifications are in a position able to be a really nice alternative to jrk. i really mean it

    (alternative in terms of easy of use)
    fer
  8. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    No, it will not work unless it is modified. arduino/sabertooth commnication is done through a serial link at 115200 bps. If I'm correct, motomonster uses PWM output from arduino. That shouldn't be a big change, but I'm not able to test it as I do not have a motomonster. It even could be a parameter as I already managed different sabertooth modules. But I first need to finish my rig first :)
  9. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    2,998
    Location:
    Switzerland
    Balance:
    29,306Coins
    Ratings:
    +3,004 / 29 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    IMHO there exist enough codes for Ard and MM - no need for an other :)
  10. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    481
    Balance:
    4,640Coins
    Ratings:
    +174 / 2 / -0
    You are right... but i guess no arduino and moto moster code has the learning capabilitie of the pot position... and also i guess no code has a touch screen... :/)
    Last edited: Jun 8, 2016
  11. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    To be honest, there is no real "learning" of the pot position. It is just setting min/max values per axis, nothing more, nothing less. On the touch screen, I agree it is unique so far :p
    • Like Like x 1
  12. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    hi @vthinsel I recently bought an Arduino mega and an LCD shield and downloaded your sketch for the Arduino.
    I was having a lot of trouble getting anything to work, the LCD would light up and I could scroll through a few of the settings but I was not able to access any or change any of the settings, eg: K,P, I, D or min, max settings etc.
    The LCD shield I bought looked like any others but didn't come with any specs. After trying some example codes where you press the buttons and it should show up on the LCD what button was pressed I was getting "LEFT" when "SELECT" button was pushed and "DOWN" when "LEFT" button was pressed.
    The down, up and right buttons were ok.
    I found on FREETRONICS website a page where it stated what the voltages should be at the AO pin when each button is pressed and the corresponding digital input for their LCD shield.
    I have attached a pic of a screenshot from freetronics with my voltages and what I set my corresponding inputs to in your sketch.
    I still have some testing to do but for now I can at least access all the settings and change them now.
    Thought this might help if anyone else has similar issues with another shield.

    P.S. My settings that I have used are the ones on the left of the pic in black writing

    Attached Files:

    Last edited: Jun 13, 2016
  13. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Hello,
    I'm happy you were able to solve the problem. If I remember, I included in the code some other values to try to match different type of keypad resistors. The voltage dividers may be different from vendor to vendor, needing some code updates.
    As you have an arduino mega, I suggest you go for the more sexy TFT design :p
  14. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    I'm thinking about the TFT, will it work with the current 3.13 version of your code?
  15. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    No, the TFT is for version 3.15 and onwards.
    3.13 Vs 3.15 is only about LCD Vs TFT, no other changes.
  16. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Have you released version 3.15 on here? BTW great work with the code and screens
  17. vthinsel

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    372
    Location:
    FRANCE
    Balance:
    4,841Coins
    Ratings:
    +469 / 1 / -0
    My Motion Simulator:
    3DOF, SCN6
    Released in first post of the thread.
  18. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    Thanks for that, I've just been looking at TFT shields
  19. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    hi @vthinsel just wondering if you or anyone else has used this code with a sabretooth 2x25. I already had the 2x25 which is why I am using it, anyway I am having no luck in getting the code to work. I have the dip switches set as per the picture to set the baud rate at 38400. At the moment I am just using a volt meter to check the output from the sabretooth and just trying on motor one at this stage. The voltage stays at around -10 volts no matter what position the pot is or if I try axis testing through sim tools it still stays the same.
    There doesn't appear to be a problem with the sabretooth or the mega as I can getting everything working with @Wanegain code. I would prefer to use your code as it incorporates the lcd/tft option which would be really useful.
    Would really appreciate any advice or tips you or any other members could give.

    Cheers
    sabertooth dip switch.png
  20. graz

    graz New Member Gold Contributor

    Joined:
    Aug 19, 2014
    Messages:
    25
    Occupation:
    mechanic
    Location:
    melbourne australia
    Balance:
    2Coins
    Ratings:
    +15 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, JRK
    P.S. I have also tried using other baud rates, with it set at 9600 the voltage coming out of the sabertooth drops to approx. -3.5 volts but still doesn't change with pot or sim tools testing