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,949Coins
    Ratings:
    +1,016 / 10 / -1
    I think @Pit has a good point.. your PSU may not be powerful enough. A few things to try:

    1. Connect a motor direct to the PSU (no H-Bridge) and see if it can start the motor - don't leave for long though
    2. Try getting a small 12v DC motor from a toy or ebay and connect it to the H-Bridge instead of the winch motors. SMC will work exactly the same, just manually turn the POT to see the motors speed up and slow down as the target and feedback signals align.
    • Informative Informative x 1
  2. Outatime

    Outatime New Member

    Joined:
    Apr 21, 2014
    Messages:
    29
    Balance:
    205Coins
    Ratings:
    +6 / 1 / -0
    I'll get a new car battery tomorrow and try it again.
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,949Coins
    Ratings:
    +1,016 / 10 / -1
    @Outatime, I just noticed the screenshot of your settings. The PWMmax is way to low for normal operation. This is fine for testing to minimise damage to anything but you will probably need something at least 200 or more for winch motors.
    • Like Like x 1
    • Useful Useful x 1
  4. Outatime

    Outatime New Member

    Joined:
    Apr 21, 2014
    Messages:
    29
    Balance:
    205Coins
    Ratings:
    +6 / 1 / -0
    I've found the solution.
    The motor "brakes" (right to the lever wheel) on the winch motor was too tight. It stopped the motor from reversing. I have removed them.

    Now it's working !
    See pictures. Tried it with PWMmax 126 and PWMmax 207.

    It's not exactly following the feedback line. Is that normal ?
    What are the yellow peaks ?

    Motor1-workingPWMmax126.jpg Motor1-workingPWMmax207.jpg
    The PSU was still working with PWMmax 126.
    At PWMmax 207 it was working with the car battery only and followed the feedback line a lot better.

    Thank you.
  5. Outatime

    Outatime New Member

    Joined:
    Apr 21, 2014
    Messages:
    29
    Balance:
    205Coins
    Ratings:
    +6 / 1 / -0
    Well now there is the next problem.
    The one motor is moving slower than the other. About 1/2 or 2/3 of the speed of the other.
    I have changed the H-bridges (I have spares) = same result.

    When I change the three H-bridge input pins
    RPWM, LPWM, R_EN + L_EN
    between the two bridges the other motor is slower which was faster first.

    Same result in SimTools Game Engine output testing.

    So the problem seems to be the input signal ?
  6. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    It seems to be a SMC3 related "issue" - you are using "different" PWMmax values (motor 1 is not equal to motor 2). This is not a bug it is a feature...:)
    • Winner Winner x 1
  7. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    if the power (PWMmax) is too low, the motor turns slower than the feedback line
    • Like Like x 1
  8. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Seek and you shall find...[​IMG]
    • Informative Informative x 2
    • Like Like x 1
  9. Outatime

    Outatime New Member

    Joined:
    Apr 21, 2014
    Messages:
    29
    Balance:
    205Coins
    Ratings:
    +6 / 1 / -0
    Thank you all. Working correctly now ! :grin
    It was my fault. I forgot to copy the PWM values from Motor 1 to Motor 2. ;)

    I alwalys did that before but not on my last tries. ;)
  10. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    My pleasure....
    • Like Like x 2
    • Agree Agree x 1
    • Useful Useful x 1
  11. Outatime

    Outatime New Member

    Joined:
    Apr 21, 2014
    Messages:
    29
    Balance:
    205Coins
    Ratings:
    +6 / 1 / -0
    I'm very happy that my setup is working now.

    @RufusDufus
    Your tutorial on page 1 is very good but still got me noob stuggling on some parts.

    After the last points of the Initial Setup I reduced all the PWMmax values back to 0 because I was aware of my motors.
    I did not realise that all values were written live into the Arduino memory and stored there.

    So I was trying out the SimTools Game Engine output mode and nothing happended because the values were zero. It drove me mad trying out several axis settings and interface settings without a result.
    I thought SimTools is producing it's own values.

    At first I sticked to the Game Engine because for me as a beginner the GUI looked easier and I hoped to get quick results out of it without having to try out so many SMC3 values.

    It would be good to post a screenshot of the interface settings for SimTools for your SMC code too. I know the settings are in plain text on page 1 tutorial.

    GameEngine.jpg


    When I started with SMC3 this picture was not there:

    SMC3Utils Explained.JPG

    On the first sight your SMC3 looked very confusing to me with all the strange values and opportunities.
    I did not realise what the points "Out Mode" on the left bottom corner are doing.
    I was afraid of doing something wrong to click somewhere and my motors would go mad. :)

    Now after some time with the SMC3 tool I know what all the bullet points (sine, manual...) are doing and the program GUI is not that difficult.

    But for beginners like me a detailed explanation would be fine.
    For example:
    Switch to "Manual" to move the selected motor with the slider on the right side.
    Switch to "Motion" to get a motion simulator like output.

    That were my thoughts on making the good tutorial a bit better for dummies like me. ;)

    Thanks for your help and program to make my motion sim possible. :thumbs
    • Like Like x 1
    Last edited: Feb 22, 2015
  12. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,933Coins
    Ratings:
    +1,287 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform

    Hi @hooshang ... I had that noise and I connected a 100nF capacitor between the feedback signal " center leg" and the ground ... every thing worked fine ever since :thumbs
    • Useful Useful x 3
    • Informative Informative x 2
  13. hooshang

    hooshang Active Member

    Joined:
    Jul 6, 2011
    Messages:
    273
    Balance:
    285Coins
    Ratings:
    +157 / 3 / -0
    My Motion Simulator:
    2DOF, DC motor, AC motor, Arduino, 6DOF
    Hi @speedy
    thank you friend but I already solved this problem using shield wire and ground everything
    and now all noise gone and all seems to be smooth.
    shokr to have such a good mate here like you,thank you friend
    regards
    Hooshang
    • Like Like x 1
    • Informative Informative x 1
  14. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Gent, it seems that I'am stuck on the 4th step of the SMC3 seeing the Arduino:

    [​IMG][​IMG]

    Run the Windows SMC3 Utility software and make sure it communicates with the Arduino (There is no need to set baud rates, they are not configurable)
    What can I be doing wrong?

    I have the SMC3.ino uploaded and it was successfull!

    Any tipps for me? Much apprechiated!
  15. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,283Coins
    Ratings:
    +1,120 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    SMC3 says you're using port 7 (lower right)
    Check your settings again

    1.JPG
    • Agree Agree x 1
  16. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Unfortunately still the same...
    Arduino is visible properly for its own software and in device manager:


    error still.jpg
    device manager.jpg
  17. Blame73

    Blame73 Well-Known Member

    Joined:
    Nov 6, 2014
    Messages:
    1,213
    Location:
    Italy
    Balance:
    8,283Coins
    Ratings:
    +1,120 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    Firewall?
  18. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Turned firewall and virus protection off and still the same.
    Is the SMC3 code supposed to look like this for me? Because the blink one look a hell lot diffrent and that is running fine on it:

    arduino.jpg
  19. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Indeed that was the problem, for some reasone when opening up the file it did not display the code for me.
    Now it is working :)
    • Like Like x 2
  20. Greg83

    Greg83 Active Member

    Joined:
    Feb 2, 2015
    Messages:
    104
    Occupation:
    IT Specialist
    Location:
    Budapest, Hungary
    Balance:
    328Coins
    Ratings:
    +46 / 0 / -0
    Is it normal if upon connection the utility and then testing only one motor moved?
    It moved around PWMmax at 20-30, but ever since then I cant get it to move..
    Both motors look like this now:

    test.jpg

    A bit lost now :confused: Where to go from here? Is there a general setting I might try?:oops: