Modeling and Simulation of Spacecraft Power System Based on Modelica

. Spacecraft power system simulation involves the coupling of electrical, thermal and control domains. At present, the modeling and simulation of multi-domain physical system mainly uses the single-domain software to establish a single-domain model, and solves the unified multi-domain modeling and simulation through the interface between the software or using HLA. But it cannot fully support the modeling and simulation of multi-domain physical system, and the model has poor reusability and extensibility. As a multi-domain modeling language, Modelica language supports acausal modelling, unified multi-domain modeling, object-oriented physical modeling and hybrid modeling. So it is widely used in the aerospace area. In this paper, Modelica language is used to establish module library of spacecraft power system on simulation platform MWorks, and the multi-domain simulation model of spacecraft power system is obtained by assembling each sub-model, and the performance of the model is simulated and analyzed so as to achieve the purpose of improving and verifying the model.


Introduction
With the rapid development of space technology, the power system technology has also achieved rapid development. At the same time, the technical level of space power system plays a critical role in improving the performance of spacecraft and extending the working life of spacecraft. At present, a variety of application satellites that directly serve the national economy are developing towards high performance, multi-purpose and long life. Therefore, higher and higher requirements have been put forward for the power, life, reliability and other indexes of the spacecraft power system. It is of great significance to model and simulate the performance of the spacecraft power system.
The realization of computer simulation of power system needs to rely on a certain platform. But the current common platform such as Matlab/Simulink has many shortcomings in system simulation modelling [1]. Because Matlab/Simulink is based on block diagram modeling and the built model is the mechanism of the object system abstract. The built model has a huge intuitive difference from the actual system composition. So it is difficult for the general emulators to understand and it is not convenient for them to establish the system they want to study according to their needs, which greatly reduces the ease of use of the built model library. In addition, the establishment of Matlab/Simulink model for systems that need to consider complex mechanisms, such as power systems, requires a large block diagram connection. It is not only error-prone and poor model reusability, but also difficult to classify and organize each model.
For complex systems like power system modeling, EUROSIM proposed in 1996 to research and design the unified multi-domain physical modeling language Modelica through international open cooperation.
Modelica is an open, object-oriented, equation-based language, which can cross different domains and conveniently realize the modeling of complex physical system. Because Modelica can realize graphical modeling, and the built model corresponds to the actual components of the actual system. So it is convenient for the emulators who generally do not understand modeling technology but understand the system principle to carry out modeling and simulation, so that they can focus on the design of the system rather than waste time on the research of modeling language and modeling method. Modelica language supports acausal modelling, unified multi-domain modeling, object-oriented physical modeling and hybrid modeling. So it is widely used in the aerospace area.
In this paper, Modelica language is used to establish module library of spacecraft power system on the simulation platform MWorks, and the unified multidomain system-level dynamic model of spacecraft power system is assembled by each sub-model, and the dynamic performance of this model is simulated and analyzed so as to achieve the purpose of improving and verifying the model.

Introduction to Modelica language
Modelica is an open, object-oriented, equation-based language, which can conveniently realize the modeling and simulation of physical systems including mechanical, electronic, electric, hydraulic, thermal, control and process-oriented subsystems, and make use of computers for the performance analysis of cross-field and crossdisciplinary physical systems.

Features of Modelica language modeling
Modelica is a reusable physical modeling language that adopts a hierarchical component model and adopts a connection mechanism based on the generalized Kirchhoff principle for unified modeling, which can meet the requirements of multiple domains. Its main characteristics are as follows [2]: (1) Acausal modeling based on equations Acausal modeling is a declarative modeling approach, meaning that it is based on equations rather than assignment statements. The causal property of the model based on equation is not clear, and the causal relationship of variables is determined only when the equation system is solved. Acausal modeling is more suitable for expressing the physical structure of complex systems, and the Modelica model based on equations is more intuitive and simpler than the traditional model with assignment statements.
(2) Unified multi-domain modeling Modelica language can support model development in electrical, mechanical, thermodynamic, hydraulic, biological, control and other domains. Through the unified language to describe the model of various domains, it can greatly reduce the difficulty of model integration, and better improve the precision of the models. Modelica language defines the communication interface between components as connectors, which mainly include through variables and across variables of corresponding domains. As shown in Table 1, through variables and across variables from various domains are given. (3) Object-oriented modeling Modelica provides complete support for objectoriented modeling and provides mechanisms such as variation, redeclaration, operator overloading to support model polymorphism characteristics. The object-oriented modeling method can greatly simplify the model library architecture, enhance the readability of the model library, and also can well support the subsequent extension of the model library.
(4) Hybrid modeling Hybrid models are a combination of both continuous and discrete behavior. Modelica language realizes the hybrid modeling of continuous time and discrete events by introducing logic judgment mechanisms such as WHEN and IF.

Compilation and solution of Modelica model
The compilation and solution process of Modelica model is mainly divided into three processes: compilation, analysis and optimization, and simulation solution. Fig. 1 describes the compilation and solution process of Modelica model.

Multi-domain model library based on Modelica language
Object-oriented modeling technology makes models easy to reuse, so many experts and scholars are developing

Mathematical model of Solar array-battery pack combined power supply system
Solar array-battery pack combined power supply system is a power system composed of solar array as power generation device, battery as energy storage device, and corresponding power control equipment. It is the most widely used spacecraft power system in the world.

