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. 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 RufusDufus,
    No i did not do that, after i tested everything in SMCUtil (all axis worked fine) i'd used Simtools to test the 2dof movement.
    it was not to responsive (moving the sliders above 40% did move the motors), but then i used the calibration tool (tuning center) to set the min/max
    values, and i did it with the game LFS of course :)
    Now the movement in the game engine (Rool & pitch) is very responsive.
    After i saved it i did a couple of laps with LFS, but exelerating and braking doesn't give the desired effect of roll (tilting the platform to the front or back) it does it when is use the settings in the gameEngine tool :-(

    I'd tested it with Assetto Corsa and the thing i noticed is that the movement looks like it is Sway & Surge, in the game engine screen it displays the right game and Roll & Pitch, thats also the movemet i captured in Tuning Center.
    Maybe this brings some light in the darkness :rolleyes:

    (in the mean time i'm going to reset al my settings and start all over again, maybe it helps)
    • Like Like x 1
  2. 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
    Hi Dedas, for braking you want the Surge DoF. That will tilt the car forward and back under braking and acceleration. Roll is the side to side motion caused by orientation of the car (such as sitting on the side of a hill).
    • Like Like x 1
    • Agree Agree 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
    Hi Historiker,
    You are so right :D this explanes the strange behavior.
    motion_yaw_pitch_roll.jpg
    motion_surge_sway_heave.jpg
    motion_x_y_z_axis.jpg
    Now its seems to work, as a matter a fact a bit to good (i got kicked out of the seat now when i'm cornering and hitting the curbs:grin)
    Got to tweak it because the rig is devastating ;)
    I'm testing now with surge to emulate accelerating and breaking, and sway to emulate the g-forces when cornering.
    • Like Like x 4
    • Agree Agree x 1
    Last edited: May 27, 2014
  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
    Yes, my wife made be put a harness in mine because the violent movement tossed me out one day, lol. I was riding a roller coaster :D

    Edit: Those are really nice graphics of the forces, do you have high def versions of those?
    • Like Like x 2
    • Agree Agree x 1
  5. eaorobbie

    eaorobbie Well-Known Member SimTools Developer Gold Contributor

    Joined:
    May 26, 2009
    Messages:
    2,574
    Occupation:
    CAD Detailer
    Location:
    Ellenbrook, Western Australia
    Balance:
    20,440Coins
    Ratings:
    +1,684 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    I agree we could add that to the manual. and FAQ section.
    • Like Like x 1
  6. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,236
    Location:
    Marseille - FRANCE
    Balance:
    20,975Coins
    Ratings:
    +2,089 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    • Like Like x 1
    • Winner Winner x 1
  7. 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 @RufusDufus this evening one of the two psus stopped (I have connected one PSU to one Monster Moto separately). After powering the psu and starting the SMC3 utility nothing happened. The winches was dead. Turning the potentiometer did not give any feedback in SMC3. First I thought about an hardware issue (Monster Moto, potentiometer etc) but I tried (as one last solution always) the reset button onto the ardunio - "et voila" it works. Any suggestions? :sos:roll
    • Like Like x 1
  8. 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 have a short circuit but do not know from where and why. Perhaps the Moto Monster (the new one) is blowed
    • Like Like x 1
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    @Pit, there are a couple of reasons a reset of the Arduino would have worked

    1. If the failure caused current spikes or significant noise on the power/gnd lines it could have caused the Aurdino to latch up and need resetting.

    2. More likely though, when it failed and you turned the pots, you turned them into the "Limit Zone" setup in SMC3Utils. If this happens the SMC3 code shuts down the motors for safety until reset either through SMC3Utils or a hardware reset. Note also if you leave the sime tilted such that the pots are in the limit zones when you power on the code will shut down the motors immediately making it appear as though nothing is working. Just make sure the sim/pots are somewhere close to center when powering up.

    As for the short circuit... I still think the way you are connecting the two drivers together could be causing problems (assuming you are still doing this). Think about it this way... Assume the motor is being driven and you have +12V output on Moto Monster A1 and GND on B1 and the same for A2 and B2. I understand you are connecting A1 and A2 together and B1 and B2 together. Now we reverse direction... A1 goes to GND and B1 to +12V. IF the second driver takes even a ms longer to switch its outputs then you (for a very brief instant) have A2 still at +12V and B2 still at GND. With A1 connected to A2 you therefore have +12V connected directly to GND for that brief instant. Now remember the PID algorithm is switching the direction at something like 20kHz so that is alot of times you are potentially connecting 12V to GND which may be over stressing your H-Bridge output driver chips causing them to fail or shutdown early.

    I personally would go with the recommended wiring from the driver datasheet - it can still have the same problems if the wiring is wrong however the risk is reduced because each side is driven by one driver IC.
    • Like Like x 1
    • Informative Informative x 1
  10. 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
    @RufusDufus thank you for your efforts. I tried to wire as described in the diagramm(s) and get the same polarity on each side. (A1/A2) and (B1/B2):

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

    But now I have no pot feedback onto the Monster Moto. If I turn it nothing happens. The output is 12v continuous (PWMmax = 10 !). The direction drive LEDs are always off. Did I forget something?

    Attached Files:

    • Like Like x 1
    Last edited: May 30, 2014
  11. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    @Pit, Ok, First of all the wiring is correct as per the datasheets. In this configuration you connect A1/B1 to one side of the motor and A2/B2 to the other side of the motor.

    Just let me just make sure I understand...
    You are getting say +12V on A1/A2 at the same time and GND on B1/B2 at the same time? That definately doesn't sound right? In this case it seems something is wrong with the Moto Monster board or the wiring.

    Or are you saying you get +12V on all A1/A2/B1/B2. This is OK in terms of outputs it just means the motor is being braked. So in this case either the Aurduio thinks the motor is in the correct position, or it has shut them down for some reason, or its not outputting the correct signals, or the Arduino board is stuffed?

    A few things to check
    1. SMC3 is configured as MODE1 for this setup.
    2. When running windows SMC3Utils it is not saying the motor is OFF in the top left of the window
    3. When running windows SMC3Utils you can see the pot input moving as the pot moves
    • Like Like x 1
    • Informative Informative x 1
  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
    A1/B1 have the same polarity, meaning if I connect them I have zero V. If I connect A1 to A2 I have 12V.
    Passed.
    Passed
    Passed.

    IMO there seems to be an issue with the PWM output.

    To be sure two pots are connected to the arduino.

    1. KP=400, PWMmax = 10 or more. A1 and A2 =12.55V (or -12.55V if the pot is lower or upper) . If the pot is within the zero line no voltage output is generated.
    2. KP=400, PWMmax = 0 (!). A1 and A2 = 11.88 V output. If the pot is within the zero line no voltage output is generated.

    Conclusion: Due to the LEDs are not lighting and there is no correct PWM signal there seems to be an issue with that.

    UDPATE: ditto failed using the Duemilanove 2dof firmware! Only power ON (+ or -) or OFF (pot within zero line) , no LEDs, no continuously increasing pot feedback. Perhaps there exist different VNH2SP30 revisions.
    • Like Like x 1
    • Informative Informative x 1
    Last edited: May 31, 2014
  13. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    @Pit, Ahh, the LEDs will never work in this configuration. Because we are using each single driver as half of a H-Bridge each one is always set at +12V brake mode or GND brake mode.

    ie. A1 and B1 will always be set to match each other (12V or GND) giving us double the drive power because we are using both the highside and lowside switches for one motor terminal. If they didn't ALWAYS remain the same voltage as each other then you wouldn't be able to join them together!

    A2 and B2 also must always be the same as each other.

    But when the motor drives in one direction you will see A1=B1=12V and A2=B2=GND
    When the motor goes in the other direction A1=B1=GND and A2=B2=12V
    When the motor is stopped you could have either A1=A2=B1=B2=GND or A1=A2=B1=B2=12V

    Hope I'm not confusing you ;)
    • Like Like x 1
    • Informative Informative x 1
  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
    prfff :eek: :D

    I am going to try out it now. I have one more bridge in reserve :p
    • Like Like x 1
  15. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,952Coins
    Ratings:
    +1,016 / 10 / -1
    Good luck... maybe your other h-bridges are still ok also?
    • Like Like x 1
    • Winner Winner x 1
  16. 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
    thumb_COLOURBOX5219450.jpg it works!
    • Like Like x 1
  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
    If you want and if you are agree you can implement the half-bridge option of the Monster Moto into your first posting.
    • Like Like x 1
  18. 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

    • Like Like x 4
    • Useful Useful x 1
  19. 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
    Wow, looks great Pit! :cheers
    • Like Like x 1
  20. 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
    yeah I am very happy now. Ready at last. After the video was taken I could set the values of heave more aggressive without stopping the winches. Thank you all for your efforts and time you have spent.
    • Like Like x 1