Development of A Simulink Model To Investigate Fuel Consumption And Efficiency Of A Main Fuel Engine

⎯ marine business is one of the largest businesses in the world. Exports and Imports of human necessities in the majority are using ships. This is because of the ratio between the goods that can be delivered on each trip and the number of trips it can go to fulfill this. This makes the shipping or transport cost-efficient. But the continuous growth of the world population and its standard of living creates an ever-increasing dependency for the world economy on international trade. Therefore a good shipping company will always develop a better way of shipping together with more efficient and optimized voyage planning. To increase the efficiency of shipping, companies try to reduce the cost of almost everything. Therefore, one of the options for improving the efficiency of shipping is by increasing the efficiency of the ship itself. The ship efficiency is not only determined by how fast the ship and how much the ship can load, but also how much fuel does the ship consume for each operation. An investigation of the engine efficiency must be done. The investigation will be done by using an engine model in Simulink to create a similar engine model to the real engine. Then simulate the dynamic process of the engine, which will affect the consumption in general. Therefore the consumption of the engine can be analyzed. The results of this bachelor thesis is an explanation of how to develop the engine model. This includes the explanation of what is the engine efficiency and the engine parameters that affect efficiency, such as engine consumption, engine losses, etc. The model development includes the change in parameters and model structure. Then a simulation is done to compare the results with the measured data. From this process, the model can be considered satisfactory when the results are similar to the measured

I. INTRODUCTION 1 The continuous growth of the world population and its standard of living creates an increasing dependency on the world economy on international trade. Therefore a good shipping company will always develop a better way of shipping together with more efficient and optimized voyage planning. Other than that, there is an economic factor that must be fulfilled to make the shipping costefficient.
One of the options for increasing the efficiency of shipping is by increasing the efficiency of the main engine itself. For a certain travel distance, the engine will work in a random or dynamic state. This creates a random condition for the engine load, torque, and consumption itself. For whatever the distance of the travel, the consumption of the engine is the main reason whether or not the ship can be called efficient. Therefore, an investigation of engine efficiency is often done many times.
Developments nowadays are based on models and designs that are created and simulated under certain parameters. A thorough understanding of how the engine operates is important in this matter. By that information, a simulated formula of the system can be obtained. The simulation will be done under various conditions while the ship is on the voyage. This is done by adapting the existing model of a diesel engine to present the influence of power/speed change to fuel consumption. When this is done, the next step will be to try to use the data from the simulation to find a structured procedure to derive a suitable coefficient for the model. From this model, another simulation of the engine running under dynamic operation can be fulfilled. This simulation of a running engine will result in a similar condition of the engine while in operation at sea.
The simulation for this thesis is done by using MATLAB/Simulink. This program is designed to help understand and create various systems using blocks and diagrams. For the engine operation, the data that are going to be used are the systems for the engine operation itself, such as the injection systems, combustion process, etc. The use of the existing model of the diesel engine is helpful due to a complex task that has to be done in creating a new and running diesel engine model. This model will only be based on energy transfer and has to show the dependency of efficiency from an operating point, speed, and load torque. The non-optimal fuel injection will serve as a dynamic behavior where it should be implemented and checked for different engines. This is done by deriving data of operation parameters and losses from actual machine data or load test reports. This requires an actual model of the combustion machine and its control, as well as losses parameters such as connected pumps and friction. For this thesis, the model will be modified to suit the parameters of an actual engine.
There should be a measured data from an actual engine that can be used to validate the model. Signal outputs such as the fuel rack position or specific power have to be supplied to the model. The simulated data from the simulation will be used to determine the engine behavior under these conditions and loads. These will generate a graphic or diagram that will show data such as an engine propeller matching diagram would. From this point, an optimization of the system can be determined.

