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

2DOF project

Discussion in 'DIY Motion Simulator Projects' started by MarcNSF, May 30, 2017.

  1. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    IMAG0637.jpg
    Hi all
    can anyone tell me if this Arduino and H-bridge will work with Racing mat's 2dof code
    if yes please I need a wiring diagram:sos

    Attached Files:

  2. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,316
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,626Coins
    Ratings:
    +5,113 / 18 / -0
    @MarcNSF ,
    First I have not seen any spec sheet on the HBridge, the PDF you sent has noting useful in it.
    I would think they have some real documentation somewhere?

    Anyway, looking at the HBridge, you can see where the motors get attached on the bottom where its labeled 'A' and 'B'.
    The center two screws on the bottom of the HBridge is where the battery gets attached.
    So that takes care of the 6 screws on the bottom.
    You with me so far?

    Next you can see on the top, where the yellow pin header is, that there are 2 rows.
    One for 'A' motor and one for 'B' motor.

    I believe the Int1 and Int2 are the direction pins for each motor.
    The GND and + is power and ground from the Arduino. (not sure if its 3.3v or 5v thou, guessing 5v)
    EN = enable so both of those get hooked to (5v?)
    and the CT is the PWM input pins.

    ....GND <-> GND pin
    .........5V <-> 5V & (EN1 & EN2 - probably could attach a safety switch here)
    .....pin 4 <-> in1 motor1
    .....pin 5 <-> CT1
    .....pin 6 <-> CT2
    .....pin 7 <-> in2 motor2
    .....pin 8 <-> in1 motor1
    .....pin 9 <-> in2 motor2

    .....pinA0 <-> center pin of pot 1
    .....pinA1 <-> center pin of pot 2
    .....pinGND <-> 0 ohm's pin potentiometer 1 & 2
    .....pin 5V <-> 10k ohm's pin potentiometer 1 & 2

    You understand @MarcNSF ?
    Does this look good @RacingMat
    yobuddy
  3. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    The HBridge didn't have any other documentation
    wasn't sure about in1 ,in2 ,and CT didn't want to burn the HBridge :p
    Thanks for the explanation @yobuddy hug:
    Last edited: Jun 24, 2017
  4. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,316
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,626Coins
    Ratings:
    +5,113 / 18 / -0
    Yea, I could not find much either.o_O lol

    I'm almost positive it runs on 5v, as its quite common voltage.
    And it probably has a voltage controller onboard anyway.
    (you could trace the + input on the yellow connector to see what chip it runs into. I bet its a voltage controller.)
    yobuddy
  5. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi @yobuddy
    found this HBridge from the same supplier but it's a single motor driver

    Performance parameters:
     Rated voltage: 3 V-15 V
     R1 short circuit, VCC and B + short circuit. VCC output voltage and drive the input voltage.
     R1 open circuit, VCC and B + disconnect. VCC input voltage 3-12 V.
     Rated current: 30 A
     Current peak: 70 A
     Switching frequency: 1 K to 200 kHz
     Dimensions: 5.0 cm (long) * 5.0 cm (wide) * 3.1 cm (high)
    V + Power Input +
    GND Power Input -
    EN Driver Enable, high enable, low off
    RPWM Forward PWM input, high active
    LPWM Reverse PWM input, active high
    CT Current signal output, analog signal
    VT Voltage signal output, analog signal

    The CT is a current output
    What do you think should I proceed with your wiring diagram?

    Attached Files:

  6. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I think the sm3 mode2 code should work
    please advise @RufusDufus
  7. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi
    this what I came up to regarding my Hbridge with the sm3 code
    but not sure about the pwm of it goes to in1 or in2:confused:

    pin2 ENA ---->A IN1 motor 1
    Pin3 ENB --+->A EN motor 1
    Pin9 PWM ---->A IN2 motor 1
    pin4 ENA ---->B IN1 motor 2
    Pin5 ENB --+->B EN motor 2
    Pin10 PWM ---->B IN2 motor 2
  8. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,316
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,626Coins
    Ratings:
    +5,113 / 18 / -0
    the In1 and In2 are the direction pins.
    the PWM goes to the CT pins of the HBridge.
    What's wrong with the one you got buddy?
    yobuddy
  9. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @yobuddy
    I'm still using the same HBridge
    Found this while searching
    https://github.com/bjornburton/champbot/wiki/H-Bridge-DBH-01C
    This is the same h-bridge I have and they have some documentation on it
    The CT is really current output

    That's why I sent this:
    pin2 ENA ---->A IN1 motor 1
    Pin3 ENB --+->A EN motor 1
    Pin9 PWM ---->A IN2 motor 1
    pin4 ENA ---->B IN1 motor 2
    Pin5 ENB --+->B EN motor 2
    Pin10 PWM ---->B IN2 motor 2

    But still confused about PWM and in1,in2

    Do you agree???
    Any advice??

    Can't wait to see some motion on my rig ;)
    Last edited: Jun 26, 2017
  10. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @yobuddy
    Don't worry I'll prepare the fire extinguisher :p
  11. yobuddy

    yobuddy Well-Known Member Staff Member Moderator SimAxe Beta Tester SimTools Developer Gold Contributor

    Joined:
    Feb 9, 2007
    Messages:
    5,316
    Occupation:
    Computer Technician
    Location:
    Portland, Oregon - USA
    Balance:
    49,626Coins
    Ratings:
    +5,113 / 18 / -0
    you would not hook the PWM pin to a direction pin.
    Use it as the CT input.

    like this buddy
    Ard ---------- Hbridge
    ....GND <-> GND pin
    .........5V <-> 5V & (EN1 & EN2 - probably could attach a safety switch here)
    .....pin 4 <-> in1 motor1
    .....pin 5 <-> CT1
    .....pin 6 <-> CT2
    .....pin 7 <-> in2 motor2
    .....pin 8 <-> in1 motor1
    .....pin 9 <-> in2 motor2

    .....pinA0 <-> center pin of pot 1
    .....pinA1 <-> center pin of pot 2
    .....pinGND <-> 0 ohm's pin potentiometer 1 & 2
    .....pin 5V <-> 10k ohm's pin potentiometer 1 & 2
    • Friendly Friendly x 1
    Last edited: Jun 27, 2017
  12. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Wired everything up:

    Ard ---------- Hbridge
    ....GND <-> GND pin
    .........5V <-> 5V & (EN1 & EN2 - probably could attach a safety switch here)
    .....pin 4 <-> in1 motor1
    .....pin 5 <-> CT1
    .....pin 6 <-> CT2
    .....pin 7 <-> in2 motor2
    .....pin 8 <-> in1 motor1
    .....pin 9 <-> in2 motor2

    .....pinA0 <-> center pin of pot 1
    .....pinA1 <-> center pin of pot 2
    .....pinGND <-> 0 ohm's pin potentiometer 1 & 2
    .....pin 5V <-> 10k ohm's pin potentiometer 1 & 2

    After checking every single wire many times, I turned it on
    The PC immediately turned off
    The USB port ,ARD and Hbridge sadly died
    :(
  13. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Bought new ARD, HBridge and a usb hub with external power supply
    Wired it up :
    Ard ---------- Hbridge
    ....GND <->
    .........5V <->
    .....pin 4 <-> in1a motor-a
    .....pin 5 <-> ENa
    .....pin 6 <-> ENb
    .....pin 7 <-> in1b motor-b
    .....pin 8 <-> in2a motor-a
    .....pin 9 <-> in2b motor-b

    .....pinA0 <-> center pin of pot 1
    .....pinA1 <-> center pin of pot 2
    .....pinGND <-> 0 ohm's pin potentiometer 1 & 2
    .....pin 5V <-> 10k ohm's pin potentiometer 1 & 2
    IMAG0637_1.jpg
    It worked finally :)
    But the output of the motors reached 5V max
    Any ideas?

    Marc
  14. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
  15. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi all
    Using the SMC3 software and code helped a lot
    The platform is working:D

    Thanks to @RufusDufus ,@noorbeast ,@yobuddy ,@Pit and this great forum

    Will post some videos
    And pics soon

    Regards
    Marc
    • Like Like x 2
    • Winner Winner x 1
  16. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Had to add 2 springs to counter balance
    One is always under tention ,the second will be when the rig tilts backwards
    IMAG0688.jpg

    Also added roller bearings
    IMAG0689.jpg

    For more precise sensitivity
    IMAG0687.jpg
  17. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    As promised a small test video



    Dirt Rally motion test
    • Like Like x 6
  18. MarcNSF

    MarcNSF Marc

    Joined:
    May 24, 2017
    Messages:
    66
    Location:
    Lebanon
    Balance:
    - 98Coins
    Ratings:
    +42 / 0 / -0
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Upgraded the rig;)
    IMAG0780.jpg
    IMAG0781.jpg
    IMAG0778.jpg
    • Like Like x 5
  19. Ned

    Ned Member

    Joined:
    Jul 22, 2017
    Messages:
    63
    Occupation:
    fixed operations manager
    Location:
    melbourne
    Balance:
    714Coins
    Ratings:
    +31 / 0 / -0
    My Motion Simulator:
    2DOF, Arduino
    Man that is different to anything I have ever seen, its cool and compact as well, well done awesome work.
  20. ferslash

    ferslash Active Member

    Joined:
    Feb 8, 2011
    Messages:
    495
    Balance:
    4,798Coins
    Ratings:
    +181 / 2 / -0
    how did you bend the steal that good to be round and equal in the two bended bars?

    nice sim!
    fer
    • Useful Useful x 1