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

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Is it possible to use SMC3 with X-sim?
  2. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Jymä, As far as I know they all got their sims running... I believe they needed to install the latest version of Simtools and also:

    1. Ensure in the simtools interface setup you have created "and saved" a Default profile
    2. Make sure that there is a "Output Testing" profile in the Tuning Center

    I notice also you have all three axis in the output string in your interface setup... If you aren't using all three axis then only include the ones you need: for example [A<Axis1>][B<Axis2>]
  3. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Good pickup...

    I think this may be more to do with the low KP and PWMmax values. With the low values it takes a while for the PID to ramp up the output when the target changes so the motor doesn't have enough current to move it straight away then it eventually builds up and moves the motor to target and drops the current again.

    Increase these values but make sure your H-Bridge drivers are well heatsinked/cooled first.
  4. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Never tried but as long as it can send the required command format [A<Axis1>][B<Axis2>] where <Axis1> is a 10bit binary value sent as 2 serial bytes.
  5. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    For motion sims the Kp is definately the most useful parameter of the PID loop. Kd and Ks should have an effect though. Note they all interact with each other. I work mostly with Kp - from memory it is set at 600. I don't worry too much about the others.

    Not quite sure what you mean by Kp=100 in Simtools? Kp is a tuning parameter in SMC3 only.

    Yes, Ks will create instability in a PID control loop if set too high. Again you should be able to get good results focussing on just Kp and PWMmin and PWMmax.
  6. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Check my response to Jymä in post 342 above.

    EDIT: Also note the posts immediately following!
    Last edited: Oct 18, 2014
  7. Jymä

    Jymä Member Gold Contributor

    Joined:
    Nov 24, 2011
    Messages:
    61
    Location:
    Finland
    Balance:
    184Coins
    Ratings:
    +43 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @RufusDufus Got it working!!! Apparently it is a little bug or incompability in SimTools (or with SMC3 communication). I had the same thing with one other program. Though SimTools worked well with another Arduino code.

    If I have Finnish date and time format in windows (the bottom right clock shows now 9:41 18.10.2014) that problem occurs. If I change it to English (9:41 18/10/2014) it starts working! It can be tested by going to Control Panel->Clock, Language, and Region->Change the date, time or number format and put it to Finnish. And then launching SimTools again. Thank you for this motor driver!
    • Like Like x 3
  8. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Great fault finding there Jymä... I will do some investigation and see if I can work out what the difference is. I have always used the English format which I guess is why I've never seen it.

    Strange because the only thing that really changes between the two programs is a serial data stream sent to SMC3 arduino. I wonder if the change causes Simtools to send the 10bit binary values in reverse byte order? Maybe @yobuddy can suggest what to look at?

    Anyway, great that you have it working, will be nice if we can find what the underlying cause is though.
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    @Jymä, thanks again for the feedback... I have changed the date time to Finnish on my setup and can confirm the data output from Simtools is no longer valid.

    @yobuddy, I connected a second computer to the serial port output of my Simtools computer to monitor the data being sent by Simtools.

    When working correctly the packet data changes smoothly as expected with the center position sending out a binary value of 511 as expected and then increasing and decreasing as the slider is moved.... here is the serial data (5 byte packets, Hex followed by Ascii)

    5b 42 02 13 5d [B..]
    5b 41 01 eb 5d [A.ë]
    5b 42 02 13 5d [B..]
    5b 41 01 eb 5d [A.ë]
    5b 42 02 13 5d [B..]
    5b 41 01 f1 5d [A.ñ]
    5b 42 02 0d 5d [B..]
    5b 41 01 f5 5d [A.õ]
    5b 42 02 09 5d [B..]
    5b 41 01 f5 5d [A.õ]
    5b 42 02 09 5d [B..]
    5b 41 01 f5 5d [A.õ]
    5b 42 02 09 5d [B..]
    5b 41 01 f5 5d [A.õ]
    5b 42 02 09 5d [B..]
    5b 41 01 f7 5d [A.÷]
    5b 42 02 07 5d [B..]
    5b 41 01 f7 5d [A.÷]
    5b 42 02 07 5d [B..]
    5b 41 01 f7 5d [A.÷]
    5b 42 02 07 5d [B..]
    5b 41 01 f7 5d [A.÷]
    5b 42 02 07 5d [B..]
    5b 41 01 fb 5d [A.û]
    5b 42 02 03 5d [B..]
    5b 41 01 fb 5d [A.û]
    5b 42 02 03 5d [B..]


    When I switch to Finnish date/time mode the Simtools output is not correct. The second byte of the binary number is always zero and only the first byte changes - that is the most significant bits of the 10bit binary number are changing, hence the step change in motor position... here is the serial data (5 byte packets, Hex followed by Ascii)

    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
    5b 41 01 00 5d [A..]
    5b 42 03 00 5d [B..]
  10. Jymä

    Jymä Member Gold Contributor

    Joined:
    Nov 24, 2011
    Messages:
    61
    Location:
    Finland
    Balance:
    184Coins
    Ratings:
    +43 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    If it seems to be a trouble to fix users could always just change that time format if that problem occurs. Though I think it will happen with some more common languages too.
  11. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    There is some major problem at my rig, Win XP, nano clone, mode2,
    I have set date to english, and did all the above, and it remains the same, it works OK in simtools output testing if I set Kp not higher than 100 in SMC3util.
    Higher than ~100, and in simtools output testing, slowly moving the slider, the motor goes crazy, it follows the slider in general, but jumping around crazy, in SMC3util the same slidermoving generates a silky smooth motor motion.
    Seems like instead the data 1,2,3,4,5 etc as i move the slider, somehow it gets 1,2,3, -50, [big jump] ,5 etc.
    so no deadzone, but an erratic working.
  12. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    In tuning center, the values are smoothly changed from -32767 to 32767 but something happens after that in the chain.
    If a date setting can ruin simtools, then it can be anything.

    What operation system are you using?
    I wanted to drive the Ard from this XP machine, assetto corsa will run on a win 8 machine.
  13. Jymä

    Jymä Member Gold Contributor

    Joined:
    Nov 24, 2011
    Messages:
    61
    Location:
    Finland
    Balance:
    184Coins
    Ratings:
    +43 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I was using Windows 7 x64. I think you should try setting everything to that Windows 8 machine first to see if it would work that way. You basically just setup them same way but use these Simtools interface settings (with your comport) and without running SMC3Util and Simtools at the same time. http://www.xsimulator.net/community/attachments/gameengine-jpg.16335/
  14. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    My settings were correct, I took all the advices.
    By the way, my nano has got the CH340 USB chip.
  15. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    X-sim has no interface plugin for SMC3.
  16. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    What a relief, it is OK under win8. But my Q6600 is the bottleneck in AC, I wanted to use the XP machine to take away the job as much as it can.
    How much is the processor usage of simtools usually?
  17. dedas

    dedas Active Member

    Joined:
    Feb 5, 2012
    Messages:
    115
    Occupation:
    IT Manager
    Location:
    Netherlands
    Balance:
    - 26Coins
    Ratings:
    +81 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Well just to be clear, the motors are moving one at a time (not both) :)
    The problem is, the motors are working fine in SMS3Utils (values are PWMmax=200 and KP=500), smooth movement when i use the slider. But in Simtools (gameEngine) i got the strange behavior when i move one of the sliders Axis or Dof.
    I thought of one of the feedback pots isn't working correct, but after measuring there working both fine (they are 10K)
  18. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Another test, simtools output testing thru UDP to SMC3util, it goes total berserk. The blue line [target] breaking up, then coming again, and the motor jumps wildly.
    Stopped every process and service under XP, no change.
  19. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Me too. Are you using XP?
  20. Jymä

    Jymä Member Gold Contributor

    Joined:
    Nov 24, 2011
    Messages:
    61
    Location:
    Finland
    Balance:
    184Coins
    Ratings:
    +43 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @dedas If you are using Windows 7 or 8 try what i did above. I had exactly the same problem. Go to Control Panel->Clock, Language, and Region->Change the date, time or number format and put it to English.
    • Informative Informative x 1