Shop OBEX P1 Docs P2 Docs Learn Events
Single Battery with PSC and 10amp motor driver — Parallax Forums

Single Battery with PSC and 10amp motor driver

ZootZoot Posts: 2,227
edited 2006-10-21 01:02 in Robotics
I have bot that works well generally, but I have some noise problems that I'm trying to resolve.

The bot runs off a single 12V 100AH lead-acid battery. The motors are controlled with an MD22 10A motor driver; the servos by a PSC; the electronics are a BS2p40, some Pings, ADCs, IR detectors, etc.

I think in addition to general noise from the motors (which I have been reducing slowly-but-surely system wide), I think I may have ground loop/supply issues.

Here is how I've currently got the battery hooked up to the driver, the PSC, the regulators etc. The hookup for the motor driver was recommended by the driver manufacturer (Devantech) but with the PSC also, I'm not sure about the mix.

(battery+) ---> +Vin filtered 6V 3A regulator  ---> PSC +V servo power
(battery-) ---> -Vin filtered 6V 3A regulator ---> PSC -V servo power
(battery+) ---> Motor Driver +Vin
(battery-) ---> Motor Driver -Vin
(battery+) ---> +Vin 5V 3A regulator ---> Vdd PSC, Vdd Motor Driver, Vdd Electronics
(logic gnd from logic side of motor driver) ---> -Vin 5V 3A regulator ---> Vss Electronics (NOT connected to Vss of PSC or Driver)




