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. 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
    @Pit thanks for sharing and nice job
  2. 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
    @RufusDufus
    SMC3 is actualy incredible job,:thumbsthank you friend for sharing and supporting
    to me at least it has this very important lesson that code plays a major role comparing
    with other parameters.now my sim is much smoother than before and almost
    get rid of those tiny steps during very slow changing direction, all the set up and wiring took me
    an hour(without all last weekend I spent to reading all the posts...;))
    ok here is my smc3util setting:
    Untitled111.jpg
    this is as you generally recommend, but if i want to get more ...
    and better configuration and setting, what should I do ?
    thank you again
    regards
    Hooshang
    Last edited: Jun 18, 2014
  3. 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
    Hi HoosHang your settings are already close to the limit. The Pwmmax can be pushed to 255 but that is all. That means your hardware like the motors is limited powering up your rig.
    • Like Like x 1
    • Informative Informative x 1
    Last edited: Jun 19, 2014
  4. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Yes PWMmax can be increased, you basically have it set to 200/255 = 78% max duty to your motors. Of course increasing this will place the h-Bridges/PSU/motors under more stress so if they're not upto it you may have problems. If you have the Big Worm Drive motors commonly used this shouldn't be an issue for the motors as long as the H-Bridge and PSU can cope.

    Other areas you can tweak. Increasing PWMmin helps get the motors moving and is often good for improving smoothness. I have noticed that this can sometimes create some motor noise depending on your setup.

    Kp, Ki and Kd can all be increased to fine tune the motion. Have a read of the first post it talks a little about these.

    Last of course is the mechanical setup. If there is any slop in the mechanical connections anywhere that can cause jerky motion especially between the motor and feedback pot.
    • Like Like x 1
    • Informative Informative x 1
  5. 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
    @RufusDufus
    SMC3 is great, but it has still some space to work to be best and it actualy worth it , it has a lot of advantage
    comparing others, first it can drive three motors and can freely set with any motor driver boards ...

    thank you Pit and RufusDufus for informations
    I increase PWMmax to 240 and what is the optimum number for PWMrev?

    I cant increase PWMmin,as soon as adding any number make motors noise ,haw can I get rid of this?
    and what combination of Kp,Ki, and Kd is the best setting and how should I configurate them
    thank you friend
    best regards
    Hooshang
    • Like Like x 1
    • Agree Agree x 1
  6. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    I agree, the great advantage is that this sketch will run three motors. I recently changed over completely to SMC3 for this reason. I did away with an unneeded Arduino board and reduced the size of the enclosure.

    Last night was my first session with SMC3 only and it was great. I have to admit to not having tweaked it at all, I just loaded the settings found on the first page of this thread. It would be nice if there were a default settings file included in the zip file (hint hint) :)

    Thanks again Rufus
    • Like Like 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
    I use the same value as PWMMax.
    That is not an issue. If the motors are too noisy set the Fpid to "2" instead of "1".
    What the values mean you can read in the documentation which @RufusDufus has been provided. The Kp value is responsible for the "hard" turns. The higher the value the better (harder) the turns. The speed of the motors wont be affected.
    • Informative Informative x 2
    • Like Like x 1
  8. 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
    Fpid is already set to 2 ,but still has the noise even increase a few number to pwmmin:think
    thank you
    regards
    Hooshang
    • Like Like x 1
  9. 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
    PWMmin if needed to hold the position will produce some noise. That is not a bug but a feature :). If your motors have a planetary gear there is no (or only a little) PWMmin necessary.
    • Like Like x 1
    • Informative Informative x 1
  10. 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
    @Pit
    thank you friend for quick reply
    @RufusDufus
    SMC3 been more than my expected up to now but I want to know if
    there is any setting or configuration for smc3utils to give
    any better performance .SMC3 potentially showed that has this ability
    and iam still playing with numbers:p
    anyway thanks a lot friend
    regards
    Hooshang
    • Like Like x 1
  11. 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
    yes play with the different values and make your own experience. Due to all the different hardware build into the rigs everybody has to figure out the best value for himself.
    • Agree Agree x 2
    • Like Like x 1
  12. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Hooshang, can you provide some more info as to what you are looking for with "improved performance". As Pit says every sim setup is different... Are the motors not tracking the SimTools output well enough? What motors and H-Bridge are you using? Perhaps also post an updated screenshot of your current SMC3 settings.

    It's a bit of fiddling around but SMC3 Utils can connect to Simtools via UDP and pass the data onto SMC3 - by doing this you can actually see exactly what Simtools is outputting and how well the motors are tracking. It is described a bit in the first post. Alternatively you can use the MotionTrack Digital Scope setup to see the same thing. http://www.xsimulator.net/community/threads/simple-digital-scope-for-motion-sim-testing.5485/

    If the motors are tracking well you need to focus on Simtools profiles, if the motors aren't tracking then focus on SMC3 settings and your mechanical setup.
    • Like Like x 3
    • Agree Agree x 1
  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
    @RufusDufus
    first thank you for effort for making and supporting SMC3
    then,iam using Arduino uno and pololu vnh2sp30 dual controller
    and the same hardware setup as i used Prilad code(thanks him)
    and actualy no problem with simtools setting and profiles
    what i am realy looking for is that when i changed code to
    SMC3,i found lots of difference interms of resolution however
    it got much better but i think specially for flight sim we still need
    maybe a little more bits or configuration or codes...donno...and as i
    follow the related posts you discussed with other experienced members
    who persist on using other board famous JRK,i realise there is not
    long way to reach or even take advantage...

    here is my updated smc3util setting
    Untitled221.jpg
    thank you friend
    regards
    Hooshang
    • Like Like x 1
  14. 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
    Hi @hooshang, nice that it works for you. BTW can you explain the sense of your posting above? I do not know what you are really meaning :) SMC3 works fine here, I could not imagine how it should be faster, smoother or whatever you want. Sure every code can be optimized, but it works definitely.
    • Like Like x 2
    • Agree Agree x 1
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    I'm glad you are (almost) happy. Without knowing exactly what you are trying to improve here are some things you could try...

    1. I notice you are using ver 0.6 of both SMC3 and Windows SMC3 Utils. There has been a version 0.63 available for some time and I would recommend them.
    2. Kp can be increased further and may help if motion seems jerky. TRY THIS FIRST. It can increase to 1000 but try increasing by say 100 at a time. Note all parameters can be changed to whatever ranges Windows SMC3Utils allows. Kd may need to be increased to balance any overshoot created.
    3. Adding some Ki may help with slow motion tracking. increase by 50 at a time and see how it affects motion.
    4. If you are getting too much overshoot then increase Kd, again start with increments of 50. If that creates noise in the motors increase Ks a few clicks.
    5. Try Fpid/1 that will double the PID calcs per second to what you have now. (or try other values to see if that has any benefit).
    6. If your pots are mechanically connected well then the deadzone should be zero - this is really only if you have slop in your system and will create some level of stepped response.
    7. Lastly what do you have as the delay in the simtools interface. eaorobbie has pointed out that the game plugins run at 20ms so don't go any slower than that... in fact if you use less it won't hurt (the ard can keep up with 1ms) that way you don't have to worry about the game plugin speed. I have also noticed that the delay is the sum of all interface delay settings, so if you have more than one configured then add them all together to work out the Simtools packet rate.
    • Agree Agree x 2
    • Informative Informative x 2
    • Winner Winner x 1
  16. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Sorry if this suggestion seems elementary but have you considered that what you are looking for is not in SMC3 but in Simtools? Have you used the Tuning Center to play around with the responses? There are also many "fine tuning" methods in the Axis Assignments area per DoF as well.

    As Pit and Rufus have mentioned, it is difficult to understand what results you are trying to get.

    I hope this helps :)
    • Like Like x 3
    • Friendly Friendly x 1
  17. 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
    @Pit
    you answer to all my post word by word so no need to explain the meaning
    thank you
    @RufusDufus
    ill change it to 0.63 and check all these items you mentioned above and let u know the resaults
    packet rate is 10ms
    thank you
    @Historiker
    in my sim,no boards changed also not any motors or power supply or any other hardwares and
    at last no changes in simtools recently I'v just changed my previous code to the new one(smc3)
    and I feel smoother motion and more resolution.
    just talking about the code.maybe lack of information or english make no sense .sorry guys:)
    thank you & regards friends
    Hooshang
    • Friendly Friendly x 1
  18. 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
    @RufusDufus
    these 2 little more bits makes a lot difference
    in my flight sim,thank you again friend,:cheers i followed your
    instruction but as Pit (thanks him too)said I was closed to optimum adjust
    and it moves smooth now
    now I have two questions
    1- is it possible modified smc3 for 6 motors on a bigger board with more pins
    like arduino mega 2650 or any... for 6dof platforms
    2- I donno if there is possiblity to make a code with 12 or more
    bits of resolution
    thank you guy ,you made big job
    regards
    Hooshang
    • Like Like x 1
  19. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Thank you Rufus! SMC3 has so much potential. I will be looking to use it on my sim projects. Not exactly as shown but used in a resourceful way. Summer has taken me away and now attempting to get back to it.
    • Like Like x 1
  20. 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
    hello friends
    here is my setup,run an ac motor by arduino uno with smc3,
    motor is 3 phase ac 0.55kw with reduction gearbox ,RPM=70
    inverter is LG ic5-1

    welcome and would be great to hearing any idea:)
    regards
    Hooshang
    • Like Like x 7
    • Winner Winner x 2