An Energy Consumption Model for Designing an AGV Energy Storage System with a PEMFC Stack

: This article presents a methodology for building an AGV (automated guided vehicle) power supply system simulation model with a polymer electrolyte membrane fuel cell stack (PEMFC). The model focuses on selecting the correct parameters for the hybrid energy bu ﬀ ering system to ensure proper operating parameters of the vehicle, i.e., minimizing vehicle downtime. The AGV uses 2 × 1.18 kW electric motors and is a development version of a battery-powered vehicle in which the battery has been replaced with a hybrid power system using a 300 W PEMFC. The research and development of the new power system were initiated by the AGV manufacturer. The model-based design (MBD) methodology is used in the design and construction of a complete simulation model for the system, which consists of the fuel cell system, energy processing, a storage system, and an energy demand models. The energy demand model has been developed based on measurements from the existing AGV, and the remaining parts of the model are based on simulation models tuned to the characteristics obtained for the individual subsystems or from commonly available data. parametric model by simulation of either the ﬁnal system or from the parameters of the individual models’ elements (components of the designed system). The presented methodology can be used to develop alternative versions of the system, in particular the selection of the correct size of supercapacitors and batteries which depend on the energy demand proﬁle and the development of the DC / DC converter and controllers. Additionally, the varying topology of the whole system was also analyzed. Minimization of downtime has been presented as one of many possible uses of the presented model.


Introduction
The use of electric drives in various types of vehicles is becoming increasingly popular. The growing use of such drives is due to the many advantages of electric motors compared to internal combustion engines. This is particularly evident in closed areas in internal transport where automated guided vehicles (AGVs) are heavily utilized. High torque, quiet operation, and zero-emissions are just some of the advantages over other primitive solutions. However, these vehicles have operational problems such as insufficient work duration and limited ranges. This is caused by the relatively low energy density of the energy sources used in these vehicles. The development dynamics of the basic energy sources used in AGVs, such as lithium-ion batteries, does not indicate that this problem will be solved in the short-term (within the next decade). For this reason, designers are searching for other energy sources that provide significantly higher levels of energy density while having the same advantages by the following types of irreversibles: Activation losses, fuel crossover and internal currents, ohmic losses, mass transport, and concentration losses. The origins and descriptions of these irreversibles, as well as the modeling method, have been previously discussed [4,5]. When creating a simplified model, two points from the activation region and two points from the ohmic region are utilized from the polarization curve. However, for the construction of a detailed model, further data are required, such as the number of cells, nominal Low Heating Value (LHV) stack efficiency, nominal operating temperature, nominal air flow rate, absolute supply pressure, and the nominal composition of fuel and air; these are typically provided in the fuel cell manufacturer's documentation. When it comes to modeling fuel cell dynamics, current step and interrupt tests must be completed for a given cell. The necessary parameters to construct this part of the model are then determined from these tests or can be obtained directly from the manufacturer's data, because they depend on the fuel cell itself. If such tests cannot be performed, the data can be assumed from a recommended range [4]. Occasionally, the fuel cell manufacturer does not provide basic technical data for the FC, and in this case more tests on the system are required to determine a full range of parameters. Other parameters obtained in tests depend on the whole system in which the FC works and its load, and they are specific for a particular configuration of the system.
Other fuel cell equivalent circuit models for passive mode testing and dynamic mode design have been compared in [6]. This comparison includes the following dynamic models: Larmie [7], Dicks-Larminie [5], Yu-Yuvarajan [8], Choi [9], and shows that complex models are not always effective for practical applications. These four dynamic models are used to simulate the power-generating cell, whilst the passive equivalent circuit model represents the fuel cell which is not producing electric power. These models represent the response to an external electric stimulus to determine the condition of the fuel cell. Additionally, in [6], Page [10], and Garnier [11], passive models are compared. The work [6] does not present any relationship between passive mode test responses and dynamic mode performance.
Not all of the fuel cell's irreversibles are relevant under normal operating conditions. While commissioning and rated conditions are the most common conditions, overloading is not a common condition. Some systems do not function under FC operation with such overloading conditions at all. Therefore, irreversibles that affect work under such unusual conditions are not considered or modeled at all. However, sometimes this is needed, and irreversible mass transport and concentration losses must be modeled. A model for mass transport losses in the form of a theoretical model is presented in [12] and in the form of an empirical model in [4]. This model was developed to simulate transport phenomena in a proton exchange membrane fuel cell (PEMFC).
The hydrogen fuel cell is complex and expensive, and in systems with high dynamics of power demand where it is required to supplement such a cell with additional elements such as startup batteries, buffers, inverters/converters, then the whole system needs to be modified to handle a specific load. Testing such a system can be completed using a computer simulation model presented later in the article, but it is also possible to create a physical simulator which is a cheap alternative to testing. Such a solution built based on a programmable DC power supply, control interface, and software written in LabVIEW has been proposed for testing the entire system and acts as a guide in the development of power conditioning equipment [13] with the ability to work in steady-state and transient modes.

