Experimental Study on the Performance of Controllers for the Hydrogen Gas Production Demanded by an Internal Combustion Engine

This work presents the design and application of two control techniques—a model predictive control (MPC) and a proportional integral derivative control (PID), both in combination with a multilayer perceptron neural network—to produce hydrogen gas on-demand, in order to use it as an additive in a spark ignition internal combustion engine. For the design of the controllers, a control-oriented model, identified with the Hammerstein technique, was used. For the implementation of both controllers, only 1% of the overall air entering through the throttle valve reacted with hydrogen gas, allowing maintenance of the hydrogen–air stoichiometric ratio at 34.3 and the air–gasoline ratio at 14.6. Experimental results showed that the average settling time of the MPC controller was 1 s faster than the settling time of the PID controller. Additionally, MPC presented better reference tracking, error rates and standard deviation of 1.03× 10−7 and 1.06× 10−14, and had a greater insensitivity to measurement noise, resulting in greater robustness to disturbances. Finally, with the use of hydrogen as an additive to gasoline, there was an improvement in thermal and combustion efficiency of 4% and 0.6%, respectively, and an increase in power of 545 W, translating into a reduction of fossil fuel use.


Introduction
Hydrogen is an abundant gas in the universe.However, hydrogen is generally combined with other elements or organic compounds.A traditional technique for obtaining hydrogen gas from water is through electrolysis.The use of hydrogen as a gasoline additive to feed an internal combustion engine is an interesting approach to get economic savings, as well as fewer pollutant gases [1][2][3].Compared to gasoline, hydrogen as a fuel extends the service life of the engine and reduces maintenance, since it does not accumulate carbon in the combustion chamber or spark plugs, the resulting gases are cleaner, have a higher explosion power than gasoline, and water vapor is obtained as a result of its combustion.However, the main disadvantage is that hydrogen is not a primary fuel, but is combined with other elements in nature.Additionally, hydrogen is lighter than air and disperses rapidly.Because hydrogen molecules are small, it takes a large amount of energy to compress them.Hydrogen gas escapes easily from deposits.Even using the best tank, there are leaks, as the H 2 evaporates at a rate of 3% daily [4].The implementation of a system to produce hydrogen gas on-demand can solve this drawback.
Some studies have reported vehicle onboard hydrogen production [2,3].However, all of them produce a constant amount of hydrogen which is experimentally determined, and is only valid for one operating point of the engine.Different research on a mathematical model of an alkaline water electrolyzer is presented in [5][6][7][8].The models presented in those works are based on thermodynamic fundamentals, as well as electrochemical and electrodynamic relationships.They are also static models, so they are not suitable for application to control techniques.In the research presented by the authors in [5,9,10], the electrolyzer is considered as a part of a more extensive system (i.e., solar renewable energy systems, wind energy).In these works, the authors proposed control strategies in which they use a static model to determine hydrogen production.
An exhaustive investigation of the existing models for the low-temperature electrolysis systems was carried out in [8].In this work, two main modeling approaches stand out: the static approach, which is a mathematical description of the polarization curve of electrolysis cells; and the dynamic approach, which allows the linking of internal phenomena (double layer capacitance, diffusion process, etc.).The author concluded that there are no control-oriented models for the electrolysis process.
Model predictive control (MPC), after proportional integral derivative (PID) control, is one of the most commonly used control methods in different industries.The main advantage of the MPC controller over other control methods is its capability of controlling a wide variety of processes, from the simplest to the most complex.Aguilar et al., (2016) [11] presented the design and application of predictive control for the water discharge that enters an irrigation channel.In this work, it was reported that predictive control had a better performance than a PID.A predictive control algorithm based on a static mathematical model of an electrolyzer was reported by [12].The objective of the control algorithm is to maximize the production of hydrogen by electrolysis, taking into account the limitations of available power and the operational constraints of the system.The results confirm a high hydrogen production obtained from the available power of renewable energy sources and a reduced number of on/off cycles.
For the design of model-based control systems, dynamic mathematical models are required to describe the dynamic relationships between process variables.In general, an electrolyzer is modeled using static, electrochemical, and empirical equations.As indicated in the literature analysis presented above, there is a lack of dynamic models for the control of electrolytic systems for the production of hydrogen gas on-demand.Therefore, the novelty of this work lies in its proposal of the design of controllers based on an identification system that involves the dynamic and static parts of the electrochemical system, with the purpose of producing hydrogen gas according to the sudden demands required by the internal combustion engine.In this work, a linear predictive control scheme and a discrete time PID controller are presented and implemented in an alkaline water electrolysis system based on a model identified using the Hammerstein identification technique.