A. General Diesel Engine Theories
Engines are machinery that is used to generate power. This power can be used for various purposes, such as generating electricity, generating thrust, etc. There are some types of engines, such as diesel engines, gasoline engines, turbine engines, steam engines, electric motor, etc. These engines are commonly used worldwide, and they have their own advantages and disadvantages. For example, the diesel engine gives high torque but low speed compared to gasoline engines, which will produce higher speed but less torque. This comparison is, of course, done in the parameters of the same size as the engine. Other engines, such as the turbine engine, will generate high power with the cost of high fuel consumption. For this thesis, the engine that will be discussed is the diesel engine.
Diesel engines are invented by Rudolf Diesel. The diesel engine is an internal combustion engine that uses the heat and pressure of the compression to ignite the fuel mixture. Mechanical components such as spark plugs, coils are not required for ignition. Because as the piston moves upwards, it compresses the air until such a degree that the temperature will increase from the pressure. This heat is sufficient to ignite the fuel that is injected. Therefore the fuel-injected will be ignited as soon as it is injected. Despite the difference in the ignition process, the whole engine components, from diesel and gasoline engines, are pretty much alike. They both have an engine block, cylinder liner, crankshaft, pistons, camshaft, connecting rods, and valve train. They both also require a lubrication system and cooling system to operate.
Both diesel engines and gasoline engines have four steps of combustion. The sequence is the same, which is expansion, compression, power stroke, and exhaust stroke. The expansion stroke is the time where the engine gets the air from the intake manifold. In this stroke, the piston moves downward while the intake valve opens. Then there is the compression stroke. This stroke is when the piston moves upward to compress the mixture of air and fuel. After that, the combustion occurs, and the power stroke begins. This happens because the power from the ignition moves the piston downward to produce a torque, which is transferred to the crankshaft. This power is enough to move the piston back upward while the exhaust valve opens. This stroke is called the exhaust stroke because, in this stroke, the exhaust gas is blown out. As gasoline engines have two types of cycles, the diesel engine also has two types of cycles. Those are two-stroke and four-stroke cycles. The principal of 2 strokes and four-strokes are the same. The two-stroke engine completes their whole cycle from an expansioncompression-power-exhaust stroke in 2 rounds of the cycle. So the exhaust stroke is done at the same time as the power stroke. For the four-stroke engine, each stroke is done individually.
Marine Propulsion plants are complicated systems with hull, engine, and propeller operating together. Diesel engines are very important components of the system and are highly nonlinear and time-invariant. Therefore the modeling of diesel engines is one of the key problems for simulations and control of the system. These simulations can be used for various purposes, such as machinery performance analysis, ship performance, maneuvering analysis, and machinery control development.
To understand how to model an engine system, an understanding of how the engine actually works is needed. The figure below is the schematic diagram of a propulsion system of a ship. The diagram focuses on the engine system.

B. Combustion in Diesel Engine
In the diesel engine, the air is compressed with a compression ratio of from 15:1 to 23:1. Then the liquid fuel is sprayed by a fuel injector located near to the topcenter of the piston into the combustion chamber. The pressure and temperature of the air inside the cylinder are very high enough to trigger some chemical reactions when the fuel is injected into the cylinder. On the other hand, the chemical reaction may start so slowly in diesel engines. This is called the delay period. (1; 2) As the absence of an ignition spark, the ignition process in diesel engines can't be controlled to set when and where to ignite. Ignition depends on the high compression ratio. It will set the gases inside the International Journal of Marine Engineering Innovation and Research, Vol. 5 (3), Sept. 2020. 151-163 (pISSN: 2541-5972, eISSN: 2548-1479 154 combustion chamber to be above the temperature and pressure needed for starting the combustion process (1;2)

Figure. 2. Diesel Engine Cylinder View
In the diesel engine, the cycle started from the piston is at the bottom dead center, and both valves are closed at the beginning of the compression process. Then the air is compressed adiabatically, which means the compression is done without heat transfer to or from the environment when the piston is moving upwards. The volume will be reduced, but both pressure and temperature will rise. When the piston is about to reach the top dead center, the fuel is injected and started to ignite. After the ignition has started, the piston begins to move downwards. In this process, the pressure remains constant, but both volume and temperature rise as a result of the combustion process. When fuel injection and combustion has completed, the hot gas expands, and work is done on the engine. The volume of gas rises, but both pressure and temperature started to fall at this expansion phase. In the end, the exhaust valve opens, and the pressure inside the cylinder falls. Then the cycle returns to the first step for gaining continuous work. (1; 2)

