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

    RaceRay Administrator Staff Member SimAxe Beta Tester

    Joined:
    Nov 8, 2006
    Messages:
    4,656
    Occupation:
    Self-employed | Web and application development
    Location:
    Hamburg, Germany
    Balance:
    23,864Coins
    Ratings:
    +2,007 / 13 / -0
    My Motion Simulator:
    2DOF, DC motor, SimAxe, SimforceGT
    @ericRacer good to hear that it is working. Do you have the specs of your conputer? I am curious about the cpu differences between yours and rufus computer.
    • Like Like x 1
  2. ericRacer

    ericRacer You get old because you stop playing ! Gold Contributor

    Joined:
    Jun 11, 2009
    Messages:
    251
    Occupation:
    Pilot
    Location:
    Canada, Quebec
    Balance:
    949Coins
    Ratings:
    +147 / 2 / -0
    My Motion Simulator:
    3DOF, Arduino, Motion platform
    Hi @RaceRay ,
    i attached a file in the previous post #59 ;)
    Eric :cool:
    • Like Like x 1
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Good to hear you have it running.... still curious why you don't get a higher packet rate?
    • Like Like x 1
    • Agree Agree x 1
  4. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Hi Rufus, thanks again for creating, and supporting, this project.

    I am going to try your code and utility for my 6DoF project. As I finished welding the frame and mounted the motors I thought I would spend some time setting up the Arduinos. I am going to use three Arduinos to run two Pololu 755s and two of the Chinese Mode 1 drivers that you have in your first post. I have the code loaded and started SMC3 utility (.063 of both). Everything seems to be working but I do not have any motors or power connected to the motor drivers. Are there any tests that I can do with this configuration to test the motor drivers or do I have to connect the 12v power supply and motors?

    Thanks again

    David
    • Like Like x 1
  5. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Depends on what sort of testing you mean. You could check that SMC3Utils talks to the Arduino OK... ie can setup parameters etc.

    If you have feedback pots fitted you should be able to see the green feedback line change as you turn the pot. Also the yellow PWM curve should change as it tries to align motor feedback and target.

    I always suggest if you have a toy DC motor and battery then hook that up to the H-Bridge for testing and just manually turn feedback pot - motor should speed up and slow down around the target position.

    If you are planning on using the UDP passthrough for testing/setup you could check that you can get that working with simtools and see the Simtools output (light blue curve on chart).

    If you have a CRO or DSO you could hook up to the PWM signal and check that it changes duty cycle as expected.
    • Like Like x 1
  6. spartan300

    spartan300 New Member

    Joined:
    May 25, 2011
    Messages:
    19
    Occupation:
    Doctor
    Location:
    Athens
    Balance:
    462Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    hi,
    I have set up an arduino UNO R3 with a dual VNH2SP30 Motor driver from pololu.
    I connected everything and start with SMCutil v. 0.63. Everything working great.
    Now i want to connect the simtool.
    I only use one PC with those spec: intel i5 3.4Gh, 8Gb RAM 2133MHz, nVidia GeForce GTX 760 2GB, SSD 250GB, windows 7 ultimate 64x.
    The simtool works great with my game (RBRally).
    I think that the only think that remains is to connect the SMCutil with simtool (or not)?????
    Thank you
    Loukas
    • Like Like x 1
  7. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Well in fact you don't need Windows SMC3Utils once you have setup the motor parameters. The Windows tool is really only required for setup.

    I would recommend not even using Windows SMC3Utils with Simtools to start with... Its just another thing to get working. Keep it simple to start with and just connect Simtools directly to the Arduino SMC3 using the comm port. You need to setup Simtools with 500000k baud, No Parity, 8 data bits and 1 stop bit. Also set Simtools to output 10bit Binary data. Make sure Windows SMC3Utils is not running.

    Once you are happy everything is working as expected then you can consider adding Windows SMC3Utils to monitor the motors but it is not necessary.
    • Like Like x 1
  8. spartan300

    spartan300 New Member

    Joined:
    May 25, 2011
    Messages:
    19
    Occupation:
    Doctor
    Location:
    Athens
    Balance:
    462Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Thank you RufusDufus,
    I have a few more questions.
    1.Any changes i made with SMC3Utils goes direct to arduino chip and remains there?
    2.When i will connect simtools i dont have to load any other file to arduino chip? Also my com port setting (com6) on windows has 115200baud. Does this cause any problem beeing 500000 on simtools?
    Thank you very much.
    Loukas
    • Useful Useful x 2
    • Like Like x 1
    • Agree Agree x 1
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Yes when changes are made with SMC3Utils the values are written to the Arduino EEPROM so they are saved even when reset or powered off.

    No there is nothing else to load to the Arduino after you have programmed it with the SMC3 code once. (Other than setup the parameters with SMC3Utils)

    It doesn't matter what the device manager says the baud rate is. Simtools sets everything up as long as you have selected the right values in the interface tab.
    • Informative Informative x 5
    • Like Like x 1
  10. spartan300

    spartan300 New Member

    Joined:
    May 25, 2011
    Messages:
    19
    Occupation:
    Doctor
    Location:
    Athens
    Balance:
    462Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    :thumbs:thumbsyou are great
    thank you.
    I'll try it and reply the resolts.
    • Like Like x 1
    • Friendly Friendly x 1
  11. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Hey RufusDufus,

    Can this code be adapted to motor drivers that only require one PWM and one DIR wire? (as well as the ground wire from the ardiuno)?

    Two of my motor drivers are Pololu 755s, I had hoped to use your code with them as well.

    http://www.pololu.com/product/755
    • Like Like x 1
  12. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Yes it can be used as-is. Just make sure it is set to MODE1 before uploading the Arduino code (ie edit the line at the top of the code use CAPS and no spaces for MODE1). When you wire it up use the PWM and either one of the DIR/EN output pins for that motor. (one will just drive the motor in the opposite direction to the other). :)
    • Like Like x 2
    • Informative Informative x 1
  13. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Awesome! Thank you
    • Like Like x 1
  14. doctorxeno

    doctorxeno Member

    Joined:
    Nov 10, 2013
    Messages:
    33
    Balance:
    607Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi,

    I have a problem setting up simtools. In SMC3utils everything works fine. The simulator moves.

    When I try to do so in simtools... no movement.

    I have made axis assignments and interface settings to:

    SER
    comport7 (also in windows)
    baudrate 500000
    8,N,1
    10 bits
    binary
    interface A<Axis1>B<Axis2>
    10ms

    Tried it also with firewall and internet connection turned off and reset the arduino a few times. No luck.

    Any suggestions?
    • Like Like x 1
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    All SMC3 commande start and end with square brackets [...]. So if you update your interface line to: [A<Axis1>][B<Axis2>] you should be in action. :)
    • Like Like x 1
  16. doctorxeno

    doctorxeno Member

    Joined:
    Nov 10, 2013
    Messages:
    33
    Balance:
    607Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi,

    I have changed the interface output, but still no luck. I do not know what I am missing out.
    • Like Like x 1
  17. spartan300

    spartan300 New Member

    Joined:
    May 25, 2011
    Messages:
    19
    Occupation:
    Doctor
    Location:
    Athens
    Balance:
    462Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi,
    I had the same problem,and when i put square brackets everything solved with the communication.
    Now i have other problem.
    In output testing via Axis when i move the slider slowly , nothing happens untill it reaches about 25-30% then it moves all the way to the respective direction. the same at - values . I dont have liniar movement .I will try to make a video to saw exactly what is happening.
    Any suggestions?
    Thank you
    Loukas
    • Like Like x 1
  18. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Is it possible that you still had SMC3 Utils running? Only one program can use the comm port at a time so you have to shut down Windows SMC3 Utils before you start Simtools.
    • Like Like x 1
  19. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Loukas, a number of members have reported this now... we are looking into it. I have been able to reproduce myself but only in the Simtools output testing mode. So far I have never noticed the issue while running a game.

    Can you do a test for me...
    Shutdown Simtools and restart. BEFORE running any games try the Simtools output testing... If my testing is correct it should work smoothly as expected.

    Now start a game and then shutdown the game. Try the Simtools output testing again and see if you have the step response?

    Let me know how you go.

    Thanks,
    • Like Like x 1
  20. spartan300

    spartan300 New Member

    Joined:
    May 25, 2011
    Messages:
    19
    Occupation:
    Doctor
    Location:
    Athens
    Balance:
    462Coins
    Ratings:
    +19 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    No it still the same. Before running any game i tested and still goes to the top or down limit when it reaches 26% -26% in output testing via Axis.:(
    • Like Like x 1