FailSafe's Blog

Lessons learned, Lessons reviewed

Well, its definitely been an eventful week. I completed all of the hardware portion of the project. I learned many lessons about the project and about prototyping circuits in general that I would like to share with you.

1)Pretty is not as good as functional.

The sensing leads for the current sensing amplifier must be mounted directly across the resistor/fuse and keep them very short . I originally tried to clean up the look of my circuit by routing the Vs+ wire (sensing wire of the current sensing amplifiers) to a 12V rail on the breadboard instead of wiring them directly to the positive side of the individual fuses on the relay board. My understanding was there would be no difference because the 12V on the breadboard was at the exact same potential as the fused 12V bus on the relay board. This allowed me to reduce the required number of wires to the relay board and keep it clean. Also, I had ran wires from the Vs- (sensing wire of the current sensing amplifiers) from the breakout board directly to the negative side of each individual current sensing resistor. There was no way I could have done it any other way because each load circuit is individual and at different potentials. This did not look too pretty, but it was necessary. Well as you might realize this idea of keeping it tidy looking created a functionality problem in the circuit.

This was due to the way the current sensing amplifier operates. The current sensing amplifier (CSA) measures the voltage drop across a very low resistance high wattage resistor. This assumes that the Vs+ terminal of the CSA will always be at a higher potential than the Vs- terminal. This only makes sense and indicates the correct direction of current flow. This was not the case with my original “pretty” layout. The problem was I did not account for the combined added resistance that all of the wire routing on the relay board, the terminals on the relay board, the long length of wire from the relay board to the breadboard, the terminals on the breadboard, the wire jumpers on the breadboard, and the resistance of the breadboard strips themselves. This extra resistance between the 12V bus on the relay board and the 12V rail on the breadboard caused the 12Vrail on the breadboard to be at a slightly lower potential than the 12V bus on the relay board. Not only that but due to that extra resistance and my “pretty” wiring scheme the Vs+ terminal of the CSAs were actually at a lower potential than the Vs- terminals. This was because the resistance between the Vs- terminal and the 12V bus on the relay board is only .005Ω, and the resistance between the 12V bus of the relay board and the 12V rail of the breadboard was closer to 3Ω. This looked to the current sensing amplifier like the current was flowing in the opposite direction and it caused the output of those amplifiers to go negative. Not the result I was looking for and highly inaccurate representation of the reality of the circuits operation. Of course the solution was simple if not “pretty”: I just had to wire the Vs+ terminals of the CSAs directly from the breakout board to the 12V bus of th relay board to eliminate any ohmic losses. Once that was completed the CSAs worked flawlessly and reported the correct current readings.

2)Quit working when you get tired.

This is probably the most important lesson of all, and the one I guarantee you will not follow. Working when its late and you are tired is STUPID. Ever knows that you make mistakes when you are tired and I am no exception. Case in point, I completed all of the final hardware changes to the circuit Saturday night and was happily turning on and off load circuits. I even wired up a 12V Car headlight bulb to act as a typical load. I was getting tired and was about to call it a night when I thought it would probably be neat to check out the operation of the included firmware of the chip. I installed the required drivers and setup Putty to allow me to do simple serial communication to the device. Everything was working really well. I was able to turn on and off the 12V load using the serial console on the computer. Then after sometime it stopped working. I am not sure if this was due to a mistyped command or an improper setup, but it didn't work. I was pretty tired and should have come back to it fresh the next day, but I decided to press on(Just like you always see on those damn reality shows!). Next thing you know I am poking wires into the circuit and then it happens. You guessed it, I let the smoke genie out. I totally fried something on my development board. I am hoping it is only part of the built in voltage regulator, but honestly I suspect I fried the MCU. Only after watching the pretty smoke did I decide that maybe I was a little too tired and I called it a night. I will be looking into on Monday.

3)It doesn't make any sense to breadboard complicated circuits anymore

