June 14, 2009

Fuel Injection - Evolution Journey-II

This is a fully automotive powertrain article.
Disclaimer: I am a novice in this area. If experts read this kindly correct...

Q: What are the different fuel injection methods used?
Fuel injection systems evolved over the years from being a simple Manifold injection to DI ( Direct injection). The injection of the fuel into the Intake Manifold based on the Air Mass that is currently sucked into the cylinder is controlled either electronically or by mechanical methods. This is typically a function of the engine load. The engine load can roughly be determined by the throttle opening. The terms "Full-Load" ( i.e. Throttle valve is fully open) and "Idle" (i.e. when the Throttle valve is closed & the vehicle is stationary) are very frequently used in the discussions further.
After the SPFI ( Single point fuel injection) where the fuel was sprayed into the manifold the next thing that became very popular was multi point fule injection (MPFI). Here multiple injectors were placed at suitable positions in the intake manifold to get finer control over the air-fuel mixture. Also having multiple injectors ensured that the injector closest to the cylinder going into suction stroke could be activated. In some cases this is called Port Fuel Injection (PFI). This provided also the following benefits:
  • Fuel going into each cylinder could be precicely controlled.
  • Air & fuel would get mixed just before inlet into the cylinder. This ensured that the atomised fuel did not have condensation problems. i.e. in manifold injection with single injector the air-fuel mixture when suddenly expanded in the cylinder under cold start conditions the fuel would condense & form larger particles inside the cylinder which led to higher emissions
The MPFI injection systems came in two variants, though this is not really something great !!..
  • Batch Fired : In this all the injectors for one bank of cylinders where activated in one shot. i.e. for a 4 cylinder engine, injectors for cylinder 1 & 4 were activated together similarly 2 &3.
  • Sequentially fired: Here the injectors where activated sequentially based on which cylinder was going into suction stroke.
Finally came the Direct injection. The direction injection opened up new domains of controlling the air fuel mixture because now only air would enter the cylinder and it could be the ECU that would control the fuel being injected into the cylinder. This ensured that by injecting at different points inside the cylinder & by different cylinder head profile one would achive higher spread of the atomized fuel. This lead to better flame front propagation, ensuring higher power output.
Why did we not go for Direct Injection to start with ?
The manufacturing processes in earlier days did not provide us with methods to have injectors that could bear the very high pressures generated inside the cylinder. Also, the fuel injector tip has to bear extreme temperatures which are generated inside the cylinder. Also, the pump which pumps fuel into the injector needs to generate very high pressures because if fuel is injected in the later stages of compression ( like it is done in Stratified mode of operation). The injector nozzel design also has undergone many design changes to ensure that a extremly fine spray with precise control on droplet size could be created.




Powered by ScribeFire.

June 9, 2009

Inlining code - Coding Myth 2

This post is regarding the inline keyword.
Very often we learn C & C++ together and end up mixing one language with the other. I learnt this the hard way when i found out in some debate that the "inline" keyword doesn't belong to the C language.....Boohooo!!..
Inline keyword natively belongs to C++.  It serves the purpose of just ensuring that the function is pasted inline instead of having a call to the function at every instance of the function call.
It was not a part of C. In "C" we achive similar functionality by using what are termed as "Function Like Macro's".
E.g.
#define Max(a,b)  ((a)>(b)?(a):(b))
The funciton like macros have a major disadvantage over Inline functions and that is the blindness to the compiler.
#define macro's are processed by what is known as the "C Preprocessor". The preprocessor looks for the macros and does a macro pasting operation. Which means that where ever in the above example Max is used the equivalent code is pasted.
E.g
y = Max(5,6); is equivalent to y = ((5)>(6)?(5):(6));
Then what is this blindness funda?
Well if iwrote this code
int *ptr;
y = Max(ptr,'5').
Then even this would work as for the Macro-Processor. Infact in this particular example even the compiler will not complain. However, if this was a inline function then the compiler would have been flag an error.  So it is easy to see that the inline key word has benifits over the #define macro.
Now some interesting stuff
  • - Did you know that the inline keyword is just a request to the compiler. The compiler might choose to ignore you fully and would just make the function a normal function if it feels that by making it inline it is losing out on optimization.This is in contrast with #define function like macro's which are outside of the compiler's control.
  • - Modern C compilers provide you various methods of inlining function by compiler extensions. E.g some compilers provide pragma's
#pragma InlineStart
void Inlinefunction(void)
#pragma InlineEnd
or things like
@inline void Inlinefunction(void)
  • Inlining is very useful to ensure modularity & keep your code clean. However, In "C" if this was natively available then we embedded users would not have resorted to function like macro's.
  • Evils of the keyword "inline".....Well it is difficult to debug your inline function because there is no call to the function and also it is not really visible to your debugger:-(.
Now that we have some idea of the keyword "Inline", you can try to check out the statements made above using our good old GCC compiler with "-S" option and have a look at the generated assembly code.
Please leave your comment. You can subscribe to this blog by using the links under "Subscribe" section.

Powered by ScribeFire.