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

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Dedas, did you click "Capture Min/Max" in the tuning center, then drive for a bit, then click "Save New Settings" and then "Stop Capture"?

    This process tells Simtools what level of force to use (I might be way over simplifying that). Until you do you might not get any movement.
    • Like Like x 2
  2. 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
    No i didn't do that, i'll try that first thing tomorrow evening :thumbs
    • Like Like x 1
  3. 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
    Ok did a capture and saved it with LFS, in the virtual axis screen i can see pitch and roll (among others) changing when i'm steering so there is output!
    But the motor behave strange and when i'm testing them in the Axis testing screen i can only move them with de Sway & Surge sliders.
    In the axis assignment screen i've got DOF1 as Sway and DOF2 as Surge, when i changed them to Roll and Pitch they don't move any more :think
    i've read the manual, maybe i've missed something but i havent got a clue :sos
    • Like Like x 1
  4. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,161
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,201Coins
    Ratings:
    +2,164 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    Can you post screen captures of your "axis assignment", "interface Settings" screens? It should not matter what the axis are assigned to, if they are assigned to Roll and pitch then when you move the roll or pitch slider in Output testing they should move. Test by Axis instead and make sure each axis moves when you slide the slider (rather than by DoF).

    By the way; Output Testing only uses the default profile so make sure that is the profile that you are changing.
    • Like Like x 1
  5. 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 there Historiker,
    I solved the problem of the Roll & Pitch, my default profile was set to Sway & Surge (silly me :rolleyes:)
    The reason why i didn't saw it was because the motors only move when the sliders pass 25% (some kind of deadzone? and it seems like there reacting a bit slow)
    anyway here are my screenshots, i also made a screenshot of SMC3Utils
    SMC3Utils.jpg
    Simtools game enige interface.jpg
    Simtools Axis.jpg
    Thanks in advance :thumbs
    • Like Like x 1
    Last edited: May 13, 2014
  6. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Good to hear you have it working...

    You could try increasing the Kp or adding a Ki parameter a bit to see if that helps with the deadzone issue. It may be that the current settings aren't providing enough power to get them moving until the error increases a bit.

    I note also you are not using the latest version 0.63 - I would recommend upgrading when you have everything sorted there was a timer bug that caused 0.6 to stop working after an hour or so.
    • Like Like x 1
  7. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    495
    Balance:
    4,798Coins
    Ratings:
    +181 / 2 / -0
    how do you edit the arduino code to select the mode1???

    i saw the code but didnt know what to edit.... anyone?

    fer
  8. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    495
    Balance:
    4,798Coins
    Ratings:
    +181 / 2 / -0
    about seleccting the mode in the arduino code... do i only have to use de worde mode1?

    like:

    #define mode1

    is it the way i have to edit the ard. code?

    best regards

    fer
  9. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Hi fer

    #define MODE2

    or

    #define MODE1

    can be modified within the ino file by a text editor or Arduino software: doubleclick the ino file for a firmware upload.
  10. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Correct as Pit detailed...

    Make sure you only have one of them defined and MODE must be in capitals.
  11. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    495
    Balance:
    4,798Coins
    Ratings:
    +181 / 2 / -0
    thanks guys... :D i hope this weekend i get some progress

    best regards

    fer
  12. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    Hi all today is screwed-up day. I got the Sparkfun Monster Moto and began to build up the driver. Wiring is like every time, using the old one from dx.com shows it working perfectly.

    SMC utility is all off and NO PWMmax, but:


    1) B1/B2 diode lamp is on, power 2V, A1/A2 diode lamp is off, no power
    2) I turn the potentiometer, but PWMmax is zero! A1/B1 diode lamp is full on, 12v max output! The chip will be very hot after a few seconds.

    I tried all, there is no short circuit from the wiring cables (tested), but perhaps one on the board.

    What can I do from the very basics to test if the Monster Moto is damaged or is working fine? Any suggestions?

    Thanks.
  13. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    edit, I can it explain better...PWMmax is 50.

    the feedback of the potentiometer is lower than the target:

    A1/B1 no power (no LED on), A1/B2 +4.7V output, the left LED under the A2/B2 "DIR" is on and the brightness equivalent to the power.

    The feedback of the potentiometer is higher than the target:

    A1/B1 -12 V output, right LED is ON and very bright (but not always on!), B1/B2 -3.5V output.

    So there is some really big issue...
  14. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    UPDATE:

    pins 4/5/10 (Arduino) are and stay connected to MM. Driver 2 (A2/B2) works fine. pins 2/3/9 ar NOT connected to MM.

    If I connect now the pin 3 (Arduino) to pin 8 (MM) A1/B1 gets 12V output...driver should not work because the target and feedback are in the middle position. So I know now there is a short circuit, but where and I think I can nothing do...
  15. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    ok guys this piece of shit is cooked now...no help required any more :) Thanks for reading:p
    • Like Like x 1
  16. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi Pit, Was this testing the two drivers connected to one motor?

    Could you provide a complete wiring diagram or complete pin to pin list between Arduino and Moto Monster.

    Your description above doesn't sound quite right.
  17. Pit

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

    Joined:
    Oct 2, 2013
    Messages:
    3,012
    Location:
    Switzerland
    Balance:
    30,451Coins
    Ratings:
    +3,091 / 31 / -0
    My Motion Simulator:
    DC motor, Arduino, 6DOF
    No the very first testing is always using power meters. The issue was from the first.
    EDIT: Hi @RufusDufus I decided not to update the diagram because it will have too much lines...the wirings to the second MM are identical, only the outgoing pins of the Arduino are different:

    Motor1:

    Pins Arduino ---------MM

    2 (Motor 1 H-Bridge ENA) ---------------4 and 7 (INA1 and INA2)
    3 (Motor 1 H-Bridge ENB)----------------8 and 9 (INB1 and INB2)
    9 (Motor 1 PWM) --------------------------5 and 6 (PWM1 and PWM2)


    Motor 2:

    Pins Arduino ---------MM

    4 (Motor 2 H-Bridge ENA)---------------4 and 7 (INA1 and INA2)
    5 (Motor 2 H-Bridge ENB)----------------8 and 9 (INB1 and INB2)
    10 (Motor 2 PWM) -----------------------5 and 6 (PWM1 and PWM2

    PS: today I found the reason of the complete damage yesterday: the board has been scratched by an Jack screw onto the lower side :( But this has nothing to do with the first issue from the very first beginning where the board was not mounted yet.
    Last edited: May 18, 2014
  18. 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
    Guys,
    I've got some strange behavior.
    Got everything up and running (hard & software) now i'm trying to use LFS to test the sim.
    Using simtools 0.1.2.0 and LFS 0.6e.
    Used tuningcenter to capture the min and max and saved it, then tested the roll and pitch movement in the game engine.
    So far so good (nice direct movement when i do some axis testing) :)
    Ok, patched the game LFS, started the game (game manager recognised it), settings are default.
    When i'm driving the behavior is strange, platform doesn't roll and pitch like expected. It seems like the captured settings made with tuning center aren't used at all :(.
    (I've got no other profile to test a other game like rFactor)
    I'm going to read the manuals, maybe i've overlooked something, anybody has a clue?

    Hmmm i just noticed something, when i'm driving LFS and see my axis in the virtual axis screen i see some odd movement of the axis when i'm driving.
    It makes no difference using my Logitech wheel or keyboard hmmmmm strange.
    This certainly explances the strange behavior of the axis movement.
    Last edited: May 24, 2014
  19. 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
    Maybe its the LFS profile, just downloaded other ones. I'll be testing them this weekend, see what that brings.
  20. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Hi dedas, the way you describe it, it sounds like you setup the "default" min/max values in tuning center and then patched the game? You need to make sure you setup the "LFS" min/max values in the tuning center. There is a dropdown list to select the game but this will be automatically selected when the game is running.

    Another way to test when first getting things running is to just assign one DOF (say roll) to one axis and see if that one motor then moves in accordance with the roll changes - it may not move the sim rig correctly but you at least see if everything is smooth and responding as expected. Once you have that working add in your other DOFs.