Solar array
Solar cell is a semiconductor device that can convert solar energy into electric energy. Silicon solar cell is composed of a P-N structure, and the P-N junction can be regarded as a constant current source in parallel with an ideal diode [3]. Ig represents the photogenerated current caused by illumination at P-N junction, I d represents the diode current at a certain working voltage, and leakage current will be generated at the place where the P-N junction is not completely formed. Then a silicon solar cell satisfies the equation: Where A is an arbitrary curve fitting constants, R s is the battery series resistance, R sh is the parallel resistance for battery, I g is the photogenerated current, I 0 is the diode saturation current, e is the electronic charge, K is the boltzmann constant, T is the absolute temperature, I is the battery output current, and V is the voltage of the battery.
A plurality of encapsulated single solar cells are formed into solar array in series and parallel according to power supply requirements, and the DC equivalent circuit of solar array can be obtained, as shown in Fig. 2. According to this equivalent circuit, it can be concluded that the output voltage and output current of solar array meet the following relation: Where N p is the number of parallel solar cells, N p is the number of series solar cells, T is the absolute temperature of the solar array, I and V are the output current and output voltage of the solar array respectively.

Battery pack
As an energy storage power source, battery is an important part of the satellite power system. Its main function is to provide necessary power for the satellite during the earth shadow period. Nickel-hydrogen battery has a better number of charge and discharge cycles without obvious "memory effect", and has been successfully applied to many GEO and LEO satellites. Therefore, this paper focuses on Nickel-hydrogen battery research.
The establishment of multi-domain simulation model of Nickel-hydrogen battery is based on a simplified mathematical model based on physical process proposed in reference [4]. In this paper, the object-oriented and acausal modeling characteristics of Modelica are fully utilized in the modeling of the battery, and the original mathematical model is directly used to describe the Nickel-hydrogen battery behavior. This greatly simplifies the battery modeling process, but also retains the battery and the external interaction of the electrical terminal and hot port to achieve modular battery modeling.

Power control equipment
The power system adopts S 3 R (sequence switch shunt regulator) to shunt, and its working state is completely controlled by bus error voltage. The main error amplifier (MEA) carries out Three Domain control over the power supply working mode [5]. The distribution of S 3 R bus error voltage working area is shown in Fig. 3.   Fig. 3. Schematic diagram of Three Domain control.

Unified multi-domain modeling based on Modelica
Based on the graphic modeling function of Modelica, the simulation model of Solar array, nickel-hydrogen battery group and power control equipment components is established, and the multi-domain simulation model of spacecraft power system is obtained according to the topological structure of the power system. The integration model is shown in Fig. 4.

Results
In this paper, the multi-domain simulation model of spacecraft power system is used to carry out simulation experiments. In the simulation, the solar irradiation model was simulated by a square wave generator with a fixed frequency, with a period of 5000s and an amplitude of 1353W. The load model has a long-term power consumption of 100W and a peak power consumption of 400W, with a duration of 8 minutes. The Settings of solar irradiation and load are shown in Fig. 5 and Fig. 6 respectively.  The initial temperature of solar array is set at 298K, the initial current is 0A, the initial temperature of battery bank is set at 273K, and the initial bus voltage is set at 28V. The remaining initial simulation values are determined by the simulation software. The simulation algorithm "Dassl" was selected, and the simulation was set to be accurate 1x10 -4 with a simulation duration of 5000s. Fig. 7 and Fig. 8 show some simulation results of the satellite power supply system.   (1) The voltage of the power bus is basically stable at 28V, indicating that the shunt regulator (SR) and battery discharge regulator (BDR) are working normally. During an orbital period, the bus voltage fluctuates to some extent.

Results
(2) During the illumination period, there are two obvious fluctuations in bus voltage, which are caused by the shunt regulator (SR) shunt and load power consumption. The shunt regulator (SR) is a power control device, and the change of actual load power consumption is caused by the switching machine or flywheel acceleration of the instrument, which reflects the multidomain coupling relationship in the electrical, control and mechanical fields of the spacecraft power system. The fluctuation of the two parts in the figure is not large, which indicates that the shunt regulator (SR) designed in this paper can work normally.
(3) In the shadow period, the bus voltage does not exist obvious fluctuation. However, when the satellite enters the shadow region from the light region, the bus voltage fluctuates too much, which indicates that the bus voltage is obviously disturbed when the satellite enters the shadow region.  Fig. 8 shows the simulation curve of charge and discharge of Nickel-hydrogen battery. It can be seen that in the light area, the battery bank is charged at the charging rate of 12.5A, which is consistent with the set value, indicating that the battery charge regulator (BCR) is working normally. In the shaded area, the battery is free to discharge at the rate of about 7.5A, which is within the allowable range. However, the discharge current of the satellite is too large when it enters the earth shadow, so the overcurrent protection measures should be added.

Conclusions
In this paper, the unified multi-domain physical modeling language Modelica is used to establish the simulation model of Solar array, Nickel-hydrogen battery group and power control equipment components, and the multidomain simulation model of spacecraft power system is built, which is coupled to multi-domain such as optical, electrical, thermal and control. Finally, the simulation model of the power system is verified under given conditions, and the domain coupling relationship within the power system is further verified.