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

    yura999 New Member

    Joined:
    Aug 6, 2017
    Messages:
    26
    Balance:
    321Coins
    Ratings:
    +4 / 0 / -0
    My Motion Simulator:
    2DOF
    Friends, please tell me so what am I doing wrong? Or is everything working properly for everyone?! After all, maybe someone will have the same situation as me, but there will already be a solution to such a problem.
  2. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi everyone, I'm a simulation enthusiast and a few months ago I bought the Simtools license.
    I have a big problem with my simulator (electric linear actuators with Arduino) and I ask your technical support to solve it, I'll explain what happens.

    I had downloaded the SMC3 V1.0 version, but I had a problem: as soon as I inserted the USB cable, the actuators went to the central position very quickly. Then I tried to use version 1.7a with "Soft Start", but even with this I am having problems, the movement starts slow but when it reaches the central position the actuators make 5 violent clicks (up and down).
    In Game Engine> Interface Settings, I have selected 10 ms in Output Rate.

    What I ask is: I want to use SMC3 V1.0 version. Is it possible to prevent the actuators from snapping in the center when I plug in the USB cable? That is to make the actuators move only when I start Simtools using the Game Engine functions "Startup & Resume" and "Shutdown & Centering"?

    Another question: in Game Engine I set 500000 BitsPerSec, in the Windows COM port I set 115200 BitsPerSec.
    What are the correct values that I need to set in the Windows COM port?

    Tell me if there is any remedy, I hope you give me some answers, I am confident of your kindness and your professionalism.
    A thousand thanks
    Last edited: Nov 14, 2022
  3. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    I might be totally wrong as my rig has been down for a long time, but I think this is controlled by the program inside the Arduino. As soon as it has power, it brings the motor to the center. SMC3 is more like an interface to bring value to that program, but I don't think there is control for the start setup. But it's been so long, I could be wrong.
  4. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi Pierre and thank you for speaking to my request for help.
    Yes, that's it: as soon as the computer restarts or when the USB cable is connected, power arrives to the Arduino, the motors move to the central position, this is managed precisely by the SMC3 code, in fact this behavior arises even without starting the Game Engine or Game Manager.
    The problem is that it goes to the center in a nervous way, with a violent click that makes the whole simulation station vibrate.
    It would be a very good thing if this start was not there, that it is only Simtools, at its start, that brings the engines to the center.
    Is there any way I can do this? I address this question especially to Rufus Dufus who wrote the code.
    Hope to get your help.
    Thank you very much indeed.
  5. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    • Like Like x 1
  6. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi Pierre and thanks for the links and your advice.
    I looked at the links but couldn't find the solution I need.
    I have two big problems to solve, I explain step by step what I do (with version V1.0):

    1) I power up the motors, plug the USB cable into the computer, the cylinders move violently towards

    2) When the cylinders have reached the center, they go up and down by about 1cm, constantly, without ever stopping.

    Is there a way or a solution to solve these problems?
  7. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    If you look here, the most important values for stabilization are: Fpid, Kp, Fpwm. They are the ones controlling the loop of retro action. Telling the actuator: No you are too far, come back. Too far in the opposite direction, come back. This is probably what is happening with your rig. You could try to reduce PWMmax to see if it's not that your motor is moving too fast, making too big of an adjustment.
    6 DOF from scratch
    Pierre
  8. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Thanks Pierre, ok for the oscillation problem I will try to change these values.
    On the other hand, for the problem of violent shooting when I insert the USB cable, how could I solve it?
  9. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    No idea. My rig was always going to the center at full speed.
  10. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,876 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Have you tried the SMC3 Soft Start version with some dead zone allocated in the settings, if the actuators continue to move you also likely need to check/refine the rest of the SMC3 settings, and possibly the pot mount and cabling: https://www.xsimulator.net/community/threads/smc3-arduino-3dof-motor-driver-with-softstart.9479/
  11. motiondynamics

    motiondynamics Member

    Joined:
    Apr 12, 2019
    Messages:
    177
    Balance:
    1,055Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi noorbeast, the values I entered through the use of SMC3utils are the ones I attached in the photo.
    They are correct?
    What values should I correct?

    NOTE: I know very well that the PID values strictly depend on the type of motor being used

    Attached Files:

  12. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,029
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    147,872Coins
    Ratings:
    +10,876 / 54 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    These are the SMC3 instructions for initial configuration:
    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
    And the explanation for each of the settings are here: https://www.xsimulator.net/communit...driver-and-windows-utilities.4957/#post-48121

    You are correct that settings are somewhat hardware dependent, but if you are following the instructions I would expect Kp to be higher, Max Limits would not be 0, and I would expect Fpwm to be 25.
  13. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    Fpid was the value that has de most smoothing value on my rig. Mine was at 4.
  14. Davy Bert

    Davy Bert New Member Gold Contributor

    Joined:
    Jun 10, 2022
    Messages:
    1
    Balance:
    - 101Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    The Arduino software is written to work with a 10k pot meter, so pulses will not work. (i guess)
    My motor did not have a long shaft so i have placed the pot meter aligned with the shaft of the motor.
    I've designed and printed an arm to move the pot meter along with the movement.
    https://www.thingiverse.com/thing:5585075

    A little hint: Be sure to eleminate the mass connections of your motors.

    After all, it all takes some work but man this is worth it.
    Another congrats for the creator of this arduino script!!
    This take sim racing to a very imersive level.

    In the beginning i was searching for a way to lock the motion simulator when playing without movement, but hey, i never played again without and do not play games anymore when no plugin is available.
  15. TomKlash

    TomKlash Member

    Joined:
    Nov 21, 2012
    Messages:
    50
    Location:
    FRANCE
    Balance:
    425Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, SCN5, Arduino
    Hello everybody,

    Thanks a lot to RufusDufus for this code and software. I use it for my G-Seat Simulator.
    So i have a question on it :

    I use SMCUtils to param it. To reduce potentiometer noise (witch give motor noise) i chose Fpwm at 20Khz or 25Khz and especially Fpid / 4. When i pass from Fpid /1 to Fpid /4 the noise stop or decrease strongly, sometimes it necessary to pass from 25Khz to 20Khz.

    It necessary to pass from a value to another to optain a result. Load parameters from file (saved) has no effect.
    I don't know explain it.

    The most important in my question is that i need to restart this manipulation after computer restart.
    I think parameters stay in arduino memory but how to explain having to redo this operation after restart ?


    Thanks for your help.
  16. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    949
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    7,719Coins
    Ratings:
    +892 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    From what I remember when my rig was up and running, you don't have to redo this operation after a restart if you stayed inside the limited parameters of the motor. If you didn't trigger any safe stop or revers limits, it should restart and bring your rig to the center.
    When I was hinting those limits, I had to reboot all Arduino by turning their power off and rebooting the computer.
    I hope this will help you.
  17. TomKlash

    TomKlash Member

    Joined:
    Nov 21, 2012
    Messages:
    50
    Location:
    FRANCE
    Balance:
    425Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, SCN5, Arduino
    Thank you for your help.
    I stay inside the limited parameters, i haven't limit in my settings and no Pwm rev.

    I think the settings stay the same after restart but to reduce noise i need to switch into 2 value of Fpid or Fpwm.

    Very strange...
  18. ChuckyP

    ChuckyP Active Member

    Joined:
    Sep 21, 2020
    Messages:
    122
    Location:
    Chicago, IL
    Balance:
    748Coins
    Ratings:
    +63 / 0 / -0
    My Motion Simulator:
    3DOF
    I had ( and still do slightly but much better), motor noise and I did notice changing some of the values in SMC3 stopped them for a brief moment but it seemed to be very arbitrary and not much of a solution. I went back to the standard settings and started tracking down the root cause which seems to have been interference and a bad ground.

    I hope you find the root cause.
  19. TomKlash

    TomKlash Member

    Joined:
    Nov 21, 2012
    Messages:
    50
    Location:
    FRANCE
    Balance:
    425Coins
    Ratings:
    +10 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, SCN5, Arduino
    Interesting, can you tell me more on interference and bad ground on your simulator ?

    Which solution do you use to reduce this noise ?

    Thanks.
  20. ChuckyP

    ChuckyP Active Member

    Joined:
    Sep 21, 2020
    Messages:
    122
    Location:
    Chicago, IL
    Balance:
    748Coins
    Ratings:
    +63 / 0 / -0
    My Motion Simulator:
    3DOF
    I’m still working on the wiring. But I am trying to keep all of the power cables running both from the power supplies and the motors away from my potentiometer wiring and usb cable going to the arduino.

    my bad ground was a broken wire on the arduino going to the motor drivers.

    moving the potentiometer cables around under the sim would cause the motor noise to increase and decrease.

    I changed both of these variables at the same time however so I’m not sure which was causing the problem. I hope you find it.
    • Informative Informative x 1