Shop OBEX P1 Docs P2 Docs Learn Events
PCB Design help for powering Prop controlling 12V motors — Parallax Forums

PCB Design help for powering Prop controlling 12V motors

eagletalontimeagletalontim Posts: 1,399
edited 2015-01-02 16:45 in Propeller 1
I am fairly new at designing a custom PCB and am going to need some advise on this design. I have done several others and they have worked great but this one project has had issues I can't seem to fix. This is a revamp to my Solar panel sun tracker. The original design is a hacked and modded older project that was not really designed for this application. The attached image is the beginning steps to the design. Placement is not a big issue except for the CAT5 connector in the bottom left.

What I need help with is the main power and "noise" reduction. The board is powered by a 12V battery bank that is 18ft away. The maximum draw with both motors running is 3A @ 12V. No PWM is being used. Since the power supply is so far away, I need to ensure the Prop stays on when a motor kicks on and the low voltage side stays as constant as possible as I plan on adding an XBee Wifi module to this as well. I will also be using a 4 channel ADC for the sun position sensor. This is where my current design is failing. When a motor kicks on, the current 555 timer setup I am using picks up the noise from the motors even with several ceramic caps connected right at the motor's leads as recommended in a previous thread.

As I am designing this PCB, I am creating an order on Digikey for any needed components. If any are needed or should be changed, please let me know!

Another question I have is trace width and amperage. Online calculators confuse me and I don't see how recommended trace widths will fit with the lead spacing of some components......Specifically the component I have selected for the H-Bridges.
1024 x 636 - 185K
«134

