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

    vthinsel Well-Known Member

    Joined:
    Feb 20, 2015
    Messages:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    164Coins
    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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    495
    Balance:
    4,798Coins
    Ratings:
    +180 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    495
    Balance:
    4,798Coins
    Ratings:
    +180 / 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:
    495
    Balance:
    4,798Coins
    Ratings:
    +180 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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 - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,013
    Location:
    Switzerland
    Balance:
    30,409Coins
    Ratings:
    +3,088 / 31 / -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:
    495
    Balance:
    4,798Coins
    Ratings:
    +180 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    - 28Coins
    Ratings:
    +21 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    - 28Coins
    Ratings:
    +21 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    - 28Coins
    Ratings:
    +21 / 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:
    436
    Location:
    FRANCE
    Balance:
    5,963Coins
    Ratings:
    +563 / 2 / -0
    My Motion Simulator:
    Arduino, 4DOF
    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:
    - 28Coins
    Ratings:
    +21 / 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:
    - 28Coins
    Ratings:
    +21 / 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:
    - 28Coins
    Ratings:
    +21 / 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