C. Energy Balance Theory
"Energy balance for a direct injection diesel engine shows that about one-third of fuel energy input is lost to environment through heat transfer, another third is wasted as exhaust heat and only one-third is available as shaft work" (Sharma and Jindal 1989). The whole model of this thesis is based on the energy balance theory. This theory requires an understanding of how the energy from the fuel that is injected into the engine will produce power for the engine. More precisely, the energy enters the engine in the form of fuel injected and will be used to produce power while some energy will be lost as heat due to friction, cooling water, exhaust, and other heat transfer process. This heat loss should be decreased so that the engine will have higher efficiency. Therefore, it is important to know the theory behind these heat losses.
According to the literature, there is some formula that is used to determine the energy balance inside the diesel engine. Some of the equations are regarding the input energy that is given to the engine, brake power output, etc. Here are some of the examples of the equation formula that is explained in the literature.
The formula above explains that the represents the input of energy to the engine is equals to the fuel mass flow ( ) times the energy contained inside the fuel (LHV).
The formula above shows that the brake power output ( ) is equal to the brake torque ( ) times the angular velocity of the crankshaft ( ).
The formulas above are a reference for the formula that is used in this thesis. For this thesis, the losses are not calculated, but it is based on assumptions. So there will be variables or constants that will represent the losses of this engine model. Further analysis of the losses is done in a later chapter. Fuel injection in diesel engines has the task of atomizing the fuel and forced it into the engine through a nozzle. The camshaft controls the opening of the nozzle by lifting the pin valve.

• Direct Injection
In a diesel engine, fuel is injected into the combustion chamber directly. The injection aims onto the head of the piston when it's about to reach the top dead center. The direct injection has a high risk due to the injectors will be exposed to both high heat and high pressure. The result is material used for direct injector has a high cost due to its high resistance to heat and pressure. The precision is needed to ensure the ignition process, like the absence of an ignition spark. (2) • Indirect Injection The indirect injection system in the diesel engine delivers fuel into a small chamber called a swirl chamber or pre-combustion chamber, which is connected to the cylinder by a narrow air passage. The swirl chamber is used to create an increase in a fluid motion to perform a better fuel and air mixing. This result is a diesel engine with a smoother and quieter condition when running. Because of the presence of a swirl chamber, pressure in the injector can be lower. Most IDI systems use a single orifice injector. Mostly, indirect injection engines are more difficult to start and require glow plugs to help the combustion process. In addition, the indirect injection has a lower efficiency than the direct injection due to an increase in heat loss. (2)

• Common Rail System
In a common rail system, the common header or the accumulator store fuel coming from the fuel tank, then the fuel is sent to the injectors. The header is set to maintain high pressure. It can also return the excess fuel to the fuel tank. The nozzle sprayed the fuel with the help of a needle valve operated with a solenoid. The injection occurred when the solenoid is activated and lifts the needle valve allowing the high pressure of fuel from the header comes out to the combustion chamber. On the other hand, the spring pushes the needle valve into the nozzle passage and blocks the path for fuel entering the cylinder. Those happened when the solenoid is not activated. The overflow of the fuel will go back to the reservoir. Then it will go through the whole process again. (2)