Comments

  • DomanikDomanik Posts: 233
    edited 2014-12-09 21:14
    A schematic would be helpful.
    18' wire size? Total resistance/ drop per foot.
    Does it get noisy with the battery 1 foot away?
    3A may be an average draw. When the motor turns on resistance may drop to less than 1 ohm. Measure resistance with a meter across the leads as you slowly turn the motor shaft.
    Add a separate +12V wire for the Propeller & logic Vreg all the way from the battery; it could be a 20/22 small gauge that comes from the battery and keeps the motor and noise on its own +12V circuit.
    The ground at pin 19 should be the zero V reference. A 50 mil trace should go directly from P19 to Vreg. The big fat trace at P19 goes to the motor circuit only. The key is keeping one reference point for ground-zero (P19) and ground current low for the logic. You need heavy bypassing between the Vreg input and ground and the Vreg output (5V) and ground. This should isolate your heavy current motor ground from you light current logic ground.
    By keeping the high current ground returns separate from the logic ground upto P19 the high current stays our of your logic. The extra 12V wire (that's isolated from the motor circuit) insures a constant supply to the Vreg and input/output caps. = quiet logic.
    With a 12V X 2 wire cable the motor noise is dropped across the 18' supply wire. Half dropped on the 12V supply, half on the ground wire.
    A fair amount of magnetism is created by the current through the traces supplying the motors: keep this away from your logic. It acts like a transformer.
    The ground on the ADC is important to keep current flow as low as possible. Tiny drops caused by shared grounding can throw off your readings.
    In general the Vreg, bypass cap, low voltage logic should be on the left side of the PCB and high current motor stuff on right side
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-09 21:35
    You mentioned a 555 but as this is a new thread you haven't provided any information about why you have a 555 or what it's doing. Rather than a skeleton PCB layout a block diagram with maybe some extra detail might be handy, I'm sure you would have had to sketch something up already?

    The motor current from 12V batteries which I assume are lead-acid is neither here nor there in terms of voltage drop unless of course you are using underrated cable. However the old diode+ cap trick from 12V into the switching 5V regulator will do the trick. Never try to put this after the 5V regulator for a whole heap of reasons. The cap value may vary but you can get by with a couple of thousand microfarads especially if your software cuts back power consumption during motor start and stall. If you can run separate power from the 12V battery just for the logic then all the better.

    If I have traces for heavy power or motor loads I prefer to expose the solder mask on these tracks so that I can "tin them up" and many times I specify 2oz copper and try to keep them short.



    If you would like to get hold of a PCB that will do your job including ADCs and H-bridges then I have an old design a did a few years ago that should come in handy. It's designed to drop into a nice little DIN rail case as well but have a look at this old thread and go to post #6 and you will notice the short tinned tracks going from the driver modules to the connectors. They certainly handle quite a few amps easily.
    http://forums.parallax.com/showthread.php/111173-Industrial-control-my-way?p=791643#post791643
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-09 21:39
    The motors draw around 300 to 500 mA each when running, the initial start is pretty close to 3A if both motors kick on at the same time.

    Since the wire is buried underground in a PVC pipe, I don't have the ability to add an additional wire to separate the 12V for the motor and 12V for the Prop power supply.

    I am not understanding what you are referencing on P19 as that is shown as pin 24 on the Prop which is a general purpose I/O.

    You will have to bear with me as far as electronics terms you may use. I know enough to be dangerous :) To me, if it gets hot, reduce power or add a resistor. If it dies when switching something on, it probably needs a capacitor. If it gets a strange output, put a filtering capacitor in. I could not tell you what value to put in, but with enough testing, I can get it to work eventually.

    EDIT*
    The 555 timers are basically set up as a vibrator. The pulse width changes based on the resistance of LED's that are exposed to the sun in an Up, Down, Left, Right pattern. The pulse width is calculated in the Prop and it puts the difference into a running average formula. Once the average reaches a specified number, the panels move till the difference is even or very close to even. Then it resets the average and starts all over.
  • DomanikDomanik Posts: 233
    edited 2014-12-09 23:34
    I am not understanding what you are referencing on P19 as that is shown as pin 24 on the Prop which is a general purpose I/O.
    Sorry that was a quick and terse write up on my part. The P19 refers to your connector where ground comes in. Since your pipe is buried goto plan B. RE: PCB Layout: Bring two 0.050" traces off of your pin 19 and 20 in order to somewhat separate the power coming in for the computer vs the motor. You might want to measure the voltage at the board compared to the battery while the motors are running. Drop should not be much -- 1 volt is fine (12V at the battery/11 volts at the board). I was thinking you were drawing 3A instead of 0.3A, big difference. If you have a scope you might try to see if there's a big voltage drop when the motors turn on and if this rattles through your regulator to your VDD +5v. If you see a drop in VDD you might need to add more C on the input to hold up the +12V. A diode in series with the 0.050" +12V trace might really help (another good idea from Jack). The diode is in case the motor pulls down the +12V, then it won't be able to drain the input cap to your Vreg.
    Jack's link goes to an awesome looking product he did. Haven't tried one but the design looks excellent.
  • hatallicahatallica Posts: 175
    edited 2014-12-10 03:33
    Talon Tim,

    I will offer one off-the-PCB suggestion to start. Twist the pairs of wires that go to a particular motor. The 18 feet of wire will have distributed inductance and sudden changes in current (0 to 3A or 0.5A to 0) will introduce voltage spike and possibly induce noise on other wires nearby. Twisting the wires (a few turns per foot, roughly) will go a long way towards cancelling out the inductance and reducing voltage spikes (noise).

    Otherwise, Peter & Domanik are offering good suggestions, so I won't confuse the issue by saying the same things in a different way.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 06:41
    On the rotation motor, I can twist the wires, but on the lift actuator, I cannot as it is sealed inside a thick insulation. I am trying to design for worst case scenario and put as much protection as possible against noise and large voltage drops. This is why I have the 4700uF cap as the buffer for the motors. I plan on adding a separate diode + cap buffer for the power going to the power regulation for the Prop as well. If one takes all the hit, the other should not fluctuate as much correct?

    The other thing I am not quite understanding is how create 2 ground with only 1 ground coming in. One needs to be "quiet" and the other is for the motors. Running 2 separate traces still joins at 1 common place. Is there a way to ensure one trace will stay "quieter" than the other?
  • DomanikDomanik Posts: 233
    edited 2014-12-10 08:04
    The other thing I am not quite understanding is how create 2 ground with only 1 ground coming in. One needs to be "quiet" and the other is for the motors. Running 2 separate traces still joins at 1 common place. Is there a way to ensure one trace will stay "quieter" than the other?

    Layout.jpg
    Your diode, ~20-100uf electrolytic cap, Vreg, ADC, computer all go inside dotted line. This keeps the motor current out of the logic area.

    There is no quiet anywhere, there is no zero. All noise is relative to some arbitrary point in the circuit. I picked pin 19 as zero. Since there is very little current flow through the ground trace from your LV logic it will appear there is ~no noise. On the VDD side, using a Vreg of 12V to 5V gives you 7V of head room. Therefore the input can drop from 12V to 6V (the Vreg pulling stored current out of the input cap) and still keep your LV VDD at 5V with no glitches. Any noise that makes it through the Vreg should be filtered on the VDD side with a large cap. The inline diode on the 12V is essential to making this work. Good Luck.
    852 x 645 - 25K
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 08:52
    Would I use 2 separate diode + cap setups between the Prop power and the motor power? This is what I was planning on doing. One that is has a pretty large capacitor to help assist get the motor(s) started and the other would ensure the current pull would be routed directly to the 12V input instead of pulling from the capacitor helping keep the logic power up. Hope that makes sense.
  • JonnyMacJonnyMac Posts: 9,105
    edited 2014-12-10 08:55
    Don't forget the 0.1uF bypass caps on your Propeller chip.
  • DomanikDomanik Posts: 233
    edited 2014-12-10 09:15
    Would I use 2 separate diode + cap setups between the Prop power and the motor power?
    No. One diode is fine. A schematic with reference designators, values, all parts & wiring plus a proposed PCB placement would be helpful.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 09:40
    I am kind of designing on the fly as I always have done :P I know about what I am wanting to accomplish and the basic wiring so I work on specific parts of the design until it all comes together as one. After I run through the final design and ensure all traces are connected and grounds / power connections are connected where they need to go, I order the boards.

    I do plan on using 0.1uF bypass caps but was also wondering about that as well. Do I simply run a trace (Positive and a Negative) from each pin to the next and put 1 bypass cap across each those 2 sets of power pins?
  • Ken GraceyKen Gracey Posts: 7,392
    edited 2014-12-10 10:10
    We have a project in the works that may be of interest to you, a Dual H-Bridge 10A, 12-24V Propeller-based Motor Controller.

    Here's the prototype that was just assembled today:

    DHB-10.jpg


    I expect to have these in our inventory by February 1st.

    Ken Gracey
    640 x 480 - 125K
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 11:58
    Can I test one of those prototypes :) I am hoping to have this done before the first snow fall here so February is a little too far out for me.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-10 12:18
    To minimize problems from motor noise add the following components between the +12V in and the power input to the logic. A schottky diode, an inductor or LC pi filter, a large capacitor, and a switching regulator to convert the 12V to 3.3V or 5V. The diode stops current flowing from the capacitor to the motors, the inductor filters out noise, the large capacitor acts as a power reservoir, and the switching regulator for efficient voltage conversion. The regulator will still require small capacitors on the input and output as specified in the data sheet.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 12:40
    kwinn, that is almost exactly what I am shooting for :) I have not done the design for the Prop supply yet. Since I am trying to divide up the 1 source into 2 : a clean source and one that can handle the noise from the motors. I was not sure how to set this up. From what I can tell so far is the large cap needs to go on the Prop power supply circuit protected with a diode to prevent the motors from pulling "juice" from the capacitor. I was thinking that I needed to put one of the diode + cap setups on the motors for the initial start since the main battery bank is so far away and I am only using 16G wire. For added protection, I could add another diode + cap setup to the Prop supply but apparently this is not needed.

    I am at work right now and don't have access to my computer to modify the current design. When I get home, I can make the changes and post the new picture of the design.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-10 16:00
    Yep, large cap on the prop power supply with diode. Think of the diode as the electrical equivalent of a plumbing backflow preventer. You can put capacitors near the motors, and it will help a little with the motor startup. The bigger the better, but no need for a diode on it. Best thing is to start and run the motors in sequence rather than at the same time. that should not be a problem in this application.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 20:24
    Here is a more updated screen shot of the design. Please critique! If I am doing something wrong, I need to know now :)
    1024 x 614 - 341K
  • SapphireSapphire Posts: 496
    edited 2014-12-10 21:00
    I don't like how you ran the ground line all around the board and end up at the RJ-45 connector. We don't know what noise you might get on that, and its only path back is by way of the prop. I would run a separate ground to the RJ-45 connector away from the prop, and a separate ground to the prop and maybe eeprom, all from your ground pads near the regulators. What is the 10-position sip header for? Your fuse says 10A but are you sure traces can take 10A?

    Anxiously awaiting a pic of your solar panel too!
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 21:08
    Ok, I will see about making the change to the ground traces. The RJ-45 is the connection that goes out to the ADC which will be about 5 feet away from this board. I am hoping it is not too far. The ADC is the MCP3204. There should probably be a 10K resistor on the Data Out pin which I will have to add.

    Here is a pic of the current solar panel setup : IMG_20140927_102913_663.jpg
  • SapphireSapphire Posts: 496
    edited 2014-12-10 21:16
    If that ADC is 5 feet away, and the motors are arcing, you might get noise on that ground, so best to keep it away from the prop. And buffer any inputs to the prop too.

    Nice panel setup, is the solar tracker the little box on top?
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-10 21:29
    I think that is what is causing the noise on the current circuit but I can't seem to figure out how to get rid of it. No matter how many ceramic caps I put on the motors even in a delta configuration, the noise was still there. I need to be able to keep the noise to the sensor and back as "quiet" as possible as this is what controls where the panels move next. At night or in storms the panels lay flat and face directly south to keep the surface area to a minimum that would be exposed to wind. For some reason, I will wake up in the morning before the sun comes up and the panels are facing East and slightly tilted forward but when I hook my laptop up and run the Serial Terminal, the output of the sensor is below the "wake" threshold.

    The sensor is in that box at the top. It is actually a metal case for a halogen light I bought from home depot. I used a dremel to cut the opening for the CAT5 jack and secured it into place really well. With this redesign, I hope to work out all the flaws in my current design.

    What do you recommend to use as a buffer into the PROP pins? A simple resistor?
  • SapphireSapphire Posts: 496
    edited 2014-12-10 21:57
    I use a resistor so any high voltage spikes can be controlled by the protection diodes. Doesn't eliminate the source of the noise, but at least helps keep it from damaging the prop.

    Interesting about the facing east when you wake up. I assume once they park for the night, they don't move again, so it shouldn't be the motors causing a false reading. I mean, you need a light level first before you move the panels, right? So what could cause that? Moonlight? Any other stray lights nearby? Have you considered taking a number of samples before acting on the light level, so a lightning flash doesn't trigger the system to wakeup in the middle of the night?
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 04:24
    I do have it set up to take a bunch of samples before waking but it does not seem to help. I have increased this number many times but still get weird results. By switching to the ADC, I hope to eliminate this problem.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-12-11 06:15
    I have 10 years in the prosthetic industry centered around motor control circuit design for prosthetic arms. Motor control design is an art, especially when using a single power supply. A schematic would really help here, a PCB image doesn't convey all that is necessary.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 07:21
    I have never done a schematic for a PCB. I usually build the circuit on a bread board and once it works, I draw it out on a PCB. If there are weird glitches I get on the bread board, I try to fix it with the little knowledge I have but if not successful, I blame it on the long wires and possible bad connections. When I make the PCB, I oversize everything I think will help and hope for the best :)
  • DomanikDomanik Posts: 233
    edited 2014-12-11 08:19
    Here is a more updated screen shot of the design. Please critique! If I am doing something wrong, I need to know now :)
    Your +12V to your Vregs look fine. Your ground coming off pin 19 to your 4700uf cap looks fine. There's no reason noise should get in through that path. On your 5V and 3.3V distribution you should use a wider trace than your typical signals-- are those 10 or 12 mil traces??? Another "solution" is to throw in a power and ground plane but that drives up cost. An overused dumb "solution" if it isn't needed. However >>>> Does your PCB layout package have copper flood / fill / pour? If so you should flood the left half of the board with ground on the bottom and +5V on the top. Then hatch the floods. Some of the traces can then be eliminated and bypass caps moved wherever you'd like. Some of the traces can be moved to the top making the bottom ground "plane" more contiguous. Keep the floods away from the motor circuit traces by limiting it to the left side. Overall this provides better connections - lower resistance and lower inductance - between the logic parts and the Vregs.

    I like the way you've kept the supply current traces and connectors to the motors in the lower right side of the board. Do not make a connection between these power/ground traces and the left side of the board. Right now it's nicely separated, just a little light on the copper in the logic area.

    A design consideration might be to use high efficiency switching Vregs instead of LDO/linears. Some have idle currents in the micro amps. With an LDO 7V drop (from 12V to 5V), all that excess must be dissipated as heat.. The max efficiency can only be 42% versus 90% with a switcher.
  • DomanikDomanik Posts: 233
    edited 2014-12-11 08:56
    I have never done a schematic for a PCB.
    Parallax has moved to DipTrace. There are free limited versions if that might interest you. Otherwise your board looks good. We all know any physical board is self documenting.

    http://en.wikipedia.org/wiki/DipTrace
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 08:57
    The 5V regulator is a switching regulator that I use a bunch which is an R-78 style switching regulator that drops in to a 220 slot. I think you can type R-78 into digikey search and it will show the different regulators. I made a custom pattern in DipTrace for that item. The 3.3V regulator is a 1A 3.3V LDO that specifies it only needs a minimum of 1.0uF for regulation. Since I like a little more stability, I went with a 4.7uF instead.

    As for ground planes.... I am not very good at those since mine tend to act as an antenna and cause all sorts of problems. I can give it a shot and maybe it will work this time? The copper pour / ground plane does not usually cost more from the PCB manufacture I use.

    I am not sure what trace with that is but I think it is 0.013" which is default on DipTrace.

    I have DipTrace Non-Profit which is what I use now instead of ExpressPCB.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-11 10:07
    Is there any way you can monitor what is happening by adding some code to output the status of sensors, pin states, and the time to an sd card or via serial connection to a pc/laptop? That may help figure it out.
  • DomanikDomanik Posts: 233
    edited 2014-12-11 10:35
    As for ground planes.... I am not very good at those since mine tend to act as an antenna and cause all sorts of problems.
    Hmmm. A ground plane/ copper pour should help to keep things quiet and never act as an antenna. Should provide some shielding and definitely low impedance return paths for your ground currents to your regulator. Same for +5V. Again (a dead horse) source connections for current should be at the regulator: Power and Ground. Noise will have a way into your circuit if you connect from the LV logic area to the 20 pin power connector, the 4700uf motor cap or the two motor connectors.

    Go For It!
Sign In or Register to comment.