Modeling of the System Using a Fuel Cell Stack
To generate energy in FCs, it is necessary to use a hydrogen tank together with a hydrogen pressure reduction system and a control valve mediated by a controller to regulate the amount of hydrogen supplied on an ongoing basis. Oxygen is usually supplied from the air through a fan system to the fuel cell. It is also possible to supply oxygen from a high-pressure tank similar to the whole hydrogen supply system.
For large FCs (larger than 10 kW), the installation of the FC itself becomes very complicated and maintaining balanced operational parameters becomes a problem. These issues are the subject of Energies 2020, 13, 3435 5 of 31 separate research, and balance of the plant (BOP) [14] and incorrect configuration and selection of inappropriate operating parameters of individual elements of the FC system can lead to insufficient cell performance and rapid degradation of the cell. A simple solution to the complexity of the installation on the FC preparation side can be made by using an FC configuration based on a dead-end anode (DEA) structure. This type of installation, unlike the flow-through anode (FTA) configuration, significantly simplifies the need to prepare hydrogen and guarantees the appropriate humidity of the cell, ensuring close to 100% hydrogen use by controlling the (normally closed) purge valve [15,16]. This configuration is popular for low power FCs, but also developed for higher power applications. DEA installations operating differently to FTA are not managed by a regulated control valve and have to be purged periodically by the purge valve [17].
Since the fuel cell itself is an energy generator operating under specific parameters, usually this produced energy must be adapted to the purposes of the energy demand characteristics. If the power take-off is not variable, this system may be simpler, but with high variability of energy demand, it is necessary to consider the electric converter/inverter and energy buffer supplied via batteries or supercapacitors. Supervising the work of these devices can take place at various levels, most often at the basic level through ongoing control of the parameters of individual devices, and frequently at the strategic level by adapting the operating parameters not only to the ongoing demand but also to future demand.
Modeling the power supply load is a separate problem. A power supply load model takes the form of a specific load profile based on the behavior of the powered system and optimized with measurements taken during the experiment or by considering physical phenomena, e.g., a model outlining the dynamics of a moving object. The choice to develop this model depends on the design phase. If one has a prototype or physical copy of the system required to be powered, one can choose the first solution, but if one only has the concept or accurate documentation, the second solution is needed. Interesting solutions can be found in various works for modeling system fragments or the entire system oriented at determining specific parameters. An example model for a complete power supply system for hybrid vehicles is described in [18]. The modeled system consists of a hydrogen power supply, DC/DC converter, battery, inverter, electric motor, and the vehicle body. A complete model of the system was developed based on the experimental data. The model was then used to develop a power management control algorithm for fuel cell hybrid vehicles using a stochastic programing technique. This approach requires a complete system which can be subjected to a series of experiments. Another approach is to use model-based design (MBD), where a model is created at the design and concept stage, and numerical simulation experiments outline various potential solutions and determine the impact of various parameters on the system's performance (sensitivity analysis), or to formally optimize the system or its components [1,2].
Improved modeling of the Proton Exchange Membrane (PEM) fuel cell power stack for electric vehicles in which a separate oxygen tank supply system was used to improve performance is presented in [19]. Simulation calculations were oriented towards finding an optimal control strategy for the pressure that facilitates the output power according to the power demand of the load.
In addition to the holistic approach to modeling the hydrogen fuel cell system, researchers are interested in individual elements of the system. Furthermore, the hydrogen cell itself, with a series of tanks, controllers, control valves, and fans supplying air, may include power electronics which process and adapt energy to meet demand from energy buffering units, including various types of batteries and supercapacitors. Regulators and controllers are indispensable to these units and operate at various levels, and often operate with a complex strategy for a given application.
Selecting the power electronics for the FC's energy conversion system is quite a difficult task. The situation is additionally complicated by the fact that the energy-receiving system requires the conversion of energy to different voltages, types of currents, and their power simultaneously. We chose to only focus on work completed on general modeling of energy flow and power losses, not energy-electronic phenomena or their modeling. Therefore, only models for average value converters were assessed, and those cooperating with basic energy buffers and thus implementing alternative strategies of constant current and constant output voltage were analyzed. There are no universal solutions to control of energy flow because the characteristics of the energy demand received from FC are application dependent. The selection of elements of the entire FC system is of interest to many scientists. An essential element in the system is the boost converter. A simple model of the cell as an electrical circuit has been previously described [20]. The model, taking into account a portion of the irreversibles appropriate to the nature of the application, is used to select the suitable type of DC/DC boost converter and to select the parameters of the energy storage constituting the energy buffer which compensates for rapid changes in energy demand. Various connection options (behind or before the converter) of the supercapacitors are also discussed.
For energy buffers, there has been significant progress in the development of the latest types of batteries. The multitude of solutions is not conducive when making optimal decisions, especially at the development stage of the system. Therefore, simple battery models using the most popular battery types are used. The basic battery models are lithium-ion, lead-acid, nickel-cadmium, and nickel-metal hydride [21], and their various parameters are also defined, including charge and discharge, temperature effects, and ageing. This enables the modeling of various connections cells in series and/or in parallel [22][23][24][25].
A "Theoretical Modeling Methods for Thermal Management of Batteries" review has been previously completed [26]. In addition to typical models, various new approaches are presented, e.g., in [27,28].
In [27] a novel lumped electrothermal circuit of a single battery cell was presented, including the extraction procedure of the parameters of the single-cell from experimental evidence and a simulation environment, given in SystemC-WMS for the simulation of a battery pack.
In [28] a new open-circuit voltage (OCV) model is proposed. The new model can simulate the OCV curves of a lithium iron magnesium phosphate (LiFeMgPO 4 ) battery at different temperatures. It also considers both charging and discharging. The most remarkable feature from the different models, in addition to the proposed OCV model, is their integration into a single hybrid electrical model. A lumped thermal model is implemented to simulate the temperature development in the battery cell. The synthesized electro-thermal battery cell model is extended to model a battery pack of an actual electric vehicle.
Typically, the problem of choosing a buffer system includes what type of energy buffers will be selected, the size of the buffer, and the features of individual parts (batteries, supercapacitors). Buffer hybridization is a common solution which involves a combination of a supercapacitor with a battery and is outlined in [29]. Various configurations and sets of supercapacitors and batteries together with DC/DC converters are discussed in several papers [30][31][32]. The correct selection of the buffer parameters and the topology of this system allows one to overcome most of the FC's weaknesses. Selecting the optimal parameters and topology for these subsystems in the FC is important, as the FC is strongly dependent on the energy demand characteristics in the system [30,32].
Modeling supercapacitors (SC) requires consideration of the electrical, self-discharge, and thermal behavior. A comprehensive review of the modeling techniques is described [33][34][35] The equivalent mathematical model derived from the electrical model, which was used to simulate the voltage response of the supercapacitor, is presented in [33].
The review presented in [33] discusses SC modeling, state estimation, and their industrial applications, intending to summarize recent research progress and stimulate innovative thoughts for SC control/management. For the SC modeling, state-of-the-art models for electrical, self-discharge, and thermal behavior are systematically reviewed, where the electrochemical, equivalent circuit, intelligent, and fractional-order models describing the electrical behavior simulation are highlighted. For SC state estimation, methods for state-of-charge (SOC) estimation and state-of-health (SOH) monitoring are covered, together with an underlying analysis of the ageing mechanism and its influencing factors. The models which are described in the literature have various advantages and disadvantages, ranging from the ease of use down to the complexity of characterization and parameter identification. Work presented in [35] presents a comprehensive review and compares these models, specifically focusing on the models that predict the electrical characteristics of double-layer capacitors (DLC), showing the strengths and weaknesses of different available models and their various areas for improvement.
Experience in implementing the various applications of the hydrogen fuel cell system is very helpful when designing a complete system. One can find many interesting descriptions of applications with different degrees of maturity and covering both stationary and mobile applications in ground, water, and aerial vehicles. Research has described the various aspects of the whole system and its hybridization [36][37][38][39], current energy management and energy management strategy [40][41][42][43][44], energy control and processing [45,46], optimization of power systems based on fuel cells for matching operational parameters [47,48], power transmission in hydrogen cell-powered propulsion systems [49], and general aspects of the development of hydrogen cell-based systems [50,51].

Model of Energy Transfer in the System
A general methodology for building an energy transfer model enabling simulation experiments when designing a hybrid power supply (HPS) system based on a hydrogen cell stack for an AGV is shown in Figure 1. Experience in implementing the various applications of the hydrogen fuel cell system is very helpful when designing a complete system. One can find many interesting descriptions of applications with different degrees of maturity and covering both stationary and mobile applications in ground, water, and aerial vehicles. Research has described the various aspects of the whole system and its hybridization [36][37][38][39], current energy management and energy management strategy [40][41][42][43][44], energy control and processing [45,46], optimization of power systems based on fuel cells for matching operational parameters [47,48], power transmission in hydrogen cell-powered propulsion systems [49], and general aspects of the development of hydrogen cell-based systems [50,51].

Model of Energy Transfer in the System
A general methodology for building an energy transfer model enabling simulation experiments when designing a hybrid power supply (HPS) system based on a hydrogen cell stack for an AGV is shown in Figure 1. Conducting simulation experiments requires the definition of the HPS system in the AGV. Since these vehicles are designed for close repetitive transport operations over long periods and have known operating conditions, i.e., speed and load, one can adapt the HPS system to individual needs, such as the demand for instantaneous power during a specific operating condition. At this stage, the criterion for assessing the designed HPS system should also be determined. For the next step, it is necessary to measure and identify the instantaneous power demand by the AGV at different operating conditions. These measurements should include the power demand for expected operating conditions over the planned route. From this, work can be completed on the data preprocessing, modeling, and validation of the models representing the power demand. These models are identified Conducting simulation experiments requires the definition of the HPS system in the AGV. Since these vehicles are designed for close repetitive transport operations over long periods and have known operating conditions, i.e., speed and load, one can adapt the HPS system to individual needs, such as the demand for instantaneous power during a specific operating condition. At this stage, the criterion for assessing the designed HPS system should also be determined. For the next step, it is necessary to Energies 2020, 13, 3435 8 of 31 measure and identify the instantaneous power demand by the AGV at different operating conditions. These measurements should include the power demand for expected operating conditions over the planned route. From this, work can be completed on the data preprocessing, modeling, and validation of the models representing the power demand. These models are identified based on data from instantaneous power measurements at various operating conditions. Based on a set of such models, it is possible to simulate the power demand for the new AGV route and other operating conditions. A detailed discussion on this subject is presented in Section 3.1.
Simultaneously, by the defining power demand models, it is possible to create component models of the HPS system. It should be noted that these models of HPS can be identified based on additional measurements or characteristics provided by the manufacturers. More information about creating and identifying component models of an HPS including a hydrogen cell, models of storage components, and other auxiliary components, are described in Section 3.2. To validate the hybrid power supply system model, it is possible to provide the load in the form of played-back real values of instantaneous power demand and creating comparisons, e.g., concerning the current power supply system installed in AGV.
The proposed methodology described herein and in further sections of this manuscript allowed us to design a customized HPS system for operating conditions over a preplanned route. This can be achieved by conducting simulation experiments to find the optimal solution or a set of possible solutions which satisfy defined criteria. The optimal criteria can refer to finding the optimal battery or supercapacitor capacity for the HPS or other objectives. More information on this subject is discussed in Sections 4.2 and 4.3.

A Generic Model for Instantaneous Power Demand
This section describes a generic procedure for building a model to compute instantaneous power demand. This generic model is used to estimate the instantaneous power demand under the AGV's different operating conditions during working duty cycles. The model results are used as a load for the hybrid hydrogen power supply system model discussed in Section 3.2. The use of both models makes it possible to perform different simulation experiments, which allows one to examine different configurations of a power supply system with varying parameters. The generic model for instantaneous power demand is the first part of this model. The presented methodology for building an instantaneous power demand model, ultimately to develop a new hybrid vehicle power supply system, depends on the available data sources. Two possible options defining the data source availability can be distinguished:

•
Variant I: Data which describe the full dynamic model of the AGV are available. In this case, the developed model allows one to implement any scenario of AGV operation and estimate the instantaneous power demand. The data includes all the dynamic parameters of the vehicle including the mechanical system of the vehicle transmission system, the model of the control system, as well as the electric power supply system. It should be noted this is a seldom case and is a time-consuming modeling activity that requires a lot of information about the considered object, i.e., access to information about the dynamic parameters of the vehicle, information about how the vehicle is controlled, including the operation of supervised control system, etc. Unfortunately, some sections of this information are often unavailable due to companies protecting their intellectual property.

