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

Arduino uno R3 and pololu vnh5019. Please help me walk through this.

Discussion in 'SimTools compatible interfaces' started by james wheeler, Apr 23, 2014.

  1. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    I am ready to, for the first time, get my motors running;)
    I have a ard. uno R3 and the pololu dual motor controller vnh5019. Which is a shield.
    I would like to stack them to cut down on the soldering.
    Is it at all possible?

    I think I have Installed the arduino software correctly because in device manager I can see Arduino under com6 port.
    Knowing this however I do not know how to get the simtools to communicate with the ard.

    I have downloaded the code that racingmat has linked to his tutorial but will it only work with the motomonster controller? or is it universal?

    Once the sketch is installed into the ard. is it possivle to change it?

    and after it is installed how do I set up the simtools engine?

    I will now take a video of what I am doing so hopefully someone can see where I will go wronge.
  2. Historiker

    Historiker Dramamine Adict Gold Contributor

    Joined:
    Dec 16, 2010
    Messages:
    2,158
    Occupation:
    Retired
    Location:
    Michigan USA
    Balance:
    9,176Coins
    Ratings:
    +2,156 / 19 / -1
    My Motion Simulator:
    3DOF, DC motor, Arduino, Motion platform, 6DOF
    All of these questions are covered in the various threads, spend some time reading. :)
    • Agree Agree x 1
  3. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Yes I have been. But reading, and getting feed back on weather or not I am grasping the idea correctly is two different things. eaorobbie has told me I must separate the boards but in racingmats 2 dof tutorial he states "I choose not to stack the two cards although it is expected to" which implies that they are to be stacked. So seeing an example of my under experience and how it can contribute to some confusion, I am sure you can appreciate that reading can only do so much when with all that I have read leads to the next problem. It is a learning curve and a blind one at that. I will do my best to explain what I think I already know before asking a question.
  4. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    Here is a video of what i have got together right now.
  5. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hi James!

    Good Starting point!
    I have several hints for you:
    - use the interface preset I uploaded in the Resources (i will get everything setup in Simtools)
    - you have to check what kind of Hbridge it is: 1 or 2 direction's pins? In order to choose the required code
    - start your first tests without potentiometers not mounted! just wired but not link to the motor
    - you're very close! Congrats :))
    Yours
    Mat
  6. 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,390Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    There is a major issue with stacking mate, you can not isolate the two and if the drivers fail they will fry the Ard and anything connected to its usb port, an expensive boo bo , its why I recommend them not to be stacked, and as @Historiker has stated clearly , all your questions have already been answered in other post by others using the same driver. Just poor reading I feel,sorry.
    @RacingMat the driver wires up the same way as the Monster Moto, think it uses a couple of different pin numbers thou, but has all simular names, very easy to hook up.
  7. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    @eaorobbie: Thanks for the info! (I hadn't time to have a look at the specs this morning)

    About frying arduino, I wonder: if gnd, 5V and some in and out pins are connected between Arduino and drivers by wires, it's probably enough to fry the ard, no?
    What is worse by stacking? I would have said it's the same...
    yours
    Mat
  8. 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,390Coins
    Ratings:
    +1,683 / 23 / -2
    My Motion Simulator:
    2DOF, DC motor, JRK, SimforceGT, 6DOF
    The driver in question can drive current back from the motor when it moves unassisted by the driver, like a generator, this if too large for the vn chip to handle can be sent to the Ard, I use isolators when using ards with high powered drivers, I have personally lost a very expensive motherboard due to this same issue as Prilad explains in his post they are recommended to protect the ard in turn protects your pc from fatal voltage spikes, they do happen if you run the driver hard enough.

    This is why I don't personal recommend stacking them.

    On another note have you ever checked how hot they get, I have recorded 140c on them while running 25amp winches flat out. So not having them stacked allows for better cooling. As the card is designed to dispate heat from the bottom as well as the top of it too, so having air space under them helps them cope a lot better.
  9. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,603Coins
    Ratings:
    +1,008 / 8 / -1
    It would also be worth noting that high powered H-Bridges generate high currents and have the potential to create a lot of electrical noise. I see in the video you have the main power ground running round one side of the arduino and the main power line (with fuse) running around the other side. To avoid a large current loop I would suggest trying to reorganise the cabling such that the main power and ground lines run together and preferably away from other digital/analog signals.
    • Informative Informative x 1
  10. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    @RacingMat I have removed the pots as suggested but I don't know what you mean by 1 or 2 direction pins. Is that m1inA and m1inB?
    if so then i THINK this is the revised hook up for a pololu vnh5019

    arduino => pololu vnh5019

    pin 4 => pin 2 m1inA
    pin 5 => pin 9 m1 pwm
    pin 6 => pin 10 m2 pwm
    pin 7 => pin 7 m2inA
    pin 8 => pin 4 m1inB
    pin 9 => pin 8 m2inB

    5v => 5v
    GND => GND

    POTm1 => A4
    POTm2 => A5
    sheild connection.jpg

    Also racingmat I Downloaded the simtools engine preset Arduino RacingMat_InterfaceConfig but can't get it to load into the engine.

    @eaorobbie I have seperated the boards and figured out why i thought the controller was broken.Simple rookie mistake. I didin't hook up the 5v&GND

    @RufusDufus I will rewire everything nicely on the finished product this was just a test bench of sorts. But I never thought of that thank you. i will be sure to have them well insolated.

    So with your help I have made one step forward. While the boards were stacked I was not getting any reaction from the motors. After rewiring to the above layout I have the motors running, ty eaorobbie. but 1 way all the time. (good thing I removed the pots racingmat.)

    I am still using the racingmat sketch in the uno. I will take another video so it might be easier to follow.
  11. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    In the video It shows the wire set up and what happens with it revised while using racingmat 2dof code. It seems to me that I won't want anything to happen till I start simtools. But still it does
  12. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Also racingmat I Downloaded the simtools engine preset Arduino RacingMat_InterfaceConfig but can't get it to load into the engine

    It's as simple as drag and drop!
    Read the manual or the comment in the resource post
  13. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Hum, can you check the pot wiring: that's weird...

    Continue to try without Simtools until it becomes fine! :)
    Good luck: you're close to succeeding!
  14. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    I have revered the 5v and gnd wires on the pot and still the green wire pot controls both motors
  15. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    I hope your driver is not broken...

    Please try only one motor and one pot on A4
    after that, try same hardware but on A5
    then try with the other motor and same pot on pin A4
    then try with the other motor and same pot on pin A5
    then try with the other pot

    there is faulty item somewhere: pot, motor, pin... be methodical!
    assuming you didn't change anything into the code.
  16. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    yes me too.
    I Tried your sugestions @RacingMat
    Here are a couple of vids of what happened





  17. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    So, the behaviour is not the same with pot 1 or 2?!
    the second appears to be faulty, no?

    I'm not sure to understand everything you're saying :-(

    Maybe your wiring should be using "jumpers" to have good connexion
    [​IMG]

    this is what you have to get :
  18. RufusDufus

    RufusDufus Well-Known Member

    Joined:
    Jul 21, 2013
    Messages:
    681
    Location:
    Adelaide Australia
    Balance:
    15,603Coins
    Ratings:
    +1,008 / 8 / -1
    @james wheeler , you say in the video that the motors are turning as soon as you switch on. Don't worry about that its expected. This is normal until the pots get mechanically connected to the motors. You have to turn the pot until the motor stops.

    To investigate your issue where one pot seems to work both motors but the other doesn't, it seems to me that the second pot input may be open circuit for some reason.

    Get it all working the way you had in the video with one pot driving both motors and the other doing nothing (double check its still doing the same thing). Now swap the pot wires on the Arduino A4 and A5 pins (or whichever you were using) and see if the same pot still drives both motors. (might be a good idea to mark the pots first).

    If it does I would say there is a good chance the second pot is damaged and the wiper is open circuit.
  19. james wheeler

    james wheeler Active Member

    Joined:
    Mar 17, 2014
    Messages:
    185
    Balance:
    216Coins
    Ratings:
    +48 / 1 / -0
    My Motion Simulator:
    2DOF, Arduino
    jumpers! thats what they are called. I had to go to the electronics store today to get another pot and was aski g for those but didn't know what they were called.lol
  20. RacingMat

    RacingMat Well-Known Member Gold Contributor

    Joined:
    Feb 22, 2013
    Messages:
    2,233
    Location:
    Marseille - FRANCE
    Balance:
    20,875Coins
    Ratings:
    +2,079 / 21 / -2
    My Motion Simulator:
    2DOF, DC motor, Arduino
    Turning your Pot from MIN to MAX, should make your motor running full speed then slower, then stop, then reverse, then reverse full speed.

    With only 1 pot wired, your 2 motors are running: I believe your Hbridge is broken... or badly wired?
    You have to simplify ;-)
    Continue with only 1 pot wired!

    pin 4 => pin 2 m1inA
    pin 5 => pin 9 m1 pwm
    pin 6 => pin 10 m2 pwm
    pin 7 => pin 7 m2inA

    pin 8 => pin 4 m1inB
    pin 9 => pin 8 m2inB

    POTm1 => A4
    POTm2 => A5
    5v => 5v
    GND => GND