E. Engine Efficiency
The efficiency of the engine is a result of a ratio of the useful work done to the heat provided. This means the friction and other losses reduce the work done by the combustion process. The efficiency of the diesel engine mostly depends on the expansion ratio. The work that can be extracted from the combustion process is proportional to the difference between the initial pressure and the ending pressure during the diesel cycle. Therefore, the bigger the initial pressure can increase the work extracted. (1) Friction can reduce the efficiency of the diesel engine. The diesel engine has friction that is produced by many moving parts. There are friction forces remain constant when the applied load is constant. There are also other friction losses increase as engine speed increases, for example, piston side forces and connecting bearing forces. Only a few friction forces that decrease at higher speed, one of them is the friction force on the camshaft's lobes used to operate the inlet and outlet valves. In addition, an operating diesel engine has another kind of loss called pumping losses. It is defined as a work required to move air into and out of the combustion chamber. This pumping loss is low at low speed, but it will increase as the square of the speed.
Air is important and also needed to perform the combustion process. If there is not enough oxygen for combustion, the incomplete combustion will occur, and less energy produced. A high fuel to air ratio will produce more unburnt hydrocarbon that affects engine efficiency. Some pollutants, for example, unburnt hydrocarbon and nitrogen oxide, can be created at high combustion temperature. This can affect engine efficiency because the energy is being extracted to creating the pollutant instead of for doing work. Somehow it was handled by cooling the air intake to get denser air for the combustion process. The engine will produce more power and less amount of nitrogen oxide produced. However, the amount of unburnt hydrocarbon will also increase as the engine produce more power. (1)

F. MATLAB/Simulink
To model the engine, the use of the software is necessary. The software that is going to be used is Simulink. This program is developed by MathWorks and is a graphical programming program for modeling, simulation, and analyzing. The main interface is a graphical block tool and a custom set of blocks that are available in the library. It is based on the MATLAB environment, such as the mathematical model of  155 calculation, but in a graphical method. Other than mathematical modeling, Simulink can also incorporate MATLAB algorithms into models, which will be beneficial later for further analysis. (4) Simulink supports system-level design, simulation, automatic code generation, testing, and analysis of systems. Simulink is capable of systematic verification and validation of models through modeling style checking, requirements checking, and model analysis itself.
The first step for using Simulink is by modeling the algorithms and physical system using blocks of diagrams. This model can be both linear and nonlinear systems. Factors such as friction, gear slip can also be modeled. A library that has predefined blocks will help in building the model. The blocks are connected in a way that the signal lines can establish mathematical relationships between system components. Refinement of the model appearance or adding masks can customize how the users interact with the model. A group of blocks can be organized into subsystems, which will enable a discrete build of components that reflect real-life systems. Simulation of the system can be done after that.

• Modeling
As explained briefly in the passage above, modeling in Simulink is basically connecting a diagram of a dynamic system graphically using blocks and signal lines. A block within a diagram defines a dynamic system in itself. Collectively the blocks and lines in a block diagram describe an overall dynamic system.
In general, block and lines can be used to describe many "models of computation." One example would be a flow chart. A flow chart consists of blocks and lines, but it cannot describe general dynamic systems using flow chart semantics. (5) The Simulink Library Browser is the library where all the blocks that are used in modeling can be found. These blocks include Continuous and discrete dynamics blocks, such as Integration, Transfer functions, Transport Delay, etc. Other blocks are Math blocks such as Sum, Product, Add, etc. Then there is a source block, which consists of Ramp, Random generator, Constant, Step, Sine Wave Generator, etc. Lastly, there is the sink block, which consists of displays or graphic displays so that the simulation can be seen into numbers, graphics, or other values depending on the sink used.

• Simulation
The simulation of the model refers to the process of computing the whole calculation or formula that the model is designed and run it in a certain span of time, depending on the input time. This process uses inputs from the model that is open. Firstly, the program engine invokes the model compiler. This converts the model into an executable form. A process called compilation. Then for the next phase, Simulink allocates the memory needed for working areas such as signals, states, and runtime parameters. This step will allocate and initializes memory for data structures that store information for each block. Then the simulation enters the simulation loop phase. This phase computes the states and outputs of the system at intervals from the simulation start time to the finish time. This can be done by using the information provided by the model. The successive time points at which the states and outputs are called time steps. The length between time steps is called step size. (5) This whole process will result in a display or graph depending on the type of sink used. Then these outputs can be analyzed for further research. For this thesis, the results are divided into three main outputs, which are the speed, power and or torque, and consumption. These graphs can produce data logs that can be exported into an excel sheet. This way, a comparison can be made with another set of data logs.