•
Variant II: Only data with selected operating conditions are available, such as the speed of individual main drives that accompany the measurements of the instantaneous power demand of the vehicle. It should be noted that the use of this variant is purposeful, especially for AGV which has a limited number of possible settings of selected operating conditions, e.g., rotation speed of drives as well as acceleration and braking ramps. In such a case, it is not necessary to identify the entire domain defined by the space of possible values under the parameters of the operating conditions but only selected characteristic parameters. For the aforementioned values, under a combination of operating conditions, a bank of autoregressive models has been applied. These models are representations of signals which, for selected operating conditions, represent instantaneous power demand for the selected type of vehicle. The main task of the models, in detail, is to:

•
Represent expected values and variance of the instantaneous power demand under selected operating conditions; • Reflect the dynamics of changes in the instantaneous power demand and their frequency amplitude characteristics.

Models for Stationary Conditions
The autoregressive model of the signal [53][54][55] of instantaneous power demand is given by the formula: where y is the instantaneous power demand, is the noise which follows a Gaussian distribution, A q −1 n is a polynomial of the n order represented by A q −1 n = 1 + a 1 × q −1 + a 2 × q −2 + a n × q −n , and E y , Var y are the expected value and variance of the instantaneous power demand. The expected value and variance can be additionally represented by other linear or quadratic functions of f (V, L). To account for dynamic changes in the instantaneous power demand, the model can be represented in the frequency domain [55] using the following formula: where P y e jω represents the power spectral density of the modeled signal. The above model can be applied under stationary operating conditions.

Models for Nonstationary Conditions
Similarly to stationary conditions, a signal model can be built for the nonstationary conditions [55,56]. This applies to parameters such as acceleration, braking, and emergency braking, etc. The model to apply for this case has the following formula: where Tr y is the linear model of the acceleration, deceleration ramp, etc. This part of the model can be determined using a least-squares criterion. En y d is the envelope model established for the signal after removing the trend from the nonstationary signal y d . The model of the envelope can be evaluated for the following signal: where z[k] is a module of an analytical signal obtained using a Hilbert transform [57] and N is a length of the moving average filter. The envelope signal can be represented by a regressive model given by Equation (1). If the envelope is flat and monotonical then a linear model can be used. After removing the trend and by eliminating the second-order nonstationarity resulting from the variable variance, the frequency assessment of the model presented in the Equation (2) can then also be used.

Model Validation
The validation of the model describing the route section under selected operating conditions can be calculated by using the following measures: • Using a training data set to develop the model and validation data y val (k) , the following measures of model compliance can be determined: where t 0 M(k)dt is the energy computed for the signal model, and Er FreqStruct = P y e jω − P y val e jω (6) where P y e jω , P y val e jω are the power spectral densities of the model obtained as an output of the model and the power spectral density of validation data, respectively. The measure determined here is a functional assessment in the frequency domain and it determines the difference in signal power for the frequency components. The selection of the model order is determined, based on the similarity of the power spectral density characteristics, to reflect the dynamics of the signal changes by the signal model.

Combining Models
After validating the individual models representing the signal from instantaneous power demand, a selected scenario can be built which represents the AGV route. Usually, this route is planned and the AGV moves along the route under established operating condition parameters such as speed, load, etc.
Before creating a power demand model for a selected vehicle scenario, it was necessary to divide the scenario into appropriate route sections for which appropriate models would be assigned to generate the instantaneous power demand signals.
An important element when building full waveforms for the entire scenario was the points where the signals of the partial models would be combined. To combine waveforms of the individual models, it is possible to use the following window (Equation (7)), which is a modified version of the window previously shown in [58], the length of which can correspond to the length of the modeled waveforms:

