Friday, April 8, 2011

What is a "good" architecture?

Hopefully you recognise it when you see it...

I believe every system has an architecture, documented or not, and intended or not. So I think it is reasonable to discuss if the architecture of a system is good or not, and that the question if the architecture description is good is a different, but related question.

So what criteria could you use to establish if an architecture is good? Is it suitable for it's purpose is a more precise question? But this probably differs depending on the stakeholder, a system could be very nice and intuitive for the user, but very difficult to develop and maintain for the developers. In the rest of this blog post I will writing about goodness from a developer perspective (including the architect, if one is involved).

I think there are different levels of how well the architecture suits it's purpose to guide and control the implementation.

The ideal level is where the developer understands the architecture and following the architecture is the obvious way to implement something. Doing it differently is seen as more difficult and less elegant.

The next level is where the developer understands the architecture, is able to follow it on her own and can evaluate if the implementation follows the architecture or not. The developer also understands the "debt" that would occur if she deviates from the architecture, for example in terms of compromising some quality attributes. At both this and the previous level the developer can contribute to the design of the architecture itself, and an appointed architect doing the design may not always be necessary.

The developer may need continuous support from the architect to be able to understand the architecture when working. This is very common and requires more work and puts limits on the the ratio between the number of architects and developers in large projects.

The worst level is where the developer cannot understand the architecture and the only one that can determine if the implementation follows the architecture is the architect by reviews. This is very work intensive on the part of the architect. The architect is also viewed as a police that interferes with the developers rather than supporting them.

I have worked at all this four levels in various projects, and I think that you need to be on the upper two if you talk about a good architecture from a developer perspective. I also think that if you want to be truly agile in a self-organising team it is at the two top levels you nee to be.

Monday, March 21, 2011

Embedding Linux for an Automotive Environment

I thought this presentation was interesting enough to share, even if i have absolutely nothing to do with it: Embedding Linux for an Automotive Environment. I guess you need to have a thorough understanding of Linux to understand how the optimisations were implemented.

You can watch a videorecording of the talk as well.

Friday, February 25, 2011

Functions of Electronic Fuel Injection or EFI

Although all cars sold today have electronic fuel injection systems, earlier automobiles had carburetors, which were less efficient. Some other types of small engines, such as lawnmowers or rototillers, still use carburetors. Both the carburetor and the electronic fuel injection system are mechanisms that supply fuel to the engine.
The first fuel injection systems were throttle body fuel injection systems, or single point systems, which had an electrically controlled fuel injector valve. Later, these were replaced by more efficient multi-port fuel injection systems, which have a separate fuel injector for each cylinder. The latter design is better at metering out fuel accurately to each cylinder, and also provides for a faster response.
Although electronic fuel injection is much more complicated than a carburetor, it is much more efficient. The injector is a type of valve that is controlled electronically, which opens and closes and supplies atomized fuel to the engine. It sprays fuel into the intake valves directly in the form of a fine mist. The injector opens and closes rapidly, and the pulse width, or the amount of time it stays open, determines how much fuel goes into the valve. Fuel is supplied to the injectors by a fuel rail.

Several sensors are included as part of the system, to ensure that the correct amount of fuel is delivered to the injectors, and then to the intake valves. These sensors include an engine speed sensor, voltage sensor, coolant temperature sensor, throttle position sensor, oxygen sensor, and airflow sensor. In addition, a manifold absolute pressure sensor monitors the air pressure in the intake manifold to determine the amount of power being generated. 
In a sequential fuel injection system, the injectors open one at a time, in conjunction with the opening of each cylinder. Some other injection systems may open all injectors simultaneously. The sequential option is advantageous because it allows for faster response when the driver makes a rapid change.
The entire injection system is controlled by an electronic control unit (ECU), which functions as a central exchange for information coming in from all the various sensors. The ECU uses this information to determine the length of pulse, spark advance, and other elements. The ECU has several safety features built in, including a fuel cut parameter and top speed parameter.
 

Fuel Filter Functions