II. METHOD
In this bachelor thesis, the author will develop a Simulink Model to behave as similar to a real engine. The model is a pre-created model, which was created by Prof. Ing-. Axel Rafoth. In this thesis, measured data from a real engine is important. The process of measurement is not done by the author. The measured data is also given by Prof. Ing-. Axel Rafoth.
The first step in this thesis is to compile the measured data into one excel sheet. This way, it will be easier to use in further steps. Then the next step is to develop the model under static operating points. This way, the model will be stable enough to have dynamic inputs later on. Under this process, there will be numerous simulations and comparisons from both the measured data and the simulated results. This is to determine the similarity of the model to the real engine.
The second process is to develop the model under dynamic operating points. When some dynamic inputs are added, a change in the controller should be done. This way, the engine model will have a better and more stable running process. There are two controllers in this model, which are the engine speed controller and the engine load controller. Both controllers will affect each other in this model.

A. Engine Model
Every Simulink model is based on blocks and connections which is explained in previous chapter. The model combines the use of subsystems and loops to create a similar operation or process to that a diesel engine.
The model itself consists of blocks and connections that are arranged so a similar system of an engine can be made. The main blocks are: • Engine control block The first block is the engine control block. Inside the block, there are set of subsystems and connections that is controlling the speed of the engine, the consumption of the engine and the fuel rack position calculation. Vol. 5(3), Sept. 2020. 151-163  (pISSN: 2541-5972, eISSN: 2548-1479) 156

Figure. 5. Engine Control Block
From the input speed block in the left corner of the figure, the speed of the engine is controlled. Then it goes to the controller for the fuel rack. All the ramps in the left section are an array of ramps that are used to generate a similar situation of dynamic operation. The main input is the ramp called the Input Speed block. The two other ramps, which is called the SpeedChange1/2, are used to add the change of speed during dynamic operations. If the operation is in static operations, then the two ramps can be used by changing the value of the input into zero. This will create no change in the initial input of the speed by the top ramp.

Figure. 6. PI Controller
By changing these values, the injection of fuel rack results will be more similar to the real measured data. Then there is another input in the left, which is the engine omega or angular velocity of the engine in the crankshaft. This value is important because it will also be used in the consumption formula.
The consumption formula is located in the top section of the figure. The whole blocks and connection of the formula is a translation from the mathematical model. The mathematical formula for the consumption is (1)

• Load Control block
The second block is the load control block. Inside the block, there are set of subsystems and connections which are controlling the load of the engine, the torque reference, and the inputs of torque reference.

Figure. 7. Load Control Block
There are three subsystems in this block. There is also this manual switch, which can be operated manually to change the connections between the blocks. There is a constant value of Tin, which is very useful for low-speed International Journal of Marine Engineering Innovation and Research, Vol. 5(3), Sept. 2020. 151-163  (pISSN: 2541-5972, eISSN: 2548-1479) 157 operations because this model have a characteristics to calculate the torque based on the gain of the speed. This means that if the operating points are in the low end of the speed curve, the torque will be less than expected. Therefore a constant input of torque is a more suited option for this matter. If there is sufficient torque, then the load torque will be sufficient so that the power and the consumption match the real engine. However, there will still be minor differences in numbers.
The first subsystem, which is the Load Characteristic Block, will be used to create a propeller curve, which is dependent on the speed of the engine. This subsystem will be useful for static operating points where there is no change after a certain speed is achieved. This certain block is the reason why there is a need for a constant input of torque instead of a speed-dependent torque block. This speed-dependent torque is called engine rotational torque. This torque is what causes the crankshaft to turn. The basic theory behind this is that the torque equals force multiplied by the radius or length of the arm. This force is based on mass multiplied by acceleration. So if the acceleration is high, the torque will also increase. (2) The next subsystem is the torque reference, which controls the torque gain for a certain amount of time. This subsystem consists of a step input, a ramp function, and a constant input of initial torque. This initial torque is calculated in the .m file. This block is mainly used in the dynamic operating points because it can change the torque reference according to the desired amount in a certain span of time. This is the aim of the dynamic operation.
The control valve block is the third subsystem in this block. This subsystem consists of the controller of the torque itself. Within this subsystem, there are a PI controller, ramp function, and valve angle output. The PI controller is the same composition as the controller from the engine controller block. The difference is the value of the input in the controller. For this block, the inputs are Iload and Pload. These inputs can be found in the .m file.