Hybrid Power Supply System Model for the AGV
The model of the hybrid power supply system for the AGV was developed in the MATLAB/Simulink environment partly using the Simscape Electrical library components. This model is a numerical tool supporting the selection of elements for the hybrid power supply system. The block diagram of a hybrid power supply system is shown in Figure 2. The numerical model was built based on this block diagram (Supplementary Materials). This model could be used to optimize the parameters of the power supply system after a specific operation scenario for the AGV is chosen (length and diversity of the route, load, driving dynamics) and after assuming the optimization criteria (for example, minimizing the capacity of the main energy store).
Energies 2020, 13, x FOR PEER REVIEW 11 of 31 built based on this block diagram (supplementary materials available at 'www.mdpi.com/xxx/s1'). This model could be used to optimize the parameters of the power supply system after a specific operation scenario for the AGV is chosen (length and diversity of the route, load, driving dynamics) and after assuming the optimization criteria (for example, minimizing the capacity of the main energy store). The electrical energy source in the hybrid power supply system was the fuel cell stack fueled by hydrogen. It was assumed that hydrogen was stored in a metal hydrides tank equipped with a pressure regulator [59]. The flow of hydrogen through the fuel cell stack was regulated by a proportional control valve. The control signal for this valve was generated using a hydrogen flow regulator. This regulator was a component of the fuel cell stack controller. The controller additionally protected the stack against operation from moving outside the safe operating range of the electrical and thermal parameters. In addition, the fuel cell stack controller contained the SCU (short circuit unit), which periodically short-circuited the stack and improved its performance [60]. Due to the operation of the SCU, it was necessary to install an auxiliary supercapacitor in the system, which maintained the supply voltage for the duration of the stack short-circuit, and additionally provided an energy buffer for rapid changes in the load current of the stack when the stack was not able to impulsively provide adequate power due to limitations imposed by its own dynamics and the hydrogen fueling system dynamics.
Electrical energy from the fuel cell stack was supplied to the main AGV power busbars through a DC/DC Constant Current -Constant Voltage (CCCV) converter working at a Constant Current (CC) or Constant Voltage (CV) output, where the output current setpoint for CC mode could be invariable or could be set by the stack load power regulator, which was part of the converter control system. The method for determining the output current setpoint depended on the configuration of the hybrid power supply system used and the method of its optimization.
A lithium-ion battery or supercapacitor could act as the main electrical energy storage. The The electrical energy source in the hybrid power supply system was the fuel cell stack fueled by hydrogen. It was assumed that hydrogen was stored in a metal hydrides tank equipped with a pressure regulator [59]. The flow of hydrogen through the fuel cell stack was regulated by a proportional control valve. The control signal for this valve was generated using a hydrogen flow regulator. This regulator was a component of the fuel cell stack controller. The controller additionally protected the stack against operation from moving outside the safe operating range of the electrical and thermal parameters. In addition, the fuel cell stack controller contained the SCU (short circuit unit), which periodically short-circuited the stack and improved its performance [60]. Due to the operation of the SCU, it was necessary to install an auxiliary supercapacitor in the system, which maintained the supply voltage for the duration of the stack short-circuit, and additionally provided an energy buffer for rapid changes in the load current of the stack when the stack was not able to impulsively provide adequate power due to limitations imposed by its own dynamics and the hydrogen fueling system dynamics.
Electrical energy from the fuel cell stack was supplied to the main AGV power busbars through a DC/DC Constant Current -Constant Voltage (CCCV) converter working at a Constant Current (CC) or Constant Voltage (CV) output, where the output current setpoint for CC mode could be invariable or could be set by the stack load power regulator, which was part of the converter control system. The method for determining the output current setpoint depended on the configuration of the hybrid power supply system used and the method of its optimization.
Energies 2020, 13, 3435 12 of 31 A lithium-ion battery or supercapacitor could act as the main electrical energy storage. The reasons for using electrical energy storage (as energy buffer) together with the fuel cell stack, in traction applications, were the large fluctuations in the power demand and the need to accumulate energy from regenerative braking. The energy storage, in this case, complemented the deficiencies of the fuel cell stack, meaning the stack was not able to increase the output power impulsively, had limited peak power, and was not able to absorb braking energy. The nature of the fuel cell stack was rather dedicated to independent work in stationary applications. In traction applications, an additional energy storage device was necessary [30][31][32].
There was a management system between the main power busbars and the main energy storage, the primary role of which was to protect the energy storage against operation outside the safe range of electrical and thermal parameters. The management system also allowed for pre-charging of the main energy storage with energy from the fuel cell stack after starting the hybrid power supply system, which was needed when the supercapacitor acted as the energy storage. It was assumed that the energy storage could also be charged from an external energy source, depending on the adopted configuration of the hybrid power supply system and the scenario of the AGV operation.
While developing the numerical model for the hybrid power supply system, assumptions were considered from the practical conditions or were the result of previous preliminary analyses. The initial selection of the fuel cell stack was guided by the average power demand of the AGV and from economic criteria. The cheapest fuel cell stack was selected that would meet the AGV requirements according to preliminary estimates. It was assumed that a horizon fuel cell stack, type H-300, with 300 W power, a rated voltage 36 V, and rated current of 8.3 A would be used [61]. This stack consisted of 60 PEM fuel cells connected in series, low-temperature operation, powered by hydrogen from the pressure tank and oxygen obtained from atmospheric air. The nominal efficiency of the H-300 stack was 40%. This was a low power fuel cell stack that had a very simple "balance of plant" structure. The stack was equipped with three fans that provided cooling to the stack with a suitable amount of the air. The fuel cell stack was equipped with a factory controller that regulated the rotation speed of the fans by supplying them using the Pulse Width Modulation (PWM) method, and which controlled the hydrogen two-state valves. This fuel cell stack with factory controller functioned as a dead-end anode stack [15,16] without external humidification and hydrogen recirculation. It was assumed that the functionality of this controller could be extended to meet the needs of the power supply system under development by controlling the proportional hydrogen valve for flow-through anode operation [17], which was included in the numerical model. The presented numerical model was primarily used to determine the flow of electrical energy in a hybrid power supply system, so several simplifications were assumed when developing this model. It was assumed that the fuel cell operated at a constant temperature and the airflow from which oxygen was extracted was always sufficient, regardless of the power load of the cell. The assumption regarding airflow was also fulfilled for the modeled fuel cell in the absence of external restrictions, which has been previously determined [62], where it was stated that even with the smallest used fan efficiency the cell worked with an air excess coefficient of~20. Both thermal phenomena occurring in the hydrogen tank and the hydrogen release dynamics from the metal hydride storage were not taken into consideration. It was assumed that the hydrogen in the fueling system always had sufficient pressure to achieve the required hydrogen flow. Additionally, thermal phenomena in other elements of the power supply system were deemed to be negligible, assuming that they worked in optimal and constant thermal conditions. The phenomena related to the pulse operation of power electronic devices in the DC/DC converter were also not taken into account together with any ageing of the lithium-ion battery.
It was assumed that an external energy source was required to start the hybrid power supply system, ensuring the power needed to start the fuel cell stack and the stack controller, especially when the main energy storage was discharged. A low-capacity start-up battery could be used as an auxiliary energy source, which, if necessary, could be charged from an external source and, after starting the Energies 2020, 13, 3435 13 of 31 power supply system, could be recharged from the main power busbars. The energy needed to start the power supply system was small; however, the starter battery model was omitted for simplicity.
Modeling of the AGV drive system had been simplified to just model the instantaneous power demand, while the demand for the power of the components of the drive system (inverters, motors) during vehicle movement and related to the operation of the vehicle's control, safety, and signaling systems also had to be taken into account. The instantaneous power demand model for a selected AGV operation scenario was created by submitting multiple data samples obtained during measurements made by a real AGV with different load states and with different operating states, both during steady driving and in dynamic states (acceleration, braking). The data samples were recorded for an AGV powered by a standard (factory) lithium-ion battery that was charged from an external source at the end of the operation. Then the data were subjected to filtering and processing as described in Section 3.1. It was assumed that the instantaneous power demand for a vehicle powered by a standard battery and in a vehicle powered by a hybrid power supply system with a fuel cell stack under the same operating conditions and load conditions was the same. In connection with the adopted method of modeling the AGV drive system, the phenomena associated with switching power electronic devices in the inverters of the vehicle's drive nodes were excluded from the research.
Optimization of the structure and parameters of the hybrid power supply system could be carried out considering various criteria by setting selected parameters for the numerical model and analyzing the obtained waveforms, both utilizing experiments performed by trial and error and by automatic optimization algorithms. Usually, the parameters of the fuel cell stack were assumed at the beginning of the optimization process because the choice of the stack was not very flexible and the rated powers of the available stacks were highly graduated. The choice of energy storage was more flexible, so the parameters of this storage device could be optimized. During the simulation, the ongoing analysis of the selected waveforms of electrical quantities were carried out in terms of exceeding the defined criteria (critical values). This analysis is conducted regardless of the applied optimization method in the numerical model. If such an exceedance occurred during the simulation, then the simulation would be stopped and the model would return an error code that determined which criterion had been violated. A total of fifteen different criteria were defined in the numerical model for the various components of the hybrid power supply system. These criteria are: • For the fuel cell stack: A minimum voltage, maximum load current, maximum load power, and the conditions of long-term power overload; • For the auxiliary supercapacitor: The maximum charging or discharging current; • For the DC/DC converter: A minimum supply voltage, maximum load power, and the conditions of long-term power overload; • For the main energy storage: The maximum charging and discharging current, and the conditions of long-term overload during charging and discharging; • For the main power busbars load model (i.e., the AGV power demand model): A minimum voltage, maximum voltage, and the maximum difference between the achieved power and the required power.
These criteria resulted from the catalogue of real element parameters of the hybrid power supply system and the conditions imposed by the elements of the AGV drive system (e.g., for inverters: The minimum and maximum supply voltage). Not all the criteria needed to be active at the same time. The selection of active criteria depended on which power supply parameters were unknown in the design aid process and which were imposed as project assumptions. For example, if the required minimum DC/DC converter power rating was unknown, then the criteria related to the power overload of the converter was turned off. If a specific DC/DC converter type needed to be used in the design, then in this situation the parameters of this converter should have been treated as project assumptions and the appropriate criteria values in the model were to be set, following the datasheet of the converter. In addition, the model for the hydrogen fueling system analyzed the hydrogen consumption during Energies 2020, 13, 3435 14 of 31 the simulation and returned the appropriate error code if the hydrogen tank was emptied. In this situation, the simulation was also stopped.
The numerical model of the hybrid power supply system defined the allowable voltage range and allowable state-of-charge (SOC) range of the main energy storage. Exceeding the voltage or state of charge for energy storage was not treated as a critical error and did not stop the simulation. However, it affected the way the energy storage worked, which was signaled in the model by the appropriate status signals. If the minimum voltage or the minimum state of charge was exceeded during discharge, the energy storage could only be charged. If with such limited use of energy storage, there was an increased power demand from the AGV model, the voltage of the main power busbars would fall below the criterion value. Similarly, if the maximum voltage or maximum charge was exceeded during charging, the energy storage could only be discharged. If under this condition, the AGV model attempted to achieve a return of braking energy to the energy storage, then the voltage of the main power busbars would rise above the criterion value. Exceeding the criterion values of the main power busbars voltage was treated as a critical error and stopped the simulation by returning an appropriate error code. In this situation, the error code had to be analyzed together with the main energy storage status to detect the reason for stopping the simulation.
The simulation model developed in the MATLAB/Simulink environment was built according to the block diagram shown in Figure 2. In addition to the blocks outlined in Figure 2, it also contained elements that allowed one to record the simulation results in the MATLAB for automatic optimization, and it also contained elements that allowed an ongoing view of waveforms, important parameters, error and status signals for the trial and error experiments.
To model the fuel cell stack, a block from the Simscape Electrical library was used, which is described in detail in [4]; the addition of concentration or mass transport losses in accordance with the method presented in [5] was applied. The losses of concentration or mass transport ∆V trans are described by the equation: where the coefficients m and n are selected experimentally and I FC is the stack load current. To tune the model for the fuel cell stack's activation area and load losses (ohmic losses), the results of measurements completed on the real H-300 stack and the genetic algorithm were used. During measurements this stack operated as a dead-end anode with the factory controller. In addition, the concentration losses model was experimentally tuned to obtain the appropriate stack voltage drop when overloaded. The thresholds for stack voltage and current were taken into account, and when they reached the stack were disconnected from the load by the factory stack controller. The power of the fuel cell stack's own needs ("balance of plant") was modeled as being linearly dependent on the stack load power. The H-300 stack balance of plant was very simple (containing only fans, a controller, and hydrogen valves). However, it would be possible to model the balance of plant for a more sophisticated system, if the power demand characteristics of the components were available.
The fuel cell stack controller model included a hydrogen flow regulator that generated the FFR (ref) control signal for the hydrogen proportional control valve, which determined the flow through the anode of the stack. The principle of proportional control for this regulator was derived from the equations of the fuel cell stack model used in MATLAB presented in publications [4] and [5]. This regulator calculated the hydrogen flow needed to meet the hydrogen needs of the fuel cell stack at a given load current and a given hydrogen utilization. With a set number of cells in the stack, stack temperature, pressure and purity of hydrogen, the control principle is described as follows: where the value of the coefficient C FFR can be determined using the relationships given in [4] or [5]. current I FC(avg) of the fuel cell stack. This regulator ensured the hydrogen flow when the load current in the stack increased dynamically, which in turn ensured the rapid opening of the hydrogen control valve and prevented a voltage drop in the stack. Due to the strong averaging of the stack load current at the regulator input and the dynamics of the control valve (which was modeled by first-order inertia), the setpoint of hydrogen utilization by the stack should have been slightly less than the nominal hydrogen utilization to ensure proper fueling of hydrogen in fast transient states. The nominal hydrogen utilization could be calculated using the stack's rated parameters and relationships, as given in [4]. For an H-300 stack, it was 83%. When starting the hybrid power supply system and its associated transient states, the flow regulator ensured a sufficiently high initial hydrogen flow. The stack controller model contained a stack power demand model (power of its own needs), implemented as an array of values with interpolation that models "balance of plant". This power demand was included in the load model of the main power busbars. The characteristics of an H-300 stack for nominal hydrogen utilization, obtained by the numerical model and tuned based on the results of the measurements are presented in Figure 3.  The "auxiliary supercapacitor" block in Figure 2 also contains the controller that charges the auxiliary supercapacitor in a precise manner during the power supply system start-up to the required minimum voltage and then connects it to the output busbars of the fuel cell stack.
The DC/DC converter model was an average value model that considered the efficiency characteristics implemented as an array of values with interpolation and a no-load current. Additionally, it included the characteristics of the output power limitation as a function of the converter supply voltage. The output power limitation could be used interchangeably with the power threshold detection (and error code) depending on the purpose of the simulation test. The setpoint of The "auxiliary supercapacitor" block in Figure 2 also contains the controller that charges the auxiliary supercapacitor in a precise manner during the power supply system start-up to the required minimum voltage and then connects it to the output busbars of the fuel cell stack. The DC/DC converter model was an average value model that considered the efficiency characteristics implemented as an array of values with interpolation and a no-load current. Additionally, it included the characteristics of the output power limitation as a function of the converter supply voltage. The output power limitation could be used interchangeably with the power threshold detection (and error code) depending on the purpose of the simulation test. The setpoint of the output current in CC mode could be constant or it could come from the regulation of the fuel cell stack load power. It was a Proportional Integral (PI) type, anti-windup regulator.
The model of the main energy storage management system, depending on the state of charge and voltage of the energy storage, allowed for its normal operation (such as charging and discharging) or to operate with restrictions (only discharging or only charging). This allowed a pre-charge of the energy storage after starting the power supply system if this function was needed.
The main energy storage model contained models of supercapacitor or lithium-ion battery, alternatively selected.
The model of the main power busbar loading system is included in the "AGV" block shown in Figure 2, which loads the power supply system with the power required by the AGV. Additionally, the power for the fuel cell's own need is represented by the "auxiliary DC/DC converter" block in the same diagram. The power required by an AGV is shown in the value tables, containing samples of the power demand while driving and samples of the vehicle's own needs.
The hybrid power supply system model included control signals that enforced the appropriate order of switching on its elements during start-up, thus mapping the operation of the real system.

