Shop OBEX P1 Docs P2 Docs Learn Events
12V Motor Control - Fried BS2 :( — Parallax Forums

12V Motor Control - Fried BS2 :(

lleblanclleblanc Posts: 15
edited 2008-06-11 16:46 in BASIC Stamp
That's right, my BS2 is fried after a quick test of trying to control my motors. I have another 2 on order just in case, but I figured I should post my circuit and see if anyone can tell me if this will work before I throw another $50 down the drain.

I'm using IRL510 MOSFETs with DPDT switches to control my motor. The yellow wires go to pins on my basic stamp. One to turn on the power and one to switch the relay (fwd/rev) for each motor.

After my quick test the motors worked fine until I tried to switch direction so I'm guessing that I got a noise spike that fried my stamp. I added in the IN4001 diodes where my stamp is connected to the circuit to try and alleviate this (can't test until I get my new stamps) but I'm also concerned that I'm powering the Development Board with the same 12V supply (see the top power connecters).

I'm using the 9V battery plug from radio shack which must be wired wrong internally as it was trying to provide my dev board with negative voltage which is why I had to reverse the wires...

Does anyone have any suggestions? I'm somewhat over my head with this stuff as my Boe-bot was my first experience with circuits but I feel like I'm close to getting this working.

--
Lenny

Post Edited (lleblanc) : 5/29/2008 4:11:46 PM GMT
1600 x 1200 - 843K
«1

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 16:17
    Draw a neat schematic of your circuit and post that for review. Any of the things you've already mentioned were enough to fry a Stamp like connecting the supply voltage backwards or leaving out the protective diodes on the relay coils.
  • lleblanclleblanc Posts: 15
    edited 2008-05-29 16:33
    What program would I use to draw the schematic?

    Like I said I have no formal experience with this and pretty much everything I know is what I read in the Boe-Bot book and from this forum. The stamp worked fine after the reverse voltage (thankfully), and worked fine being hooked up to the circuit, but fried when I added my motors to the mixing pot.

    Can a spike from the motors travel through the DPDT and back through my power source to my development board? This is the only other place that I can see the spike getting to the stamp.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 16:38
    You can draw the schematic on a piece of paper with a marker and take a picture of it. That would be faster than having to learn a new computer program.

    Yes, a spike from the motors can travel back into the development board. The relay coils can also also generate a spike.
  • lleblanclleblanc Posts: 15
    edited 2008-05-29 17:19
    See attached. This is my original circuit that I tested with my motors. After frying the BS2 I added the diodes on all the IRL510 gates where it connects to the BS2.
    1600 x 1200 - 575K
  • ercoerco Posts: 20,259
    edited 2008-05-29 17:51
    Kentucky Fried Stamps?

    FYI, you can buy BS2e stamps on ebay for ~$23 until the supply is exhausted. Parallax blew them out and they are a real bargain. Tastes (and programs) just like the BS2 with more space to program. Worth considering if you're in the market for more Stamps any time soon. Here's one volume seller:

    http://cgi.ebay.com/Parallax-Basic-Stamp-BS-2E-Module_W0QQitemZ250251889900QQihZ015QQcategoryZ4663QQssPageNameZWDVWQQrdZ1QQcmdZViewItem

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • ercoerco Posts: 20,259
    edited 2008-05-29 17:59
    Those 9-volt battery clips are properly color-coded (red+ black--) when used as intended, to hook up a 9-volt battery.

    But if you use them to make connections to another 9-volt battery connector (such as on a BoE or carrier board), everything gets reversed. Sparks fly and chips die. You're not the first, and you will not be the last.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 18:06
    The diodes are not really helpful on the gates. They need to be connected across the relay coils and across the motor. Since you're reversing the polarity of the power to the motor, the diode across the motor won't work. Connect the diodes across the relay terminals connected to +12V and the MOSFET. The diodes need to be connected backwards (cathode to +12V, anode to the MOSFET pin).
  • lleblanclleblanc Posts: 15
    edited 2008-05-29 18:20
    Thanks Erco, that makes sense with the 9V battery clips now... Thanks for pointing that out.

    That makes sense Mike. Thanks for taking the time to look at this. I'll have my new stamps tomorrow so I'll be able to try this out...
  • Mike GreenMike Green Posts: 23,101
    edited 2008-05-29 18:35
    Do be sure to turn off the power to the motor before you try to change direction and allow some time (tens of milliseconds) for the relay to switch before turning on the power again. Even though you would have the protection diodes, the back EMF can cause arcing and the starting surge can also damage the relay contacts if they're not fully switched.
  • ercoerco Posts: 20,259
    edited 2008-05-29 19:19
    I use a lot of relays in Stamp projects·driving small 6 VDC DC motors (Mabuchi RC-280 size). I'm attaching a quickie schematic of·my favorite H-bridge circuit that I often use with a BS2. It uses two SPDT relays per motor and provides dynamic braking of the motor. Drive one of the two lines high for forward or reverse. When both lines are high or low, the battery is disconnected, but the motor is shorted out and stops in a hurry. Very useful for accurate positioning, or if you need to reverse direction quickly, just let the motor brake itself (by shutting it off briefly)·before reversing power. Circuit works well with Radio Shack's small 5V SPDT relay 275-240 and a couple of their bulk-pack NPN switching transistors 276-1617.

    Note that motor braking IS hard on the motor brushes and relay contacts, so don't push the limits of your relay's ratings with a huge DC motor. Per Mike's warning, arcing can occur.

    Apologies, my initial wiring sketch was wrong, but I have corrected it now.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."

    Post Edited (erco) : 5/30/2008 3:33:11 PM GMT
  • lleblanclleblanc Posts: 15
    edited 2008-05-30 02:52
    Thanks for all the great advice guys. You've probably saved 3 or 4 stamps from meeting their demise in my hands... I'll let you know how things go.
  • stamptrolstamptrol Posts: 1,731
    edited 2008-05-30 12:12
    erco,

    Good little circuit, but the transistors short out the 5 volt supply when they're on.

    I suspect the transistors are meant to be in the relay connections to ground?

    Cheers,

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tom Sisk

    http://www.siskconsult.com
    ·
  • ercoerco Posts: 20,259
    edited 2008-05-30 15:14
    WOW. Thanks for catching that whopper. My bad for sketching a circuit quickly between meetings. Will fix ASAP.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·"If you build it, they will come."
  • kennetkennet Posts: 33
    edited 2008-05-30 16:25
    If you want to work with MOSFETs and you want to build your own H-Bridge circuits get into the habit of isolating your stamp pins with Photocouplers.They provide the protection that your Stamp pins need from mistakes. The PS2501-4 or something simular is the way to go.

    Ken
  • kennetkennet Posts: 33
    edited 2008-05-30 16:57
    Also don't forget to use a 10K pulldown resistor between the gate and source on all of your MOSFETs. Pulling MOSFET gate value down to 0v improves performance.

    Ken
  • lleblanclleblanc Posts: 15
    edited 2008-05-30 17:13
    bunkleybot, If I have diodes on my stamp pins that are connected to the MOSFETs would this provide enough protection.
  • kennetkennet Posts: 33
    edited 2008-05-30 21:47
    The short answer is no! When working with relays and any kind of logic circuit·Always use protection diodes across the·relay·coil. This stops the voltage spike at the source. The cathode side of the diode goes to the positive side of the coil.This is pretty much industry standard operating proceedure.This should protect your Stamp pin, although nothing protects logic circuits like complete isolation (PS2501-4). In any event you should be alright with what you have for now.

    Ken

    ·
  • lleblanclleblanc Posts: 15
    edited 2008-06-02 21:46
    Okay, so thanks to everyone here my BS2 is still alive after a weekend of fiddling around with trying to get these motors to work.

    I am running into a problem when I hook up both my motors though. My IRL510 transistors get extremely hot and after a few seconds of working properly one dies off and starts letting the voltage through even when I put my BS2 pin to LOW. I'm assuming that when I have both motors hooked up I am exceeding what this transistor can handle and maybe I need to go to the IRL520 or IRL530 to keep things running

    Anyway, more fiddling around with my circuit here. I've gone through the IRL510s that I ordered so I need to place another order to replenish my parts before I can continue testing. I really like the idea of the Optocouplers as well bunkley. Hopefully I'll be posting in the completed projects forum soon!

    Thanks again everyone for the help to date. I don't know how many stamps I would've fried before I got things under control.
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-02 21:59
    IRL510s are fairly robust devices. Other than shuffling your feet on a carpet in winter and watching a spark jump from your finger to the gate lead, they're hard to damage. There must be something you're doing that's limiting the gate voltage so the MOSFETs don't conduct fully and overheat. You need to draw a schematic showing your current circuit and post it.
  • lleblanclleblanc Posts: 15
    edited 2008-06-03 00:53
    Here's my new circuit. Essentially the only changes are the IN4001 diodes (circled).
    1600 x 1200 - 545K
  • Mike GreenMike Green Posts: 23,101
    edited 2008-06-03 01:07
    Yeah, your problem is that you left the diodes in the gate leads. Don't do that. They don't help and they reduce the gate voltage available by at least 0.7V. Just remove them. The diodes on the relay coils are wrong and the diodes on the motor connections are wrong also. Please please look at the diagrams in the Nuts and Volts Column and the Industrial Control tutorial. The H-bridge schematic that erco posted shows how to connect the diodes on the relay coils. On the same diagram, connect one diode with its cathode to the Motor Bat + terminal and its anode to the Motor Bat - terminal where they attach to the relay.

    I do suggest that you connect a 10K resistor between the MOSFET gates and ground to keep them turned off until the Stamp initializes its I/O pins.

    You can have the 2nd IRL510 for each motor to turn it on and off. Put it in the Motor Bat - lead between that and ground (and connect the Motor Bat - lead to ground). The diode mentioned will protect that transistor.

    Unlike with junction transistors which are current controlled, MOSFETs are voltage controlled and don't need a series resistor in the gate lead.

    Post Edited (Mike Green) : 6/3/2008 1:13:29 AM GMT
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-06-03 03:38
    lleblanc,

    The diodes are fine, only if they are placed in the correct location. In the schematic that you provided they are not placed correctly. I would however place a resistor in series on the gates in addition to a resistor to ground... even though the MOSFET gates are capacitive by nature, a series resistor can help limit the inrush current which can eventually damage the transistor. Also, if your driving the gate with a 5V supply, the gate (inside the MOSFET) can actually "see" 10V during a transition from HIGH to LOW or LOW to HIGH because of the capacitive nature of the gate. According to the spec sheet, 10V is the absolute maximum voltage allowed between the Gate and Source. The resistor to ground does not need to be much, but enough to keep the gate from floating and causing an unintentional turn on.

    The schematic that you provided in general is a solid design, one that I have used many times without fail. I did take the liberty to re-draw half of your schematic so that it might be better represented.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
    1307 x 709 - 201K
  • lleblanclleblanc Posts: 15
    edited 2008-06-05 14:55
    So I'm expecting my new shipment of IRL510s today so I can continue on trying to get this working but I'm a little confused by a couple of things in the schematic you drew up Beau.

    1. Right now I have the wire leading from my BS2 pin to the gate on the MOSFET but it doesn't connect to the gnd so I'm not sure where to place the 1M resistor. Should I have this connected to the GND with the 1M resistor?

    2. Should the diode that you have around the relay connect from one side to the other as you have it in the diagram or am I mis-interpreting the schematic? Is there a chance that the relay could be damage by placing it like this?

    I hope that these questions make sense...
  • Beau SchwabeBeau Schwabe Posts: 6,568
    edited 2008-06-05 16:22
    lleblanc,

    The 1M resistor should go between the Gate and Ground.· A much smaller resistor (4.7K) should go between the gate and the BS2 I/O pin.· Although you could eliminate this resistor, having it there helps to limit the inrush current when you transition from LOW to HIGH or vise-versa.

    The diode on the relay is correct.· It's function is to "snub" the voltage spike generated from the collapsing magnetic field when you remove power from the relay.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Beau Schwabe

    IC Layout Engineer
    Parallax, Inc.
  • lleblanclleblanc Posts: 15
    edited 2008-06-06 16:41
    Okay, so I did some testing last night with the new circuit and it works much better when I don't have the wheels attached to the motors. Things are switching faster and the circuit holds up to running the motors, switching direction, etc.

    Excited, I put the wheels on my motors and put the robot down on the ground and I didn't get anything. After some quick analysis my MOSFET controlling the on/off of the motor had stopped working. I replaced it and tried again and it worked for a little while moving quite slow but eventually the MOSFETs that control the on/off of the motor stop working.

    I know the motors have enough juice to move the robot as I can plug the motor directly into the battery and the robot moves like crazy, but for some reason when I have the circuit setup the transistors can't handle the load.

    Could this be that the motors are trying to draw too much initial current to get the robot moving causing these transistors to stop working? I'm using salvaged DC gear head motors out of cordless drills (14.4V although I'm running them at 12V).
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-06-06 17:37
    IRL510s are rated "5.6A" continuous.· How much does your "robot" weigh?· Can you get the "robot" going without the control circuits, just wiring the motor to the battery?· Your current demand is greatest in getting going, changing a body at rest to a body in motion requires a lot of energy (more load, more current).· Could be that you're at/near stall current?·

    Post Edit -- There's no good reason that the "Direction" FET should crater because it only switches the Relay on/off, motor current doesn't·flow through it.

    Post Edited (PJ Allen) : 6/6/2008 5:53:40 PM GMT
  • lleblanclleblanc Posts: 15
    edited 2008-06-06 17:50
    The robot now weighs approximately 35lbs. Each wheel has it's own motor and when I plug these directly into the battery it moves around VERY quickly (almost too fast but that's an easier problem to deal with once the thing works).

    That's exactly what I'm thinking is that it is trying to draw too much current when it's initially trying to get going, frying the IRL510.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-06-06 17:58
    That's a hefty one.

    Seems that's it.· I think that you need a beefier FET.

    You could put them in parallel, the current will divide between them, but you need to find out what you're drawing initially, or you'll burn two (or three?)·at once.

    FETsparallel.jpg
  • kennetkennet Posts: 33
    edited 2008-06-10 01:00
    Seems to me that you are wasting a lot of money on MOSFET's that may or may not be barely adequate. My advice is to·use a· high current MOSFET 's like the IRLZ34N ,IRFZ46N, or even a automotive MOSFET like the IRF3205Z . These devices can handle far more current that you will need for you current project,·but you don't have to worry about overheating them.·Make sure you·use heatsinks with ALL MOSFET's. This is VERY,VERY important.

    Ken
  • lleblanclleblanc Posts: 15
    edited 2008-06-11 14:44
    I ended up getting some IRL530 MOSFETs that could handle the load I was throwing at them (at least for a little while). It was working well for about 45 seconds when the MOSFETs overheated and I got a nice (little) smoke show.

    I'm going to pick-up some heatsinks and hopefully that will resolve my overheating issue.
Sign In or Register to comment.