Model-based on-board post-injection control development for marine diesel engine

: The increasing demands for reducing fuel con sumption and emissions in contemporary technology solutions lead to the use of more sensors, actuators, and control applications. With this increasing engine complexity, the feedback design is complex due to the coupling between inputs and combustion parameters. To be able to design the controller systematically, model predictive control ( MPC ) comes to the scope because of its advantages in the design of multi - input multi - output ( MIMO ) systems, especially with its constraints handling ability and performance in simultaneously optimizing the engine fuel e ﬃ ciency and emission reduction. Multi injection is one of the promising techniques for achieving better engine performance. In this work, post - injection control is implemented utilizing MPC MIMO strategy with the target of exploring the possibility of reducing emissions and improving engine e ﬃ ciency by controlling post - injec tion duration and injection timing. The work ﬂ ow of the MPC controller design from control - oriented model ( COM ) establishing to MPC problem formation and solution meth odology is discussed in this work. Moreover, one contribu tion from this work is the di ﬀ erent implementation angle when compared with the state - of - the - art approaches, where the MPC controller is implemented purely by Matlab Simulink to enable the rapid control prototyping design. The simulation result demonstrated the ability of the controller ’ s tracking performance and showed a preliminary step towards the non linear combustion model - based multi - injection MPC design. The systematic model - based controller framework developed in this work can be applied to other control applications and enables a fast path from design to test.


Introduction
With the increasing demands for more efficient engines and stringent emission legislation (e.g., Tier III, China II), the optimal way of operating the engine is one of the key questions in research. For diesel engine, the fuel injection system is one of the key factors that determines the engine performance. Modern diesel injection system with its ability of injection rate shaping, injection timing, and duration variation offers a more flexible injection characteristics than the traditional one [1,2].
Multiple injection strategy through replacing a single fuel injection event with multiple discrete injection events of reduced size can be achieved using common rail (CR) systems, equipped with the modern injectors. Multi-injection strategy typically includes three phases: pilot injection, main injection, and post-injection. However, the number of injections can be more than 3 in the cases that more than 1 pilot or post-injections are applied. Pilot injection can reduce the ignition delay of the main injection and prolong the combustion duration, which reduces rapid heat release rate and nitrogen oxide (NOx) emissions generally compared with the single injection strategy [2]. Post-injection strategy can effectively increase the mixing to decrease soot and adjust the exhaust gas temperature. That is beneficial for after treatment systems for the re-generation of diesel particulate filters and to activate selective catalytic reduction after cold start. The benefits and effects of multi-injection on emissions, combustion noise, and fuel consumption have been evaluated and discussed in refs [1][2][3]. However, most of the literature regarding multi-injection is from automotive and heavy duty vehicles aspects, and therefore the understanding of multi-injection performance impacts on large bore engines is the key motivation for this work.
However, the multi-injection technology increases the engine control design complexity due to more control variables and coupling relations between control inputs and combustion parameters. Currently, the most common way of diesel engine control is the look-up table-based proportional integral derivative (PID) controller, which can work well for single-input single-output (SISO) systems, but for multi-injection multi-input multi-output(MIMO) systems there is no systematic way for design [4].
In recent years, the optimization-based control technique called model predictive control (MPC) has captured the interest both from academia and industry, because of its ability to deal with (i) multivariable systems, (ii) optimal inputs and, (iii) system constraints [5]. In order to be able to design the controller systematically, optimal control of multiple injections MIMO type of control is considered over traditional SISO controls. Generally, MPC has shown its advantages in MIMO system design, especially with constraints handling and its performance in optimizing engine emissions and fuel economy performance. This fact has also been widely acknowledged in recent years [6][7][8]. Therefore, the main task of this work is to explore the systematic framework for model-based control development and evaluate its performance for post-injection control application. In this work, the workflow of applying MIMO MPC control is explored on a medium speed big bore diesel engine.

Post-injection controller design
The goal of this work is to design a controller, which can maximize the fuel efficiency under the constraint of NOx emission by exploring the possibility of applying postinjection strategy. The fuel efficiency is reflected by brakespecific fuel consumption (BSFC). Therefore, it is desirable to directly utilize NOx and BSFC as the system outputs, and SOI_post (Start of Injection) and Duration_post (Duration of Injection) as the control inputs.
The injector current pulse from Figure 1 indicates that the SOI_main and SOI_post are calculated by considering the injector delay. The injection duration is defined as the difference between the injector current pulse width and the injector delay. In principle, both main injection and post-injection timings and duration need to be considered in the controller design, which means a more complicated controller. Since the total fuel demand is controlled by the desired load, and SOI_main can be predefined or controlled by CA50 controller (crank angle time for burning 50% of the injected fuel) the controller can be designed as follows: Instead of using the timing of SOI_post, the relative distance between post and main injection timing is considered: (1) Instead of post-injection mass, the ratio of post-injection mass to total fuel mass is defined as: Note that the fuel injection duration is directly linked to the injected fuel mass. In this work, the Rpost is within the limit of 0-0.5, so that the post-injection duration is not longer than the main injection. The SOI_main is fixed to a constant timing for simplicity.