Automated Guided Vehicle (AGV)
An automated guided vehicle is designed for the transport of goods, materials, and semi-finished products as part of internal transport carried out in closed production or warehouse halls. The vehicle is designed to travel at ground level and can transport goods directly by itself by placing a loaded pallet on the upper loading surface of the vehicle or by pulling an attached transport trolley. The vehicle moves independently throughout the hall, performing tasks independently without human assistance in accordance with its pre-planned action and along a planned route. Usually, the vehicle travels along fixed routes according to a fixed schedule adapted in conjunction with the production cycle. The reproducible nature of the travel route and loads is important for matching the planned hydrogen fuel cell stack-based power supply system to the application. The vehicle monitors the surroundings via a sensor system to avoid collisions with them. The vehicle is powered by a lithium-ion battery placed in an easily accessible and replaceable cassette and the drive consists of two electric motors. A low-power AGV (Formica-1, AIUT Ltd., Gliwice, Poland) was used in this research.

Identification Experiment
Identification of the instantaneous power demand model whose output is the input of the hybrid power supply system model requires proper planning of the identification experiment. The first step of these activities was to develop a common test plan for different operating conditions that take into account various stationary and nonstationary operations carried out on the real AGV.
The experiment was completed for different operating conditions at different route sections. The experiments are listed in Table 1. Due to the autonomous operation of the AGV control and the stochastic nature of the interaction between the vehicle surface and the AGV, the selected experiments were repeated several times and the average results obtained in this way were used for testing the signal models.  During the conducted experiments, the following values were recorded: The voltage and the current returned by the batteries, the current values recorded on the main drive, and the current value on the stabilizing converter. Additionally, measurements of the resistance of the drive that was not directly measured were made. Due to these measurements, it was possible to record the instantaneous power demand. A schematic of the measuring system is shown in Figure 4. The data were recorded using an oscilloscope and with a sampling frequency of 100 or 50 kHz, depending on the duration of the selected route section.

No. Operating Conditions Related to Routes Other Operating Conditions
Energies 2020, 13, x FOR PEER REVIEW 17 of 31   Restrictions on the safety and control of AGV are specified in the standard [52], including various responsibilities imposed on manufacturers and users. Due to the above reasons, the AGV was equipped with a logger system to record or monitor selected parameters during operating conditions around the route.

No. Operating Conditions Related to Routes Other Operating Conditions
Selected logger data was used to observe the operating conditions. The data gathered concerned the rotational speeds of integrated Tekno TO-62 drives (left and right drive nodes according to Figure  4) equipped with an induction motor (nominal power 1.18 kW), the mechanical transmission with gear ratio 8.12 with a maximum continuous wheel torque of 25 Nm, and the power with a nominal voltage of 33 V. This element was also equipped with a 48 VDC nominal brake and a 5000 pulses speed encoder. The data were recorded using the AGV's inbuilt logger with a sampling frequency of ~2.5 Hz and were not synchronized with the instantaneous power demand signals recorded with the use of an oscilloscope. The recorded speed data were used to identify the operating conditions associated with the route section covered and its identification. This is a necessary part of the Restrictions on the safety and control of AGV are specified in the standard [52], including various responsibilities imposed on manufacturers and users. Due to the above reasons, the AGV was equipped with a logger system to record or monitor selected parameters during operating conditions around the route.
Selected logger data was used to observe the operating conditions. The data gathered concerned the rotational speeds of integrated Tekno TO-62 drives (left and right drive nodes according to Figure 4) equipped with an induction motor (nominal power 1.18 kW), the mechanical transmission with gear ratio 8.12 with a maximum continuous wheel torque of 25 Nm, and the power with a nominal voltage of 33 V. This element was also equipped with a 48 VDC nominal brake and a 5000 pulses speed encoder. The data were recorded using the AGV's inbuilt logger with a sampling frequency of~2.5 Hz and were not synchronized with the instantaneous power demand signals recorded with the use of an oscilloscope. The recorded speed data were used to identify the operating conditions associated with the route section covered and its identification. This is a necessary part of the proposed approach, in particular, which is forced by conducting measurements in situ conditions where synchronization of measurements with the logger data (operating condition) was not possible. Figure 5 shows selected waveforms, speed signals from the logger, and the auxiliary computed signals. To synchronize the measurements and thereby identify individual sections of the route for which signal models can be developed, the data were preprocessed by determining the auxiliary signals which were used to enhance the recognition of different operating conditions (some examples are shown in Figure 5), using resampling methods and identifying common starting points for both sources of data. For the obtained segments of the labeled measurement data related to route sections and selected operating conditions, models for stationary and nonstationary conditions were identified defining the banks of models. Figure 6 shows the selected labeled measurement data based on previously determined data labels from the logger and auxiliary data. Based on the data labels, it was possible to segment the data and create a bank of signal models representing the instantaneous power demand for selected operating conditions. To synchronize the measurements and thereby identify individual sections of the route for which signal models can be developed, the data were preprocessed by determining the auxiliary signals which were used to enhance the recognition of different operating conditions (some examples are shown in Figure 5), using resampling methods and identifying common starting points for both sources of data. For the obtained segments of the labeled measurement data related to route sections and selected operating conditions, models for stationary and nonstationary conditions were identified defining the banks of models. Figure 6 shows the selected labeled measurement data based on previously determined data labels from the logger and auxiliary data. Based on the data labels, it was possible to segment the data and create a bank of signal models representing the instantaneous power demand for selected operating conditions.

Instantaneous Power Demand Model for a Selected Scenario
The route scenario presented in Figure 7, developed for the AGV, consists of a section of the slalom route with the load (marked in red) and the rest of route unloaded.

Instantaneous Power Demand Model for a Selected Scenario
The route scenario presented in Figure 7, developed for the AGV, consists of a section of the slalom route with the load (marked in red) and the rest of route unloaded.

