timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Motor driver not working! :(

Sun Mar 24, 2013 6:57 am

I got my Gertboard in today and I'm loving it so far, but I've run into an issue getting the motor controller to work.

Here's my setup:

(J2) GP18 -> (J5) MOTA
(J2) GP17 -> (J5) MOTB
(J19) G <- External Ground
(J19) MOT+ <- External 5v+
(J19) MOTA -> Motor +
(J19) MOTB -> Motor -
(J7) P1 -> (J7) P2

I run motor.c and while the program runs, the motor doesn't do anything. So I started debugging. I've verified MOT+ and G have power with my multimeter. Next, I routed GP18 and GP17 through B11+B12/BUF11+BUF12 so I could watch the LEDS to verify logic was being received from the RPi. With this setup I can run the motor program and watch the LEDs brighten, fade and switch. This tells me the PWM/GPIO is functioning correctly.

At this point I thought, hey, maybe it's the motor, so I replaced it with a multimeter. I'm detecting no voltage at all on the output ports.

Am I missing something? Any ideas as to what the issue could be?

User avatar
malakai
Posts: 1383
Joined: Sat Sep 15, 2012 10:35 am
Contact: Website

Re: Motor driver not working! :(

Sun Mar 24, 2013 7:59 am

I would think a multimeter at the external power would be a place to start is it 5v at the terminals? Assuming when you say external ground you mean the ground from the power source and not grounded somewhere else. Since pins 17 and 18 are universal to all Pi's unlike 21/27 it wouldn't be that. It seems like you have it all setup correctly. And since you say you just got it it shouldn't be a problem with your soldering skills ;)

The doc is here https://docs.google.com/viewer?url=http ... hrome=true on page 27 is the setup your following if others are curious.
http://www.raspians.com - always looking for content feel free to ask to have it posted. Or sign up and message me to become a contributor to the site. Raspians is not affiliated with the Raspberry Pi Foundation. (RPi's + You = Raspians)

User avatar
joan
Posts: 12816
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor driver not working! :(

Sun Mar 24, 2013 9:37 am

A different motor driver chip was used on the original kit of parts which needed 12V+ motors. The latest pre-assembled Gertboards should work at 5V. Could you have an early version?

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Sun Mar 24, 2013 11:27 am

The latest pre-assembled Gertboards should work at 5V.

That was what I thought too, but no: 5V is not enough. You need more.I have not yet tried what the minimum voltage is.
I had 5V and a 9V battery only. The 9V battery definitely works.

The specification of the controller says the minimum is 6V.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Sun Mar 24, 2013 4:56 pm

Hmmm, well then... Let me try it at a higher voltage and see what happens. Originally I was going to do 9 volts, but the only regulator of that size I had on hand wasn't working so I went down to 5v. I guess I'll try the 13.8v output from my bench supply. (I really need to invest in a variable power supply.)

User avatar
joan
Posts: 12816
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Motor driver not working! :(

Sun Mar 24, 2013 5:31 pm

Strangely enough there are still a few Gertboard kits available from Farnell.

http://uk.farnell.com/gertboard/gertbom ... dp/2115337

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Sun Mar 24, 2013 6:00 pm

eBay and Amazon still have some kits for sale as well. Mine was purchased from Newark last week and has a board date of October 2012.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Sun Mar 24, 2013 9:07 pm

So yeah, I think there was something wrong with my module... Instead of running my 13.8 volt power supply through a 5v regulator circuit, I wired it straight in to the MOT+ and G screw terminals on the Gertboard and hooked up a slightly beefier motor that I knew could handle the extra voltage. (Actually, I ran the positive through my fused multimeter to measure the amps, but that shouldn't make a difference, right?)

Ran the motor program and... The motor started, after about 3 seconds the motor control IC made a loud pop and started smoking. The motor was only pulling 150mA and neither the fuse on the Gertboard nor the fuse on my multimeter popped.

Is this, uh, covered under warranty? Who do I contact for that? What do you think happened?! I'm 100% sure it was wired right and there was nothing shorting the underside of the board or any of the wires that I could see.

Image

For what it's worth, none of the other components were damaged.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2808
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Motor driver not working! :(

Sun Mar 24, 2013 9:40 pm

timb wrote:Is this, uh, covered under warranty? Who do I contact for that? What do you think happened?!
Don't know, depends what happened.
Would suggest you contact the vendor.
I can only think of two options as to what might have happened...

* PBKS moment
* Faulty component

...without seeing how you wired it, it's impossible to say which it is. :D

I blew up an led the other day. I have no idea if I messed it up or it was faulty, but it went bang and the top flew off. :lol: I'd like to think it was faulty - they usually go "fizz", or a small "pop" if you overdo it. "Bang" was a new one on me. :D
Alex Eames RasPi.TV, RasP.iO

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Sun Mar 24, 2013 10:04 pm

Haha, I've never seen an LED explode like that either. They normally just sizzle for me. (I did have one catch fire once. 120VAC though... :evil:)

Pretty sure it wasn't a PEBKAC, because the motor did start up just fine and ran for 3-5 seconds before it popped. Current being pulled was just 150mA according to the meter. Power supply was putting out 13.86v. (If I connect the motor directly between the meter and power supply it's pulling the same amount of current, plus the fuse in the meter and Gertboard didn't blow...) Here's some pictures of the layout:

Image

Image

Image

The GPIO control lines were being routed through the buffer.

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2808
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Motor driver not working! :(

Sun Mar 24, 2013 10:14 pm

I've never tried using the buffers with PWM. Do you think that "confused" the motor controller?

Other than that I can't see anything wrong.
Alex Eames RasPi.TV, RasP.iO

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Sun Mar 24, 2013 10:22 pm

Before I hooked the motor up, I jacked in the 13.8v supply and hooked the voltmeter to the MOTA and MOTB output terminals and ran the motor program. The PWM appeared to be working, as I could see the voltage rising up to the peak and then falling in line with the buffer LED and program output.

I was of the understanding that you could route any digital I/O through the buffer and essentially use it as if it directly connected to the GPIO pin. It's essentially there to protect the RPi from getting fried, right?

User avatar
alexeames
Forum Moderator
Forum Moderator
Posts: 2808
Joined: Sat Mar 03, 2012 11:57 am
Location: UK
Contact: Website

Re: Motor driver not working! :(

Sun Mar 24, 2013 10:46 pm

timb wrote:I was of the understanding that you could route any digital I/O through the buffer and essentially use it as if it directly connected to the GPIO pin. It's essentially there to protect the RPi from getting fried, right?
May well be right. That's one for Gert or someone who "knows about this stuff". I don't know how the buffers work, but I expect I will soon. :D
Alex Eames RasPi.TV, RasP.iO

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Mon Mar 25, 2013 8:59 am

I was of the understanding that you could route any digital I/O through the buffer and essentially use it as if it directly connected to the GPIO pin. It's essentially there to protect the RPi from getting fried, right?
Not for 100%. The difference is that the GPIOs can work bi-directional, so switch from input to output mode on the fly. The buffers can not do that.
There are buffer/converters which claim they are auto sensing and switch direction. We tried them in a project here at BRCM and they failed miserably.
( I mentioned this in a post somewhere else and found that others had the same experience. )
I looked into them in detail because they would have been the ideal solution for a board like this but from the specs I could see they would fail in this application too.

Even then buffers can protect only so-much. Mostly against small stupid errors. You put enough volts on the buffer and you may still fry your Pi.
The probability is very small but still there.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Mon Mar 25, 2013 5:01 pm

Right, but aside from directionality there should be no difference between hooking something directly to the GPIO and running it through the buffer, right? You don't think that could have hurt the motor driver chip, do you?

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Mon Mar 25, 2013 6:33 pm

No, definitely not.

User avatar
elektrknight
Posts: 140
Joined: Sat Mar 02, 2013 1:25 pm

Re: Motor driver not working! :(

Tue Mar 26, 2013 4:28 am

From my experience this kid of problem can be caused either by over voltage conditions due to oscillations or ringing in the power output stage of the H-bridge or over current in the output stage.

Standard disclaimer (as I have never used the ROHM BD6222 chip) this is all my speculations based on reading the datasheet after getting interested in this problem.

On paper (or at least in the PDF I am reading) this chip has all kinds of protections including cross-conduction, over current(OCP), thermal shutdown and over voltage (OVP). However, there is a bit of a surprise waiting when one reads the OVP spec and I quote here:

"Also, note that this circuit is supplementary, and thus if it is asserted, the absolute maximum rating will have been exceeded."

OK so the OVP kicks in when the voltage exceeds 30V but the chip is speced to max 18V ?!
Hm, this is what they call protection circuit?

OCP
There is also a question of the "Stand-by or idling" mode when both control inputs (FIN, RIN) are low.
In this case the output stage goes into higz (disconnects from the motor) but if the motor has been running like in this case it will generate voltage and current which is now shorted through the chip body diodes. Depending on the motor speed at the moment of entering the idling mode, current generated by the now shorted motor can be way bigger then current during active operation.
I would check code in the motor.c to see if it sets both FIN and RIN low when it is doing the PWM, it actually could be the revers if GPIO buffers are reversing the signal polarity.

One last thought. Using beefier motor might have actually contributed to the destruction of the BD6222 chip as the idling current would have been bigger then current generated by the smaller motor.

Also here is the link to another report of BD6222 burning up

http://www.electro-tech-online.com/elec ... 22hfp.html
Placek Malinowy to jest to!

pihead
Posts: 12
Joined: Sun Aug 26, 2012 1:22 am

Re: Motor driver not working! :(

Wed Apr 03, 2013 5:12 pm

What power supply were you using for the Pi? Were the grounds of both supplies connected together?

You could have had a significant ground-potential difference between the two power supplies. When I connect external motors to the Gertboard I have used battery power to keep things simple, but as long as your two supplies have the same ground reference you should be OK. A 13.8 volt bench supply with a 5 volt regulator for the Pi might be a good way to go.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Wed Apr 03, 2013 8:52 pm

pihead wrote:What power supply were you using for the Pi? Were the grounds of both supplies connected together?

You could have had a significant ground-potential difference between the two power supplies. When I connect external motors to the Gertboard I have used battery power to keep things simple, but as long as your two supplies have the same ground reference you should be OK. A 13.8 volt bench supply with a 5 volt regulator for the Pi might be a good way to go.
Interesting. You know, I never thought of that! The Pi was being back-fed through the bottom USB(A) port from my LapDock. Since this incident I've actually gotten a real bench supply. A nice little Korad KA3005P (that's fully controllable via RS-232/USB). It's got connectors on the front for +, - and G; would connecting G from the PS to a ground pin on the Gertboard be sufficient to eliminate the ground potential?

Just so there's some closure here, I emailed Newark last Monday and explained what happened. 24 hours later they gave me a full credit for the Gertboard and then put in an order for a new one at the same price! It got here on Monday and there was no RMA in the box so I emailed them. They told me to not worry about sending the old one back! I ended up de-soldering the motor driver chip, screw terminal blocks and fuse holder.

Everything else on the board works so I'm sure I'll figure out a project for it. Newark has great customer service though. Really glad I bought the board from them.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Wed Apr 03, 2013 9:02 pm

One oddity I forgot to mention: The replacement Gertboard had the same revision and date as my first one, but this unit didn't have 5V pins on it. The holes and label are on the PCB, but no header. It wasn't included in the box or anything.

I ended up soldering one on, but I just thought it was weird. :?:

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Thu Apr 04, 2013 7:39 am

but this unit didn't have 5V pins on it.
The first boards did not have 5V headers.
The manufacturer has extra costs to keep the holes open
(Add masking tape, flow board, remove masking tape)
Which is not too bad for the big middle area but nasty for all the small isolated holes.
So I suggested it might be cheaper just to add headers.
They may be playing around with that trying to find the cheapest solution.

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Thu Apr 04, 2013 7:57 am

Gert van Loo wrote:
but this unit didn't have 5V pins on it.
The first boards did not have 5V headers.
The manufacturer has extra costs to keep the holes open
(Add masking tape, flow board, remove masking tape)
Which is not too bad for the big middle area but nasty for all the small isolated holes.
So I suggested it might be cheaper just to add headers.
They may be playing around with that trying to find the cheapest solution.
That's really interesting. Speaking of things not on the board, what's the deal with the blank area in the bottom right? Was there something intended to go there and pulled at the last minute or what?

While I'm asking questions, who decided on putting a female GPIO connector on the bottom of the board? That seems like a really bad design choice to me, as it requires you to take your RPi out of the case to use. Seeing as how the Gertboard includes standoffs, I assume it's designed to mount on a platform. That seems mutually incompatible with that sort of connection to the RPi. Wouldn't a male header on the top with an included ribbon cable been a better choice? (Or even both! Use a passthrough connector that's female on the bottom and has long pins coming through the top.)

I ended up solving the problem by making my own custom male/male cable. (I used a chassis mount male IDC connector for the Gertboard end so I could screw it down on the plastic platform I plan on making.)

I'm not complaining or anything, just curious. (From what I've seen, the kit versions of the GB used a normal male connector on the top side.)

Image
Image
Image

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Thu Apr 04, 2013 9:38 am

what's the deal with the blank area in the bottom right?
You mean the various footprints with no components on them?
The first GB had a linear regulator to supply 5V. The idea was you could connect an external supply (7-12V) and feed both the GB and the Pi. Turned I made a major calculation error: the power consumption was so high then even a huge heat sink became too hot to handle.
With the production design plugging on top of the Pi I had to make sure there was no metal at the bottom in that corner as it could short out on the video connector. Not wanting to waste the space I placed parts for a 5V switched mode supply. But assembling that would have put the cost of the board up. Even worse: it would have meant a whole new set of parts to procure, delay the time-to-market as well as add risk that it would have failed EMC tests. I have manually assembled two boards with that and tested the circuit. It works perfectly so anybody wanting that can look at the schematic, buy the parts** and assemble it themselves. You get a 2A supply where the fuse is BEFORE the regulator so no voltage drop. The input voltage can be between about 7V and 24V. I would advice to short pins 2 & 4 of the Raspi connector on the GB to spread the current over two pins. I also would not recommend using that over a long cable.

** Make sure you buy the right inductor. It needs to have a saturation current >=3A.

Post edit: I probably should put this in a separate thread: "Add a 5V supply to your Gertboard."

timb
Posts: 46
Joined: Mon Mar 04, 2013 8:09 pm

Re: Motor driver not working! :(

Thu Apr 04, 2013 9:01 pm

That's really cool, I'm totally going to build that! I've been doing a lot of breadboarding with the Gertboard, so I could really use a nice, clean regulated 5V output. I can just hook that to my 13.8v bench supply, which will free up my new variable supply for other stuff.

Is this the circuit you're referencing?

Image

You know, looking at that page of schematics I just realized something. We have to jump P1+P2 on J7 to power the board. I had always wondered what P3 did, because if I jumped that to P2 the board still worked. After looking at this schematic, it all makes sense now! P3 is coming from the RPi's 3v3 rail. I assume it didn't provide enough current to power the board and that's why you went with a regulator?

User avatar
Gert van Loo
Posts: 2440
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Motor driver not working! :(

Thu Apr 04, 2013 11:14 pm

No that is the linear regulator one which gets waaay to hot.
It can still be used if you replace the standard linear 7805 with a switch mode version, but they are rather expensive:
Like these http://www.murata-ps.com/data/meters/dms-78xxsr.pdf
There are others (cheaper) an somebody once mentioned it in a post, but I can't remember where.



This is the new one on the assembled Gertboard
Attachments
smps.JPG
smps.JPG (38.09 KiB) Viewed 6392 times

Return to “Gertboard classic”

Who is online

Users browsing this forum: No registered users and 1 guest