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

PCB Design help for powering Prop controlling 12V motors

24

Comments

  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 10:48
    Already have that available using the PST. It shows the calculated output of each 555 pulsed outputs. Usually a range between 155 and 500 depending on the light level. It also shows the current difference between the Up / Down and Left / Right, then it shows what the running average is. It also shows the East stop switch and the West stop switch flag along with the Moving flag and the Parking flag.

    All this information I am hoping to send via the Xbee Wifi module on the design I am working with right now.

    When the panels are moving, the sun position sensor picks up strange readings which makes the panels move more than they should or not quite be in line with the sun. This is losing out on usable power and wasting power all at the same time. There is another thread about this from a few months ago.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-11 11:59
    OK, so you already know what one of the problems is. Can you post a schematic of at least the sensors including the 555.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 12:27
    It was a schematic I found online but I can't remember how I found it. I think I posted a thread about it as well. I am doing away with the 555 and am going with the ADC as I don't have to use 4 cogs to continually read the 4 different pulses. It will open up quite a bit of room for more advanced features.
  • Beau SchwabeBeau Schwabe Posts: 6,566
    edited 2014-12-11 13:49
    Ok, so not having a schematic is like building a car without knowing what engine your going to use.



    THREE simple steps will keep you out of trouble:

    If you build a prototype on a solder-less bread board or whatever....
    1) Create a complete schematic from the prototype
    2) re-create the prototype from the schematic and make sure it works as expected
    3) then design your PCB, assuming your PCB software links to your schematic


    Not knowing how you have things connected makes it difficult if not impossible to determine where a hidden problem might be.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 14:33
    I guess I am one of those who like to fabricate on the fly. I am in no way an engineer and write or draw it out on paper or design an entire schematic. Not trying to be rude or anything, but with the way I work, I design on the fly and try not to, IMO, waste time drawing it out and then have to basically redo the exact same thing I just got finished spending hours drawing out. A well commented PCB can act like a schematic unless it has thousands of parts which then a schematic may be needed. If I were to sit down and try to design an entire schematic for a PCB I would probably give up the first hour since I already know I will have to do this detailed work all over again.

    I know enough about electronics to be dangerous. I know what an NPN and a PNP transistor is, but have no clue how to know what resistor will be needed on the base. Same goes for resistor size / ohm ratings between Prop pins and other chips. Most of this is a guessing game and hope i don't burn something up the the process. If I figure it out on one design, I usually copy that same design and use it again on another project. Sorry for my electronic stupidity, but I just can't learn by reading and I have never been to school for this.
  • SapphireSapphire Posts: 496
    edited 2014-12-11 15:19
    Look at schematics this way. They are like blueprints for a house. Say you want a 3 bedroom, 2 bath house. With no blueprints, you could hire a contractor to build it, but you might end up with all the bedrooms on one end and the two bathrooms next to each other on the other end. With a blueprint, the contractor knows where you want each room and builds it accordingly. There is nothing wrong with breadboard prototype to test concepts and see how things work, but once it gets past a few chips/circuits, you really should take the time to document what you have in the form of a schematic. You don't have to use all the fancy symbols right now, boxes for chips with each pin labeled and a line showing where it is connected to is a good starting point. It serves as a record of what you built. I do mine in pencil, and if I change something, I just erase the line/component or whatever and draw in more. I use a spiral notebook, and when the page is full, go on to the next page. Many times after several changes, I start all over with a "clean" drawing. It's not unlike the PCB layout you did, an it will greatly assist in your attempts to make a PCB. I can't think of a time when I got to PCB layout without having a schematic done first. It's just too easy to forget a trace, or worse, run one to the wrong pin. So for starters, I would suggest you draw a schematic for the solar tracker. (I'm curious how you detect the light and how the ADC will read it) and the only way I'm going to know how it works is to see your design, if you choose to share it with us. Then can we help with suggestions on improvements. I believe the time spend drawing a schematic is never time wasted.
  • DomanikDomanik Posts: 233
    edited 2014-12-11 15:39
    If your sensor is physically attached to > your array > attached to the motor > controlled by the prop > in a loop, you may have feedback that causes your motor to hunt. A smooth start might help. If the array bounces around slightly on motor start-up this could feedback into the sensor and throw off the propeller. Where's the 555 on your lay-schem-outic...;)? It's just a schematic that's close to the metal.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 18:30
    The current sun position sensor is all inside the lamp box at the top of the panel array. It is actually using 2ea 556 to give me 4 channels. The pulses have to travel through the CAT5 back to the Prop. This is where the noise is probably being picked up which makes the pulse width change and throws off the reading. With the ADC circuit, I took my test "noise making" DC motor and laid it on the wires from the ADC and there were no glitches.

    I took the time to design a schematic for the ADC sensor board so here it goes... It took me over 30 minutes to find all the components and run all the traces. That is 30 minutes I could have spend on doing the PCB design instead :P
    729 x 848 - 108K
  • SapphireSapphire Posts: 496
    edited 2014-12-11 19:06
    That is 30 minutes I could have spend on doing the PCB design instead :P

    Maybe, maybe not. On the top I see 4 photodiodes (I assume) with each anode connected to one ADC channel. The 4 cathodes are all connected together... to nothing else? Is this right?
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-11 19:26
    The current sun position sensor is all inside the lamp box at the top of the panel array. It is actually using 2ea 556 to give me 4 channels. The pulses have to travel through the CAT5 back to the Prop. This is where the noise is probably being picked up which makes the pulse width change and throws off the reading. With the ADC circuit, I took my test "noise making" DC motor and laid it on the wires from the ADC and there were no glitches.

    I took the time to design a schematic for the ADC sensor board so here it goes... It took me over 30 minutes to find all the components and run all the traces. That is 30 minutes I could have spend on doing the PCB design instead :P

    Joking aside, the time spent documenting what you are going to do and what you are doing and have done is never wasted. I used to do up schematics in my head then lay out a board and make adjustments to my mental schematic as I went. Not any more. I might do a rough layout to get a feel for the board I want but I always do a schematic now so that the pcb package can at least do a netlist check against plus I have an actual schematic that I can also use in my documentation and come back to years later without having to guess and wonder.

    Now, back to that "schematic", ahem... that's not a schematic, that's a wiring diagram. A schematic will show the logical symbol for a component and the names of the signals so that simply by looking at it we see analog inputs, clock, data lines, Vref, etc. BTW, your cathodes are commoned but not connected to anything.

    I notice that there are light to frequecny sensors quite cheap, why wouldn't you use those instead of 555s or an ADC? Also I was a bit surprised when I read somewhere that you dedicated a cog to each channel!!! A single cog can take turns reading the pulse width/period of each channel and maintain a filtered average and still have an update rate of 100's of times a second, but not that you need such an update rate either.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-11 19:47
    I know I could have changed it to have 1 cog to read all 4 channels, but with all the glitching electronically, I stopped modifying the program and went to designing a new board.

    The ADC chip cost me $1 I think and the IR sensors I already had on hand along with plenty of resistors to choose from in my small arsenal of electronic components I have collected over the years. I already had the 556 timers the first go around so I decided to "recycle" them and put them to good use. I tend to do that with almost all my projects. If I think I can salvage something from a project that I no longer use, I avoid designing or buying something new and go the cheaper route.

    I did forget to connect the IR sensors to the +V. My schematic / wiring diagram is always read from my breadboard as I did with the "wiring diagram" posted above. My memory is worse than a gold fish so I have to visibly see the working circuit to design the PCB.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-11 21:11
    The block diagram in post 39 shows the cathode side of all four leds connected together but otherwise left floating. Shouldn't they be connected to Vcc? This is probably the reason for all the fluctuating readings.
  • kwinnkwinn Posts: 8,697
    edited 2014-12-11 21:21
    BTW, leds have a very low change in voltage and current when compared to photo diodes or transistors. I would suggest using photo transistors instead.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-11 21:35
    I know I could have changed it to have 1 cog to read all 4 channels, but with all the glitching electronically, I stopped modifying the program and went to designing a new board.

    The ADC chip cost me $1 I think and the IR sensors I already had on hand along with plenty of resistors to choose from in my small arsenal of electronic components I have collected over the years. I already had the 556 timers the first go around so I decided to "recycle" them and put them to good use. I tend to do that with almost all my projects. If I think I can salvage something from a project that I no longer use, I avoid designing or buying something new and go the cheaper route.

    I did forget to connect the IR sensors to the +V. My schematic / wiring diagram is always read from my breadboard as I did with the "wiring diagram" posted above. My memory is worse than a gold fish so I have to visibly see the working circuit to design the PCB.

    You call your way "cheap"? That's a lot of mucking around never quite getting it right for the sake of what again? The price of a lunch? Skip lunch then and get it right and we can all go home, so to speak.

    There is never any sense at all in saving a few bucks on a design, especially a one off. Even if you were going to make huge volumes you might still do a functional prototype first then after getting it right look at how you can reduce the production costs, maybe with a totally different design altogether but still drawing on the one that just works.

    It seems to me that the light-to-frequency sensors are inherently stable and it's easy to feed the clock down the line to your Prop, maybe putting little RC filters on there for any glitches, but then again that's very easily taken care of by fault-tolerant software. I noticed in your circuit that you had 100uf (not useful here) and 1uf caps but nothing in the high-frequency range with 10 or 100nf caps, don't ever neglect these. The Vref is a pin that is easy to RC filter so you should at least do that and not connect straight up to the supply which btw should not be 5V either, especially since this is straight from a switching regulator, they are efficient but you will always have high-frequency ripple due to the nature of the switching. Run your ADC from 3.3V instead as you do not need to read 5V inputs, do you? You can also save an I/O if you need to by combining the Din and Dout together as the data is essentially half-duplex as is with most SPI. I like to put a small resistor in the Dout pin just in case of I/O conflict. Pin 7 and pin 12 were drawn incorrectly as going through a cap to ground.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-12 04:42
    You call your way "cheap"? That's a lot of mucking around never quite getting it right for the sake of what again? The price of a lunch? Skip lunch then and get it right and we can all go home, so to speak.

    It seems to me that the light-to-frequency sensors are inherently stable and it's easy to feed the clock down the line to your Prop, maybe putting little RC filters on there for any glitches, but then again that's very easily taken care of by fault-tolerant software.

    Before starting the project, I had never heard of a light to frequency sensor nor can I find one on DigiKey. In a thread I started several months ago, I was told that I could use an ADC as an alternative to using a 555 timer setup so I decided to try this route. There was already code in the OBEX for the ADC I have bought and the pinout was explained in the comments of the code so I was confident enough to not burn anything up. This is why I went ahead and bought the ADC.

    I know it may not make much sense, but the 100uF was needed on my bread board as the readings were jumping +/- 3 or 4 numbers when sitting in room light. I did forget to connect pin 7 to ground and yes, it does not make sense to have a capacitor there, but on the bread board, without the 1.0uF capacitor, the readings would jump +/- 50 or more when a steady light source was shining into the sensors. Like I stated before, I don't know that much about exact specifics on how to decide what value component goes where.
  • HH Posts: 21
    edited 2014-12-12 07:40
    To me that pcb looks like a daisychained ground loop mess. But without a schematic it's hard to tell what the purpose of each component is, and if it would be ok or not.

    Anyway. Try to make a common ground point. And connect all component grounds from there (especially important for logic chips) A groundplane would be best for logic. Increase the tracewidth of all ground and 3,3v paths. Decouple the logic part of the board in one common place with atleast 1uF 0,1uF and perhaps a smaller cap matched to decouple the switching regs. frequency. Do the same close to all IC's, a bare minimum is 1uF. But never hurts to add a 0.1uF to filter some higher frequencies.

    I almost never design circuitry without overengineering the amount of ceramic caps I use.


    On analog circuitry (adc's and opamps) a groundplane is usually a bad idea. Instead run the ground and supply traces on top of each other on opposite sides of board. Use a separate Vref or properly decouple and separate the ground from logic and power parts of the system.
    (refer to a appnote on ADC circuit design). If you don't know how to layout a ADC circuit, there is little point in using one. Do sigma delta on the prop instead or continue using the 555. (just make sure you add atleast 1.uF on the 555's and take care so the can't dump to much current when switching, they are bad enough in that regard on internal switching, hence relatively big caps on the 555s)

    Use shielded cables for the motors. Make sure the entire system actually has a good and groundconnection. (I've even had to install groundspikes and wire to those in a few circumstances (but this usually involves VDF and stepmotor control)

    In short.
    Never daisychain ground in a noisy environment. Use shielded cable, Use a large common groundpoint. Run separate traces from this point to each groundpoint for IC's of any kind.
    555's are noisy little buggers, that can cause a lot of groundbounce by themselves. So give them nice big fat caps. (low frequency, high current)
    edit: If I recall correctly they weren't especially stable either, so the frequency you get from them varies quite a lot in seemingly simmilar conditions.

    Good luck. You will get there with persistence. I've been there, and even if it is a hassle, learn to do schematics. It saves you so much time in the long run. :)
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-12 09:05
    I will make the changes to the board tonight and see if I am understanding this information correctly. One day I hope to understand this way better than I do now. I tend to jump into projects fast and try to cram it all in at once. If I come at the project slowly, I lose interest and give up on it.
  • DomanikDomanik Posts: 233
    edited 2014-12-12 10:47
    [QUOTE=H
  • HH Posts: 21
    edited 2014-12-12 11:40
    I must admit i haven't bothered to actually check thorougly how this project is trying to accomplis its goals. I just saw the layout, and was thinking, hmm, this looks very much like the mess I was making of my projects a few years ago.
    I didn't see any loops. and if there isn't any chains, ok, in that case increase tracewidth, add caps, and you're good.

    edit: Got a better look. Looks pretty good actually. There is a ground trace running the full lap to eeprom, prop, and then a connector marked sun_sensor, which i guess is for the ADC. The part with eeprom, prop and propplug is ok I'd guess. The trace running down to the connector is something I would connect directly to the central groundpoint. And then separate the ground with a very small resistive load on the adc board.

    I don't see any point with the 470uF on the 3,3v rail. Guessing it's electrolytic, consider 10uF ceramic or tantal instead. It's not connected to ground tho, so I have no idea.

    There are 2 devices marked motor_cont. I hope these have flybackdiodes? again, no idea.


    But no obvious reason this would cause much trouble, unless cables and traces are severly undersized for the currents.
    The 555's arent on the layout so I have no ideas there.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-12 12:35
    The first PCB screen shots are of the main "brain" where everything will connect to. The wiring diagram I posted is of the sun sensor which is on a board all of it's own. I have not done a PCB layout for it yet. The ADC circuit will be replacing the 556 timer circuit that is in use right now. That design is not working reliably so I am redesigning hence the desire to reach out and get help with the design. Power supply and noise seems to be a week point for me.

    The Motor Controls are the same part I asked about in the 5A motor control (H-Bridge) thread a few days ago. They do have flyback diodes built in them.

    Trace sizes are a concern for me as well, especially on the "high side". In a previous post, I was told to use 0.050" which IMO seems a bit small. The current draw is between 300ma to 600ma for each motor while running.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2014-12-12 12:49
    Before starting the project, I had never heard of a light to frequency sensor nor can I find one on DigiKey. In a thread I started several months ago, I was told that I could use an ADC as an alternative to using a 555 timer setup so I decided to try this route. There was already code in the OBEX for the ADC I have bought and the pinout was explained in the comments of the code so I was confident enough to not burn anything up. This is why I went ahead and bought the ADC.

    I know it may not make much sense, but the 100uF was needed on my bread board as the readings were jumping +/- 3 or 4 numbers when sitting in room light. I did forget to connect pin 7 to ground and yes, it does not make sense to have a capacitor there, but on the bread board, without the 1.0uF capacitor, the readings would jump +/- 50 or more when a steady light source was shining into the sensors. Like I stated before, I don't know that much about exact specifics on how to decide what value component goes where.

    Pin 7 & 12 need to be connected to ground, not through a 1uf capacitor was my point. The other point was the fact that you are using 5V straight from a switching regulator with it's high-frequency ripple for your ADC. Even if you did you could have filtered Vref at least but there is no reason to run this chip from 5V when a clean 3.3V is available and suitable for this purpose. If you are seeing readings jump you should rule out the light itself by simply feeding a known voltage into an input and if it jumps around then you know it's your ADC circuit at fault.
  • HH Posts: 21
    edited 2014-12-12 12:49
    Making them wider if you have room, and reducing tracesize close to connectors if pinspacing is giving you trouble, and tinning the high current traces when soldering.

    No harm in making a groundplane on the highside. and then splitting off a secion of the groundplane for the logic side. And adding a .1 or 0.05 trace between them, to separate current side and logic side groundplane.

    And yes I agree, and it bears repeating ad infinum: for ADC's, use linear regulators, and filter it good. Again, you can learn a lot from take a good look at a appnote detailing PCB layout considerations for adc's.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-12 17:15
    Here is an updated screen shot of the PCB board. Is this looking better? And other things I might need to change?
    1024 x 625 - 360K
  • DomanikDomanik Posts: 233
    edited 2014-12-12 21:46
    1) Near the left 10K above left motor cont connector: Pull the logic GP to the right and down to connect 2 parts. A chunk of GP is floating. I can't tell if the dark traces are on the top or bottom.

    2) Your power traces appear to be a little narrow. Is it 12mil? On the 3.3V I would run fatter traces (55 mil or 1.5mm) on the dark side from pin 3 of the Vreg, to pin 2 of 4.7uf cap, the 4 pin connector, to the 470uf, then down the middle of the propeller and T to pin 12 & 31. This would eliminate the split plane mentioned in 1. above by eliminating the two 3.3V traces. Also from the 470uF pin 1 the fat trace on the dark side could continue to the Xbee P1, the .1uf, 10K, EEPROM pin 8. This will do a better job of tying the GP sections together.

    3) It looks like pin 8 of the RJ45 supplies 3.3V somewhere. Personally I would regulate down at the end point to 3.3V and send 12V from pin 1 of the 5V reg. The route would start on the GP side to break it away from the reg, then onto the dark side along the XBee upper socket and around the perimeter top and left and wrap around the pin 8 of the RJ45. Alternately you could run 12V to pin 2 or 7 and leave your options open.

    4) Now the GP on the far right. It was actually better without the GP. With a single trace from pin 19 to pin 2 of the logic 4700uF cap there was better current isolation. Now you're sharing a paths to the motor 4700uF cap around pin 1 of the fuse connector. Considering the low motor currents of 100 to 500ma, the 250mil traces are more than adequate.

    Just curious about the 4 10K from the prop to the motor connector. What's the cable length and is it standard PWM-- 1.5ms every 20ms? What's coming in/out on pins 15, 16, 17, 18 of the big connector?

    I'll be interested to see what you come up with.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-13 12:34
    Ok, I made quite a few changes and have decided to make the PCB file available for those who have DipTrace. The file is here : www.techboneyard.com/home-stuff/Main-Board-V1.dip

    As for the power going to the ADC which will plug into the RJ-45 connector... I like the idea of changing that to 12V and regulate it on the board as that may help with the long CAT5 cable voltage loss (if any) and any noise picked up. The 5V switching regulator I use for power regulation may not be able to handle the direct sunlight all the time so I would have to find something else. If I could connect to 5V instead and use a 3.3V regulator on the sensor board, would that work as well?

    The 4 10K resistors are what were recommended to use between this component : http://www.digikey.com/product-search/en?KeyWords=TLE5206-2S and the Prop to protect it. This is what will control the motors which will be connected on the header pins 15 through 18. Pins 15 and 16 are Up and Down control, and 17 and 18 are Left and right control.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-12-13 14:38
    I wasn't able to see your board. I must not have the latest version of Diptrace installed.

    The layout in post #1 (and post #54) only had a single pull-up on the I2C lines. There are a lot of I2C drivers which require pull-ups on both the clock and the data lines. Parallax only has a couple boards with a pull-up only on the data line. Most of Parallax's boards use a pull-up on both lines.

    I always like to bring any unused I/O pins out to pads in case I want to access these in the future.

    XBees provide some diagnostic information on several of their pins. If you connect these pins to LEDs you can see if the XBee is on or asleep, associated or not and also get an idea of the RSSI by seeing how bright a third LED is.

    I didn't read every post in this thread so sorry if these things have already been discussed. Also none of the things I mentioned are crucial to the board working correctly so no need to explain why you don't want to incorporate any of these suggestions.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-13 15:14
    I am not using I2C on anything? The ADC is wired as SPI. The DipTrace file above is with version 2.4.0.2 which is the latest version I believe.

    I do plan on adding a bunch more but before I do too much, I was trying to nail down the power and noise issue I have on the current design that is in service now. I don't have a layout for that board as it is long gone :( So...out with the old, in with the new.
  • Hal AlbachHal Albach Posts: 747
    edited 2014-12-13 18:28
    The EEPROM is I2C.
  • DomanikDomanik Posts: 233
    edited 2014-12-13 18:50
    Ok, I made quite a few changes and have decided to make the PCB file available for those who have DipTrace. The file is here : www.techboneyard.com/home-stuff/Main-Board-V1.dip

    As for the power going to the ADC which will plug into the RJ-45 connector... I like the idea of changing that to 12V and regulate it on the board as that may help with the long CAT5 cable voltage loss (if any) and any noise picked up. The 5V switching regulator I use for power regulation may not be able to handle the direct sunlight all the time so I would have to find something else. If I could connect to 5V instead and use a 3.3V regulator on the sensor board, would that work as well?

    The 4 10K resistors are what were recommended to use between this component : http://www.digikey.com/product-search/en?KeyWords=TLE5206-2S and the Prop to protect it. This is what will control the motors which will be connected on the header pins 15 through 18. Pins 15 and 16 are Up and Down control, and 17 and 18 are Left and right control.
    I don't know the 3.3V regulator but many can hook to 12V just fine. 5V could also be used instead of 12V; the small drop on the 5V out to the ADC should be minimal.

    I looked up your component and it requires a rise/fall time of 100ns minimum (pg 14). Using 80pf circuit capacitance, a prop rise/fall of 5ns, and the 10k in series you'll be getting 3.5us of IN rise/fall to your motor driver. Consider replacing the 10K with 220 ohm which will bring your RT to down to 35ns. At 3V the current through the 220 would be 14ma. The IO pin of the prop can source 40ma and I'm sure has protection diodes that should be able to clamp. Generally cross-talk noise or spikes has a very rough time surviving in a low impedance environment. So it should be safe and if the huge voltage spikes alluded to are occurring it should corrected at the motor source of the problem with Vpwr/Grnd clamp diodes.

    The part has an idle current (Quiescent current) of 10ma X 2 parts + propeller current + etc. You might want to do an idle current budget to see how much all the circuits drain the battery when it's not doing anything.
  • eagletalontimeagletalontim Posts: 1,399
    edited 2014-12-13 20:19
    Thanks for the input on replacing the 10K's with 220 ohm. I can make this change easily. If I can help it, I am trying to stay with through hole components which will make it a little easier to work with swapping parts with readily available RadioShack parts.

    Idle current is not an issue as this circuit is fed by 2 ea 125AH deep cycle batteries. They still charge / top off on cloudy days.

    As for pull up resistor for the EEPROM... I have never done this and the PDF documentation for the Prop does not show a pull up on the EEPROM pins.
Sign In or Register to comment.