• Engine process block
The next block is the engine process block. Inside the block, there are a set of subsystems and connections that is controlling the process of the engine itself. This process includes the losses calculation, the burning process, and the efficiency calculation, and the engine torque itself. These calculations mainly have inputs from other blocks that have been explained before. Inputs for the etacv_max constant block in the left corner is calculated in the .m file.

Figure 8. Engine Process Block
The consumption value is from the engine control block. The consumption times the calorific value of the fuel will result in energy for the operation. This energy is used to determine power. The efficiency times the consumption will result in power. In short, the formula should be, (3) Then the power of the engine can be calculated. The formula is, (4) From the brake power, the calculation of the torque can be done. The formula for power in terms of torque is, (5) Therefore, the torque can be calculated by using the same formula which is changed to, (6) The next important thing in this block is the Losses and Efficiency block or subsystem. This subsystem contains the whole calculation for the efficiency and losses. The calculation for the efficiency of the engine can be seen in the figure below. The explanation of each block in the figure can be found in the explanation about the .m file.

• Inertia block
This block controls the angular velocity of the engine, the angular velocity of the shaft, and shaft power. The input of this block is the engine torque from the engine process and the torque load from the load controller block. These inputs will be used to calculate the angular velocities and shaft power. On the left side, there are two inputs, which are the actual torque of the engine and the actual torque of the break. This break is equipment to transfer the torque from the engine crankshaft to the measurement equipment. This is because there is no way to actually measure the torque directly in the crankshaft while the piston is pushing it down. Therefore the system will be using a two-mass configuration. This two-mass system requires another inertia factor so that the system can run as similar to the real engine. The first part is the engine inertia. This is not modified much because the model already uses this in the previous block configuration.
There is an addition of a brake inertia block. This block is similar to the diesel inertia block, but the difference is at the inertia of the part itself. For the engine inertia, the value is 45 kg.m2, but at the break inertia, the value is 3.6 kg.m2 (6). Another added part is the stiffness block. This is to represent the elasticity of the coupling that connects the two mass of inertia. This stiffness will be a load input to the engine inertia, but for the break inertia, it will be the source of input. This way, the actual system as the coupling is done.

B. Model Development
The model for this thesis is running as a model, but it is still not similar to a real engine. In this case, the engine that is used for comparison is the engine in the laboratory of the University. To create a similar running process from the model, some adjustments must be made.

• Structural Change
The first model is different from the model that is currently used in this thesis. It has been modified by changing some blocks and even adding other blocks to create a more similar results from the simulation. The first change that was made was changing the way the losses of the engine to be calculated. In the first model, the losses for the incomplete combustion are included in the losses system, but this can be simplified by separating the incomplete combustion losses to be another type of losses. Therefore the accuracy of the calculation is increased. And then the whole incomplete combustion is not affecting the calculation of the efficiency anymore, but it is added to the total losses, which will be used to subtract the power to get the real usable power.

Figure. 11. Incomplete Combustion Losses
Then the engine control block also gets a modification. First, there is a problem with the fuel rack position being too low for the whole process. In the first model, the consumption is calculated in the engine process block, which gets its input by the flow rate or, in this case, the fuel rack for the model. But this is not exactly true, because the flow rate is not equivalent to the fuel rack position. This problem is solved by adding the new formula to the model. And this formula is the calculation of the fuel consumption itself. In this formula, the fuel rack is used to calculate fuel consumption. Therefore the value of the power and torque are more similar to that of a real running engine. This consumption formula is explained in the chapter above regarding the engine control block.

