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

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    206
    Balance:
    1,215Coins
    Ratings:
    +9 / 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.
  2. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

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

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    206
    Balance:
    1,215Coins
    Ratings:
    +9 / 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?
  4. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    1,006
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    8,044Coins
    Ratings:
    +944 / 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
  5. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    206
    Balance:
    1,215Coins
    Ratings:
    +9 / 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?
  6. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

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

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,741
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    Tasmania, Australia
    Balance:
    152,229Coins
    Ratings:
    +11,066 / 56 / -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/
  8. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    206
    Balance:
    1,215Coins
    Ratings:
    +9 / 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:

  9. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    21,741
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    Tasmania, Australia
    Balance:
    152,229Coins
    Ratings:
    +11,066 / 56 / -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.
  10. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    1,006
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    8,044Coins
    Ratings:
    +944 / 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.
  11. Davy Bert

    Davy Bert New Member Gold Contributor

    Joined:
    Jun 10, 2022
    Messages:
    2
    Balance:
    - 95Coins
    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.
  12. 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.
  13. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    1,006
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    8,044Coins
    Ratings:
    +944 / 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.
  14. 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...
  15. ChuckyP

    ChuckyP Active Member

    Joined:
    Sep 21, 2020
    Messages:
    122
    Location:
    Chicago, IL
    Balance:
    748Coins
    Ratings:
    +64 / 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.
  16. 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.
  17. ChuckyP

    ChuckyP Active Member

    Joined:
    Sep 21, 2020
    Messages:
    122
    Location:
    Chicago, IL
    Balance:
    748Coins
    Ratings:
    +64 / 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
  18. Pat Regan

    Pat Regan DIY Fokker D7F Flight Simulator Gold Contributor

    Joined:
    Mar 12, 2021
    Messages:
    18
    Balance:
    195Coins
    Ratings:
    +3 / 0 / -0
    My Motion Simulator:
    SCN5, Motion platform, 4DOF
    EUREKA! I HAVE FOUND IT!!! :)

    I do believe this thread has the answers to just about every electronics question I have about the rig I'm presently building. Thanks to all for the obviously huge amount of effort that went into making this information available to guys like me. Muchly appreciated.

    VBR,

    Pat
  19. Klaus Schmidinger

    Klaus Schmidinger Member

    Joined:
    Oct 3, 2022
    Messages:
    53
    Balance:
    433Coins
    Ratings:
    +17 / 0 / -0
    My Motion Simulator:
    AC motor, Motion platform, 6DOF
    With my DOFReality P6 with SFU gears I have the following problem: sometimes, when the motor moves down and then up again, it makes a short "dip" at the point where it reverses direction. It's like it loses power for a moment and then has to catch up again. For testing I'm using the SMC3 utility, moving motor R3 in "Motion" mode. The attached image "smc3.png" shows the parameters:
    smc3.png
    The problem happens with all 6 motors, but most prominently with the #3 motors in both control boxes. And it only happens when I sit in the seat, so there is more load on the motors. With an empty seat it does not happen.

    Here's a video that shows this: http://www.tvdr.de/flightsim/power-01.mp4.
    The oscilloscope displays the voltage between the two motor wires. Note how in the beginning the arm moves smoothly and the voltage switches between +/-24V and does PWM. At about 17 seconds the first "dip" occurs, which also can be heard (the motor sounds differently for a moment and the whole platform makes a bang). At this point the voltage shows an odd behavior (play the video in slow motion to see it):
    dip-voltage.png
    It only reaches +8/-6 Volts, and this doesn't seem to be the proper PWM.
    I have superimposed the SMC3 diagrams of the "Motion" with (green) and without (red) me sitting in the seat:
    motion-diff.png
    At the points indicated by the red arrows you can see where the two curves drift apart. The green one shows the "dip" the motor makes.

    I have contacted support@dofreality.com about this, but so far they haven't been able to help me. So I'm hoping that somebody here knows what's causing this, and maybe how to fix it.
    Last edited: Jan 2, 2023
  20. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    1,006
    Occupation:
    Tech Artist
    Location:
    Quebec, Canada
    Balance:
    8,044Coins
    Ratings:
    +944 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    Could it be your power supplies that can't satisfy the demand in current of all the motors changing direction. For me, it is the most likely problem. Possible solution, having a battery paralleled to the power supplies that would give the missing Amps for the motors.