Control-oriented model (COM)
The prerequisite for applying MPC controller is the COM, which is computationally efficient yet accurate enough that can be utilized for closed-loop combustion control. Over the past, different models have been developed for diesel engines, ranging from complex computational fluid dynamics (CFD) models [9][10][11] to relatively simple physicsbased [12][13][14], physics and data-driven models [15]. The CFD model can predict the process accurately, however, they are extremely time consuming for COM. Physicsbased model can have good precision, but can also be computationally expensive and difficult to adapt to linear MPC design module, data-driven models can address those limitations, thus an empirical data-driven modeling approach is taken here to obtain the COM by approximating the linear model through experimental data. The cycle to cycle linear model is described in the state space form: where ( ) X k and ( ) Y k are the system states and outputs, ( ) U k is the input. A, B, and C are the system and system input and output matrices.
The COM in this work is defined as: The input variables, i.e., changes of the control signal. Assuming a static relation between system input Y and states X, the A matrix will be an identity matrix. In addition, for simplicity the states of the system are chosen the same as the outputs. Therefore, the C matrix is an identity matrix. Here the post-injection mass ratio is assigned as the system state because in the model Δ Rpost is a control variable and the absolute value of Rpost cannot be guaranteed to be within the constraint. Therefore, one solution is to add Rpost in the system states so that the absolute value can be tracked easily.
The B matrix is the derivatives of X with respect to U: To obtain the engine performance characteristics with respect to the different post-injection configurations, an experiment is conducted on a single-cylinder Wärtsilä research diesel engine with the specifications listed in Table 1.
The engine has a CR fuel injection system. The modern injector is a twin injector, which has one small and one big needle. Benefiting from this setting, it is possible to inject both a relatively small and a big amount of fuel. However, this may also bring more uncertainty to the system because of the injector characteristics differences. Therefore, the minimum injection duration and minimum dwell between injections for both needles are obtained experimentally.
They are also considered when analyzing the experimental result. The required charge air pressure is supplied by an external compressor.
The test is done at nominal speed with full load. During the test, the main injection timing is fixed at a constant timing. Only the dSOI is changing, which means that the post-injection timing is changing. The post-injection duration is fixed at different constant quantities. The duration of the main injection is controlled by the load controller. Table 2 outlines the test plan.
As listed in Table 2, the test for the first four rows are configured to the big needle in the injector, while from the last four rows on the tests are done with the small needle. After analyzing the experimental results, the impacts from Rpost and dSOIP on NOx and BSFC are extracted separately:

MPC controller design
The linear time invariant system from the system identification result is used in the linear MPC design. The concept of MPC is to minimize the cost function at a given time by solving the optimal control trajectory. The MPC cost function J is defined which reflects the control objectives: The core technique in the design of discrete MPC is based on modelling the future control trajectory U Δ . The Laguerre function, which is used to model the difference of the future control signal, is explained in Section 2.3.
The cost function J can be reformulated through the Laguerre function approach as: Finally, the cost function J can be formalized in a quadratic form with respect to the decision variables η that are to be optimized: while ensuring that Δ is the incremental control signal. Q is the weight matrix for the error signal. R is the weight matrix for the control action. Np is the prediction horizon, the total number of time steps that we look ahead in the future from the initial time step. E is the Hessian matrix, and the vector F describes the linear part of the objective function. They can be computed in a straightforward way according to literature, such as ref. [16]. η is the decision variables to be optimized, here they are the coefficients of the Laguerre functions, that are representing Δ dSOIP and Δ Rpost .

Control signal trajectory description
Forward shift operator has been traditionally used to model the future control signal U Δ for the predicted outputs. This results in huge amount of forward shift operations, in the cases of high sampling rate and complicated process dynamics system. This in turn leads to poor numerically conditioned solutions and high computation load [17]. It has been pointed out in the literature [16,18] that in comparison with the conventional MPC to using MPC with the Laguerre functions turns out to have fewer parameters in the optimization algorithm, and the computation load can then be reduced. Specifically, for online MPC application, reasonable accuracy approximation of the control signal with low computation is obligatory. Therefore, in the design of MPC controller, instead of traditional U Δ , Laguerre function ( ) l k m is used to capture dynamic response of the process and it is applied in this work to approximate the control trajectories as described below: where N is the number of terms used in the expansion and c j is the coefficient, ( ) l m j is a set of Laguerre functions, k i is the initial time, m is the future sampling time, and η is the parameter to be optimized. Laguerre function has two parameters that need to be defined: scaling factor a, which is a constraint on the decay rate of the incremental control signal, and the number of terms that defines the number of Laguerre functions used to capture the dynamic response. Since those parameters have strong impacts on the system closed-loop performance and online computational cost, in this work multiple sets of values are tested and in the end the best set is selected.