Figure. 12. Consumption Formula Block
After the engine control block and the losses block is modified, there is another block that is modified. It is the inertia block, which previously uses a one-mass system. This block originally is meant to measure the initial torque that the piston gives to the crankshaft directly. But in reality, there is no way to measure this value. Instead, there is another system that is coupled with the crankshaft. This system is called the brake system-this way, the torque can be measured. Therefore the model is modified to use a two-mass system for the inertia block. The whole explanation of this two-mass system is already explained in the previous chapter about blocks and connections.

• Parameters Change
The model can be modified as it is because there are some trials and errors that have been made. From the first model, a simulation is done, and by that simulation result, it is compared to the measured data. From this comparison, then the model can be adjusted accordingly. The parameters are also one of the key factors for this process to succeed. Parameters such as RPM input, input torque, losses constant can be changed accordingly based on the operation points that are being analyzed. This is why, for the first step of the model modification, these are the parameters that are frequently changed other than the changing of the structure of the model itself.
An example of why the parameters need to be changed is the basic behavior of this model. This model is based on the energy balance theory. Therefore the power and torque created are related to the losses that are present in the model itself. If the power or torque is not adequate, then the consumption and fuel rack position will also be affected even though the engine speed is already the same as the desired value.
When the static operation is stable, and the data match the measured value, the next step is to simulate the dynamic behavior of the engine. The first task is to get the right parameters so that the simulation will behave dynamically. The dynamic operation has a certain graph characteristic. This characteristic is what the modification will be aiming for.
The controller parameters are going to be changed accordingly to the operating points. Pcontr or Pload is the input for the Kp block. And the Icontr and Iload is the input for the Ki. Kp is the proportional gain of the controller, while Ki is the integral gain of the controller. The Kp basically will regulate the speed of the rise time of the graph, and the Ki will regulate the overshoot and the oscillation after the overshoot. These two, Kp and Ki is the basic controller variables that are used for the PI controller. The basic formula for such PI controller is, (7) In the formula above, the variable [s] is for some integral value, or in other words, the error value, which will be used as an integral value. This integral formula is already added to the model as an integrator block. The table above is explaining what the Kp and Ki actually do in a certain graph. While the Kp is getting higher, the rise time or the time for the process to get to the desired point is decreased. Therefore the ramp or graph will slightly tilt to the time axis. It is the same for the Ki, but because Ki is an integral, therefore the time to get to the desired point will not be affected as much. Instead, the overshoot from the graph will increase significantly. The oscillation is located after the overshoot. While the Kp will not affect the oscillation greatly, it will still be a difference in the period of the oscillation. The Ki, on the other hand, will affect the oscillation greatly, because if the Ki is higher, then the oscillation will occur in a shorter period of time. Which will result in a more unstable graph after the overshoot?.
There is a method for PI controller development. It is called the Ziegler-Nichols method. This method starts by reducing the Ki or the integral gain to zero and then increasing the Kp or the proportional gain until it generates a constant oscillation. Once the graph is constantly oscillating, the Kp value of that operating point will then be called the ultimate gain (Ku). Then the estimated Kp value for the model should be about 0.45 times the Ku. After the Kp value is obtained, the Ki value will be increased steadily until the desired data is acquired. (7) When using the Ziegler-Nichols method, the model is slightly modified to accommodate the needs of the controller. Due to the existence of another controller beside the engine control unit, then the other controller, which is the load control, must be turned off. This can be done by adding a limitation at the end of the controller, which limits the output to a certain value as constant. Therefore the controller will act as if it is off. This way, the load control will not affect the engine control. After that, the engine control inputs will be changed according to the method. First, the Ki will be turned to zero. Then the Kp will be increased from zero to a certain value until the graph is constantly oscillating. The value that is achieved is 3. This represents the Ku or the ultimate proportional gain. Then according to the theory, the Kp should be 1.35. By this value, the Ki is increased until the desired graph is achieved. For this matter, the value of the Ki is changed to 0.08 at first.
But when the load controller is turned on, the graph starts to oscillate once more. Therefore some changes in  161 the controller input, both in the engine control and the load control, should be done. But especially in the engine controller, the input should be changed in accordance with the calculated value so that it does not differ too much from the first value.
To analyze this matter, an excel sheet which contains the measured data and the graph created from that measured data is necessary. The data from the Simulink will be logged into the excel sheet and then be compared with the measured data. This way, the process will be easier.

