hbridge issue

Drive a 4-wire bipolar stepper motor or a pair of DC motors from your Arduino. [Product page]
Post Reply
chardie
Posts: 6
Joined: Mon Jan 13, 2014 10:28 am

hbridge issue

Post by chardie » Mon Jan 13, 2014 1:06 pm

ok i am really new to arduino and shields and things i picked up the freetronics dual hbridge motor shield today and connected it up to a 12 volt 4.2 ah battery and a 12 volt 2 amp dc motor uploaded the code from this site for the shield and could not get it to work .

how ever if i get a mains plug pack and then plug it into the eleven the motors will run and there is a high pitched whine. the plug pack is 12volt at 1 amp i think if i touch the motor leads to the battery there is no whine and the motor spins like crazy. so i am curious to know whats going on.

i am pretty sure the polarity is correct. the jumpers for channel a are connected and the bridge vin to motor power jumper is on. the switch for the amp setting is set at 2 amps. the motor specs say it is 2amps so i figure the amperage switch should be 2 amps as well.

the only other thing of note is by process of elimination if i tap the channel a jumpers when the battery was connected i could a hum from the motor but it didn't spin any thoughts or suggestions ?

i do have a multimeter but the battery died while i was investigating things so i will get another battery tomorrow for it . one other thing i did try was to connect up the prototype board to the headers on top of the motor shield and run the blink a led program which ran ok so the shield is ok just something to do with the motor voltage

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: hbridge issue

Post by andrew » Mon Jan 13, 2014 9:36 pm

Please wait until your multimeter is working again, then check the voltage from your battery. If it's between 8 and 12v then check polarity, connect it to the HBRIDGE shield, add the "bridge Vin" jumper and you should be fine. Otherwise charge the battery etc.

By using the plugpack to power your Eleven, shield and motor shows that the hardware is fine. Some motors will whine like that, as they are being powered via DC pulse-width modulation.

If you have any more questions, let us know.

chardie
Posts: 6
Joined: Mon Jan 13, 2014 10:28 am

Re: hbridge issue

Post by chardie » Tue Jan 14, 2014 7:48 am

umm i think i killed it the hbridge and the eleven. no leds lighting up on either board
i am pretty sure i had the polarity right as the blue led came on the hbrigde. with a new battery in the multimeter i was getting over 12 volts so the battery is ok. unplug the battery and plug the mains power pack in and it worked no problems. so connect the battery back up.
reading your response i get the impression that if my polarity is wrong then my power cables are back to front so i swapped the power cables which is when everything went pear shaped
can connecting the power cables with the wrong polarity kill the cards ? any suggestions ?

andrew
Freetronics Staff
Freetronics Staff
Posts: 978
Joined: Sun Jul 14, 2013 7:06 am
Location: Melbourne, Australia
Contact:

Re: hbridge issue

Post by andrew » Wed Jan 15, 2014 8:40 am

chardie wrote:umm i think i killed it the hbridge and the eleven. no leds lighting up on either board
i am pretty sure i had the polarity right as the blue led came on the hbrigde. with a new battery in the multimeter i was getting over 12 volts so the battery is ok. unplug the battery and plug the mains power pack in and it worked no problems. so connect the battery back up.
reading your response i get the impression that if my polarity is wrong then my power cables are back to front so i swapped the power cables which is when everything went pear shaped
can connecting the power cables with the wrong polarity kill the cards ? any suggestions ?
The battery needs to be between 8 and 12v if you're powering the Eleven with it as well as the shield. By reversing the polarity to the HBRIDGE you've most likely killed it.

The Eleven should be ok, remove everything from it and connect to PC via USB. Upload the 'blink' sketch in the IDE (Under Files>examples>basics>blink". If that works your Eleven will generally be OK.

chardie
Posts: 6
Joined: Mon Jan 13, 2014 10:28 am

Re: hbridge issue

Post by chardie » Wed Jan 15, 2014 11:06 am

no joy cant upload the blink program cant see the serial port,no leds lighting up on the eleven either. guess i'll get another eleven and hbridge next time i go to town. mark it down to experience building i guess.

chardie
Posts: 6
Joined: Mon Jan 13, 2014 10:28 am

Re: hbridge issue

Post by chardie » Fri Jan 24, 2014 11:49 am

ok got another eleven and hbridge i do have a question about the wiring of the stepper to the hbridge the info i have is
Stepper Wiring:
Red: A+
Grey: A-
Yellow: B+
Green: B-
now on the hbridge i have channels a & b. with channel a i have 1or2 so i am wondering which is the positive side ? .I presume 1 would be positive or red A+ and 2 negative grey A-
any thoughts would be great :)

cef
Freetronics Staff
Freetronics Staff
Posts: 106
Joined: Wed Nov 09, 2011 12:53 am

Re: hbridge issue

Post by cef » Sat Jan 25, 2014 5:57 am

Technically, that's correct, but it's a bit of a misnomer as they're not really polarised like that. It's best to be consistent, and it "does" affect the direction your motor spins. Because of the way stepper motors work, you want them either connected both forward or both reversed.

The main thing to note is that as long as your stepper has a coil between A+ and A-, that goes into A1 and A2 on the board. Same goes for B+/B- and B3/B4.

Best and easiest way to be sure is to check resistance with a multimeter (motor disconnected, not turning). If it's open circuit, then you know that's not the correct pair of wires.

PS: I say this, as some people scavenge motors from old equipment, and then look up the specs. Sometimes the manufacturers don't adhere to their own colour codes, so it's always good to check, even if they're new motors! It's also possible that you got a bad motor and either the coils are shorted together, or one of the coils is shorted (0 rather than say 1-5 ohms - exact value should be on the spec sheet, or can be worked out using ohms law from the spec sheet values) - Had this exact thing happen to a friend who blew up his stepper driver (not a Freetronics one, but same principle applies).

chardie
Posts: 6
Joined: Mon Jan 13, 2014 10:28 am

Re: hbridge issue

Post by chardie » Sat Jan 25, 2014 6:52 am

i kinda took a leap of faith after i had posted. found a pic with the red in the 1 out :) and i got the stepper running. i played with the sample code provided on the website 2 things i noticed is that if i set the speed below 160 it sound like it was gonna destroy itself made the most grinding noise it was pretty happy at about 200 also if i set the step at much less than 9 it seemed not to turn properly and then it would do a big jump i should mention this is a stepper with reduction gearbox fitted don't know if that makes a difference. i had this idea that the sample code may not be the best way to run the stepper slowly. i am looking at running the stepper slowly to turn a lead screw on a barn door tracker for astro photography the screw only need to turn around once per minute. it's a brand new motor of ebay :) if i could of salvaged something i would have but that's beside the point any thoughts ?

Post Reply