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. 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
    Hello
    I have a little problem, im use hall sensor potentiometer , it has 180 degree. in the middle I have 2,5V on one end 4,8 oon second 0 its normal voltage for the usb. Now my question. I must set my limits like this: Max limits on 255 and clip on 220. How to fix it? Make gearbox or so? Or it's not a problem? tempImageRucKmV.png
  2. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,666
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,864Coins
    Ratings:
    +10,804 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    The pot should be rotated to the center position on the graph and then connected to the motor where the lever is in its centered rest position.
  3. 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
    its not a problem with centering or so. My problem and question is not how to set the potentiometers and how to centre the feedback. My question is about a small range. It is not about the range in which the rig itself moves, it is about the limits in the smc. I now have to have the limits set to 250 Max and 220 Clip. The movement of the platform is large even very large, but the range of the potentiometers is no longer. I'm wondering if I need a gear for the potentiometers, and if so, I'll have to look for it somewhere.
  4. spyrates

    spyrates New Member Gold Contributor

    Joined:
    Feb 2, 2021
    Messages:
    16
    Balance:
    77Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    2DOF
    Let's see if someone can give me a hand. The problem is the following and I compared 2 line actuators with 4-wire hall effect, two power cables, but I can't do it with Arduino. help please thank you
    Last edited by a moderator: Jan 13, 2024
  5. Michail

    Michail Member Gold Contributor

    Joined:
    Jan 5, 2022
    Messages:
    158
    Location:
    Germany
    Balance:
    697Coins
    Ratings:
    +26 / 1 / -0
    For the moment I am using SMC3 with rotational wheelchair motors in Mode 2. Is it possible to use linear actuator in mode 2 as well? I am searching for linear actuator for Surge axis for a full motion system.
  6. Attyla.pl

    Attyla.pl Member

    Joined:
    Oct 1, 2023
    Messages:
    75
    Location:
    Polska
    Balance:
    330Coins
    Ratings:
    +20 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Where can I look for the reason that the "target receive" signal level is lower than the "target sent" signal level ?
    On the same components several times I had the correct signal level ie target recive coincided with the signal target sent.
    The question is "where" does the arduino get the value of the "target receive" signal ?
    target sent recive.png

    Problem solved :)
    Load code smc3.ino version 0.6 and load again version 1.0 , arduino working OK :)
    • Like Like x 1
    Last edited: Jan 21, 2024
  7. Michail

    Michail Member Gold Contributor

    Joined:
    Jan 5, 2022
    Messages:
    158
    Location:
    Germany
    Balance:
    697Coins
    Ratings:
    +26 / 1 / -0
    Short question guys. If I am not anymore remember the pid smc3 settings from current system. And I want the same settings to add to my second arduino with different port, are smc3utils software able to read from the current system? I mean not load from file.
  8. TomServo

    TomServo New Member

    Joined:
    Nov 18, 2023
    Messages:
    2
    Balance:
    17Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino
    SMC3 question here. I have a 3DOF hydraulic simulator driven by PLCs. I need the arduino to output 50% PWM at middle of ram travel, 0% "down" 100% "up". There is no feedback to the arduino, the sim handles it's own positioning and feedback. Has anyone modified SMC3 arduino sketch for this use? If not, any advice? I would like the responsiveness pot to work also. Ad/Thanks/vance!
  9. TomServo

    TomServo New Member

    Joined:
    Nov 18, 2023
    Messages:
    2
    Balance:
    17Coins
    Ratings:
    +0 / 0 / -0
    My Motion Simulator:
    Arduino
    I wish I could edit the prior message for clarity. Anyhow to clarify, I need the arduino to pass the position data to the sim via PWM straight. No servo feedback from sim to arduino. Just desired position data straight from pc out through arduino via PWM pins. Ideas/comments/advise/(hopeful look) pre-modified SMC3 arduino sketch? Anything appreciated.
  10. tselehub

    tselehub New Member

    Joined:
    Dec 6, 2023
    Messages:
    24
    Balance:
    98Coins
    Ratings:
    +1 / 0 / -0
    My Motion Simulator:
    2DOF
    Can I use this code for 1DOF only for traction loss?
  11. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,666
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,864Coins
    Ratings:
    +10,804 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Yes you can.
  12. JaniK

    JaniK New Member

    Joined:
    Jan 11, 2023
    Messages:
    10
    Location:
    Finland
    Balance:
    39Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I have a "problem or feature" in my rig.

    When I have pwmMIN at 40-50 the motor CTC lever can be slightly rotated with hand or by "swinging your body in the seat on the rig"

    If I raise pwmMIN to make the lets say "rubberband deadzone" go away, the motor starts to make whining noise.

    What other settings should I try to play with to get the rig "standing still silently" ?

    Or is it just a feature of the IBT2 and my setup and motor choice..?

    (Edit: misclicked post button halfway )
  13. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,666
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,864Coins
    Ratings:
    +10,804 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    It could be interference, these related threads may be of interest:

    https://www.xsimulator.net/community/threads/smc3-noise-new-computer.15980/

    https://www.xsimulator.net/community/threads/motor-en-smc3-noise-after-switching-psu.17144/
    • Informative Informative x 1
  14. JaniK

    JaniK New Member

    Joined:
    Jan 11, 2023
    Messages:
    10
    Location:
    Finland
    Balance:
    39Coins
    Ratings:
    +7 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    My noise is quite similar as the link #2 video about changing power supply and getting noise.

    I changed my SMC3 settings to:

    17099349788476569684529840522705.jpg

    I just played for about 30 minutes and it just Works.

    The sound is not so bad anymore, it only bothers when not gaming. Yes I got my first 30minutes of gaming (setting axes the correct way for about 20min) and then when the rig does what is expected and not too little or much, I drive it hard for about 10minutes without any errors :cheers

    This thing is awesome !
    • Like Like x 1
  15. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    I am having an issue with SMC3. I recently hooked up all three of my motors to check my wiring polarity and such. One of the motors (Motor3) ran silky smooth while the other two (Motor1, Motor2) were very jerky in their movements. I switched the connections on the Arduino board between Motor1 and Motor3 and the jerky motion moved with it. I verified that I had my settings between all the motors the same except the Fpwm being 5kHz on Motor1&2 and 4kHz on Motor3. Only other changes from the default initial settings were the Kp and PWMmax values. I did not change any wire routing or switch the feedback sensor from motor to motor, I only swapped the wires at the Arduino for the feedback and the motor control. Here is two pictures from the SMC utilities screen, you can see that it is driving the PWM signal differently between the two.

    Jerky Motor1, Motor2 outputs. upload_2024-3-9_0-28-56.png
    Smooth Motor3 output.
    upload_2024-3-9_0-29-27.png

    Can anyone explain what's up with this. At first, I thought I had a noisy sensor, but since whatever is plugged into motor3 is smooth I have ruled that out.

    For reference, this is the base of my platform during a power check before I started wiring the sensors and motor control wires.
    upload_2024-3-9_0-40-58.jpeg
  16. noorbeast

    noorbeast VR Tassie Devil Staff Member Moderator Race Director

    Joined:
    Jul 13, 2014
    Messages:
    20,666
    Occupation:
    Innovative tech specialist for NGOs
    Location:
    St Helens, Tasmania, Australia
    Balance:
    145,864Coins
    Ratings:
    +10,804 / 52 / -2
    My Motion Simulator:
    3DOF, DC motor, JRK
    Can you please post a picture that shows all of your SMC3 settings.

    If 2 of the motors are totally powered off, including unplugging power to the PSUs, does the problem continue, as that should reveal if it were interference?
  17. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    Certainly.
    Here are screenshots from it running a square wave output.
    The first is on Motor3. upload_2024-3-9_20-27-27.png
    The second is on Motor2, but Motor1 looks the same. upload_2024-3-9_20-28-22.png
    These were taken while driving the same motor/gearbox/sensor, I just switched the connection on the Arduino. I did have to turn the Deadzone up if I was using Motor1 or Motor2. The Sensor inputs for whichever two motor outputs I wasn't using were connected, but the motor controls for those were not hooked up. I had repeated this on all three motors, one at a time while I was trying to figure it out. Also, using an oscilloscope and looking at the analog inputs, they didn't appear to have any extra noise on them. Unfortunately, I managed to kill the IBT_2 drivers I was using, so at the moment I only have one 18V25 G2 driver to use.

    While typing this I did have a thought. Motor1 and Motor2 outputs are run from Timer1 in the Arduino while Motor3 is run from Timer2. Are the PWM calculations different since Timer1 is 16bit and Timer2 is 8bit? Could those default settings it started with just be very wrong for those outputs? I was just trying to verify my center positions and wiring and didn't think to try tuning the PID settings when I saw this since the first one I hooked up was motor3 and everything ran smooth.

    I don't think it will help, but I have some short video clips of the motor running in both conditions, what format should they be in? .mp4 doesn't seem to work.
  18. Michail

    Michail Member Gold Contributor

    Joined:
    Jan 5, 2022
    Messages:
    158
    Location:
    Germany
    Balance:
    697Coins
    Ratings:
    +26 / 1 / -0
    I would like to ask how to find out which fpwm and fpid to choose? How to know which is the right khz frequency?

    Will the ks value influence the all the pid parameter or just the kd value?
  19. Gefahren

    Gefahren New Member

    Joined:
    Mar 9, 2024
    Messages:
    18
    Occupation:
    Electronics Engineer
    Location:
    Central Mississippi, USA
    Balance:
    113Coins
    Ratings:
    +33 / 0 / -0
    My Motion Simulator:
    3DOF
    I did figure out why with the same settings in SMC3 gave different behaviors between Motor1, Motor2 and Motor3. In the Arduino code the Integral and Derivative values are calculated differently for Motor3. I don't know if that was intentional or not. You can see from the comments in the code that they used to match.

    For Motor1 & Motor2
    iTerm_x100 = (Ki1_x100 * (long)CumError); // was >>6

    dTerm_x100 = (Kd1_x100 * (long)DeltaPosition); // was <<5

    For Motor3
    iTerm_x100 = (Ki3_x100 * (long)CumError) >> 6;

    dTerm_x100 = (Kd3_x100 * (long)DeltaPosition)<<5;
    • Informative Informative x 1
  20. jarena

    jarena Member Gold Contributor

    Joined:
    Feb 28, 2012
    Messages:
    39
    Balance:
    136Coins
    Ratings:
    +5 / 0 / -0
    hi guys ,
    On the diagram using 2 ITB-2 and Adruino, it shows one power supply to run 2 motors. my question is .. one power supply enough to run 2 24v motors that pull about 4amps each?