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

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,093 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Which error? Please can you attach the screenshots of you steps before uploading the code? Do you have selected the active COM port where the Ard is connected before uploading?
    ard.jpg
    Last edited: Dec 29, 2014
  2. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,093 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
  3. michto35

    michto35 Member

    Joined:
    Jan 31, 2014
    Messages:
    97
    Location:
    france
    Balance:
    102Coins
    Ratings:
    +52 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
  4. terry wells

    terry wells Active Member

    Joined:
    Jan 19, 2014
    Messages:
    250
    Occupation:
    retired military
    Location:
    minnesota USA
    Balance:
    716Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    3DOF, Arduino
    you need to define either ENABLE POT SCALING or liner or non liner pot scaling in your arduino IDE try that and see if it helps
    Terry

    Attached Files:

    • Informative Informative x 1
  5. michto35

    michto35 Member

    Joined:
    Jan 31, 2014
    Messages:
    97
    Location:
    france
    Balance:
    102Coins
    Ratings:
    +52 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Tank you for your answer, i will look tonight
  6. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,966Coins
    Ratings:
    +1,016 / 10 / -1
    Hi, I am currently on holidays and can't see the images too well.

    If you are still getting compiler errors then I would suspect there is something wrong with your installation of the Arduino IDE. Make sure you are using the latest version.

    Try installing the basic Arduino Flash LED code on the arduino site, make sure you don't have any problems with that first.

    If the error is that it can't connect with the arduino to download code then make sure no other code is running and connected to the arduino. Ie shutdown Simtools and windows smc3 utils before trying to program the arduino.

    It looks like you have the wrong interface settings in Simtools, but if you can't program the arduino you don't have to worry about that yet. The details you need are in the first post.

    I will have a closer look at screenshots in a week when back from holidays.
  7. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,966Coins
    Ratings:
    +1,016 / 10 / -1
    I will have a closer look when I'm back from holidays.

    RacingMats code is good code that has been used by many. If you have that working stick with it until you have everything else working (best only to change one thing at a time). The SMC3 code gives you a bit more control over the motor drive using a PID control loop. It may give you some finer detail in your motion, but not everyone notices a difference.

    While you can enable the POT Scaling as Terry indicated, don't do this unless you actually have a POT connected!
  8. michto35

    michto35 Member

    Joined:
    Jan 31, 2014
    Messages:
    97
    Location:
    france
    Balance:
    102Coins
    Ratings:
    +52 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    thanks rufufus, good holidays
  9. everaldo ramos da silva

    everaldo ramos da silva Member

    Joined:
    Oct 1, 2013
    Messages:
    8
    Occupation:
    merchant
    Location:
    são paulo- Brazil
    Balance:
    57Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, JRK, 4DOF
    When I open the utils SMC3 appears this?
    What should be happening?
  10. terry wells

    terry wells Active Member

    Joined:
    Jan 19, 2014
    Messages:
    250
    Occupation:
    retired military
    Location:
    minnesota USA
    Balance:
    716Coins
    Ratings:
    +59 / 1 / -0
    My Motion Simulator:
    3DOF, Arduino
    Hey rufusdufus:, How can I make my 10 turn/10K pot work with SMC3? no matter what I do I cannot get any signal to my motor to make it run. I am using the tail rotor gear (like histoker) on my gear cluster winch motor set-up. The pot is (BOURNS 3590S) I have it connected according to the manufacture specs. ( A three turn pot works ok?)

    Attached Files:

  11. everaldo ramos da silva

    everaldo ramos da silva Member

    Joined:
    Oct 1, 2013
    Messages:
    8
    Occupation:
    merchant
    Location:
    são paulo- Brazil
    Balance:
    57Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, JRK, 4DOF
    A Happy New Year to all and God bless you greatly!
  12. insanegr

    insanegr !N$@n€

    Joined:
    Jan 14, 2014
    Messages:
    504
    Location:
    Athens
    Balance:
    16,718Coins
    Ratings:
    +499 / 1 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    make sure your potentiometer is in middle position(2.5V). this is one feature of this code if it goes out of limits it disables the motor until you get it back into limit zone, otherwise smc3 will keep it disabled
    • Like Like x 1
  13. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,093 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    I cannot see the green (potentiometer) line. Are they connected and correctly wired? BTW the screenshots are too small and less quality. PS: if the hint of @insanegr should not be successful.
  14. Edson Lourenço Bezerra

    Edson Lourenço Bezerra Edson Bezerra - Desenvolvedor Open Source

    Joined:
    May 14, 2014
    Messages:
    67
    Occupation:
    Analista de Sistema
    Location:
    Jundiaí
    Balance:
    147Coins
    Ratings:
    +24 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform, 4DOF
    Caro colega, se precisar de ajudar estarei a disposição
  15. Edson Lourenço Bezerra

    Edson Lourenço Bezerra Edson Bezerra - Desenvolvedor Open Source

    Joined:
    May 14, 2014
    Messages:
    67
    Occupation:
    Analista de Sistema
    Location:
    Jundiaí
    Balance:
    147Coins
    Ratings:
    +24 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform, 4DOF
    Trying to do some test to with my arduino and SMC3, this returning me the following bug compilation:


    SMC3.ino: In function 'setPwmFrequency void (int, int)':
    SMC3: 259: error: 'TCCR2B' was not declared in this scope
    SMC3.ino: In function 'void InitialisePWMTimer2 (unsigned int)':
    SMC3: 296: error: 'TCCR2B' was not declared in this scope

    Some error code or hardware

    grateful
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,966Coins
    Ratings:
    +1,016 / 10 / -1
    It looks like the Arduino IDE/compiler is not installed correctly. Have you been able to compile and load other arduino code?

    Make sure you are using the latest Arduino IDE from their site.
  17. Edson Lourenço Bezerra

    Edson Lourenço Bezerra Edson Bezerra - Desenvolvedor Open Source

    Joined:
    May 14, 2014
    Messages:
    67
    Occupation:
    Analista de Sistema
    Location:
    Jundiaí
    Balance:
    147Coins
    Ratings:
    +24 / 2 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform, 4DOF
    Good morning presado RufusDufus, yes did this test and the cause more logic can be the difference that my Arduino board is the Leonardo and ta and a mega 1280.
  18. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +41 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    hello RufusDufus
    first of all thank you for the work you have developed further and helps the community .
    I have nothing idea of writing arduino code , and I would like to consult you .
    is that use x -sim and simtools , with ibt -2 and arduino one .
    connections are different for each firmware , which increasingly have to change all connections.
    would be very difficult to modify the output to coincidie with both firm and not have to go changing everything every time ?
    considering that I have no idea of modifying the code , I see that some fellow indicad you how to change the analog outputs for the potentiometers .
    serious as simple as that ? modify the values that indicate the number of each output ?
    or is it more complicated for in total newbie like me?
    to see if you get me out of my doubt and pulled something clear before spoiling the code and getting nothing .
    greetings , manuel
  19. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,966Coins
    Ratings:
    +1,016 / 10 / -1
    Hi @Petar2, could you be a bit more specific as to what you are trying to match. Do you have a wiring diagram or link to the firmware that you currently use.

    The arduino has limitations so only some things can be changed.
  20. Petar2

    Petar2 Member

    Joined:
    May 23, 2014
    Messages:
    59
    Location:
    Valencia
    Balance:
    715Coins
    Ratings:
    +41 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Ok
    ARDUINO----------------------------IBT-2

    Motor 1
    Pin 2-------------------------------------- Pin 1
    Pin 3-------------------------------------- Pin 2
    Pin 10-------------------------------- Pin 3 y 4


    Motor 2
    Pin 4------------------------------------ Pin 1
    Pin 5------------------------------------ Pin 2
    Pin 9-------------------------------- pin 3 y 4

    This is the connection that I have with xsim , and I wonder if you can change this so that it is equal on both firmwares.
    so should only load the appropriate code to each software ( simtools or x -sim )
    it could change your firmware connections to be the same as that used in X - sim?


    Here I show as indicated in the code using arduino pins to the bridge -H
    respect

    Pin out of arduino for H-Bridge

    Pin 10 - PWM1 - Speed for Motor 1.
    Pin 9 - PWM2 - Speed for Motor 2.
    Pin 2 - INA1 - motor 1 turn
    Pin 3 - INB1 - motor 1 turn
    Pin 4 - INB1 - motor 2 turn
    Pin 5 - INB2 - motor 2 turn

    Analog Pins

    Pin A0 - input of feedback positioning from motor 1
    Pin A1 - input of feedback positioning from motor 2