Instantaneous Power Demand Model for a Selected Scenario
The route scenario presented in Figure 7, developed for the AGV, consists of a section of the slalom route with the load (marked in red) and the rest of route unloaded.  For the presented scenario, a signal of instantaneous power demand for a section of the route without load, shown in Figure 7, was modeled with the use of a set of models. For this section of the route the following models were prepared: The needed lengths (number of samples) of the individual waveforms computed by the models was determined based on information about the time necessary to achieve the required speed (in the case of braking and accelerating). The model output did not compute any velocity, as this value could be read from the inverse of the average power demand versus the average velocity which had been identified based on the collected data sets presented in Table 1. This was determined using the linear approximation P inst−ave = C 1 × v ave + C 2 , where C 1 is 351.4 Ws m and C 2 is 279.3 W (valid for the average velocities v ave between 0.3 and 0.8 m/s). The required number of samples for a constant speed period could be determined from the required length of the route and sampling frequency.
The waveforms were generated for the considered route section shown in Figure 7 by using previously listed models. The errors of the individual models are presented in Table 2. An example assessment of the selected model (with constant speed) for the instantaneous power signal distribution in the frequency domain is presented in Figure 8. The calculated errors were obtained from the test measurement data. Next, the individual waveforms generated with signal models were combined using the window indicated in Equation (7). An example of the joined data from two models is shown in Figure 9. The needed lengths (number of samples) of the individual waveforms computed by the models was determined based on information about the time necessary to achieve the required speed (in the case of braking and accelerating). The model output did not compute any velocity, as this value could be read from the inverse of the average power demand versus the average velocity which had been identified based on the collected data sets presented in Table 1. This was determined using the linear approximation = × + , where is 351.4 and is 279.3 W (valid for the average velocities between 0.3 and 0.8 m/s). The required number of samples for a constant speed period could be determined from the required length of the route and sampling frequency.
The waveforms were generated for the considered route section shown in Figure 7 by using previously listed models. The errors of the individual models are presented in Table 2. An example assessment of the selected model (with constant speed) for the instantaneous power signal distribution in the frequency domain is presented in Figure 8. The calculated errors were obtained from the test measurement data. Next, the individual waveforms generated with signal models were combined using the window indicated in Equation (7). An example of the joined data from two models is shown in Figure 9.   Energies 2020, 13, x FOR PEER REVIEW 21 of 31 Figure 9. The combination of the two waveforms generated from the signal models for nonstationary and stationary signals (a) without using a prepared window; (b) with the use of window; and (c) with a used window to combine the two signals from the models.
The relative energy error for the modeled route was mainly (excluding the influence of windowing) a weighted average of errors for the individual models used to determine the instantaneous power demand, and the weights of this average resulted from the fraction used of the individual signals in the whole combined waveform.
The example presented in this section shows the possibility of modeling the instantaneous power demand using a well-known class of autoregressive models of signals. The proposed approach requires a simulation experiment by recording the instantaneous power demand for various operating conditions. The advantage of the presented method is the lack of interference from the AGV software, including its control system where this information is often unavailable due to company intellectual property issues, and there is no need to create a dynamic vehicle model.

An Example of Using the Model to Optimize the Hybrid Power Supply System
To demonstrate the practical use of the numerical model for an AGV hybrid power supply system, a short model route was designed, as outlined in Figure 7. The AGV moved with a load of 1.2 tons along a model route (marked in red) and then moved along a route without a load (marked in blue). The loading and unloading points and control points are marked in green, where the vehicle stopped for a maximum of a few seconds. When driving without a load, the vehicle accelerated and braked more rapidly than when driving with a load.
The demand for power (PAGV) for the AGV during the model route was determined by the measurement results obtained for a real AGV, using the processing methods described in Section 3. An example of the waveform of the power demand while driving is shown in Figure 10. The results of measurements for the power demand when the vehicle was stopped were used to model the AGV stoppage. Figure 9. The combination of the two waveforms generated from the signal models for nonstationary and stationary signals (a) without using a prepared window; (b) with the use of window; and (c) with a used window to combine the two signals from the models.
The relative energy error for the modeled route was mainly (excluding the influence of windowing) a weighted average of errors for the individual models used to determine the instantaneous power demand, and the weights of this average resulted from the fraction used of the individual signals in the whole combined waveform.
The example presented in this section shows the possibility of modeling the instantaneous power demand using a well-known class of autoregressive models of signals. The proposed approach requires a simulation experiment by recording the instantaneous power demand for various operating conditions. The advantage of the presented method is the lack of interference from the AGV software, including its control system where this information is often unavailable due to company intellectual property issues, and there is no need to create a dynamic vehicle model.