The Motor -Vin and logic Vss of the motor driver and the PSC are connected via ground plane. The suggestion to tie the logic regulator GND to the logic GND of the Motor Driver (which is connected via ground plane across the driver board to -Vin from the battery) was made by the manufacturer. The idea to NOT tie the logic gnd of the PSC to anything (just like the motor driver) was my own. And it works OK. But not always -- under duress the PSC and/or the driver will fail occasionally. Is there a better way to wire this all up with a single battery.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-17 23:08
    You have to have all grounds connected together. There's no way around it. Typically, you want to have all the high current grounds connected directly to the battery negative terminal. That's primarily the motor driver. You should have a heavy wide strap connecting the motor driver -Vin to the battery negative terminal. Connect all the logic grounds together on the 5V regulator, then use a lighter strap to connect that to the battery negative terminal. The servo grounds probably connect to the PSC logic ground. You could run this separately to the battery negative terminal if you want rather than to the logic ground at the 5V regulator. Basically, you don't want the high current ground currents flowing in the same conductor as the logic currents. If there's any significant resistance either in the conductors or in the metal to metal junctions between conductors, you don't want those noise voltages to show up in the logic grounds. The servos represent an intermediate noise source. No one servo should draw more than maybe 1A, so the noise voltages should be lower in the servo ground wires.
  • ZootZoot Posts: 2,227
    edited 2006-10-18 04:40
    Mike Green said...
    You have to have all grounds connected together. There's no way around it. Typically, you want to have all the high current grounds connected directly to the battery negative terminal. That's primarily the motor driver. You should have a heavy wide strap connecting the motor driver -Vin to the battery negative terminal.

    I've got it that way now.
    Mike Green said...
    Connect all the logic grounds together on the 5V regulator, then use a lighter strap to connect that to the battery negative terminal.

    OK. Right now the logic grounds go to the logic ground of the motor driver, which connects via PCB ground plane to motor -Vin.
    Mike Green said...
    The servo grounds probably connect to the PSC logic ground.

    Are you asking? Yes the PSC has it's logic and -Vin connected via ground plane on the PCB.
    Mike Green said...
    You could run this separately to the battery negative terminal if you want rather than to the logic ground at the 5V regulator.

    You lost me here -- you mean connect the PSC logic ground right back to the battery? The PSC -Vin is connected back to battery via thick wire now. I left logic gnd on the PSC disconnected.

    Also would I then run the logic gnd terminal of the motor driver back to the battery also? The folks at Devantech said NOT to do this.... smile.gif
    Mike Green said...
    Basically, you don't want the high current ground currents flowing in the same conductor as the logic currents. If there's any significant resistance either in the conductors or in the metal to metal junctions between conductors, you don't want those noise voltages to show up in the logic grounds. The servos represent an intermediate noise source. No one servo should draw more than maybe 1A, so the noise voltages should be lower in the servo ground wires.

    Lastly, I will stress again that it basically works -- but it sounds like I may have just gotten lucky? smile.gif

    I will sketch up a diagram tonight or in the morning if I'm still not being clear. Thank you so much!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • bulkheadbulkhead Posts: 405
    edited 2006-10-19 04:27
    I think I read somewhere in the PSC's manual that you MUST use a separate battery source for it. I spent several weeks trying to get the PSC working off the same battery pack as my Javelin stamp, and I just could not get it to work. There always seemed to be "noise" no matter what I did. I did get it to the point where it would work intermittently, but I just couldn't accept that chance that it would not work. Ever since I have used separate packs and it has never failed me.

    Perhaps there is a way you could run everything off of a single battery, but there must be a reason why Parallax does not mention it. Just beware that it may not be possible to do this, but if you do, I'm sure that at least I among others would be interested to see how you got it working.
  • ZootZoot Posts: 2,227
    edited 2006-10-19 12:46
    I'll probably have to post a diagram -- just haven't had time the last few days.

    In the setup I've got now, I don't get failures on my PSC actually, what I get is that very occasionally the motor driver will lock up (probably from noise and/or loops in the power and i2c lines). The PSC doesn't lock up at all. What prompted me to revisit my power supply setup is that as I've added more sensors to the bot, noise has gotten to be a bigger problem.

    In any case, the single battery setup I tried out was based on suggestions from the motor controller's manufacturer -- which is to not tie the logic ground of the driver (either the PSC or the MD22) to my logic supply. I'm also using a heavily filtered and regulated 6V power supply circuit for servo power. The only raw battery power in my system is for the motors (straight 12v from my battery).

    In mulling this over last night, I'm pretty sure some of my minor problems are due to the fact that I ran all the positive power from the battery through a single power switch, then split the switched power into 3 lines for +5V logic, +6v servo, +12v raw motor power. My first step in rewiring will be to tie the + power of all 3 subsystems through their own power switches back to + battery terminal. My only hesitation is if I should tie the logic gnds of the two drives to the logic supply ground, or right back to the - battery terminal, or leave disconnected. Mike suggested one of the first two setups. It seems like if I do, I've got a ground loop across the ground planes of the drivers, but with the current difference, it may be OK (I am NO expert here -- which is why I asked at the forums).

    If I had to guess -- and I'm sure someone from Parallax can elaborate -- it is possible to use single power source, but I think it's tricky and can lead to a lot of hair-pulling. So it seems like ALL the manufacturers just say use two power sources since that's a guaranteed way to get newbies (like me!) up and running without trouble.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • ZootZoot Posts: 2,227
    edited 2006-10-19 17:18
    OK -- attached are three wiring diagrams.

    #1 shows basically how I have things set up now. The dotted lines in the MD22 and the PSC show where the motor and logic grounds of those boards are tied together on the PCBs themselves. For what it's worth, a few times I switched where the MD22 and/or the PSC were getting Vdd from -- for the PSC it only works when I tie Vdd to my external 5v regulators (not if I use the Vdd on the demo board). The MD22 it works fine no matter where I tie Vdd to, though the power on the demo board is the least noisy. The PSC only works when tied to Vdd of the external regulators. Regardless, my biggest error here I'm sure is routing all the power through a single power switch. This setup WORKS though, it's just a bit unstable when everything is running at once. The MD22 and/or the PSC will lock, but come back online a few cycles later (my code pings both cards to see that they are online and tries to brings them back up if they go down -- I wrote this code as a safety measure, and boy it turned out to be handy). The MD22 developer specifically recommended running logic ground through the MD22, so I followed that same model for the PSC. I should add that my sensors and Stamp *never* crash or reset, but I do get noise all over the place.

    #2 shows what I think Mike is talking about it -- running separate feeds for all 3 systems back to the battery (and separate power switches). It seems like I would have 2 ground loops across the PSC and MD22 though? Also see above regarding manufacturer rec. on the MD22 -- tying both GND and -Vin to the battery was discouraged -- I know it's not a Parallax product smile.gif but I think I've got the same issues with both controllers, and being able to run a whole project from a single battery seems to be an issue that comes up a lot with motor drivers, servo controllers, etc.

    #3 shows another possible suggestion from Mike -- running logic GND for both boards straight back to battery (-) terminal. Again, wouldn't I have a ground loop here? Consider me totally ignorant.

    Any suggestions, corrections, advice is appreciated in advance.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    Post Edited (Zoot) : 10/19/2006 5:26:28 PM GMT
    800 x 600 - 11K
    800 x 600 - 12K
    800 x 600 - 12K
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-19 17:28
    If the MD22 and PSC have truly separate logic and motor grounds, then you should connect the logic grounds together at the logic supply regulator and you won't have ground loops. If the MD22 and PSC don't have separate grounds, but merely separate connections to the same ground, then don't connect their Vss to logic ground because you will get a ground loop. In that case, the MD22 and PSC will get their logic ground from the battery terminal connection. Hopefully, by minimizing the resistance and inductance of that connection by using a heavy straight cable, you will minimize the ground noise for the MD22 and PSC logic.
  • ZootZoot Posts: 2,227
    edited 2006-10-19 17:43
    I'm laughing here -- so it sounds like my original setup is actually not too bad! Indeed, the MD22 *and* the PSC have their logic GND terminals and their -Vin terminals connected via ground plane on the PCBs (I verified this in the schematics, in looking at the PCBs, and, of course, my current setup wouldn't have worked all these months if it were otherwise).

    With that in mind, it seems like my best bet is to take my basic setup from diagram #1 (I'm using 10 guage wire for motor V; 16 guage for servo V; 18 guage for logic V) but still split up all the + power into separate switches and run all + and - back to the battery with separate wiring (diagram #1 is pretty accurate showing where I tied various +/- power together for distribution, mostly because I was keeping things as simple as possible).

    So....the attached figure #4 shows my current setup altered for better +V distribution, and it shows my actual current hookups to Vdd for my PSC and MD22 (the thing I find strange is that the MD22 will run using Vdd from anywhere, but the PSC will only run using the same Vdd that is running the Stamp, but if it works I'm cool with that smile.gif )

    I would *love* to hear from somebody at Parallax about this... since the PSC docs require (recommend?) separate power supplies for servos/logic when using that board. But obviously it can be done -- I just don't want anybody smoking a board just because I got lucky.....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
    735 x 430 - 11K
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-19 19:37
    Those little "+ - 0" boxes might be confusing for newbies. I'm going to assume they work great, since they work for you. Otherwise, it's a very nice diagram, which shows clearly that your "common ground" is back at the battery, which should work find.
  • Mike GreenMike Green Posts: 23,101
    edited 2006-10-19 20:22
    Looks good. Now for the next phase: "power sequencing". This is the game where switches have to be closed in a particular order or everything blows up in a spectacular shower of smoke and sparks. Just kidding. In this case, it's a matter of convenience. Ideally, your Stamp has one or two extra pins that can be used to drive a relay (with an appropriate driver transistor, protective diode, etc.) You need two different relays, one with enough capacity to carry the maximum MD22 and motor current, the other to carry the PSC and maximum servo current. The only switch you fiddle with is the logic power on/off. The Stamp turns on the servo power after it's finished initializing the servo control lines, and the MD22/motor power after those control lines are ready. Since the relays are powered by the logic (6V) supply, they'll turn off the other circuits when the logic voltage goes away.
  • ZootZoot Posts: 2,227
    edited 2006-10-19 20:29
    You funny. But you brought up a really good point -- I was just thinking if this was a pro project how you would either have to turn power on logically or else get a monster switch with a bunch of poles.

    In this particular case I think I'll just add the extra power switch for servos -- having a "motor kill" switch has been invaluable during code debugging, and having a servo kill switch would actually be nice (the power switch on the PSC is generally inaccessible as that card is down in the guts of the bot). I've already got the two power switches set up, so adding the third is actually easier than sequencing as you suggest. I'm using illuminated rocker switches already and they are positioned like "taillights" on the back of the bot so it looks cool and you can always tell what's on and what's not.

    P.S. -- for those that are interested -- there are logically controlled power supplies available over at crustcrawler.com. I'm not using them myself, and they wouldn't handle the current of my motors, but it could be a really nice solution for some, and for not too much money.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST

    Post Edited (Zoot) : 10/19/2006 8:35:02 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-10-19 20:35
    Very clever, Zoot. Nothing says "I know how to debug" like a kill-switch on a powerful motor, that lets you isolate it while testing. Well done.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-19 21:14
    Zoot said...(trimmed)
    I would *love* to hear from somebody at Parallax about this... since the PSC docs require (recommend?) separate power supplies for servos/logic when using that board. But obviously it can be done -- I just don't want anybody smoking a board just because I got lucky.....
    Zoot,
    ·
    ·· I’m not sure what you’re getting at.· Technically in this case you are running from separate supplies.· Your power to the PSC for the servos and logic is coming from two different regulators which are well below the 12V battery sourcing them.· What we’re trying to avoid is that if you have a 7.2V battery going directly into the servo power connectors of the PSC and it is also going into the BASIC Stamp board then the servos are drawing from the 7.2V directly.· What happens is during peak currents the battery will drop down low enough sometimes where the BASIC Stamp will brownout and reset.
    ·
    ·· In your case you have 12V feeding separate regulated supplies for logic and servo and the supply voltage is double the servo voltage so unless the battery is almost dead anyway you wouldn’t run into the typical same source/supply situation.· I hope that is what you were looking for.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ZootZoot Posts: 2,227
    edited 2006-10-19 21:40
    Chris -- thanks. I'm getting pretty dang clear on the whole thing.

    While brownouts/resets haven't been a problem at all (the 12V motors die long before the logic and servos), ground loops would have been. I've read that a bad ground loop with high current loads could go wrong the way through your boards and smoke them (maybe that's untrue but it sounded unpleasant). I actually tested it once -- hooking up logic GND on the PSC and MD22 -- and nothing bad happened but nothing worked either. I only avoided a potential ground loop from the getgo because I spent a lot of time at the forums learning from my betters smile.gif I certainly wasn't complaining about the documentation, which like these forums, is "unparallellalaxed").

    I think bulkhead was referring to the PSC docs quoted below. For what it's worth, while I've had good results with a single battery, it has *not* been as easy I thought it would be, and a few times I was ready to just plug a few 9v batteries into my boards and be done with it....
    Somebody said...
    The processor used on the PSC requires a supply 5 VDC. Use a separate power supply for
    your servos. In general, servos require 4-7.5 VDC. Be sure that the servo power source can
    supply ample current at the proper voltage and will not damage the servos.
    Somebody said...
    Ensure the servo power switch on the Parallax Servo Controller is off, and then connect the power source
    for the servos to the screw terminals observing proper polarity. The power source for the servos
    must be a separate power source from that of the Board of Education Rev C.
    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
  • bulkheadbulkhead Posts: 405
    edited 2006-10-20 05:26
    Yes, that is what I was referring to.

    In my tests I used 3.3Ah nimh batteries with my Javelin stamp and tested it with multiple and single servos. My problem wasn't that my stamp was resetting. The problem was that the PSC interfered with my Javelin stamp's ability to read data coming from a PS2 controller. I am pretty sure because I insert a "starting up" print line at the beginning of all of my programs, so I would know if it were resetting. Overall, it would cause my robot (controlled by a PS2 controller) to behave erratically when I used a single 6.0V battery for both stamp and servo power. It's really weird because it just completely interferes with the javelin stamp's pin states (and perhaps more). Ever since I have used two separate 3.3Ah 6.0 batteries and everything has worked fine.
  • ZootZoot Posts: 2,227
    edited 2006-10-21 01:02
    Bulkhead -- you might, as an experiment, try wiring things up with single battery in a fashion similar to my #4 wiring diagram -- separate +V and -V leads for logic supply to the battery; separate +V and -V leads for servo motor supply; then connect the logic +5v pin of the PSC to your regulated 5v supply (e.g. Vdd on a BOE) and leave the logic GND of the PSC disconnected (the PSC's motor and logic GND terminals are connected on the board). This will avoid a ground loop and it should work (it has for me).

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    When the going gets weird, the weird turn pro. -- HST
Sign In or Register to comment.