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

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Is it possible to move input and output pin assignments to other locations easily? Respectfully onside functions. This is needed for the pinout on the DAC shields be assembled.
    • Like Like x 1
  2. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Changing pins is pretty easy... BUT unfortunately not all pins can be used for all functions so there is only limited changes that can be made. In particular to generate the PWM outputs, the internal timers are used and these are only available on specific pins. Also the A/D converters (ANx pins) can only be swapped with other A/D input pins.
    • Like Like x 1
  3. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Exactly Rufus. Thank you for response and when posting pinout for DAC shield is it possible to get your help making changes? I am challenged with code.
    • Like Like x 1
  4. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Hello Rufus, I am done looking for a DAC shield to use on my simulators and will be designing one for specific application. Eagle CAD layout purchased. Will SMC3 still function without ENA or ENB. My setup is full hydraulic with servo control and those features are not used. Regards, John
    • Like Like x 1
  5. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Rufus, You around? What do you think about no ENA or ENB. I read a post about using different pins with no current monitoring.












    e
    • Like Like x 1
  6. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Yes, ENA and ENB are outputs from the arduino SMC3 so you can just ignore them if the driver doesn't use them... no need to change software.

    Do you have a link to the details for the board you are using, I haven't done anything with hydraulics so would need to see more info on the driver board.
  7. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Thanks Rufus, The servo driver is the Parker BD 99-10. The install manual can be found on google search. It is also located here on my postings. What do you think about the Phidgets 1002 analog output board? The Parker BD 99 has an input need of 0-10v for control.
  8. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Thanks Rufus, great software, i will try to read everything on it, but a silly question first,
    I have uploaded it into a nano, works OK with SMC3utils, but with Simtools output testing, i have to switch off SMC3utils, because it seems to have take over control even in monitor mode. During gameplay i guess it wont take over control in monitor mode, will it?
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Magic, from what I have read the board you reference is a full Servo controller with closed loop feedback. I don't think you really need an arduino with full PID algorithm to drive it.

    I would suggest you need something much simplified... just something that converts a serial command from Simtools into a 0-10V output value. Feed this 0-10V output straight into your servo board. The software in the arduino (or other interface board) does not need to do anything complicated.

    You will need additional interface circuitry if you use an arduino to generate the 0-10V output.
  10. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Thread, typically you can't run SMC3Utils and Simtools at the same time... They are both trying to connect to the same comm port to drive the arduino and whichever you start second will fail.

    The most common use SMC3Utils to setup all of the parameters to how you like them and then shutdown and run simtools (all the parameters are saved in SMC3 arduino non volatile memory)

    If you really want to run them at the same time (to monitor simtools output and motor tracking while in game) you have to setup using UDP interface which is a little more complex but straight forward. To do this you setup Simtools to use a UDP interface output instead of the commport - this talks directly to the SMCUtils instead of the arduino, and SMC3Utils passes the info onto the arduino SMC3.

    Note it is best getting everything working first without UDP as it just creates another interface that needs to be tested and can be affected by firewalls etc being a network protocol.
    • Like Like x 1
    • Useful Useful x 1
  11. MagicEdge

    MagicEdge Active Member Gold Contributor

    Joined:
    Oct 3, 2013
    Messages:
    131
    Occupation:
    Aircraft Technician
    Location:
    Justin' TX USA
    Balance:
    1,327Coins
    Ratings:
    +100 / 0 / -0
    My Motion Simulator:
    6DOF
    Rufus, What might you have in mind that SimTools will support? The arduino uno because of SMC3. I am designing a shield that will convert 0-5v pwm to 0-10v analog and also 0-10v analog into the Ard. Eagle CAD and off to OSH Park for etching pro style. My thoughts were to use the BD99 reference voltage out to input to the arduino pot input for integral feedback and let the BD99 do the proportional.
  12. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Guess there is no better public arduino sketch for a seatmover than yours. Let me ask some questions on extending it.
    -If you delete one motor from it, can it be even faster? [what is the latency including USB?]
    -Can we use the third motor part to drive a vehicle-speed controlled fan?
  13. 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
    Hi Guys,
    After a long summer break :cool: i'm picking up the racegear with the SMC3 controler.
    But now i have a strange behavior, let me explain:
    In the SMC3utils program, when i move the slider, both motors are moving al the way (smoothly).
    But when i'm testing the behavior of the motors in Simtools (output testing), and i move the sliders of one of the Axis it seems to have al large dead zone. Motors are moving when i go above ~25% and than it responds very fast.
    So when i'm driving in one of the supported games its more like a on/off behavior :(
  14. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Magic, if it is a full servo controller the position feedback it managed by the servo controller so you only need to send it the target position (via a 0-10V signal). So if you are building a shield that converts a PWM output to a 0-10V output all the arduino should have to do is convert a Serial position command from the computer to a PWM value.

    I would look to use one of the existing arduino servo motor drivers that have been used by others to build model sims using servo motors, its the same concept - you're just using big servos!
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Thread, thanks for the comment, but "better" really comes down to what you need. I think all the solutions available are great if you use what best suits your own requirements.

    Depends what you mean by faster... If the motor tracks the target position now then nothing needs to be faster. If the motor doesn't track the target position well it is probably more to do with the motor load, ability of the driver chip and PSU to supply the required currents, and the settings you have setup using SMC3Utils (PWMmax and Kp in particular).

    If you are referring to the speed of the PID calculation loop, it is currently running much faster than commands can be sent by the game so that shouldn't be a problem... it is currently as fast as it can be to perform the required math in the software loop.

    The third output could be used to drive a fan be disabling the feedback and just using the PWM output pin. To do this remove the feedback pot and connect the feedback pin to GND. Use the same command format you would use for a normal position command but scale it as a motor speed value instead. Not sure Simtools has speed available in the available DOFs though?
    • Informative Informative x 1
    Last edited: Oct 17, 2014
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,896Coins
    Ratings:
    +1,016 / 10 / -1
    When using SMC3Utils to drive the motors, only one motor should move at a time... there are some radio buttons at the top left of the screen to select which motor you want to move. If more than one motor is moving it is probable that you don't have all the POT feedbacks connected. If you only have one connected you will get crosstalk to the other inputs that may make the other motor move as well.

    When using Simtools if you are getting a step response as described the first thing I would try is to increase the PWMmax and/or Kp values for the motor first (using the SMC3Utils). Try PWMmax at least 180 and Kp about 600 and see how you go. If that doesn't work we need to test some more things.
    • Informative Informative x 1
  17. 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
    Hi
    I am having same issue as @ericRacer and @spartan300 on pages 4-8. What was the fix for this? I am using SMC3Utils v0.63 and SimTools_v1.2. On SMC3 Utils small movements work fine. On SimTools Output testing (and games) nothing happens until 40% DOF Output or 26% Axis Output and then it shoots to the limits.

    EDIT: I added pictures for more information. SMC3utils settings are pretty off but you can see that little movements work fine when I moved motor target manually. On SimTools it doesn't work at all. First nothing happens and then the target shoots to the limits. Simtools Axis management should be ok. It is almost default SimForce GT on default (which worked with previous arduino code). And I don't have SMC3Utils and Simtools running at the same time.
    GameEngine.jpg smc3.jpg
    Last edited: Oct 17, 2014
  18. Pit

    Pit - - - - - - - - - - - - - - - - Gold Contributor

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,438Coins
    Ratings:
    +3,089 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    @Jymä: your curve is very jagged. Please check your potentiometers if they are really working properly.
  19. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Hi Rufus,
    There is a problem with SMC3 on simtools.
    My rig: arduino nano clone, and IBT-2. SMC3 is in MODE2.
    In SMC3util everything works fine, except that Kd does nothing! Even with the square wave, absolutely nothing, and i guess that PWMrev also does nothing, at least now, without load on the wiper, there is no change in feedback on square wave.
    As for Kd it does not matter i guess whether is load on the wiper or not.
    And the green feedback is exactly the same at Kd=0 and Kd=1000.
    But it works fine, even with high Kp values.
    But in simtools, the max. Kp is about 100, which will cause a very boring ride, the worst ones you see on youtube :)
    With higher Kp-s, simtools output testing becames erratic. No deadzones at me, but very erratic, unusable.
  20. Thread

    Thread Member

    Joined:
    Aug 25, 2014
    Messages:
    121
    Balance:
    295Coins
    Ratings:
    +15 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Correct myself, Kd is working, but only in relation with Ks, sorry for not knowing that.
    Simtools maybe working right, just output testing is not able to handle smooth mouse movements, i don't know.
    Any experience on that?