A car's fuel filter is located along the fuel lines, either in the engine compartment or underneath the car by the fuel tank. It is the responsibility of the fuel filter to trap large particles in the fuel in order to prevent them from getting into the engine. Because of the tremendous force behind the up-and-down motion of the engine's pistons, which compress the air-fuel mixture so that it will burn more efficiently, any large particles in the fuel could potentially cause serious damage to the engine. Large particles in the fuel also have the ability to clog fuel injectors, depriving a cylinder of precious fuel and requiring that the injector be cleaned or replaced. Therefore, maintaining a clean fuel filter is imperative to the performance of a car's engine.
Due to the differences in fuel delivery systems, each fuel filter is different. A carbureted engine, which essentially uses the principle of vacuum to suck fuel into the engine, has a fairly low-pressure fuel system. Fuel in a carbureted system passes through fuel-resistant rubber hoses. The fuel filter is made of metal or plastic, with an inlet tube protruding from one end and an outlet tube protruding from the other; a hose is fastened over each end with a circular clamp.
In a car with electronic fuel injection, the injectors squirt fuel into each cylinder. Fuel in this type of system is kept highly pressurized with the help of a pressure regulator. Due to the high-pressure system, the fuel lines must be made of metal. Sometimes the fuel filter in a high-pressure fuel injected system is placed in a low-pressure section, and may be connected to rubber hoses with hose clamps, much like in a carbureted system. However, the fuel filter in a high-pressure fuel injected system is usually equipped with a threaded fitting on each end that screws into the fuel lines on either side. 
When changing the fuel filter in your car, there are a couple of precautions you need to take. First, in a car with a high-pressure system, you will need to relieve the pressure before disconnecting the fuel lines from the filter. In most cars, this can be accomplished by removing the fuse that controls the fuel pump, and idling the car until it runs out of gas. Another method that works for some cars is to remove the gas cap. Check your shop manual for more specific instructions. 
In order to be sure the fuel filter works correctly, you will also need to take care to place the fuel filter so that the flow travels in the right direction. Most fuel filters mark one side as "in" and the other as "out." The inlet should connect to the fuel lines that come from the fuel tank underneath the back of the car, while the outlet should connect to the fuel lines that can be traced to the engine. Sometimes the fuel filter will have a different kind of fitting on each side, so that it can only be installed in one direction.
Because the fuel filter is one of the key components in protecting the engine from hazardous foreign particles, it is important to replace it regularly. Some mechanics recommend replacing the fuel filter every year during the regularly scheduled tune up, but other mechanics disagree. To be on the safe side, you should replace your fuel filter at least once every two years. Your fuel filter may need more frequent attention if you live in a particularly high-pollution area, or if you put more miles on your car in a year than the average person.  

Maintenance of the Battery

Even a well-maintained car battery will become depleted over time and eventually lead to hard starting. To save wear on your starter and to keep your vehicle in tip-top shape, changing the car battery will be required every three to five years under normal circumstances. In regions of extreme weather, a battery might need replacement more often. Following these easy steps, you can safely remove the old battery and install the new one.
Removing the old battery:
Many automotive chains that sell car batteries will give a customer credit for an old battery because the core is recyclable. Moreover, it is illegal to throw a car battery in the trash in most states, making it convenient to trade in the old battery when you get a new one. If your automotive retailer does not recycle old batteries, contact the Automobile Association of America (AAA) or check their website for battery recycling information in your area.
A car battery is filled with corrosive acid that is potentially explosive and can cause serious injury, easily burning through clothes and skin. Do not expose the battery to flame, sparks, or incendiary devices, including cigarettes. Wear protective eyewear such as clear workman’s goggles and/or a face shield with protective clothing. Do not lean over the battery when performing these steps. 
The battery terminals are labeled + (red/positive) and – (black/negative). Disconnect the negative terminal first and flex the cable away from the battery. Next disconnect the positive terminal. Finally disconnect the top clamp that holds the car battery down. Do not lay tools across the top of the battery. A conductive metal might touch both terminals simultaneously causing a short, sparks, or a potential explosion.
A car battery weighs 32 pounds (14.5 kg) or more and should be lifted out of the automobile with extreme care. Do not tip or drop the battery. Many newer batteries are made with a handy strap handle. Battery straps are also available at automotive shops. Alternately, you can lift the car battery straight up and out by holding it at opposite corners. 
Clean the battery cables, pan and clamp. If there is corrosion present (white powder), neutralize it with a mixture of baking soda and water using an old toothbrush.
Installing the new car battery:
When purchasing a new car battery, confirm that the negative and positive terminal posts are on the same side of the battery as your old one. Connecting the battery reversed can cause serious damage to your car. For your own safety, purchase a car battery that has had the electrolyte premixed and added by the retailer, and is already partially charged.
Carefully lower the new car battery into place. Make sure it is sitting flat in the battery pan, and not on the lip. Swing the top clamp into place and secure the battery by tightening down the clamp.
Many new batteries come with a protective plastic cap on each terminal post. Remove the positive plastic cap if present, and smear some petroleum jelly on the terminal post. This will help prevent corrosion. Connect the positive cable and tighten it. Repeat this process for the negative cable. (This is the reverse order of disconnecting the battery.) Be sure to remove all tools before closing the hood.
It’s a good idea to drive the car for thirty minutes or more once the new battery is installed. Highway driving is more helpful than stop and go driving. The battery will charge faster if drains are kept at a minimum, such as air conditioning, stereos and unnecessary lights.
Check the water in your battery periodically, more often during hot weather. Use only distilled water to keep the electrolyte fluid at its proper mark. If the vehicle sits unused for long periods of time, purchasing a Battery Minder or Battery Tender is a good idea. Either product will keep the battery fully charged between uses, extending its life
  

Importance of Pressure Plate