MPC implementation
The principle of the designed MPC is that at each time step using a moving time horizon window a quadratic programming problem is solved through Hildreth's algorithm within a predictive horizon to obtain the optimal control trajectory by using Laguerre functions [16]. The workflow of a MPC controller development is outlined in Figure 2.
The linear time invariant system from the above-mentioned identification result is used in the linear MPC design. The first step towards the implementation is to do a simulation study. The direct approach is to realize this in Matlab m functions and compare the simulation results.
In this section, two solutions are studied and compared: -Using Matlab standard QP solver quadprog, which utilizes the discrete state-space model from equation (3). -Using the Hildreth's algorithm and Laguerre function to solve the QP problem, where the augmented statespace model from equation (11) is used.
To get the augmented model from the original state space where I and 0 are identity and zero matrices.
After obtaining the augmented model, the following step is to determine the unknown parameters, weight matrix Q and R, prediction horizon Np, Laguerre pole location a and number of terms N , which all are tuneable parameters, to have a fast and steady control response in disturbance rejection and signal tracking. Especially with the parameters Np and N , they not only influence the closed-loop performance but also determine the dimension in the computation. In this work, the state space model is available, so the parameters can be determined by testing in the simulation. The final choices are tested and determined for each input and output as = a 0.2 and = N 7. The prediction horizon is 26 for both cases. In this work, the chosen weighting factors are shown in Table 3.
The controller's tracking performance is evaluated by simulation study during set point changes in NOx and BSFC with the same initial conditions for both cases. The simulation is started when the engine is running at certain steady-state condition. Then the aim is to seek the possibility of reducing fuel consumption under the constraint of NOx emission while not increasing or reducing the NOx and BSFC simultaneously, by controlling post-injection configuration. The results are shown in Figures 3-5. However, for confidential reason, the NOx and BSFC values are normalized and shown in a principal manner only.
As can be seen from Figures 3-5, the response of the controllers is different. The MPC controller with Hildreth's algorithm has an undershoot while the quadprog has a smoother response. This may come from the tuning parameters of a and N which can influence the system response significantly. The cost function in applying standard steady space model (3) is to minimize Δ Rpost and Δ dSOIP , and on the other hand, when applying the augmented model (11) ΔΔRpost and ΔΔ dSOIP are minimized. However, the final steady-state inputs of both controllers are the same: to reduce BSFC and NOx at the same time, a higher fuel amount post-injection is requested at an earlier timing.
Furthermore, the controller performances are compared with each other, and an identical result is obtained as indicated in Table 4 regarding different relevant performance criteria. Table 4 shows the exact result for both cases, which indicates a correct response trending for the MPC controller in reference tracking.

