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 SMC3 Arduino 3DOF Motor Driver and Windows Utilities

Discussion in 'SimTools compatible interfaces' started by RufusDufus, Dec 1, 2013.

  1. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    The SMC3 code at the bottom of the first post in this thread works fine with these boards without modification. There is a windows setup utility in the second post.

    The wiring details are also in the first post, just look for the one that has a picture of your board - its under heading MODE1.
  2. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Dear RufusDufus,

    Thanx for the info, I've understood already.
    Another question:
    There is another, different kind of wiring and code from
    RacingMat (it is a bit newer version, from this february, this year):

    https://www.xsimulator.net/community/marketplace/arduino-code-2dof-and-2-pins-direction-hbridge.67/

    Is this also workable?
    Am I right, if I want to use RacingMat's code, I have to work with his wiring and code,
    not this thread's wiring and SMC3 code?

    Thanx for helping me,
    Regards,
    George
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    Correct if you use racingmat's code then use his wiring details and support from his thread.
  4. Pedro Silva

    Pedro Silva New Member

    Joined:
    Oct 1, 2016
    Messages:
    8
    Occupation:
    Telecomm, Electronics
    Location:
    Yoshkar-Ola, Russia
    Balance:
    251Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hello @RufusDufus !
    As we say...better later than ever... Congrats for your work!! Flawless! Maybe im just couple years delayed to say that? :D:D
    The point is: im a very beginner on this comunity but very excited to get my first 3DoF ready to put my little daughter on top of it with me and shake around with roller coasters and others...
    I will start from zero to use your tools also inspired by @SilentChill first 3DoF thread. Hope it goes smooth! I confess im a little confused at a first glance with your Windows tool full of beautiful buttons and graphics, but im sure time (and this thread, most likely) will tell me how to take it over in a good term.
    One little question: as we are (as far as i understood) very close to have SimTools 2.0 released, will it causa any bad impact on your tools? If so, are you planning to adapt it accordingly?

    Thanks!! Great day for all!
  5. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,902Coins
    Ratings:
    +1,016 / 10 / -1
    As far as I know SMC3 will work with Simtools2.0 unchanged.
  6. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,557Coins
    Ratings:
    +3,487 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I can confirm it does work perfectly with Simtools 2.0 :D
    • Informative Informative x 1
  7. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    RufusDufus,

    Thanx.

    Chhers,
    George
  8. outrunner

    outrunner Run to get the race leader flag!

    Joined:
    Oct 7, 2016
    Messages:
    53
    Occupation:
    father mother
    Location:
    Italy
    Balance:
    639Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    Arduino
    May I ask why the motomonster pinout is not respected here?

    I mean: motomonster is essentially an arduino shield, so it can be "piggybacked" directly over an arduino uno without the need for "complex wirings" ... we are dealing with 3 axs here, but the code could be used with two axis with very few solderings here with some different declarations like:

    Code:
    const int ENApin1 =7;  // ENA output pin for Motor H-Bridge 1 (ie PortD bit position)
    const int ENBpin1 =8;  // ENB output pin for Motor H-Bridge 1 (ie PortD bit position)
    const int ENApin2 =4;  // ENA output pin for Motor H-Bridge 2 (ie PortD bit position)
    const int ENBpin2 =9;  // ENB output pin for Motor H-Bridge 2 (ie PortD bit position)
    const int ENApin3 =11;  // ENA output pin for Motor H-Bridge 3 (ie PortD bit position)
    const int ENBpin3 =12;  // ENB output pin for Motor H-Bridge 3 (ie PortD bit position)
    const int PWMpin1 =5;  // PWM output pin for Motor 1 
    const int PWMpin2 =6;  // PWM output pin for Motor 2 
    const int PWMpin3 =10;  // PWM output pin for Motor 3
    
    Am i wrong?

    This could cause some conflict within the code (the Author used some direct port manipulation) but it would be nice to know ;)
  9. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    outrunner,

    That's why I've asked about it, 'coz I just want to start my stuff's wiring, and
    RacingMat has a different wiring and code here:

    https://www.xsimulator.net/community/marketplace/arduino-code-2dof-and-2-pins-direction-hbridge.67/

    This wiring of RacingMat like you just stack together the 2 cards, 'coz pins are at the same place, you don't have to solder, as you wrote.

    So, guys please help me to decide what wiring and code could I use? SMC3 with more complex wiring or RacingMat's wiring with his own code?

    Cheers,
    George
  10. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Another interesting question:

    I have this arduino R3 card, with LCD display:

    http://eud.dx.com/product/high-qual...-1602-keypad-shield-kit-for-arduino-844379471

    Is that possible to stuck first the LCD to arduino, after wire the moto shield from LCD's pins?
    In this case I can put an easy code addon into the code to write the current axis datas to the LCD continously.
    That should looks GREAT...:)
    If it is possible - is there any latency to the moto shield 'coz of the LCD?

    Cheers,
    George
  11. outrunner

    outrunner Run to get the race leader flag!

    Joined:
    Oct 7, 2016
    Messages:
    53
    Occupation:
    father mother
    Location:
    Italy
    Balance:
    639Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    Arduino
    I think that changing the pinout declarations in the arduino sketch is worth a try: the worst case scenario is that nothing happen.

    About the LCD, it's worth a try: the nicest thing of Arduino is the possibility to toy easily with sketches.

    I am still in a evaluation stage (some components are on their way from china) so i'll be of no help for at least 3 weeks :(
  12. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    outrunner,

    Thanx, maybe I'll try.
    Anyone else, who has been tried that LCD, or other pinout declarations, and codes?

    Regards,
    George
  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
    me too lol
  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
    LCD? SMC3 doesn't support any lcd screens. Or maybe I didn't understand what you tried to explain, could be a language barrier.
  15. outrunner

    outrunner Run to get the race leader flag!

    Joined:
    Oct 7, 2016
    Messages:
    53
    Occupation:
    father mother
    Location:
    Italy
    Balance:
    639Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    Arduino
    That code can handle an LCD with little modifications.

    The point is: will libraries cnflict ith each other? Will the code perform well? It's only a matter of testing ;)
  16. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    @Pit

    It is an arduino shield, you can just stack together with the arduino board.
    In the code, you can just add a few lines in the cycle to write the datas, like axis 1,2
    to the display.

    Regards,
    George
  17. outrunner

    outrunner Run to get the race leader flag!

    Joined:
    Oct 7, 2016
    Messages:
    53
    Occupation:
    father mother
    Location:
    Italy
    Balance:
    639Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    Arduino
    It's am arduino shield, but you must pay attention to the declared pinout. IIRW hooking a dysplay calls for 4-5 additional pins.
  18. George Dobransky

    George Dobransky Active Member

    Joined:
    Sep 29, 2016
    Messages:
    216
    Location:
    Hungary
    Balance:
    - 39Coins
    Ratings:
    +130 / 4 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    outrunner,

    Sure, if the LCD uses just one of the same pin as SMC3's wiring, it shouldn't work,
    maybe only as a 'slave' unit, but it should take some latency...in this case, not worth....

    Chhers,
    George
  19. Grigory

    Grigory Active Member Gold Contributor

    Joined:
    Jul 6, 2016
    Messages:
    202
    Location:
    Moscow
    Balance:
    217Coins
    Ratings:
    +304 / 1 / -0
    My Motion Simulator:
    3DOF, 6DOF
    Just want to report a problem that I faced and a fix that worked:

    I have six motors controlled by three Arduino's running SMC3 code. The code is modified to support Sabertooth packet serial mode , but the problem that I had is not relevant.

    The issue was that when two motors controlled by a single Arduino were positioned so that their two potentiometers returned something close to 0V and 5v the Arduino analog input with lower voltage started to show terrible noise.

    Re-wiring or adding capacitors did not help.

    The problem was solved by modifying the code and using three consecutive analogreads instead of just one. It appears that in my case analog input with lower voltage needed more time to get a proper reading when another input had much higher voltage. Issuing multiple read commands took care of that.
    • Informative Informative x 1
  20. outrunner

    outrunner Run to get the race leader flag!

    Joined:
    Oct 7, 2016
    Messages:
    53
    Occupation:
    father mother
    Location:
    Italy
    Balance:
    639Coins
    Ratings:
    +8 / 0 / -0
    My Motion Simulator:
    Arduino
    Interesting. Maybe a (very) little delay after the analogread would suffice.

    Out of curiosity, may I ask you to post your modified code for 6 axis?