The pressure plate is an integral factor in the function of an automobile’s manual transmission. The pressure plate pushes the clutch disc, sometimes called the clutch plate, against the constantly spinning engine flywheel. The clutch disc, therefore, is either stationary or rotating at the same speed as the flywheel. Friction material, similar to that found on brake pads and brake drums, causes the clutch disc to spin at the same speed as the engine flywheel. It is this friction between clutch disc and flywheel that allows the engine torque to drive the wheels. 
Pressure plates are, as the name implies, round, metallic devices containing springs and fingers, or levers, and controlled by the release fork connected to the shifter. All of the clutch components are enclosed in the bell housing of the transmission, between the rear of the engine and the front of the gearboxWhen the driver steps on the clutch pedal, a number of springs in the pressure plate are compressed by multiple — most often three — fingers. This compression of the spring(s) pulls the pressure plate and the clutch disc away from the flywheel and thus prevents the clutch disc from rotating. When the clutch disc is stationary, the driver can shift into the proper gear and release the clutch pedal. When the pedal is let up, the fingers in the pressure plate release their grip and the spring(s) expand to push the pressure plate into the clutch disc, thereby engaging the flywheel. This release process is often called the “clamp load”. 
There are three major types of pressure plates: (1) The Long style which contains nine coil springs for pressure against the flywheel and three thin fingers for release. The Long style plate is used mainly for drag racing. (2) The Borg & Beck style also contains nine coil springs and three fingers. The fingers are wider, however, and the Borg & Beck has the more robust materials and design necessary for street driving. (3) The diaphragm pressure plate is best suited for street use and is, therefore, the most common type found on later-model automobiles. It contains a single Bellville-style spring that applies a more even load from clutch plate to flywheel. Because the single-spring diaphragm is more effective “over-center”, there is also less effort needed by the driver to hold the clutch pedal in the depressed position at a stop.

How to repair and Anti-freeze Leak

The one good thing about an antifreeze leak is that it makes itself apparent very quickly. Your temperature gauge soars, warning lights comes on, and sometimes steam pours from beneath the hood of your car, truck, or SUV. When these things occur, pull to the side of the road and stop the car as soon as safely possible. Continuing to operate a vehicle that has lost its coolant can easily lead to the destruction of its engine.

An antifreeze leak can be either external or internal. If you are experiencing an internal leak, something like a bad head gasket or a cracked engine block, it is best to have the vehicle towed to a mechanic. A broken head gasket or cracked engine block may be leaking antifreeze into a cylinder or your oil crankcase. These are not simple repairs, and will often cost well over $1,000 US Dollars (USD).
An external antifreeze leak is easier to diagnose and repair. First, you should determine where the leak is occurring. The most common sources of leakage are the upper or lower radiator hoses, the radiator cap, the radiator overflow reservoir, or within the radiator itself. Leakage can also take place around the water pump, heater core, and intake manifold gasket.
To diagnose and repair an antifreeze leak, first check the radiator cap. If you are very lucky, and cannot spot any other leaks, then the problem may simply be that the cap has been damaged and is unable to contain the pressure of the hot coolant in the radiator. The solution is to buy a new cap. Remember to wait until the car has cooled before removing the old cap, as a facefull of boiling antifreeze is a less than pleasant experience.
Next on the list is a check of the upper and lower radiator hoses and hose clamps. You should easily be able to tell if a hose is cracked or split, as the coolant will either be dripping out or spurting like a fountain. Replacing the upper hose is a relatively quick job. Replacing the lower hose is often a difficult and dirty task. If the hoses appear to be fine, check the clamps.
Like all mechanical parts, hose clamps can weaken and loosen over time, leaving tiny gaps and spaces around intake and outflow openings. Just replace the clamps with new ones. Replacement of the upper hose clamps is a breeze, as they are easily accessible. Again though, due to the cramped engine compartments of virtually all late-model cars, replacement of the lower hose clamps may lead to scraped knuckles and cursing.
The next most common source of an antifreeze leak takes place in the radiator itself. You can try the quick fix, which is to pour in a can of one of the many additives that profess to stop pinhole radiator leaks. Sometimes this will work, and sometimes it won’t. A radiator can be damaged by internal corrosion, flying rocks or debris, and sometimes simply by age itself. In any case, an additive repair is usually a temporary solution, and eventually your radiator will either need to be repaired or replaced by a professional.
The final simple repair for an antifreeze leak lies in your radiator’s plastic overflow reservoir. This reservoir takes in coolant when it becomes too hot. After it has cooled, it is sucked back into the radiator. If there is a hole or crack in the reservoir, you will loose coolant on a regular basis. The choices are either to try and repair the crack or hole with glue, or purchase a new reservoir.
Fixing a leaking water pump, heater core, or intake manifold gasket is more complex. Unless you are a qualified mechanic, they fall into the “don’t try this at home” category. The odds are, unless you are very knowledgeable in automotive repair, you will cause more damage than already exists.