Materials and Method
For this research, an alkaline water electrolyzer and a NISSAN internal combustion (IC) engine were used, located at the Centro Nacional de Investigación y Desarrollo Tecnológico (CENIDET) in Cuernavaca, Morelos, México.The electrolyzer was composed of 12 cells connected in series, with a distance between the electrodes of 0.8 cm.The area of each electrode was 289 cm 2 , the electrolyte used was 30% wt potassium hydroxide.The details of the internal combustion engine are listed in Table 1.A schematic diagram of the experiment is shown in Figure 1.  1) to feed the alkaline water electrolysis system (2).The hydrogen produced passes through a bubbler (3) and a flash arrestor (11) to introduce it into the internal combustion engine through the intake manifold.Sensors (4-7) are monitored by the acquisition system (8), and actuators ( 9) and ( 10) are controlled by the engine control unit (ECU).

Instrumentation, Sensors and Acquisition System
To measure the mass hydrogen flow produced by the electrolyzer, an Omega FMA-A2310 (0-15 SLM gas mass flowmeter) was used.For controlling the current fed to the electrolyzer, a PWM (20 kHz) control was developed.The data acquisition system was composed of the NI cRIO-9074 chassis and different data acquisition modules.The NI-9205 module was used to acquire the analogical signals, and the NI-9474 module was used to generate the PWM signal.An NI-9474 data acquisition module was used to implement the controller.A CSLA1CF ratiometric linear Hall effect sensor was used to measure the current fed to the electrolyzer.To measure the pressure inside the electrolyzer, a MPX 5500 monolithic silicon pressure sensor was used.A RTD pt100 temperature sensor was used to measure the electrolyte temperature in the electrolyzer.A MOSFET IRF3205 power transistor was used to develop the power system.
The mass air flow rate entering the internal combustion engine was measured by a Bosch 0280-218-019 sensor, the pressure in the intake manifold was measured by a Piab (0107729) vacustat, the air-fuel ratio was measured by a UEGO 30-4110 sensor, the engine speed was determined by using a rotor plate, and the temperature was measured using an RTD pt100.

Nonlinear Identification Hammerstein Models
System identification is the procedure by which a mathematical model is generated based on experimentally-obtained system data.The Hammerstein model is a cascade block system used to model a system from the knowledge of the input and output variables [13].The first block of the Hammerstein model consists of a multilayer perceptron neural network, which represents the static non-linearity of the plant.The second block of the Hammerstein model contains an autoregressive with exogenous variables (ARX), which characterizes the dynamic effects.Figure 2 shows the schematic representation of an implemented Hammerstein model.Hammerstein structure.The non-linear static block was identified using a multilayer perceptron artificial neural network, and the linear dynamic block was identified using the second-order Auto Regressive with eXogenous inputs (ARX) structure.

Model Predictive Control Law
For the formulation of the predictive control, it is considered that the plant model is linear time-invariant, the cost function is quadratic, and the constraints are in the form of linear inequalities.The complete development of the control law can be found at [14].Based on the state space model, future state variables are sequentially calculated using the set of future control parameters Equation (1).
The output predictions are given by the Equation (2): where The cost function with constraints is proposed by Equation (4): subject to the following inequality constraints: where the data matrices are defined by Equation ( 6): The control law is determined by u(k i ) = ∆u(k i ) + u(k i − 1).

Proportional Integral Derivative Control Law
The incremental discrete PID control law is developed by starting with the continuous algorithm given by Equation ( 7): where u (t) is the input of the control system, k p are proportionality constant, T i is the integral constant, k d is the derivative constant, and e (t) is the error.To implement the PID controller, the continuous PID Equation (7) has to be discretized.To solve the integral component, the trapezoidal integration method was used.Equation ( 8) is given as: where:

PID Tuning
The procedure used for tuning PID controllers consists of locating the closed-loop poles in a specific position-a procedure known as the Persson [15] pole-location method, popularized by Åström and Hägglund [16].
The parameters required by the controller are obtained using the methodology presented in [16].
where τ 1 and τ 2 are the transfer function parameters.

Engine Efficiencies
Thermal efficiency indicates what percentage of the fuel energy is used to drive and overcome pump losses and engine friction.According to [17], the thermal efficiency can be calculated from four variables: crankshaft speed, intake manifold pressure, spark advance, and air-fuel ratio.The parameters used are adjusted experimentally according to the engine used.The polynomials are presented in Equations ( 12)-( 16).For more details on obtaining the parameters, consult [17].
where c 3 are the constants of the polynomials and P m , λ, n and β represent intake manifold pressure, air-fuel ratio, crankshaft speed and crankshaft angle respectively.The combustion efficiency is determined from Equation ( 17), proposed in [18].When using pure gasoline, the term A burn expresses all the elements of combustion which cannot be explained by a simple analysis and which are not related to fuel quality, such as incomplete fuel oxidation which occurs even in optimal circumstances and acquires a value between 0.85 and 0.9.
The relative combustion efficiency dependent on the lambda factor is used to consider reactions outside of complete combustion: According to [18] higher volumetric efficiency has a positive influence on improving combustion efficiency.
However, to account for the influence of hydrogen and to consider what is reported in [19], the polynomial (21) is proposed, where Hm is the mass fraction of hydrogen added to gasoline: Finally, to determine the combustion efficiency considering the addition of hydrogen, Equation ( 22) is used.