C. Analysis of Data
The static operation data is compared with measured data, which have some static points. The model is developed based on the result of this comparison.

Figure. 13. Torque Comparison
The aim of the model is to achieve static operating points, which are the constant values in the red area. Other graphs will give some overshoot even though this is a static operation. This is due to the controller of the engine is still not analyzed and developed. Further development of the controller will be done in the dynamic operating process.
While there are some similarities in the static operations, the static operation is only a stepping stone to get a dynamic processing model. Nevertheless, there are some differences and setbacks in the dynamic operating model. In this passage, an overview of what the results are from the simulation, and the reason for such behavior will be explained.
As a comparison, the graph which is showing the whole measured data are used. From this graph, there are some minor flaws that are present. The first is the way the RPM behaves. This RPM ideally should behave as what the RPM reference gives. But in this graph, there is a little delay over the RPM. The light blue line is the measured RPM, and the green line is the RPM reference. As it is shown, the RPM did not go down as soon as the RPM reference input goes down. This matter appears while the simulation in dynamic changes is done. Therefore the results of the simulation will not be the same with the measurement because the simulation generates an RPM data that follows the RPM reference precisely. This concludes with an assumption that the RPM measurement data is delayed because of delayed measurement equipment in the real engine.
Other problems arise when the controller and the new inertia block is added. The first problem is that the controller seems to have run at a much faster pace. This leads to a faster response in the controller to achieve the desired value of operating points. This behavior leads to a seemingly constant process, while, in reality, it should still be in the dynamic process. As the figure shows, the black area is not as high as the simulated data. In the simulated data, the controller works so fast that the correction to become the desired value is done before the other dynamic change can occur.
From these two behaviors, an assumption is made on what is causing such behavior. The assumption is that it is simply a delay in dynamic behavior, and the controller needs more research and development. This assumption results in another idea of changing the parameters of the controller.
The controller parameters are the Kp and Ki. These parameters are changed once more to achieve the desired graph. For the engine controller, the Ki is changed to 0.15. This is in the hope that the oscillation will increase, therefore reducing the speed of the controller to achieve results. On the other hand, the Pload is changed to 1, and the Iload is changed to 1.05. This is also in the hope of reducing the speed of the controller. Other than that, the interval of the dynamic change is also reduced. This is only for the experimental process to determine whether the controller will achieve the desired value.

IV. CONCLUSION
1) The development of the engine model starts with a comparison of the simulation and the measured data. This way, the model flaws can be spotted. From these flaws, the change first is the loss parameters. Then there is an addition of a fuel consumption formula. From this formula, the fuel rack position and the consumption get better results. After that, the dynamic process begins. The first change is from the dynamic inputs. This input affects the RPM and therefore affects the whole system. From that point, the Kp and Ki of the controller are modified. These controller modifications are done while the inertia block is also being changed. The inertia block is changed from a one-mass system to a two-mass system. With all these changes, the model starts to run as similar to a real engine. By the end of this bachelor thesis, the error margin for the model is currently at 6% in static operations and 8-11% in the dynamic operations.
2) Parameters that are affecting the engine efficiency in this model are, a. The losses of the engine b. The speed of the engine c. The consumption of the engine d. The load of the engine These parameters will also affect each other. Therefore the change of one parameter will lead to a change of the whole system.
3) From the whole research, there are some facts about the consumption of the engine or the model. The consumption is affected by the speed of the engine, power of the engine, and load of the engine. The speed of the engine affected the consumption in a way that the faster the engine runs, the faster the fuel is injected into the engine, and therefore a higher consumption is achieved. The power of the engine also affects consumption. This is because the higher the power, the higher the losses, which means the higher the consumption due to higher demand. What makes the power increase is that the engine has to run faster. Then the load of the engine will also increase the consumption because the higher the load, the higher the power needed to run at a certain speed limit. Therefore the consumption will increase also.