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

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,463
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,614Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Please see the SMC3 settings explanation here: https://www.xsimulator.net/communit...driver-and-windows-utilities.4957/#post-48121

    You need to adjust your SMC3 settings, including things like Max, Clip, PwRev.
  2. 0v3rkill

    0v3rkill Member

    Joined:
    Mar 24, 2022
    Messages:
    46
    Occupation:
    Programmer
    Location:
    Netherlands
    Balance:
    - 259Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    i did it with the tutorial step by step, but the max limits are hardlimited to 255 and thats only halfway is there a way to increase the max limits?
  3. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,463
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,614Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    As I mentioned you can gear a pot, rather than direct connect.

    Realistically lever movement over 38 degrees up or down becomes very inefficient and puts unnecessary loads on motors, can you please confirm if you have that range.
  4. 0v3rkill

    0v3rkill Member

    Joined:
    Mar 24, 2022
    Messages:
    46
    Occupation:
    Programmer
    Location:
    Netherlands
    Balance:
    - 259Coins
    Ratings:
    +25 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    i have adjusted the script a little and build in a small factor to convert it to 180 degree values.
    it works now :)
    • Like Like x 1
  5. miaziol

    miaziol New Member

    Joined:
    Dec 20, 2020
    Messages:
    29
    Location:
    Poland
    Balance:
    - 82Coins
    Ratings:
    +13 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino, Motion platform
    can you show script here? what do you change?
  6. Rodeo5150

    Rodeo5150 ROOKIE BUT LEARNING FAST Gold Contributor

    Joined:
    Mar 21, 2019
    Messages:
    210
    Location:
    Antioch, CA, United States
    Balance:
    1,233Coins
    Ratings:
    +51 / 0 / -0
    My Motion Simulator:
    Arduino, 6DOF
    Are you sure that wiring diagram is right because you look at the code that's not the way it's written pwm is on number two in the diagram but the code is supposed to be on 9 enA and enB it's supposed to be two and three I don't understand how cuz my motors don't work for s*** it's going to keep spinning and spinning and spinning
  7. Larux

    Larux New Member

    Joined:
    Oct 12, 2015
    Messages:
    17
    Location:
    Argentina
    Balance:
    - 1,205Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hello. I have this problem in the compilation. How can I fix that?

    [​IMG]

    Attached Files:

    Last edited by a moderator: Apr 26, 2022
  8. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,463
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,614Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Where is the code from, what version is it and has the code been modified in any way?
  9. Larux

    Larux New Member

    Joined:
    Oct 12, 2015
    Messages:
    17
    Location:
    Argentina
    Balance:
    - 1,205Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    It is version v1.0.ino. Is there a more recent version?
    Nothing in the code has been changed
  10. Larux

    Larux New Member

    Joined:
    Oct 12, 2015
    Messages:
    17
    Location:
    Argentina
    Balance:
    - 1,205Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
  11. Larux

    Larux New Member

    Joined:
    Oct 12, 2015
    Messages:
    17
    Location:
    Argentina
    Balance:
    - 1,205Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Problem solved, I had the arduino micro board selected instead of arduino uno. That's why it didn't compile. Thank you very much too

    Attached Files:

    • Like Like x 2
  12. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    36
    Balance:
    229Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    3DOF
    When running a motion test like sin, within a few cycles the green feedback line and the yellow motor PWM line stop updating in SMC3util. The motor continues to move as expected. Is this a common problem or is it just me?

    if I exit SMC3utils and renter it generally starts working again.
  13. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    172
    Balance:
    1,035Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Hi everyone, I'm stuck with the "SMCutils" tool. I don't understand if this tools is essential to use.
    I have difficulty setting only the limits CLIP, MIN, MAX ...
    In Simtools there are also the "Axis Limiting" settings, are these not enough?

    I have already tried to read many times in the following post:

    https://www.xsimulator.net/communit...3dof-motor-driver-and-windows-utilities.4957/

    but i am very confused with the values of CLIP INPUT, MAX LIMITS.

    Can you explain me how to set these two parameters?
    I have 2 types of stations: one with gearmotors and one with electric actuators, both with 10K potentiometers (infinite rotations).

    Please give me some help, thank you
    • Friendly Friendly x 1
  14. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,463
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,614Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    The SMC3 utility is used to properly setup and configure PID and other settings for your specific hardware, and this should be done properly and before messing with SimTools.

    The SMC3 tuning parameter explanations are all in the second SMC3 thread post: https://www.xsimulator.net/communit...driver-and-windows-utilities.4957/#post-48121

    But likely what may help is some simple foundational understanding of PID, as in the end that may help put the specific SMC3 settings into some context. While written with a different controller in mind here is a gentle introduction to PID, which also has links to more accurate and in depth descriptions, depending on how far down the rabbit hole you want to go: https://www.xsimulator.net/community/faq/a-laymans-analogy-guide-to-pids-pid-tuning.219/
    • Winner Winner x 1
  15. Pierre Lalancette

    Pierre Lalancette Sir Lalancelot Gold Contributor

    Joined:
    Dec 11, 2016
    Messages:
    943
    Occupation:
    3D teacher
    Location:
    Quebec, Canada
    Balance:
    7,683Coins
    Ratings:
    +883 / 6 / -0
    My Motion Simulator:
    3DOF, DC motor, Arduino, 6DOF
    This is a really old thread, but it may give you some hints on how to set up your rig.
    6 DOF from scratch
  16. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    36
    Balance:
    229Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    3DOF
    The feedback analog input goes from 0-1024. So you need to be sure to adjust the pot to be close to 512 in the middle of your motion range. This is the green line on the plot which should be in the center when the rig is level.

    The values of the limit parameters are a bit confusing. The lower limit is set to the limit. The upper limit is set to 1024-limit. So as you lower the limit, the range of motion is increased. A value of 255 is the smallest range of motion.

    The clip limit is the highest value the system will accept as a target. So if you command the system to go to position 850 and the clip limit is 800 (1024 - 224) the target position is set to 800 by the Arduino.

    If the feedback value is ever outside of the limit the motor will be disabled. The system will not enable the motor while the feedback is outside the limits. This can only happen if something is wrong like a broken wire since the motor cannot be commanded outside the clip limit.
  17. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    172
    Balance:
    1,035Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    OK thanks guys for your answers.
    As for the PID values, I have no problem, I have already set the following values (correct for the type of engine I use)
    P = 350
    I = 0
    D = 0

    PWMmin = 100
    PWMmax = 200

    I have correctly set the center of the potentiometers to 512, green line in the center of the visual spectrum, the motors move very well.
    My only doubt is this, I hope to explain myself well: let's suppose that in SMC3utils I set the limit CLIP = 100 and close SMC3utils. Then I open Simtools Game Engine, Axis assignments, Axis Limiting.
    The 100% value of Amount of Axis to Use will correspond to the range of values of the CLIP limit, therefore the motor arms will have a rotation range based on the parameter of SMC3utils and will not exceed the limit of
    CLIP100?
    Are the two parameters (CLIP of SMC3utils) and (Amount of Axis to Use of Simtools) independent or do they interact together?
  18. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,463
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    144,614Coins
    Ratings:
    +10,741 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Think of the SMC3 settings as a hardware configuration/optimisation and safety limit, so if exceeded everything shuts down.

    In SimTools Axis Limiting is not really needed except as a cushion for some vulnerable hardware, such SCN actuators, which can be very fragile at their limits. For things like DC motors Axis Limiting is not needed.

    Axis Assignments, Tuning Center and Game Manager setting are all about how a possible range of motion (defined in SMC3) is allocate to various axis for a particular game (Axis Assignments), how those responds to game inputs (Tuning Center) and how a base motion profile can subsequently be tailored/varied to say dial in different types of cars for a particular track, or one type of car for different tracks (Game Manager profiles).

    What SimTools does is very different from SMC3, but each needs to be calibrated properly to do its independent but related job.
  19. motiondynamics

    motiondynamics Member Gold Contributor

    Joined:
    Apr 12, 2019
    Messages:
    172
    Balance:
    1,035Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    2DOF, 3DOF, DC motor, AC motor, SimAxe, Arduino, Motion platform, 6DOF
    Thanks noorbeast, you are very kind and very thorough in your explanations.
    I ask you for information and a configuration advice: for the operation of the platform with gear motors (motor shafts in rotation), there are no problems if the mechanical handle exceeds 90 ° or -90 °.
    Instead, I have to configure my 4 linear actuators in the 4 corners (like the D-Box system) with a stroke of 100 mm and I have to be careful not to knock the mechanical parts in the maximum range (over 0 mm and over 100 mm).
    My actuators have no mechanical limit switches and no motor lock, so when the system is not powered the 4 actuators will go down due to the force of gravity. When I turn on Simtools the motors must not be blocked due to the "Max Limits" set in SMC3utils.
    I know that SMC3utils is able to emulate the limit switches through the values of "Clip Input"
    So I need to know what parameters I need to set to prevent the actuators from going beyond 0mm and 100mm and how I can prevent the motors from locking when the actuators are all down (no power due to gravity).

    If I have not been clear tell me that I will explain maybe with some drawings.
    Thank you
  20. Joe Cortexian

    Joe Cortexian Member Gold Contributor

    Joined:
    Sep 8, 2021
    Messages:
    36
    Balance:
    229Coins
    Ratings:
    +6 / 0 / -0
    My Motion Simulator:
    3DOF
    All the parameters that you set in SMC3Utils are saved to EEPROM (permanent storage) on the Arduino. So those are used in SimTools. As far as SimTools is concerned the Arduino is a black box that you send positions to.

    You should try setting the “filter length” KS. This parameter smooths the acceleration and deceleration to minimize jerk. So if you are having a rough ride this could help. This will increase the following error but a value of 4 is 1ms. I doubt you could feel 10-20 ms of following error.