Embedded MPC implementation
The key issues with the implementation of embedded MPC are to construct the QP problem and solve the QP problem in real-time application automatically. This actually refers to one concept of embedded real-time optimization, which is the process of solving the optimization problem automatically without humans in the loop [5]. It is an area of research with great interest with main requirements of utilizing trustworthy method  to get a result by solving the problem with minimum time and memory resource.
To the authors' knowledge, there are a few practical ways to implement MPC. Either one utilizes available software like the Matlab MPC toolbox and Simulink embedded functions, written in Matlab code, or purely in C code. Moreover, in recent years researchers have developed different optimization solvers and code generators as shown in Figure 6 [5]. Although QP solvers have been investigated for some decades and are nowadays well understood, for online control this is still a concern in an engineers' point of view. Moreover, those approaches can either not handle real-time applications, or are limited in flexibility for improving the model, which increases the computational load and creates more work to adapt to the engine control platform. With the automatic code generation ability, using Simulink as a graphical front end to the embedded software stands its way out when compared with other approaches. The target of this approach is to apply the MPC controller to the rapid control prototyping platform Speedgoat.
Speedgoat is a real-time target machine with Intel i7 CPU and a vast range of I/O connectivity and industrial protocols. It is currently used as engine control system in Vaasa Energy Business Innovation Centre (VEBIC) on a Wärtsilä four-cylinder diesel engine. It is expressly designed for Simulink real-time application for a seamless workflow.
The MPC controller is implemented from scratch and it is implemented in Simulink purely, which offers a better way of troubleshooting and computation tracking and provides the quickest possible path from designing to real-time testing on engine. In this Simulink MPC,  Hildreth's algorithm is applied to solve the quadratic problem, because of its ability to automatically recover from an ill-conditioned constrained problem and deliver a compromised solution, which is must for the practical engine operation.
To implement the MPC in Simulink, the first step is selecting the unknown parameters, weight matrix Q and R, prediction horizon Np, Laguerre pole location a, and number of terms N . Those parameters not only influence the closed-loop performance but also determine the dimension in the real-time computation. So for a system with many inputs and outputs, it can be challenging to determine the parameters. The usual working flow is to have the COM available so that those parameters can be determined and predefined. This in turns requires an accurate COM, which in practical application cannot always be guaranteed. Thus, a certain level of flexibility would be beneficial for improving the controller performance. For this reason, some parameters need to have flexible dimension for the possibility of online tuning. On the other hand, variable-sized signals are not allowed in embedded software. The automatic solution can be to have a high accuracy COM and the dimension of the parameters can be fixed or the parameters will have a maximum pre-defined dimension which allows for limited flexibility. Both solutions have been tested in this work, and it turns out that the fixed dimension approach is a better option, since this has better adaptability to controller design modification, while the maximum pre-defined dimension solution increases the computation load also because the dimension checking is needed for all calculations. Figure 7 illustrates the MPC design structure in MPC, where the first part is the intermediate parameter calculation, followed by limitation to the system outputs, control inputs, and control input moves. The next step is to experimentally evaluate the designed Simulink MPC. For the above-mentioned linear state space model, the unknown  parameters are determined beforehand and pre-stored in lookup tables. Because of the hardware fault, unfortunately the Simulink MPC controller is not evaluated experimentally. However, the simulation result is the same as the case 2 in Section 2.4 with the Laguerre function, since they are exactly the same methodology with different ways of coding. However, some experiences gained through the implementation of the controller can be addressed here: -The closed-loop MPC performance is specified by the choice of tuning parameters, which can be challenging. And those parameters' dimensions are configurable which in Simulink is not allowed. Therefore, a solution of pre-defined maximum dimensions is proposed and tested. However, due to its poor adaptability to system design modification, pre-defined dimension is a better choice as a result. And calculation can be done offline and should always be conducted offline, to reduce the online computation load. -The model uncertainty and cycle-to-cycle variation need to be considered to improve the reliability of the MPC controller. -In this work, only one steady-state operating point is investigated. To cover the whole operating range, a set of linear MPC controller, would be required, which can be scheduled in real time based on engine operating conditions. -One contribution from this work is the MPC design from the rapid control prototyping aspect: the whole application is designed purely in Simulink, which offers a clear structure of every computation and provides the quickest possible path from designing to real-time testing.  -The post-injection strategy studied in this work is for MPC concept study. To test the implemented MPC controller, different phenomenon can be used as well. The MPC will be tested on the VEBIC medium speed 4 cylinder diesel engine for the next step.

Conclusion
The increasing complexity of engine system indicates a diversion of more advanced control methodology, such as model-based control, especially with the recent research focus low temperature combustion, where model is a requisite for phenomenon understanding and control strategy design. However, stepping into the model-based control can be challenging with the tremendous theory and practical embedding capability. Therefore, this work demonstrates the workflow of MPC design from a straightforward point of view, on the basis of seeking possibility of reducing fuel consumption and emission simultaneously through the post-injection strategy for marine diesel engine. With a thorough understanding of the MPC problem formation and algorithm study, MPC application development procedure is clarified and feasible rapid prototyping approach is implemented. COM model linearization and identification ensure the ability to estimate the future system responses in high frequency, while the MPC offers the optimal system move to achieve the desired operating condition optimally, simulation study assists in evaluating the controller performance and tuning, and final MPC embedding to Matlab Simulink ensures a rapid control prototyping test.
The simulation result demonstrated the ability of the controller's tracking performance. This work confirms the feasibility of implementing MPC in Simulink environment for rapid control prototyping design, which provides the preliminary step toward the nonlinear combustion model-based multi-injection MPC to reach the goal of engine operating in the optimal condition regarding efficiency, emissions, and engine design limits utilizing multiple injections.
Furthermore, the systematic model-based controller developed in this work provides a convenient framework that can be applied to other complex engine control applications and enables a fast path from design to engine test. Thus, we see this work as a good starting point for the coming new control developments in the future. project. The authors would like to express their gratitude to Business Finland for funding support.

Conflicts of interest:
Authors state no conflicts of interest.