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

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,931Coins
    Ratings:
    +1,287 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    @RufusDufus ... Am I missing something ? :think
  2. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi @speedy. Raceray suggested that some time ago to try and get extra exposure to the xsimulator site from the arduino community.

    I registered the project/software on their site but as far as I know they never published anything - maybe it didn't meet their criteria?
  3. speedy

    speedy Well-Known Member

    Joined:
    Feb 1, 2012
    Messages:
    1,193
    Location:
    Alexandria , Egypt
    Balance:
    7,931Coins
    Ratings:
    +1,287 / 10 / -0
    My Motion Simulator:
    3DOF, AC motor, Arduino, Motion platform
    • Agree Agree x 1
  4. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Hi everyone guys! Is this the right place to ask a question about an issue with SMC3?
    Sorry for not being so present, unfortunately too many hobbies and not so much time..I will update my simulator thread asap.
    However, let's arrive to my question: after successfully using the RacingMat 2DOF code I decided to try SMC3 code to move my 3DOF rig (thanks RufusDufus for your precious work).

    Here's my actual configuration: WP_20150503_13_20_22_Pro[1].jpg WP_20150510_20_33_36_Pro[1].jpg
    an Arduino Uno with three MM (one for each motor). I'm using the breadboard to prevent cables disorder (could this cause issues?).
    Well, which issue you may ask..actually nothing moves.
    I strictly followed the guide in first page, I've been checking wirings, soldering, pots, power supplies, motors etc all the day but, when increasing the PWMmax, nothing happens.
    Although SMC3util seems to work quite well, could this malfunctioning depend on the driver I'm using to drive my chinese Arduino (http://wiki.tuttoameno.it/index.php/CH340USB)? It is like if the Arduino and the MM cannot communicate.
    Or is there something wrong in the wiring (is it mandatory to connect the 5V for pots also in the MMs for example?).

    Here is a video () in which I try to explain the malfunctioning (sorry for my bad english :blush).

    Thanks in advance guys for your help. Really!:cheers

    Marco
    Last edited: May 11, 2015
  5. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,438Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    MMs have to be connected to the Ard on the 5V and GND line.
    PS: The wiring ot the MMs seems to be correct (only the issue I have mentioned) though I cannot see the wires on th Ard. BTW the 5V red wire is really on the 5V output on the Ard? Hard to see from that perspective...
    • Agree Agree x 1
    Last edited: May 11, 2015
  6. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,962Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @Overclockersmania.it : indeed, your motomonsters should share GND and 5V but it seems not to be the case...

    thanks for sharing also your success with my code ;)
  7. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    You're welcome RacingMat! thanks to you for your code, it was really helpful at the beginning and worked without issues (and even without the +5v on the MM..:grin).
    Thanks a lot also to you Pit: pots are wired correctly as I've checked with the tester and got right values.
    I think I've also tried to link the +5v on MM to the pot (for one motor) but nothing happened.
    I will try again tomorrow, this time soldering the wire. Hopefully it will work..

    Thanks again guys! Stay tuned! :cheers
  8. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,438Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Mate this IS impossible. W/o 5v the MMs can't be driven by any code. EDIT: @RufusDufus clarified that even without sharing 5v the MMs can work.
    This doesn't work, there is no 5V source on the MM but on the Ard.
    Last edited: May 13, 2015
  9. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Sorry I meant that I didn't share the 5V and the GND pins between the Arduino and the MM.
    MM was supplied with 12V.
    I thought (but I've to say I missed this point in the datasheet) that the 5V and GND pins were intended to be outputs, that's why I didn't wire those pins on MM.
    Anyway in my rig (I may have a video somewhere) MM could drive the motors properly with RacingMat's code, finding the middle position and going ccw and cw till the desired position..maybe this was possible cause I just drove my motors through Arduino serial monitor, I haven't tried Simtools yet. Any idea of this strange behaviour?

    Thanks for the help Pit!
    Marco
  10. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Marco,

    Below is the schematic for the MM. In the case of the MM the +5V is an input to the module however is only used for pull-ups on the EN signals. The board will work without it providing the source signal is driven high or has pull-ups at the source. So this is why it worked without the +5V. Even though it is not mandatory I would suggest you connect the +5V to minimise the risk of any noise generated in the cabling from the high motor currents.

    GND is typically required to be connected between any electronic circuits to provide "a point of reference" for the interconnected signals.

    MonsterMotoShield.JPG
  11. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Based on what I can see in the video it looks like the Windows SMC3Utils is communicating with the Arduino SMC3 fine. You can see at the bottom of the window it is processing close to 4000 PID calculations per second and the Rx Packets are changing both of which come from the Arduino SMC3 communications.

    One other thing to check is to manually move your seat (or just the POT) and see if the green line moves on the chart. This will confirm if the POT is wired up correctly to the Arduino.
  12. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,438Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    oops, mea culpa I did not know that. Thank you @RufusDufus for clearing up that point. I am sorry about talking rubbish...
    • Funny Funny x 1
  13. mariano68

    mariano68 Active Member

    Joined:
    Nov 15, 2014
    Messages:
    576
    Occupation:
    builder contractor
    Location:
    Argentina
    Balance:
    3,339Coins
    Ratings:
    +395 / 2 / -0
    My Motion Simulator:
    2DOF, Arduino, 4DOF
    Excuse my total noobness, I have zero electronic background so this will take me a lot of time to get it right without burning anything, I promise I wont ask again :oops:
    I don't understand what you mean with this :
    "4-Edit the code at the top if the file to select the MODE you will be using"
    is that a typo? Anyway, could you tell me what I have to do to set mode1, or is it already set by default?
    smc3 pic.jpg
    Thanks anyway!

    I think I can answer myself
    Edit: Means "Of" the file, and also the mode 1 is on by default as it is uncommented.
    Sorry, too afraid to do something wrong :p
    Last edited: May 14, 2015
  14. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    That is correct. :cheers
    • Like Like x 1
  15. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    Thanks RufusDufus and Pit for your help.
    I haven't had time till today to work on the sim so sorry for this late answer.

    However, today is a beutiful day! Pluggin' in the 5V and GND to the MM caused the sim to finally move!
    Thus I can say this was the reason why the rig didn't move.
    It still seems a bit strange to me but..who cares? IT MOVES!!!

    Pit your talking wasn't so rubbish in the end..:cheers
    • Like Like x 1
  16. dualclick76

    dualclick76 Active Member

    Joined:
    Mar 23, 2015
    Messages:
    163
    Location:
    italia
    Balance:
    11Coins
    Ratings:
    +40 / 0 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    first wanted to thank, I ask you my problem, I tried to follow step by step instructions and code event To use SMC3 SMC3 utility. when loading the code Arduino I get this error what should I do?

    Attached Files:

  17. Overclockersmania.it

    Overclockersmania.it Member

    Joined:
    Oct 24, 2014
    Messages:
    99
    Location:
    Cagliari, Sardinia
    Balance:
    20Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, Arduino, Motion platform
    I'm glad to show you today's progresses.
    SMC3Utils is working smoothly (except for what you can see at about 1:35, when motor 2 stops working..I guess can be an issue with the motor, it's like if sometimes the stall current is so high that neither a 1200W PSU and a single MM can supply it.. :eek:).


    SimTools also seems ok. Speed wasn't my goal this time but I will face this issue in the next days (I'm already wondering which new motors buy).


    What's your idea by seeing the videos?
    Thanks in advance to all of you!

    Marco:thumbs
  18. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi, Those are default registers that should be defined in the built in Arduino IDE libraries.

    Have you selected the Arduino UNO board in the tools menu before compiling/uploading?

    The only other thing I can think of is to reinstall the Arduino IDE?
  19. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    That is unusual. When those motor buttons change to off it is because the SMC3 thinks that the motors have moved into the limit zones and switches them off. Looking at the video it doesn't appear anywhere near the limits.

    I can only assume you have noise on the POT lines and there are very brief spikes of noise (not enough to show on the chart) causing SMC3 to shutoff for safety. If it was the PSU or H-Bridges it wouldn't reset using those buttons.

    Given you had some problems with your wiring before that may still be the issue.

    Make sure all the POT wires (+5V, GND, Signal) connect direct to the Arduino - not via the H-Bridge or anywhere else.

    Also twist the three wires to the POT together.

    Make sure they are soldered well.

    See if that helps.
    • Agree Agree x 1
  20. dualclick76

    dualclick76 Active Member

    Joined:
    Mar 23, 2015
    Messages:
    163
    Location:
    italia
    Balance:
    11Coins
    Ratings:
    +40 / 0 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    thanks for answering my RufusDufus Arduino is "Arduino Leonardo" card very similar to arduino one