Control Strategy
The control strategy consists of using the mathematical model of the electrolyzer.The nonlinear static block is identified with a multilayer neuronal perception network that has two hidden layers, with four neurons each.The inputs are: feed current, temperature, and pressure of the electrolyzer, and the output is the flow of hydrogen gas produced.To reduce the effects of the system nonlinearities, the inverse of the neural network was placed before the system input.In this way, the controller is be able to regulate with a better performance.
The network output can be given by Equation (23): where the subscripts have the following meanings: j is the number of neurons in hidden layer 1, p is the number of neurons in hidden layer 2, k is the number of neurons in the input layer, and i is the number of neurons in the output layer.f is the sigmoid function used in the hidden layer, and f o is a linear transfer function which is used in the output layer.Wi, Wl, Wo, and b j , b p , b i are the weights and biases of the input, output, and hidden layer, respectively.Table 2 shows the parameters of the artificial neural network (ANN) (Wi, Wl, Wo).The model obtained from the linear dynamic block is: For model predictive control formulation, the model obtained from the identified linear dynamic block is used.The constraints are determined from experimental tests and previous knowledge of the system [14].The parameters of the PID controller are obtained by the pole placement method.Due to the system nonlinearities and the fact that both control strategies were designed using only the linear dynamic block so that nonlinearities do not affect the controllers.To reduce the effects of the nonlinearities, the inverse of the ANN (23) is used.
The ANN is a multilayer perceptron.Its input and output are the flow of hydrogen and the current feed to the electrolyzer, respectively.The network has two hidden layers with five neurons in the first hidden layer and four neurons in the second hidden layer.Table 2 shows the obtained parameters (Wi, Wl, Wo).
The control scheme implemented in this research is shown in Figure 3. Figure 3 shows the scheme for determining and controlling the hydrogen production, demanded by the internal combustion engine.Using the MAF (mass air flow) sensor, the air flow through the throttle valve is measured.The total air measured is considered as 1% of the air and divided by 34.33 to determine the amount of hydrogen required by the engine (set-point).The error generated between the hydrogen produced and the demanded hydrogen enters the PID or MPC control, the control action calculates the hydrogen to be produced, and the controller's output enters a neural network that determines the current to be supplied to the electrolyzer.The current applied to the electrolyzer is controlled by the duty cycle of a PWM operating at a frequency of 20 kHz.The gasoline injection is controlled by the engine control unit (ECU).The air flow sent to the ECU is multiplied by 0.99 to prevent more gasoline from being supplied, because the remaining 1% of the air to react with hydrogen is used.
The system's monitored variables were the temperature and pressure.The controlled variable was the hydrogen flow.The manipulated variable was current feed to the IC engine.
For the design of the MPC controller, the prediction horizon and the control horizon were H p = 50 and H c = 1, respectively.The constraints of the control variables u(k) and ∆u were as follows: For the design of the PID control the gains are defined as follows: k p = 2.83, T i = 7.55, k d = 1.94.The pole placement method was used for obtaining the controller gains.