An Example of Using the Model to Optimize the Hybrid Power Supply System
To demonstrate the practical use of the numerical model for an AGV hybrid power supply system, a short model route was designed, as outlined in Figure 7. The AGV moved with a load of 1.2 tons along a model route (marked in red) and then moved along a route without a load (marked in blue). The loading and unloading points and control points are marked in green, where the vehicle stopped for a maximum of a few seconds. When driving without a load, the vehicle accelerated and braked more rapidly than when driving with a load.
The demand for power (P AGV ) for the AGV during the model route was determined by the measurement results obtained for a real AGV, using the processing methods described in Section 3. An example of the waveform of the power demand while driving is shown in Figure 10. The results of measurements for the power demand when the vehicle was stopped were used to model the AGV stoppage.  Figure 7).
It was assumed that the model cycle for AGV operation included: Waiting time for the first drive after starting the power supply system of 30 s, five drives along the model route, a standstill after each drive, and waiting time for switching off after the driving cycles of 10 s. An example of the AGV's power demand waveform during the operation cycle is shown in Figure 11. The standstill time after driving was one of the parameters that changed during the optimization process and, in this case, was 255 s. The total electric energy consumption during the entire operation cycle was 131.2 Wh, with an average power demand of 236 W. The optimization aimed to minimize the energy storage capacity and the duration of stops between drives, assuming that all the energy needed to power the AGV came from the fuel cell stack, i.e., the state of charge of the energy storage should have been the same after an entire operation cycle as at its beginning. In the model hybrid power supply system, none of the fifteen electrical parameter criteria could be violated. It was essential that, during the simulated vehicle operation between the main energy storage voltage and the threshold (criterion) values of the supply voltage of the load system, a safety margin of ~3 V was maintained. These threshold values were 30 and 60 V, respectively. Additional parameters that were tuned in the optimization process and which had an essential impact on the results obtained were the allowable range of the energy storage voltage (in particular the energy pre-charge storage voltage), the output voltage of the DC/DC converter in CV mode, and the output current of the DC/DC converter in CC mode. An important result obtained from the model was the hydrogen consumption for the assumed operation cycle of the AGV, which allowed one to choose the required capacity of the hydrogen tank.
The preliminary simulation tests were carried out for the assumed operation cycle, assuming that the main energy storage was a LiFePO4 battery with a capacity of 10 Ah and a rated voltage of 48 V, achieved from a real test bench. This is a low-cost battery that can provide a large enough impulse discharge current, with an expected value of ~3C without degradation. This battery is built  Figure 7).
It was assumed that the model cycle for AGV operation included: Waiting time for the first drive after starting the power supply system of 30 s, five drives along the model route, a standstill after each drive, and waiting time for switching off after the driving cycles of 10 s. An example of the AGV's power demand waveform during the operation cycle is shown in Figure 11. The standstill time after driving was one of the parameters that changed during the optimization process and, in this case, was 255 s. The total electric energy consumption during the entire operation cycle was 131.2 Wh, with an average power demand of 236 W.  Figure 7).
It was assumed that the model cycle for AGV operation included: Waiting time for the first drive after starting the power supply system of 30 s, five drives along the model route, a standstill after each drive, and waiting time for switching off after the driving cycles of 10 s. An example of the AGV's power demand waveform during the operation cycle is shown in Figure 11. The standstill time after driving was one of the parameters that changed during the optimization process and, in this case, was 255 s. The total electric energy consumption during the entire operation cycle was 131.2 Wh, with an average power demand of 236 W. The optimization aimed to minimize the energy storage capacity and the duration of stops between drives, assuming that all the energy needed to power the AGV came from the fuel cell stack, i.e., the state of charge of the energy storage should have been the same after an entire operation cycle as at its beginning. In the model hybrid power supply system, none of the fifteen electrical parameter criteria could be violated. It was essential that, during the simulated vehicle operation between the main energy storage voltage and the threshold (criterion) values of the supply voltage of the load system, a safety margin of ~3 V was maintained. These threshold values were 30 and 60 V, respectively. Additional parameters that were tuned in the optimization process and which had an essential impact on the results obtained were the allowable range of the energy storage voltage (in particular the energy pre-charge storage voltage), the output voltage of the DC/DC converter in CV mode, and the output current of the DC/DC converter in CC mode. An important result obtained from the model was the hydrogen consumption for the assumed operation cycle of the AGV, which allowed one to choose the required capacity of the hydrogen tank.
The preliminary simulation tests were carried out for the assumed operation cycle, assuming that the main energy storage was a LiFePO4 battery with a capacity of 10 Ah and a rated voltage of 48 V, achieved from a real test bench. This is a low-cost battery that can provide a large enough impulse discharge current, with an expected value of ~3C without degradation. This battery is built of sixteen 10 Ah prismatic cells connected in series. The energy storage model was tuned using The optimization aimed to minimize the energy storage capacity and the duration of stops between drives, assuming that all the energy needed to power the AGV came from the fuel cell stack, i.e., the state of charge of the energy storage should have been the same after an entire operation cycle as at its beginning. In the model hybrid power supply system, none of the fifteen electrical parameter criteria could be violated. It was essential that, during the simulated vehicle operation between the main energy storage voltage and the threshold (criterion) values of the supply voltage of the load system, a safety margin of~3 V was maintained. These threshold values were 30 and 60 V, respectively. Additional parameters that were tuned in the optimization process and which had an essential impact on the results obtained were the allowable range of the energy storage voltage (in particular the energy pre-charge storage voltage), the output voltage of the DC/DC converter in CV mode, and the output current of the DC/DC converter in CC mode. An important result obtained from the model was the hydrogen consumption for the assumed operation cycle of the AGV, which allowed one to choose the required capacity of the hydrogen tank.
The preliminary simulation tests were carried out for the assumed operation cycle, assuming that the main energy storage was a LiFePO 4 battery with a capacity of 10 Ah and a rated voltage of 48 V, achieved from a real test bench. This is a low-cost battery that can provide a large enough impulse discharge current, with an expected value of~3 C without degradation. This battery is built of sixteen 10 Ah prismatic cells connected in series. The energy storage model was tuned using optimization methods and the datasheet from the battery cells. It was assumed that the battery was pre-charged before starting the AGV power supply system (the initial state of charge was 50%). The selected results of preliminary simulation tests are shown in Figure 12. The results for the turned off SCU are presented so that transients that are associated with the operation of the SCU do not impair their readability.
Energies 2020, 13, x FOR PEER REVIEW 23 of 31 pre-charged before starting the AGV power supply system (the initial state of charge was 50%). The selected results of preliminary simulation tests are shown in Figure 12. The results for the turned off SCU are presented so that transients that are associated with the operation of the SCU do not impair their readability. Figure 12a shows the total demand for power Preq, including PAGV power for the AGV and PAux power for the hybrid power supply system's own needs. Figure 12b shows the load power of the fuel cell stack PFC. It can be seen that the stack was utilized optimally and correctly (without overloading) throughout the entire operating cycle of the AGV stack and was loaded with power close to the rated power.  Figure 12c shows the hydrogen flow rate FFR obtained at the control valve output. Integrating this waveform, after converting it to the standard liters, it can be determined that ~141 L of hydrogen were consumed during the entire AGV cycle of operation, which corresponds to 423 Wh hydrogen energy, assuming that the change in enthalpy of formation was equal to the lower heat value [5]. When considering the energy consumption of the AGV from Figure 12a (~144 Wh), the efficiency of the hybrid power supply system was 34%. Figure 12d shows the current IDC/DC output waveform of  Figure 12a shows the total demand for power P req , including P AGV power for the AGV and P Aux power for the hybrid power supply system's own needs. Figure 12b shows the load power of the fuel cell stack P FC . It can be seen that the stack was utilized optimally and correctly (without overloading) throughout the entire operating cycle of the AGV stack and was loaded with power close to the rated power. Figure 12c shows the hydrogen flow rate FFR obtained at the control valve output. Integrating this waveform, after converting it to the standard liters, it can be determined that~141 L of hydrogen were consumed during the entire AGV cycle of operation, which corresponds to 423 Wh hydrogen energy, assuming that the change in enthalpy of formation was equal to the lower heat value [5]. When considering the energy consumption of the AGV from Figure 12a (~144 Wh), the efficiency of the hybrid power supply system was 34%. Figure 12d shows the current I DC/DC output waveform of the DC/DC converter. It can be seen that this converter works permanently in CC mode and the setpoint of the output current is constant and equal to 5 A. Figure 12e shows the U Batt voltage waveform of the 10 Ah battery. This voltage was practically constant, which resulted from the relatively rigid discharge characteristics and the slight changes in the state of charge SOC Batt% for this battery, shown in Figure 12f. A practically constant voltage of the battery at a constant output current of the DC/DC converter caused the fuel cell stack to be loaded with constant power throughout the entire operation cycle. The standstill time needed to restore the battery state of charge to the condition before driving was 257 s.
The battery used in the preliminary simulation tests had too large a capacity for the energy demand for the selected scenario of AGV operation, which was uneconomical. In subsequent tests, the battery capacity was reduced to a value of 0.2 Ah; this still ensured the correct operation of the AGV. The capacity of the battery was chosen so that its SOC varied from 20% to 80% during the operation of the AGV. It was assumed that the battery was pre-charged to an SOC of 20%, with an SOC of at least 70% required to start the vehicle. Therefore, when the power supply system was turned on, the battery was pre-charged by the fuel cell stack. The results did not change significantly. A slightly poorer utilization of the fuel cell stack was obtained while the AGV was driving. This was due to greater voltage drops in the smaller capacity battery, which, with a constant output current of the DC/DC converter, resulted in a decrease in the stack load power. The consumption of hydrogen increased to~148 standard liters due to the initial charging of the battery, which absorbed 7.3 standard liters of hydrogen and lasted~90 s. After omitting the supercapacitor pre-charge energy, the system efficiency was similar to previously, at~34%. The used battery had a capacity of only 0.2 Ah, which was practically impossible due to too low current values for batteries with such a small capacity. Simulation tests using a selected scenario for vehicle operation and a 0.2 Ah battery were not of practical importance but were used to present the issue and how to use the model as a design aid. Therefore, during these tests, no criterion values for battery current were determined. A similar battery operation regime with real, higher capacity could be obtained for the real scenario AGV operation with higher energy demand. The use of battery capacity in such a work regime seems optimal, but it should also be noted that a battery working continuously in such a regime can quickly degrade.
Due to the possibility of quick battery degradation, further simulation tests were completed using a supercapacitor as the main energy storage. The most important advantage of supercapacitors, outlined in [30,32], is their use as an energy buffer for a fuel cell stack in traction applications due to their higher power density compared to batteries. Supercapacitors have higher efficiency and a higher number of charge and discharge cycles without degradation compared to the battery. By optimization, the criterion for the minimum capacity of the supercapacitor was chosen. The capacity of the selected SC maintained the voltage of the main power busbars over their required operating range whilst preserving a safety margin from the criterion values. The results of these simulation tests are given in Figure 13. It was assumed that the supercapacitor was not pre-charged, so its pre-charging was implemented by the fuel cell stack on start-up of the power supply system. hydrogen energy used for the AGV operation was ~695 Wh. The obtained power supply system efficiency was similar to that previously shown in the battery case, but the vehicle's standstill time after driving required to charge the supercapacitor to its pre-driving condition was 670 s. Such a long standstill time was due to the low power utilization of the fuel cell stack at low supercapacitor voltage when the stack provided slightly more power than that of the AGV's own needs. Further simulation tests were completed with the fuel cell load power regulator turned on, which affected the setpoint of the DC/DC converter output current under the CC mode. As a result of the re-optimization, the capacity of the supercapacitor in the main energy storage was reduced to 24.5 F, obtained by connecting the 2P22S component supercapacitors with a capacity of 270 F each. The results of the simulation tests are shown in Figure 14. It can be seen that the utilization of the fuel cell stack was again optimal and correct (Figure 14b). At the same time, a much shorter standstill time (240 s) after driving is needed to charge the supercapacitor to its pre-driving condition. The hydrogen consumption was 150 standard liters, of which ~14.5 standard liters are required for the initial charge of the supercapacitor, which lasts ~200 s. The energy consumption of the AGV is 139.6 Wh ( Figure  14a) and hydrogen energy used for AGV operation was ~406.5 Wh. Again, a system efficiency of ~34% was obtained, but the required standstill was much shorter than for a 35 F supercapacitor. Improvement in the use of the fuel cell stack compared to the previous simulation was obtained as the stack load power regulator increased the setpoint of the DC/DC converter output current in the CC mode at low supercapacitor voltage, just enough not to overload the stack. The fast transients shown in Figure 14b-d result from when the supercapacitor was charged to a certain maximum voltage, and the DC/DC converter then went into CV mode. In this situation, the load power of the fuel cell stack dropped sharply, and after the converter returned to CC mode, it increased again rapidly. The main difference between the operation of the power supply system with a LiFePO 4 battery and a supercapacitor is due to the different discharge characteristics of these energy storage devices. The voltage U SC of the supercapacitor changes significantly more when discharged than the voltage U Batt of the LiFePO 4 batteries (at least in the SOC range between 20% and 80%). There is a constant output current of the DC/DC converter in CC mode, resulting in a much worse utilization of the fuel cell stack due to significantly lower stack load power at a low supercapacitor voltage (Figure 13b). The presented results were obtained using a real supercapacitor model which consisted of 44 component supercapacitors with a capacity of 385 F each in a 2P22S connection system (two connected in parallel, 22 in series), which gave a resultant capacity of 35 F and a rated voltage of 61.6 V.
Using a supercapacitor, the hydrogen consumption was now 251 standard liters, of which 19.4 standard liters were required for pre-charging of the supercapacitor. The pre-charge time was approximately 340 s. The energy consumption of the AGV was 243.7 Wh (Figure 13a) and the hydrogen energy used for the AGV operation was~695 Wh. The obtained power supply system efficiency was similar to that previously shown in the battery case, but the vehicle's standstill time after driving required to charge the supercapacitor to its pre-driving condition was 670 s. Such a long standstill time was due to the low power utilization of the fuel cell stack at low supercapacitor voltage when the stack provided slightly more power than that of the AGV's own needs.
Further simulation tests were completed with the fuel cell load power regulator turned on, which affected the setpoint of the DC/DC converter output current under the CC mode. As a result of the re-optimization, the capacity of the supercapacitor in the main energy storage was reduced to 24.5 F, obtained by connecting the 2P22S component supercapacitors with a capacity of 270 F each. The results of the simulation tests are shown in Figure 14. It can be seen that the utilization of the fuel cell stack was again optimal and correct (Figure 14b). At the same time, a much shorter standstill time (240 s) after driving is needed to charge the supercapacitor to its pre-driving condition. The hydrogen consumption was 150 standard liters, of which~14.5 standard liters are required for the initial charge of the supercapacitor, which lasts~200 s. The energy consumption of the AGV is 139.6 Wh (Figure 14a) and hydrogen energy used for AGV operation was~406.5 Wh. Again, a system efficiency of~34% was obtained, but the required standstill was much shorter than for a 35 F supercapacitor. Improvement in the use of the fuel cell stack compared to the previous simulation was obtained as the stack load power regulator increased the setpoint of the DC/DC converter output current in the CC mode at low supercapacitor voltage, just enough not to overload the stack. The fast transients shown in Figure 14b-d result from when the supercapacitor was charged to a certain maximum voltage, and the DC/DC converter then went into CV mode. In this situation, the load power of the fuel cell stack dropped sharply, and after the converter returned to CC mode, it increased again rapidly. Energies 2020, 13, x FOR PEER REVIEW 26 of 31 It can be seen that the presented simulation studies achieved the optimization goals and aid the design of the hybrid power supply system. The given results were valid for the assumed scenario of the AGV operation. In subsequent simulation tests, how the SCU operation affects the obtained optimization results was checked.
The SCU short-circuited the fuel cell stack for 100 ms every 10 s. However, transients lasted longer than 100 ms and were associated, among other things, with the need to recharge the auxiliary supercapacitor which was partially discharged when supporting the DC/DC converter supply voltage during stack short-circuit. The obtained results were accurate and similar to those presented in Figure 14, the main difference was that the standstill time after driving was extended to 250 s to charge the supercapacitor back to its condition before driving. Hydrogen consumption increased slightly to 155 standard liters and the power supply system efficiency decreased by 0.7%. It can be seen that the presented simulation studies achieved the optimization goals and aid the design of the hybrid power supply system. The given results were valid for the assumed scenario of the AGV operation. In subsequent simulation tests, how the SCU operation affects the obtained optimization results was checked.