I eluded to this in an early post, but I will reinforce my stance on this issue. It does not make any sense financial or time wise to breadboard complicated circuits. It would seem that breadboarding circuits would be cheaper and faster than sending out for custom PCBs. This is a fallacy. The cost of custom one-off PCBs has dropped so dramatically that breadboarding has become the more expensive option. This is because breadboarding carries many hidden costs. Those costs include: The higher price for DIP packaged chips, the need for breakoutboards for chips not offered in dip packaging, the cost of wire and discrete components like resistors, capacitors, etc that won't be used in the final design, the cost of labor to design something twice. It usually becomes necessary to design the circuit layout twice. Once to design it using a component selection that will work with the limitations imposed by breadboarding, and a second time to redesign it using components that meet your operating conditions and can be used on production quality PCBs. Another redesign is usually in the software department. Most of the time constants are needed in your code to compensate for the variations in component's actual values to their rated specs. These constant are going to have to be recalculated when switching from the breadboard to PCB due to the many differences in the layout, components, and ohmic values if traces versus wires. The cost of designing a circuit twice also costs you time, which supposedly is the reason to breadboard in the first place. Now the argument can be made that breadboarding allows you to quickly alter your circuit design if need be and PCBs do not. i would say that is a poor argument. With the advent of advanced circuit simulators, most circuits should be thoroughly debugged before a single wire is ran or component is soldered. Also, I have found that the quick design changes are usually needed because your circuit schematic needs to be altered to work around some size limitation, or induced noise, or ohmic losses directly created by the use of a breadboard and not due to some oversight on the engineers part.

4)Lastly, don't overlook the little things; They can cause big problems.

On my way driving home this Sunday morning I got into a car accident and totaled my beloved Nissan Altima. It was a very bright morning at around 7:30AM and it had snowed the previous evening. I started out the morning by starting up my car and checking to see if I needed to use the snow scraper. I did not though, because I had cleared the car of snow last night after the snow had finished falling. I proceeded to drive off and made a right onto Rt. 7 going east. I was driving behind what I believe were a couple of pickup trucks spreading salt onto the road using one of those salt spreader things hanging off the back of the pickup. As I was driving some road grime got onto my windshield. I pushed on the windshield washer fluid/wipers to clean my windshield. To my dismay the driverside windshield washer fluid nozzle didn't function correctly. It only squirted a small stream of fluid onto the lower edge of my windshield. At the same time the wipers activated and unfortunately smeared a combination of salt and road grime directly across my field of view. Combined with the bright sun, the large amount of grime blocked my view and I was temporarily unable to see absolutely anything out of my windshield. I pressed the washer fluid lever again to be treated with more of the same futile effort. Coincidentally, the traffic light ahead of me was turning from green to red and the salt pickup truck came to a stop. I barely touched the brakes before I rammed into the back of him going 30-40MPH. I am fine and hopefully the driver is too, we both walked away without a scratch(Gotta love airbags), but the car looks like an accordion now. This is extra poor timing due to my planned move in date of my new place being tomorrow., but I guess accidents never happen at a good time.

My point is this, a small insignificant windshield washer fluid nozzle malfunctioning directly lead to the ultimate destruction of my most prized possession and the injury of two people. This same lesson can be applied to electronic projects. A single floating ground or shorted pin or unsafe piece of code could lead to disastrous, even deadly consequences when that product is used in the field. We would be wise to treat the seemingly least important part of our project with the same respect we treat the “most” important part.

I will leave you with a proverb:

For want of a nail the shoe was lost.
For want of a shoe the horse was lost.
For want of a horse the rider was lost.
For want of a rider the battle was lost.
For want of a battle the kingdom was lost.
And all for the want of a horseshoe nail.

Tired but Happy

