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

    minanke New Member Gold Contributor

    Joined:
    Dec 1, 2013
    Messages:
    17
    Occupation:
    Developer
    Location:
    Hong Kong
    Balance:
    - 374Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi, Need some help here and this is my very first build.

    Am now trying to verify all the wiring are setup correctly between the Ard > MM > Motor.

    Questions

    1) When both POT feedback are unplug from Ard A0 and A1 and switch on the power. Should both motors start turning? What I got is just Motor 2 turing slowly and its chip will become very hot after 30 secs. Wondering is my MM was broken

    2) When testing Motor 2 with POT mechanically connected to the Motor shaft and switch to Sine Mode. The Motor will turn and overshoot, the Green line will jump to the top max and then drop to the bottom max and the Motor will stopped. Until I manually turn the Motor to make the Green line back to the middle and near the Sine blue line, the Motor will turn again, but the same move pattern happened again, move to the top max and then drop to the bottom max and the Motor will stop again at the bottom. Any idea why the Motor can't move towards the blue line?

    3) And do I need to rotate the POT to have a proper start position? Currently I don't know how to set the Motor lever start position to match the middle blue line.

    4) Also can I run SMC3 windows program testing without given the Motor any loading? Currently the Motor was not connected to the rig. The Motor can run freewheel.

    Thanks in advance and big thanks to this community, simtool and RufusDufus's SMC3. :)
    Mike
    • 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 @minanke and welcome.

    some answers/solution:

    1- It is not advisable to do this kind of test with the input (A0, A1) disconnected from your Arduino. This will give random numbers and make your motors unstable.

    2- As i understand your motor don't follow the command line (blueline). Try inverting the positive and negative wire of your motor. (the purpose of the Arduino is to bring the motor of the command line and not move away from it.)

    3- yes, you need to adjust the rotation of the engine in relation to the rotation of your pot. If your engine has to turn 180 degrees and you have a pot of 270 °. So when the engine will make 180° your pot should turn 270 ° .Thus the middle of each match, and you should get a position that is closer to the blue line.

    4- yes ,the code of RufusDufus integrates calculations (pid) used to provide the right power to the motors, regardless of load.
    • Like Like x 2
  3. minanke

    minanke New Member Gold Contributor

    Joined:
    Dec 1, 2013
    Messages:
    17
    Occupation:
    Developer
    Location:
    Hong Kong
    Balance:
    - 374Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi Eric,

    Thanks for the prompt reply, I'll give these a try.
    • Like Like x 2
  4. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,560Coins
    Ratings:
    +3,488 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    I have a small problem when trying to test the motors when set to DOF the sim does not move but if I set it to Axis testing the motors move but obviously only one at a time and I can not tell which way they are suppose to be turning. Any ideas anybody ?

    I have no idea why because all the games work fine that I have setup although it's hard to tell if surge and heave are the right way round.
    • Like Like x 1
  5. AceOfSpies

    AceOfSpies Living the Dream!

    Joined:
    May 8, 2012
    Messages:
    260
    Location:
    Kilwinning, Scotland
    Balance:
    19,614Coins
    Ratings:
    +244 / 1 / -0
    My Motion Simulator:
    3DOF, DC motor, JRK, Motion platform
    Hi @SilentChill remember that when you are in output testing, its "Default" settings that are used not any of the game settings in "Axis Assignments". Maybe this is the problem.

    Mike
    • Like Like x 1
    • Informative Informative x 1
  6. 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
    in game engine app go to axis assignments-game list and make the default profile same as the game profile you are playing and don't forget to save it. then test if you have any movement while testing in dof mode
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Aug 20, 2014
  7. SilentChill

    SilentChill Problem Maker

    Joined:
    Jul 19, 2014
    Messages:
    2,643
    Occupation:
    Railway Maintenance
    Location:
    Morecambe, Lancashire, England
    Balance:
    20,560Coins
    Ratings:
    +3,488 / 34 / -0
    My Motion Simulator:
    DC motor, Arduino, Motion platform, 6DOF
    Thanks guys I will give it a try after couldn't for the life of me work it out lol but something so simple is probably right :)
    • Like Like x 1
  8. Yoder_

    Yoder_ New Member

    Joined:
    Jul 5, 2014
    Messages:
    28
    Occupation:
    IT Dude
    Location:
    Oklahoma, USA
    Balance:
    400Coins
    Ratings:
    +9 / 0 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino
    Wow! I've been working on my own rotary encoder feedback PID servo controller using an Arduino, and I had no idea your AMAZING suite existed. Awesome work. By the way @RufusDufus would you be interested in implementing rotary encoder feedback in your code? If so, I'd be happy to try to help implement it.
    • Useful Useful x 2
    • Like Like x 1
    • Agree Agree x 1
  9. minanke

    minanke New Member Gold Contributor

    Joined:
    Dec 1, 2013
    Messages:
    17
    Occupation:
    Developer
    Location:
    Hong Kong
    Balance:
    - 374Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi, My SMC3 setup is almost finish :). Now when I test with an empty seat, the seat move as expected. But when I sit on it, the motor didn't have enough power to drive me to the other side.

    So my question is should I increase the "Kp" or the "PWMmax" in order to increase the motor power.

    Thanks
    Mike
    • Like Like x 1
  10. RufusDufus

    RufusDufus Well-Known Member

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

    Sounds like you need tof first increase the PWMmax - this sets the limit of how much power can be applied to the motor.

    You may still need to increase Kp after that - Kp sets the scaling between the input signal to the max output power. So if the motion is not tracking well, increase this one which will have the effect of applying the power quicker as the input changes.
    • Like Like x 1
  11. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Yoda, implementing rotary encoders shouldn't be too hard. There is not much request for it but can help out if you need it. I don't get as much time on here these days so I may take a couple of days to reply.
    • Like Like x 3
  12. minanke

    minanke New Member Gold Contributor

    Joined:
    Dec 1, 2013
    Messages:
    17
    Occupation:
    Developer
    Location:
    Hong Kong
    Balance:
    - 374Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Thanks RufusDufus, I increased the PWMmax and also the Kp, now the motion is what expected.

    I'm very happy, my rig finally working. Thanks so much to all. Mike
    • Like Like x 3
  13. 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
    i presume you will post a video of your masterpeace soon ! :rolleyes:
    • Like Like x 1
  14. 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 had a brain fart, How does one go about installing the SMC3.ino folder into the Arduino IDE? I did it before and now I can't remember what the hell I did.

    Thanks.
    terry

    Attached Files:

    • Like Like x 1
  15. 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
    wrong folder , but it is going to create it . it will be correct after.
    • Like Like x 1
  16. 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
    OK, however "Where do you put this folder"? drag and drop or is it installed in program files /Arduino?
    • Like Like x 1
  17. 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
    i installed Arduino on E:/ and SMC3.ino should be in a folder named SMC3 then...
    xx:/arduino/eample/SMC3/smc3.ino

    but you can too create a folder elsewhere like me : /documents/Arduino/SMC3/smc3.ino

    no matter where you are installed SMC3.ino, double click on it and Arduino IDE will open it !
    :D
    • Like Like x 1
  18. 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
    OK, so here lies the problem. I have the SMC3 into a separate folder like the message tells me to do. When I open the folder and click on the SMC3 arduino, it opens and I can Verify the program but when I try to upload it I get an error message (RED) saying that it is "not in sync" and the lights do not blink like they should. I need to get the SMC3 folder into my (FILE/SKETCHBOOK) in the Arduino IDE.
    How is this done?
    • Like Like x 1
  19. 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

    put your SMC3.ino into a folder called SMC3 for example then copy it to this destination C:\Users\YOUR USER\Documents\Arduino its the default folder for scetches when arduino ide is installed.
    then open arduino ide and you will find SMC3 under file-sketchbook.
    • Like Like x 1
  20. 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 insanegr, That is exactly what I wanted to know. It worked very well, like I said in the start, "I had a brain fart". Thanks again
    Terry.
    • Like Like x 1