Discussion
The SCU short-circuited the fuel cell stack for 100 ms every 10 s. However, transients lasted longer than 100 ms and were associated, among other things, with the need to recharge the auxiliary supercapacitor which was partially discharged when supporting the DC/DC converter supply voltage during stack short-circuit. The obtained results were accurate and similar to those presented in Figure 14, the main difference was that the standstill time after driving was extended to 250 s to charge the supercapacitor back to its condition before driving. Hydrogen consumption increased slightly to 155 standard liters and the power supply system efficiency decreased by 0.7%.

Discussion
The energy transfer numeric model for hybrid power supply system was the main objective of the article. The model consisted of the elements of supply system such as: Power converter, energy buffer, FC, and control devices. For the load of the supply system, the instantaneous power demand model was used. This model represents a generic instantaneous power demand for a given route for stationary and nonstationary conditions for an AGV under experimentally determined selected operating conditions. The main reason for developing the generic instantaneous power demand model is its simplicity and the fact that it does not require any additional information about the subsystems of AGVs and any supplementary information from the AGV manufacturers. It should be emphasized that the method proposed here could be improved by using further models that consider nonstationary conditions, i.e., that include nonstationarity of frequency components. Section 4.3 describes the optimization process of the hybrid power supply system parameters for a model route and an AGV operation scenario. A similar process of optimization and design-aid can be completed using the real vehicle operation cycle by obtaining the route parameters and driving scenario from the vehicle manufacturer or vehicle user. In a situation where the AGV cannot make stops after driving, which allow for recharging of the main energy storage as described in Section 4.3, it is possible to minimize the capacity of the energy storage using a numerical model with the appropriate utilization of a fuel cell stack, under the assumption that the energy storage will be recharged using an external source after the entire operation cycle of the vehicle. In this situation, a compromise can be made between the capacity of the main energy storage (lithium-ion battery) and the hydrogen consumption, to consequently determine the capacity of the hydrogen tank. It is possible to use a stack load power regulator to intentionally reduce stack utilization and not exceed the assumed hydrogen consumption.
Further development of the presented numerical model, in the part related to the production of electrical energy, may include issues such as the dynamics of hydrogen release from the metal hydride storage under various operating conditions, and the dynamics of the cell response to a change in the hydrogen flow at the control valve output by considering the dynamics of the hydrogen distribution inside the cell. In the section of the model in which the power demand for the AGV is modeled, a dynamic model of the vehicle can be used which requires the drive torque for the specific route conditions, vehicle load, and the traction parameters (speed and acceleration). The hybrid power supply system power demand can be calculated based on the required drive torque in the dynamic models for the vehicle's drive nodes. Further development of the numerical model requires conducting additional tests on the fuel cell stack together with the hydrogen tank and examination of the real AGV to collect additional data and verify the extended numerical model.
The overall assessment of the proposed solution was carried out quantitatively for selected model elements (models of instantaneous power demand and the tuned hydrogen cell model). For other elements of the model, the assessment is qualitative as it is dependent on the specific instance of the AGV.

Conclusions
The research aim was to develop a model of a hybrid power supply system with a fuel cell stack for designing an energy storage system. The power supply system model is a numerical tool supporting the design and optimization of the power supply system following the MBD methodology. The article presents an example of the process of energy storage optimization for the AGV hybrid power supply system, which implements an example cycle of operation. Data for the AGV power demand model were obtained from measurements carried out on a real factory battery-powered AGV. These data were processed, and allowed the extract models for standard route fragments that can be interpolated under various load conditions. Based on these fragmentary models, it is possible to develop a power demand model for any route and optimize the hybrid power supply system for this route.
The conclusions from the generic instantaneous power demand model are: • The proposed generic model allows for the determination of the instantaneous electric power for any route without the need to identify the dynamic drive system parameters; • The model enables the determination of both stationary and nonstationary operating conditions using a simple approach with autoregressive models from signals with additional elements used for modeling the first-order and second-order nonstationarity with the application of additional linear, quadratic, or autoregressive models; • Building a generic model for instantaneous power demand is possible since the AGV object is a system with constant control settings and operating conditions, and the AGV usually moves along an unchanged route for a long period. For more complex objects, the proposed approach may not be cost-effective as it would require more identification experiments.
Conclusions related to the model of the hybrid power supply system:

•
The model seems to correctly imitate the energy transfer in the hybrid power system. The waveforms calculated by the model are reliable and all the phenomena visible are correct and explainable. The effectiveness of the model, however, must be confirmed by measurements of real cases with the design and optimization of the hybrid power supply system, which will be the subject of future research; • The methodology used to model the components of the hybrid power supply system, using a few original ideas, means that the results of computer simulations are calculated relatively quickly, even for long routes taken by the AGV.