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. 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
    Yes I did. I first downloaded the two zips, Installed the SMC3 V06 folder into my arduino folder like the instructions said. When I open my arduino IDE, the SMC3 shows up under sketches. I click on it, verifie file, and upload and it seems that all is well. The board is working because it will perform the "BLINK" test. Then When I try to open the SMC3utils V06 I get the message.
    Terry W
    • Like Like x 1
  2. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Hi Terry, from your post in another thread it is good to hear that you solved the issue. Could you share the solution in this thread to help people in the future?

    Thank you :)
    • Like Like x 2
  3. 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
    I downloaded and installed all zip files, connected my arduino to my Monster Moto as pre the drawing above and with the use of the Sim Tools Quickstart Guide I cannot get my motors to run using the mouse as a test. I checked all conections,drawings,power, don't know what I should do next. Can someone help me out here.

    I have my motors stoped by adj. the motor pots. It seems that I have it all connected right, because by adj. thePMWmax I can make them go slow or fast.

    Terry W
    • Like Like x 1
  4. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Terry, it is easiest to get things running in stages... Did you follow the "Initial Setup" instructions in the first post of this thread (Here they are again:

    ---------------------------------------
    Initial Setup

    I strongly recommend you follow the steps below if this is the first time you are using SMC3 with your simulator to reduce the risk of damaging anything. (THIS STEP MAKES SURE THE POTS ARE CONNECTED IN CORRECT DIRECTION)

    1. Disconnect the motor power supply
    2. Make sure Simtools is not running – we’re not ready for that yet!
    3. Wire up the Arduino (with SMC3 installed) to your H-Bridges and connect to your computer via USB
    4. 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)
    5. Set the Kp, Ki, Kd, PWMmin, PWMmax, PWMrev to 0 for ALL motors (This will make sure the motors don’t move)
    6. Set Clip to 255 (you need to do this first) and Limit to 255 (This will give you plenty of margin if something goes wrong while setting up)
    7. Turn on the power to your motors – nothing should move at this stage!
    8. Set Kp to about 400
    9. Now slowly, increase PWMmax… at some point the motor should start to move. When it does check the “Green” feedback line is moving toward the “Blue” target position.
      • If it is then that motor and feedback is wired correctly - proceed to test other motors.
      • If it is moving away turn off motor power immediately (or quickly reduce PWMmax again). In this case you need to either reverse the wires to the motor being tested –OR– reverse the +5V and GND wires to your feedback pot for the motor being tested (do not do both). Restart the test from the beginning.
    10. Do the above for each motor
    -----------------------------------------

    Note Step 2: get things running without Simtools (ie you use the Windows SMC Utility program to setup and configure your program... you will also find this program at the beginning of the thread.

    Once you have done this then adjust the settings to something like below as a starting point:

    Fpid/2
    Kp=500
    Ki=0
    Kd=0
    Ks=1
    Fpmw=20kHz
    PWMmin=0
    PWMmax=200
    PWMrev=210
    Max Limits=75
    Clip Input=150
    Deadzone=1

    These settings should give you basic movement. Test by selecting the Triangle wave or Sine Wave, etc in the SMC Windows Utils program. You can fine tune parameters from there to suit your specific motors and setup.

    Once you are happy with the setup using Windows SMC Utils, Shut down Windows SMC Utils and START Simtools and get that tuned up using the interface settings and Axis Assignments etc. Note if the Windows SMC Utils is running and connected to the comm port then Simtools won't be able to access the com port hence the reason for shutting down Windows SMC Utils.

    Let me know how you go.... If you have trouble try to be specific about what you have done and what is and isn't working. :thumbs
    • Like Like x 2
    • Dislike Dislike x 1
    • Informative Informative x 1
  5. 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
    Thank you foe helping me with my problem. I went through your check list and all checked out what I think is OK. However when I set the SMC Utils to Triangle or Sine wave, the motors run wild. (unable to stop with the pots). When I shut down SMC Utils,open SIM TOOLS, setup default I still have no movement using the mouse control. My default is setup in DOF4 #1 axis,pitch and #2 axis, Roll. is there anything else needed for the default? Do I need to use COM3 or COM4?. COM4 is the path that my Arduino board is hooked into. Also, I am somewhat confused by the last paragraph . Is what you are saying is to shut down SMC Utils before I open SIM TOOLS? I think that is what you mean. Thank You again for helping me, I want to make sure that my proto type will work before I jump into the "BIG PICTURE"
    Terry
    • Like Like x 1
  6. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    @terry wells do yo have the pots mechanically connected to the motors or are you manually turning them at the moment? If you are manually turning them then it will act more like a speed control than a positional feedback - ie when the pot is positioned such that it matches the target value the motor will stop the further away you turn the pot from this position the faster the motor will go. If you are doing this manually and running a triangle wave target for example it will be almost impossible to manually match the required target position so the motor will just appear to "run wild". So if you are doing it manually it sounds like you are all good! :grin

    Yes correct shut down Windows SMC Utils before opening Simtools. Windows SMC Utils is just a setup utility for the Arduino PID code (it does have some other advanced functionality but don't worry about that until you have things working)

    COM4 is correct if that is what the Arduino is connected to. Have you setup the "Interface Settings" tab in Simtools? The following settings should get you going:

    [A<Axis1>][B<Axis2>] Note: you need to include both the square and angled brackets

    Set for 10bit binary output

    Baud rate 500000 , N , 8 , 1 (10ms delay)
    • Like Like x 1
    • Informative Informative x 1
  7. 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
    Yes, they are mechanically connected (see pic) When I turn them from center they speed up or slow down cw or ccw. I set them to the stop mode. I typed in the info you gave me and motor A (Axis 1) works the right way. However I cannot get motor B (Axis 2) to work at all. ???? I know motor B is good because I can turn the pot and make the motor do what you say. these are my settings. Thanks again
    Terry W.

    Attached Files:

    • Like Like x 1
  8. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    @terry wells perhaps it is not clear in the photo but looking at the picture I can't see how the motors are mechanically connected to the POTs? I take it the POTs have knobs because you manually turn them? Do the POTs turn themselves as the motors turn?

    Your comment "When I turn them from center they speed up or slow down cw or ccw." - this is correct if the POTs aren't turned/driven by the motors.

    Don't worry about simtools until you have everything working in the Windows SMC Setup Utility - if it doesn't work here it definately won't work in Simtools. From what you are describing though it sounds like you are very close :thumbs

    When running Windows SMC Utils you will see in the chart the "Green" line should move as you turn the POT - this is the feedback. The "Blue" line is the target position. The Arduino will attempt to drive the motor so the green line is positioned over the blue line. So if the POT isn't turned by the Motor then you have to manually turn the pot so the green line matches the blue at which point the motor should stop. The further the green line is away from the blue line the harder/faster the motor will be driven to try and get it to where it should be. So it appears as a speed control unless the pot is 'mechanically' connected to the motor.

    Also note there is a safety feature built in to the Arduino code - if the green line moves into the "Limit Zones" the motor will be shutdown and nothing will appear to work until you move the pots back into the working zone and reset the Arduino. (This could be why you had no response from motor B)
    • Informative Informative x 2
    • Like Like x 1
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    @terry wells Ahh, I think I notice your problem in simtools... You have a , instead of a < after the B in the interface output string - simple typo :grin

    Also you don't want anything in the startup output or shutdown output - leave blank
    • Like Like x 1
  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
    Thank You for seeing that, it is working now like it should. My pots are hooked like the wiring diagram at the start of this thread. however I did need to flip/flop the blue and green wires. A0 & A1 to make the pot on the right operate the motor on the right. Is there a way I can check the motor operation by using my Joy Stick instead of the mouse? I really need to see that my stick can move the motors. You can see that the red and green are on track.

    Terry W

    Attached Files:

    • Like Like x 1
  11. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,160
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,195Coins
    Ratings:
    +2,161 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Out of curiosity, why do you want the joystick to drive the motors? Simtools reads information from the game, and then transfers the positional information to the Arduino which in turn sends direction and speed to the motor drivers and hence moves the motors.

    If you really want a joystick to move the motors then you could connect the joystick potentiometers to the arduino instead of those on your bench and they would indeed drive the motors but that would not work in SimTools.
    • Like Like x 1
  12. 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
    Call me "Old School" , but I was hoping to see this work with the joystick. That's ok ,so now if I were to download a game would I be able to see the motors work using the joystick? I just answered my own question. I set up LFS and I could see the movement. Would this work better for me if I were to have the SMC3 setup on another computer? and if so how would I connect to the main computer with the game running?

    Terry W.
    • Like Like x 1
    Last edited: Apr 15, 2014
  13. 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
    Hi @RufusDufus I let you know that I am using your great software. After testing lots of the different settings ths sim works stable and powerful. I had some issues due to the to heavy load (moto monster). KP is now 370, PWMmax 120. More power results into stopping the winches. The next days I will continue to find out the best stable settings.
    • Like Like x 1
  14. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    Thanks for the feedback, it's good to hear it is working successfully! :cheers
    • Like Like x 1
  15. dualin

    dualin Member

    Joined:
    Jul 11, 2012
    Messages:
    31
    Location:
    Cáceres - Spain
    Balance:
    - 41Coins
    Ratings:
    +4 / 2 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi, I'm trying to run the arduino with this firmware, but not I don't know what must I edit for use in mode2 with my ibt-2

    I know that it's very easy, I'm feel like an idiot, but I can't find what I must to do

    Thanks in advance

    Enviado desde mi iPad con Tapatalk HD
    • Like Like x 1
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    Before you download the SMC3.ino sketch file to your Arduino edit the code at the very top of the sketch file like below:

    Code:
    //****************************************************************************************************************
    // SMC3.ini is basic Motor PID driver designed for motion simulators with upto 3 motors (written for UNO R3)
    //         
    //****************************************************************************************************************
    
    // Set to MODE1 for use with a typical H-Bride that requires PWM and 1 or 2 direction inputs
    // Set to MODE2 for a 43A "Chinese" IBT-2 H-Bridge from e-bay or equiv
    
    #define MODE2   
    
    The line that is important is the one that says #define MODE2

    That's it... then normal procedure to download the software to the Arduino using the Arduino IDE sotware.
    • Like Like x 1
    • Friendly Friendly x 1
  17. 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
    Hi Rufus there this is a problem remains to be found, if i turn very fast the potentiometer the motor stops. It does not matter the PWMmax or the kp settings, same issues if the values are very low. For better understanding I attached a screenshot. Using a power meter I got values around 25A max. Perhaps too much for the motor monster? In contrast the fuse between PSU and Moto MOnster (25A) has not blown. The 20A fuse did not survive very long but 2 or 3 days...

    PS: Or the arudino (clone) is too slow to calculate the tasks?
    PPS: same issue using the original arduino uno 3

    Attached Files:

    • Like Like x 1
    Last edited: Apr 18, 2014
  18. 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
    Update: same issue using Duemilanove 2dof firmware. While turning very hard the pots the moto monster hangs on a second... :-/
    • Like Like x 1
    • Friendly Friendly x 1
  19. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,897Coins
    Ratings:
    +1,016 / 10 / -1
    @Pit, It looks like the MotoMonsters are shutting down. I think the chips on these boards have internal protection circuitry that shut them down if over temp or too much current.

    If the SMC3 software was shutting them down it would show OFF in the button next to the Motor in the top left of the window which it isn't in your screenshot.

    Another way to confirm when this happens is to switch of the motor power to the H-Bridges for a minute and then switch back on - but don't disconnect or reset the Arduino. Once the H-Bridge cools down and you reapply power it should work again because the Arduino still thinks everything is running.
    • Like Like x 1
    • Informative Informative x 1
  20. 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
    ow I know I need an other H-bridge...the winches are (would be) so fast and strong, but the moto monster is hard at the limit. I am familiar with SMC3 and want to stay with it.
    • Like Like x 1