Experimental Tests
This paper presents a comparison of the performance of the two controllers.The following figures show the results of experimental tests of the implementation of an MPC controller and a PID controller in an alkaline water electrolysis system.The purpose of the controllers is to control the production of hydrogen of the electrolyzer to power an unloaded internal combustion engine.It is important to mention that the power supply of the electrolyzer was independent of the electrical system of the engine.For experimental tests, it was considered that 1% of the total air entering the internal combustion engine reacted with hydrogen.The measured amount of air corresponding to 1% of the full air was divided by 34.33 to obtain the hydrogen gas demand required by the engine.
In Figure 4, the mass flow of air induced into the internal combustion engine is shown.The variation of the crankshaft speed during the test was between 900 and 2400 rpm. Figure 5 shows the hydrogen demand, the continuous line represents the hydrogen demand estimated by the mass air flow entering into the internal combustion engine.The variation in the hydrogen demand is due to internal combustion engine speed changes.The dashed line is the hydrogen production controlled by the controllers.At the top of the figure the system response using the MPC controller is shown, the error rate and the standard deviation are RMSE = 1.03 × 10 −7 , and SD = 1.06 × 10 −14 , respectively.At the bottom of the figure, the PID controller response is shown.The error rate and the standard deviation are RMSE = 1.06 × 10 −7 and SD = 1.14 × 10 −14 , respectively, this indicates that the MPC controller has better reference tracking.
Table 3 shows the establishment time it takes for the controllers to reach the reference for each setpoint change.The average establishment time of the MPC controller is 5.8 s, while the average establishment time of the PID controller is 6.8 s.
Figure 6 shows the controller's establishment time for each reference change.The red bar corresponds to the MPC controller, and the green bar corresponds to the PID controller.The last two bars represent the average establishment time of each controller.As can be observed, the MPC had a shorter time, which shows that the MPC controller had a faster response time compared to the PID controller.RMSE=1.03x10 -   SD=1.14x10 -14   RMSE=1.06x10  Figure 7 shows the current supplied to the electrolyzer (or control current) to produce the required hydrogen.During the internal combustion engine speed changes, there were no overcurrents.This indicates that the energy was used efficiently.However, at idling speed, it required a minimum current of between 27 and 30 A, and at speeds of 2400 rpm, a current of between 58 and 60 A was required.To supply the current to the electrolyzer, an energy source independent of the internal combustion engine's electrical system was used.Figure 8 shows the error between the demanded hydrogen and the controlled hydrogen production.For both controllers, the error estimation overshoots were due to the IC engine speed changes.However, once the hydrogen production was stabilized, the error tended to be zero, indicating that the controller was always searching to minimize the error between the hydrogen demanded and hydrogen produced.Figure 9 shows the thermal efficiency of the hydrogen-enriched gasoline (dashed line), and of the pure gasoline (continuous line).As shown in the figure, when the hydrogen-enriched gasoline blend was used, there was a 4% increase in thermal efficiency.This is consistent with the results reported in [20], due to the physicochemical properties of hydrogen.The calorific power of hydrogen is 120 kJ/kg, and it is 44 kJ/kg for gasoline.Furthermore, the hydrogen has a higher flame rate.Therefore, the combustion time is shorter, which reduces heat losses by cooling [17].
Figure 10 shows the estimated combustion efficiency of the internal combustion engine when hydrogen-enriched gasoline (dashed line) and pure gasoline (continuous line) were used.As shown in Figure 10, when the hydrogen-enriched gasoline blend was used, there was an increment of 0.6% in combustion efficiency.This indicates that there was an improvement of efficiency in the fuel burning, which was achieved due to the hydrogen's high diffusibility and burning speed within the combustion chamber [19].Hydrogen's burning speed is approximately six times higher than that of gasoline.Figure 11 shows the engine brake power.The range of engine brake power when hydrogen-enriched gasoline was used was 2.3-6.2kW, and the range of engine brake power when pure gasoline was used was 2-5 kW, depending on the operating conditions of the internal combustion engine.On average, there was an increase in the brake power by 0.54 kW when hydrogen was used.
If the internal combustion engine used pure gasoline as fuel, the fuel did not burn completely, reducing the engine output power.However, if the internal combustion engine ran using hydrogen-enriched gasoline, there was a slight increase in the fuel burning efficiency and better use of energy overall, thus achieving an increase in power.

Figure 1 .
Figure 1.Schematic diagram of the experimental set-up composed of a power circuit (1) to feed the alkaline water electrolysis system (2).The hydrogen produced passes through a bubbler (3) and a flash arrestor (11) to introduce it into the internal combustion engine through the intake manifold.Sensors (4-7) are monitored by the acquisition system (8), and actuators (9) and (10) are controlled by the engine control unit (ECU).

Figure 2 .
Figure 2. Hammerstein structure.The non-linear static block was identified using a multilayer perceptron artificial neural network, and the linear dynamic block was identified using the second-order Auto Regressive with eXogenous inputs (ARX) structure.

- 7 Figure 5 .
Figure 5. (top) Control system response using an MPC controller.(bottom) Control system response using a PID controller.

Figure 6 .
Figure 6.Establishment time of MPC and PID controllers at each change in hydrogen demand.

Figure 7 .
Figure 7. Current supplied to the electrolyzer by the MPC and PID controllers to produce the hydrogen gas required.

Figure 8 .
Figure 8.The error between the hydrogen demanded (set-point) and the hydrogen produced using the MPC (top) and PID (bottom) controller.

Figure 9 .Figure 10 .
Figure 9. Thermal efficiency of the IC engine, using gasoline as fuel and hydrogen enriched gasoline as fuel for each controller.

Table 2 .
Weights for the ANN model and for the ANN model of the inverse block.

Table 3 .
Establishment time MPC and PID controllers.