Well its 1am and I am still up. I spent the largest part of my day working on the project. Mostly hardware stuff though. I decided to create the high current 12volt circuit on a protoboard. That necessitated a lot of solder, but it was necessary. There is just no way we could run the kinds of currents that this project was designed for through a breadboard. The 22 gauge hookup wire maxes out at roughly 900mA current carrying capacity. I used 16 gauge wire soldered to the protoboard to supply up to 4 Amps for power distribution. I think we are going to try to push it to at least 5 and maybe see how hot it gets at 10 Amps. This is not the speced 25 amps but all of the components can handle 25 Amps, I just need to increase the wire size on future revisions. Interestingly we had a lot of isolation problems, there was a ton of crosstalk between leads on the protoboard. I looked at it with a magnifying glass and could see no physical solder bridges, but the resistance between separate circuits was near zero. I ended up using a Dremel and cutting out any solder pads between close proximity circuits. It seems to have done the trick. The hardware side is 90% finished and should be entirely rapped up tomorrow. Then I can spend the rest of this short time working on coding. The other problem is: I am moving, probably this weekend. That is really going to cut into my coding time. I should have done more coding this weekend, but I was distracted by a stiff drink and a pretty librarian. Such is life.

· 2010/01/26 01:05 · failsafe

Reality TV and Insane Schedules

I have always hated reality TV shows where the premise is you have some absurdly short time frame to make/build/develop/solve something. You know the ones: We have a week to build a house or We have to transform a car into a helicopter in 3 days…etc.. I never got the point and I still don't. The projects on TV shows like Trading Spaces are great examples of why that premise doesnt really work. Sure the rooms look decent on TV, but when you really look the flaws are blatant. The curtains are hung using staples and there is hot glue all over the place. My motto is take the time and do it right. Who cares if it takes you 8 days instead of 7, its all for nothing if you get paint on the rug anyway.
That being said, it seems that is exactly what I signed up for with this project. Don't get me wrong; I will get this done. Its just, I might have to break out the glue gun and that goes against everything I believe in. I am attempting to write reusable code for my PIC32 microcontrollers. Any coder you ask will tell you that takes time on the frontend but will pay off time and time again later on. On top of that, I don't have all of the hardware to test this code on. I am trying to write code to interact with something that only exists in my head.
Alright, enough complaining:-(. I am currently knee deep in code. With any luck it will come out looking like a car from Overhaulin and not something from Junk Yard Wars.

· 2010/01/18 20:52 · failsafe

Next Day apparently means Next Week

So, I ordered parts from Sparkfun yesterday. I paid $23 for next-day shipping. My parts should have arrived at my house no later than 7pm on Friday. I called Sparkfun today to make sure they were shipping out today. Apparently, they are not. Some where in the FAQ it states that it could take up to 3 days for processing. WTF! They said it might ship tomorrow or possibly Monday. That really screws up my weekend. Hopefully, I can get some programming done, but I really needed the second PIC32 development board.

Sex, Drugs and Datasheets

Well, hello everyone. This is obviously my first blog post. I have just ordered the last nescessary part for my project. In total, I went quite over budget. Its okay though, because I used my own money to finish funding it. I figure, I am spending $1500 on this class; Whats another 40 bucks? Well lets get on with it:

I spent literally a day (24 hours) picking out all of the parts. The current usage, input voltage ratings, temperature ratings, gain of the SSR, max load voltage, etc.. were all scrutinized to make sure they would work well together. The consequence of this is that the hardware aspect of the project was completely finalized and fully mapped out before a single part was ordered. I believe this will pay off huge in long term. The time frame of this project is too short to wait for parts to come in late in development.

Parts ordering was another reminder why breadboards suck. Ohh, you want that in a dip package? That'll be another $20 please. I think that breadboarding will go the way of dinosaurs in the near future. Eventually nothing will be available in dip packaging and anything useful will need to be designed in Oracle etc.

I had to make a lot of compromise to my design just to use dips too. An example of this is: The current usage of the solid state relay went from 1mA to 5mA. The 5mA number is acceptable for the current design, due to only driving 5 relays. If the design was scaled up though, the total current output of the PIC32 chip could be reached quite easily.

Also, I was unable to keep my goal of having every part have a temperature range of -40°C to 125°C. The clock generating crystal, the microcontroller and the solid state relays fall below that. In future revisions of the design (Once it goes PCB mounted only), I will swap out those parts for automotive grade.

Well, thats it for now. Keep your eyes open and hold your breathe for the next exciting episode of Failsafe's blog. coming soon…

· 2010/01/13 20:02 · failsafe
 
Back to top
users/failsafe/blog.txt · Last modified: 2010/01/11 10:16 by afterburn
 
 
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0