Digital Generator Control Unit Design for a Variable Frequency Synchronous Generator in MEA

: Variable frequency power generation systems have been adopted for modern aircraft power systems, thus, a new generator control unit (GCU) must be designed to regulate the output voltage and obtain high quality power supply under a wide frequency range from 360 Hz to 800 Hz. In this paper, a dual digital signal processor (DSP) structure-based GCU was proposed. Multi-loop control structure was adopted with the controller parameters varying adaptively at different working conditions to obtain better performance. Different root-mean-square (RMS) calculation algorithms have been compared and the ﬁnal RMS calculation scheme was determined to realize the trade-off between accuracy and computing efﬁciency. Experimental results show considerable performance improvements of the generator output voltage under various operating conditions with the proposed GCU.


Introduction
With the rapid development of aviation technology, the concept of more electric aircraft (MEA) becomes a reality. In MEA, the use of electrical equipment is pervasive, which leads to a continuous growing demand of power supply and more stringent power quality requirements. The power supply system is increasingly becoming an important factor that restricts the innovation of aircraft technology, which develops from constant frequency (400 Hz) to variable frequency (360-800 Hz), and from low voltage (115 V alternating current (AC), 28 V direct current, (DC)) to higher voltage (230 V AC, 270 V DC).
Compared with the constant frequency AC power supply system, the variable frequency AC power supply system does not require constant speed drive devices and the related power electronic converters. Thus, it has higher reliability, longer working time, and lighter weight. Moreover, the efficiency of the variable frequency power supply system can be up to 96% or more, while the efficiency of the constant frequency system is only 75.2-80% [1].
However, a traditional generator controller unit (GCU) uses analog devices for voltage regulation and protection execution, and is unable to be directly applied to the new high voltage variable frequency power supply system, which proposes an urgent need for the development of digital GCU. Compared with the analog GCU, digital GCU has many advantages. First of all, the digital GCU is designed to complete the control algorithm by using a microprocessor, which avoids the problem of the temperature influence and aging of the circuit device in the analog GCU, and improves the stability of the controller. Secondly, in digital GCU, using an algorithm to realize the control strategy, it is easy to modify the control parameters and to use the relatively advanced control algorithms that can significantly improve the control accuracy under different conditions [1][2][3][4][5].
In the early stage of the digital generator controller development, the controller usually uses a single microprocessor limited to the microprocessor technology, and can only complete simple control and protection functions [6]. With the rapid development of computer technology, the performance of microprocessors such as digital signal processor (DSP) is enhanced. Thus, it is possible to use multi-variable feedback controls and more complex control algorithms, which have higher control precision and better performance [7]. For synchronous generator voltage regulation controller structure, there is a predictive controller based on the motor model, which achieves stability and better performance [8]. In addition, there are other control structures [9], for example, using a part of the motor model to complete the regulatory function in the auxiliary loop. Compared with the conventional constant frequency generator, the GCU for the variable frequency system must deal with significant variations in operating points and associated dynamics due to a wide frequency range. Control algorithms and hardware should be more complex in order to obtain the desired performance [10].
Currently available published research, which focuses on the voltage control of three-stage generator, is still rare. Although various publications have been published on the control design for the generators or motors in renewable system [11][12][13], they could not be directly adopted in the MEA, due to its three-stage generation system. In [7,10], the authors investigated the model based controller design for variable frequency generator. In [14,15], a digital automatic voltage regulator was developed considering sensor failure with uncertainty analysis. However, all these publications only focus on constant frequency three-stage generators, which could not satisfy the requirement proposed by variable frequency three-stage generators.
This paper develops a digital GCU for three-stage synchronous generators with a wide range of operating frequency by improving the existing control algorithm. The main contributions of this paper can be summarized as follows: This paper proposes a dual-DSP system, in which the main-DSP completes protection, communication, and management functions of the system, while the sub-DSP completes generator voltage control and other functions. Dual DSP design can ensure that the system is more reliable, and has better control performance. The parameters of the PI controller will be changed adaptively according to the frequency, and the voltage regulation accuracy is thus higher than the constant PI controller. Moreover, this paper adopts a multi-feedback multi-loop controller structure. The inner loop compensates for the load current, so as to reduce the influence of the load current, enabling the regulator to adapt to a larger scope of working frequency and having better steady and dynamic performance.

Three-Stage Generator
A typical generator in aircraft applications is actually composed of a main generator, an AC exciter with a rotating rectifier and a permanent magnet auxiliary exciter (PMG) that is on the same shaft. Such a configuration is usually referred to as a three-stage generator. The main generator is a rotating electrode type synchronous generator, and the AC exciter is a rotating armature type synchronous generator. The auxiliary exciter is a permanent magnet synchronous generator due to its advantage of simple structure, small size, light weight, high power density and high efficiency. The three-phase alternating current generated by the AC exciter is rectified to DC power by a rotating rectifier mounted on the motor rotor, used for the excitation of the main generator. Three-phase AC voltage output of the permanent magnet machine is converted to DC voltage by the rectifier bridge to provide excitation voltage to the exciter field winding, and also to GCU [14]. Systems with above characteristics require that the main generator excitation regulation be realized through the exciter field winding on its stator. Generator output voltage is actually controlled by exciter field current, realized by controlling the Energies 2018, 11, 96 3 of 17 excitation circuit switch conduction ratio. Figure 1 schematically shows the three-stage power system components and the main functional blocks of the GCU. realized by controlling the excitation circuit switch conduction ratio. Figure 1 schematically shows the three-stage power system components and the main functional blocks of the GCU.

Internal Structure and Working Principle of GCU
Digital generator controller can execute two major functions, namely voltage regulation function and control protection function. Single DSP could not complete the above complex tasks and achieve high-speed real-time control simultaneously. Thus, this paper uses a parallel processing scheme of a double DSP system to realize the GCU function, where each DSP has its own program and data, and two DSPs can communicate and collaborate with each other to jointly complete faster regulation and protection 154]. Among them, the main DSP mainly completes control protection, build-in testing (BIT), fault detection and isolation, and communication with the host computer; the sub-DSP is specifically responsible for the generator output voltage regulation. In this scheme, system protection and voltage regulation can be implemented independently, to ensure the efficiency of the system, and improve fault tolerance with high reliability. The GCU internal structure is shown in Figure 2. In order to improve the dynamic performance of the regulator, this paper presents a fast deexcitation circuit as shown in Figure 3. In this circuit, power Metal-Oxide-Semiconductor Field Effect Transistor (MOSFET) is connected in series with the excitation circuit, which can adjust the excitation current by working on the switching mode. Diodes D1, D2 operate in freewheeling mode. Under normal circumstances, the low-side MOSFET Q2 is working in conducting state, unless generator output voltage is higher than the set value. High-side MOSFET Q1 performs the regulation function of GCU. When the two MOSFETs are both turned on, the excitation voltage is applied to the field winding. When the high-side MOSFET Q1 is turned off, the direction of excitation current will be changed due to the presence of the diode, so that the voltage across the field winding is reversed, accelerating the regulation adjustment.

Internal Structure and Working Principle of GCU
Digital generator controller can execute two major functions, namely voltage regulation function and control protection function. Single DSP could not complete the above complex tasks and achieve high-speed real-time control simultaneously. Thus, this paper uses a parallel processing scheme of a double DSP system to realize the GCU function, where each DSP has its own program and data, and two DSPs can communicate and collaborate with each other to jointly complete faster regulation and protection [14]. Among them, the main DSP mainly completes control protection, build-in testing (BIT), fault detection and isolation, and communication with the host computer; the sub-DSP is specifically responsible for the generator output voltage regulation. In this scheme, system protection and voltage regulation can be implemented independently, to ensure the efficiency of the system, and improve fault tolerance with high reliability. The GCU internal structure is shown in Figure 2.

Internal Structure and Working Principle of GCU
Digital generator controller can execute two major functions, namely voltage regulation function and control protection function. Single DSP could not complete the above complex tasks and achieve high-speed real-time control simultaneously. Thus, this paper uses a parallel processing scheme of a double DSP system to realize the GCU function, where each DSP has its own program and data, and two DSPs can communicate and collaborate with each other to jointly complete faster regulation and protection 154]. Among them, the main DSP mainly completes control protection, build-in testing (BIT), fault detection and isolation, and communication with the host computer; the sub-DSP is specifically responsible for the generator output voltage regulation. In this scheme, system protection and voltage regulation can be implemented independently, to ensure the efficiency of the system, and improve fault tolerance with high reliability. The GCU internal structure is shown in Figure 2. In order to improve the dynamic performance of the regulator, this paper presents a fast deexcitation circuit as shown in Figure 3. In this circuit, power Metal-Oxide-Semiconductor Field Effect Transistor (MOSFET) is connected in series with the excitation circuit, which can adjust the excitation current by working on the switching mode. Diodes D1, D2 operate in freewheeling mode. Under normal circumstances, the low-side MOSFET Q2 is working in conducting state, unless generator output voltage is higher than the set value. High-side MOSFET Q1 performs the regulation function of GCU. When the two MOSFETs are both turned on, the excitation voltage is applied to the field winding. When the high-side MOSFET Q1 is turned off, the direction of excitation current will be changed due to the presence of the diode, so that the voltage across the field winding is reversed, accelerating the regulation adjustment. In order to improve the dynamic performance of the regulator, this paper presents a fast de-excitation circuit as shown in Figure 3. In this circuit, power Metal-Oxide-Semiconductor Field Effect Transistor (MOSFET) is connected in series with the excitation circuit, which can adjust the excitation current by working on the switching mode. Diodes D1, D2 operate in freewheeling mode. Under normal circumstances, the low-side MOSFET Q2 is working in conducting state, unless generator output voltage is higher than the set value. High-side MOSFET Q1 performs the regulation function of GCU. When the two MOSFETs are both turned on, the excitation voltage is applied to the field winding. When the high-side MOSFET Q1 is turned off, the direction of excitation current will be changed due to the presence of the diode, so that the voltage across the field winding is reversed, accelerating the regulation adjustment.  Figure 3. The de-excitation circuit.

Generator Controller Unit Control Method
The basic task of the generator controller unit is to ensure that the output voltage of the generator is within the range of the requirement. The single voltage loop structure with fixed parameters can meet the voltage regulation requirements of the traditional aircraft power supply system, but is difficult to meet the demand of the generator working under the circumstance of a wide frequency domain and large load variation. Therefore, this paper adopts a multi-feedback multi-loop controller structure as shown in Figure 4. As can be seen from Figure 4, this multi-feedback multi-loop controller adds the load current compensating feedback loop and field current feedback loop on the basis of the voltage feedback loop. The outer voltage control loop generates the reference value of the excitation current according to the output voltage error of the generator. Since the armature reaction generated by the generator load current will affect the terminal voltage and the excitation current, the middle loop compensates for the load current, so as to reduce the influence of the load current, enabling the regulator to adapt to a larger scope of working frequency and having better steady and dynamic adjustment performance. The inner feedback loop controls the excitation current of the exciter. The excitation current command or reference for the inner loop is generated by the sum of the regulation action iexreg from the outer voltage controller and the disturbance rejection iexload from the middle load current feed-forward control loop. A more detailed design process of the proposed controller can be found in Section 5.2.

Modeling and Stability Analysis
Stability is the prerequisite for the control system to work properly. Only under the premise of system stability, improving other properties is meaningful. Among them, the stability of the closedloop feedback control is a basic requirement, which can be attributed to compute the stable region of Proportion-Integration-Differentiation (PID) controller parameters. Therefore, it is necessary to

Generator Controller Unit Control Method
The basic task of the generator controller unit is to ensure that the output voltage of the generator is within the range of the requirement. The single voltage loop structure with fixed parameters can meet the voltage regulation requirements of the traditional aircraft power supply system, but is difficult to meet the demand of the generator working under the circumstance of a wide frequency domain and large load variation. Therefore, this paper adopts a multi-feedback multi-loop controller structure as shown in Figure 4.

Generator Controller Unit Control Method
The basic task of the generator controller unit is to ensure that the output voltage of the generator is within the range of the requirement. The single voltage loop structure with fixed parameters can meet the voltage regulation requirements of the traditional aircraft power supply system, but is difficult to meet the demand of the generator working under the circumstance of a wide frequency domain and large load variation. Therefore, this paper adopts a multi-feedback multi-loop controller structure as shown in Figure 4. As can be seen from Figure 4, this multi-feedback multi-loop controller adds the load current compensating feedback loop and field current feedback loop on the basis of the voltage feedback loop. The outer voltage control loop generates the reference value of the excitation current according to the output voltage error of the generator. Since the armature reaction generated by the generator load current will affect the terminal voltage and the excitation current, the middle loop compensates for the load current, so as to reduce the influence of the load current, enabling the regulator to adapt to a larger scope of working frequency and having better steady and dynamic adjustment performance. The inner feedback loop controls the excitation current of the exciter. The excitation current command or reference for the inner loop is generated by the sum of the regulation action iexreg from the outer voltage controller and the disturbance rejection iexload from the middle load current feed-forward control loop. A more detailed design process of the proposed controller can be found in Section 5.2.

Modeling and Stability Analysis
Stability is the prerequisite for the control system to work properly. Only under the premise of system stability, improving other properties is meaningful. Among them, the stability of the closedloop feedback control is a basic requirement, which can be attributed to compute the stable region of Proportion-Integration-Differentiation (PID) controller parameters. Therefore, it is necessary to As can be seen from Figure 4, this multi-feedback multi-loop controller adds the load current compensating feedback loop and field current feedback loop on the basis of the voltage feedback loop. The outer voltage control loop generates the reference value of the excitation current according to the output voltage error of the generator. Since the armature reaction generated by the generator load current will affect the terminal voltage and the excitation current, the middle loop compensates for the load current, so as to reduce the influence of the load current, enabling the regulator to adapt to a larger scope of working frequency and having better steady and dynamic adjustment performance. The inner feedback loop controls the excitation current of the exciter. The excitation current command or reference for the inner loop is generated by the sum of the regulation action i ex reg from the outer voltage controller and the disturbance rejection i ex load from the middle load current feed-forward control loop. A more detailed design process of the proposed controller can be found in Section 5.2.

Modeling and Stability Analysis
Stability is the prerequisite for the control system to work properly. Only under the premise of system stability, improving other properties is meaningful. Among them, the stability of the closed-loop feedback control is a basic requirement, which can be attributed to compute the stable region of Proportion-Integration-Differentiation (PID) controller parameters. Therefore, it is necessary to analyze the impact of controller parameters and operating condition changes in the field of system stability.

Three Stage Generator Transfer Function
Since the mathematical model of synchronous generator is well known since the 1930s, only main results will be presented [15]. The detailed mathematical models of three stage generators can be seen in Appendix A. If the generator's speed is constant and treated as a parameter of the system, Equations (1)-(5) which are linear differential equations can be rewritten for small perturbations by simply adding ∆ to all currents and voltages [16][17][18][19].
It can be seen that Equations (1), (4) and (5) are already in a convenient form for state space representation. For armature windings, that can be done by combining linearized generator's load equation as described in Equation (6).
State-space representation of the generator needs to have the form given by Equation (7) [20].
Where, x is the vector of state variables, and u is the vector of generator input.
To get matrices A and B from Equation (7), the generator's equations will be presented in the form given as in Equation (10) [21].
After that, matrices E, F and G can be gotten as Equations (11)- (13). Then, matrices A and B can be calculated as Equation (14).
Energies 2018, 11, 96 Set the RMS value of the generator v rms as output of the synchronous generator. Generator stator d and q voltages can be rewritten as the following equations: Considering dq conversion used herein, the generator transfer function (five-order) is written by the Equation (16). Where V dN , V qN , and V FN represent stator d and q voltages, and output peak voltage of the generator, respectively.
When establishing synchronous generator low-order transfer function, set the motor under constant rotational speed, and ignore the damper winding effect, and factors di d /dt, di q /dt in the armature windings, then the transfer function can be simplified as a first-order formula as in Equation (17). K g and τ g are the amplification factor and the time constant that can be calculated by the motor parameters.
The exciter can be treated with the above method as well. The rotating rectifier is regarded as a proportional part, and the permanent magnet machine is regarded as the input of speed, so the transfer function of exciter is a three-order formula. Finally, the high order (eight-order) and low order (two-order) transfer functions of the three-stage generator are compared in the frequency domain as shown in Figure 5. It can be seen that at the low frequency and intermediate frequency sections, an obviously matching degree is shown, so we can design the controller by using the lower order transfer function. Thus, we can use the low order transfer function of the three-stage generator to do the controller parameters design and system stability analysis.

Stability Analysis
In this paper, the stability of voltage regulation system manipulated by single voltage loop of Proportion-Integration (PI) controller is analyzed through Matlab (MathWorks, Natick, MA, USA).
The relationship between the stability margin and the frequency of the system without controller is shown in Table 1, indicating that as the frequency increases, the generator voltage regulation system stability declines.
Under the frequency of 400 Hz, the impact of PI parameters on the stability of the system is shown in Figure 6. It can be seen that generally speaking, the smaller the value of PI parameters is, the higher the stability of the system will be.

Stability Analysis
In this paper, the stability of voltage regulation system manipulated by single voltage loop of Proportion-Integration (PI) controller is analyzed through Matlab (MathWorks, Natick, MA, USA).
The relationship between the stability margin and the frequency of the system without controller is shown in Table 1, indicating that as the frequency increases, the generator voltage regulation system stability declines.
Under the frequency of 400 Hz, the impact of PI parameters on the stability of the system is shown in Figure 6. It can be seen that generally speaking, the smaller the value of PI parameters is, the higher the stability of the system will be.

Stability Analysis
In this paper, the stability of voltage regulation system manipulated by single voltage loop of Proportion-Integration (PI) controller is analyzed through Matlab (MathWorks, Natick, MA, USA).
The relationship between the stability margin and the frequency of the system without controller is shown in Table 1, indicating that as the frequency increases, the generator voltage regulation system stability declines.
Under the frequency of 400 Hz, the impact of PI parameters on the stability of the system is shown in Figure 6. It can be seen that generally speaking, the smaller the value of PI parameters is, the higher the stability of the system will be.  If we delimit the phase margin and project it onto k p k i plane, PI stable region with the phase margin of 45-75 • for system under 400 Hz and 800 Hz is shown in Figure 7 as follows. If we delimit the phase margin and project it onto kp ki plane, PI stable region with the phase margin of 45-75° for system under 400 Hz and 800 Hz is shown in Figure 7 as follows. Through the above analysis we can draw the following conclusions:  The smaller ki is, the better stability system can get. But there is no linear proportional relationship between kp and stability;  Controller parameter under 400 Hz and 800 Hz is feasible in different regions for the same stability requirements;  For kp ki feasible region under the same stability demand, domain area under 400 Hz is greater than that under 800 Hz. This is because the stability of the system descends if frequency increases, so the kp ki parameter tuning requirements are more stringent, thus its feasible region is smaller;  Feasible regions have overlapping parts. If we use the same PI parameter at different frequencies, the PI parameter is required to fall on the overlapping part of the feasible region.

Software Algorithm Design
Completing voltage regulation occupies lots of central processing unit (CPU) resources, which brings challenges in satisfying high real-time requirements of the system. Thus, a modular design approach was adopted in the design of software algorithms, which makes the program a clear structure, easy to debug, maintain and upgrade modules with easy expansion, high independence, and so on.

RMS Algorithm
Voltage regulation requires accurate measurement of generator output voltage value. Selecting the most suitable program for RMS calculation is vital to ensure the accuracy and real-time execution.
Several methods already exist that could be adopted for RMS calculation. Single point algorithm is a real-time method and requires only instantaneous values of three-phase voltage at synchronized instants, and no frequency information is required. Half period integral methods can complete calculation in half cycle only provided that the signal period is known, however, this integral method will bring measurement delay. Two-point algorithm requires sampling values of two points which need to be 90 degrees apart, so it could hardly be used in practice. Fast three-point algorithm in theory only needs three consecutive points to get the effective value, however, the sampling period needs to be a quarter of cycle in order to ensure the precision.
In summary, the single-point method is applicable to the calculation of three-phase symmetrical AC signal RMS value, which is in real time and independent of frequency, and is very suitable for voltage regulation system. Using a single point algorithm to calculate the effective value of 115 V, 400 Through the above analysis we can draw the following conclusions: The smaller k i is, the better stability system can get. But there is no linear proportional relationship between k p and stability; Controller parameter under 400 Hz and 800 Hz is feasible in different regions for the same stability requirements; For k p k i feasible region under the same stability demand, domain area under 400 Hz is greater than that under 800 Hz. This is because the stability of the system descends if frequency increases, so the k p k i parameter tuning requirements are more stringent, thus its feasible region is smaller; Feasible regions have overlapping parts. If we use the same PI parameter at different frequencies, the PI parameter is required to fall on the overlapping part of the feasible region.

Software Algorithm Design
Completing voltage regulation occupies lots of central processing unit (CPU) resources, which brings challenges in satisfying high real-time requirements of the system. Thus, a modular design approach was adopted in the design of software algorithms, which makes the program a clear structure, easy to debug, maintain and upgrade modules with easy expansion, high independence, and so on.

RMS Algorithm
Voltage regulation requires accurate measurement of generator output voltage value. Selecting the most suitable program for RMS calculation is vital to ensure the accuracy and real-time execution.
Several methods already exist that could be adopted for RMS calculation. Single point algorithm is a real-time method and requires only instantaneous values of three-phase voltage at synchronized instants, and no frequency information is required. Half period integral methods can complete calculation in half cycle only provided that the signal period is known, however, this integral method will bring measurement delay. Two-point algorithm requires sampling values of two points which need to be 90 degrees apart, so it could hardly be used in practice. Fast three-point algorithm in theory only needs three consecutive points to get the effective value, however, the sampling period needs to be a quarter of cycle in order to ensure the precision.
In summary, the single-point method is applicable to the calculation of three-phase symmetrical AC signal RMS value, which is in real time and independent of frequency, and is very suitable for voltage regulation system. Using a single point algorithm to calculate the effective value of 115 V, Energies 2018, 11, 96 9 of 17 400 Hz AC signal, Figure 8 shows that the calculation accuracy is stable within ±1.5% in compliance with the technical requirements. Hz AC signal, Figure 8 shows that the calculation accuracy is stable within ±1.5% in compliance with the technical requirements. This paper presents the design of the generator controller with variable frequency system as the background. The low pass filter circuit exists in the voltage conditioning circuit, through which lowfrequency signals changing from 0 to ωH can pass with the gain of A0 under ideal conditions. The amplitude frequency response is shown in Figure 9. However, in practice, the gain of the low pass filter circuit will decrease in the pass band, so a frequency change of input voltage brings about conditioning circuit capacitance decreasing while the frequency is increasing, leading to a decrease in conditioning circuit output voltage. Eventually, the calculated RMS value will be reduced in the program; therefore, the voltage regulation accuracy is affected. Thus, it is necessary to compensate for the RMS value calculated varying with frequency in DSP program, to ensure that it can achieve an accurate POR (point of regulation) voltage maintained at 115 V.

Voltage Regulation Algorithm
The generator has a plurality of working conditions, such as voltage buildup, overvoltage and normal operation, etc. It is difficult to balance all working states if only one single control strategy is used. Therefore, different control strategies are adopted for different stages in this system. Voltage buildup stage: voltage starts to build when the generator reaches a certain speed. In the initial stage, the output voltage is very small, so it is conducive to a rapid rise in voltage by making the switch tube in a state of full conduction. However, due to the inertia of the generator, the output voltage change lags behind the change of the excitation current. Therefore, when the field current reaches a certain value, limitation operations are adopted until the build-up process is completed.
Normal operation stage: according to the frequency of the moment, the corresponding PID controller parameters for duty ratio calculation are adopted. The control strategy of Bang-bang is adopted to accelerate the dynamic response of the voltage regulation system. Set the error threshold emax and emin. Duty ratio is 0 when e(k) > emax, and 1 when e(k) < emim. When emim < e(k) < emax, use variable parameter PID control to calculate the duty cycle. This paper presents the design of the generator controller with variable frequency system as the background. The low pass filter circuit exists in the voltage conditioning circuit, through which low-frequency signals changing from 0 to ω H can pass with the gain of A0 under ideal conditions. The amplitude frequency response is shown in Figure 9. However, in practice, the gain of the low pass filter circuit will decrease in the pass band, so a frequency change of input voltage brings about conditioning circuit capacitance decreasing while the frequency is increasing, leading to a decrease in conditioning circuit output voltage. Eventually, the calculated RMS value will be reduced in the program; therefore, the voltage regulation accuracy is affected. Thus, it is necessary to compensate for the RMS value calculated varying with frequency in DSP program, to ensure that it can achieve an accurate POR (point of regulation) voltage maintained at 115 V. Hz AC signal, Figure 8 shows that the calculation accuracy is stable within ±1.5% in compliance with the technical requirements. This paper presents the design of the generator controller with variable frequency system as the background. The low pass filter circuit exists in the voltage conditioning circuit, through which lowfrequency signals changing from 0 to ωH can pass with the gain of A0 under ideal conditions. The amplitude frequency response is shown in Figure 9. However, in practice, the gain of the low pass filter circuit will decrease in the pass band, so a frequency change of input voltage brings about conditioning circuit capacitance decreasing while the frequency is increasing, leading to a decrease in conditioning circuit output voltage. Eventually, the calculated RMS value will be reduced in the program; therefore, the voltage regulation accuracy is affected. Thus, it is necessary to compensate for the RMS value calculated varying with frequency in DSP program, to ensure that it can achieve an accurate POR (point of regulation) voltage maintained at 115 V.

Voltage Regulation Algorithm
The generator has a plurality of working conditions, such as voltage buildup, overvoltage and normal operation, etc. It is difficult to balance all working states if only one single control strategy is used. Therefore, different control strategies are adopted for different stages in this system. Voltage buildup stage: voltage starts to build when the generator reaches a certain speed. In the initial stage, the output voltage is very small, so it is conducive to a rapid rise in voltage by making the switch tube in a state of full conduction. However, due to the inertia of the generator, the output voltage change lags behind the change of the excitation current. Therefore, when the field current reaches a certain value, limitation operations are adopted until the build-up process is completed.
Normal operation stage: according to the frequency of the moment, the corresponding PID controller parameters for duty ratio calculation are adopted. The control strategy of Bang-bang is adopted to accelerate the dynamic response of the voltage regulation system. Set the error threshold emax and emin. Duty ratio is 0 when e(k) > emax, and 1 when e(k) < emim. When emim < e(k) < emax, use variable parameter PID control to calculate the duty cycle.

Voltage Regulation Algorithm
The generator has a plurality of working conditions, such as voltage buildup, overvoltage and normal operation, etc. It is difficult to balance all working states if only one single control strategy is used. Therefore, different control strategies are adopted for different stages in this system. Voltage buildup stage: voltage starts to build when the generator reaches a certain speed. In the initial stage, the output voltage is very small, so it is conducive to a rapid rise in voltage by making the switch tube in a state of full conduction. However, due to the inertia of the generator, the output voltage change lags behind the change of the excitation current. Therefore, when the field current reaches a certain value, limitation operations are adopted until the build-up process is completed.
Normal operation stage: according to the frequency of the moment, the corresponding PID controller parameters for duty ratio calculation are adopted. The control strategy of Bang-bang is adopted to accelerate the dynamic response of the voltage regulation system. Set the error threshold e max and e min . Duty ratio is 0 when e(k) > e max , and 1 when e(k) < e mim . When e mim < e(k) < e max , use variable parameter PID control to calculate the duty cycle.
Overvoltage stage: when the output voltage of the generator is greater than 125 V, e(k) is greater than e max at this moment as described above, thus, both low-side and high-side MOSFET are closed in de-excitation circuit, and excitation current declines rapidly.
According to the above analysis, we can get the basic process of the control program as shown in Figure 10. D1 and D2 are the high-side and low-side MOSFET control signal duty cycle, respectively. The upper and lower limits of the error e(k) need to be determined during practical tests. Overvoltage stage: when the output voltage of the generator is greater than 125 V, e(k) is greater than emax at this moment as described above, thus, both low-side and high-side MOSFET are closed in de-excitation circuit, and excitation current declines rapidly.
According to the above analysis, we can get the basic process of the control program as shown in Figure 10. D1 and D2 are the high-side and low-side MOSFET control signal duty cycle, respectively. The upper and lower limits of the error e(k) need to be determined during practical tests. In practice, since the motor parameters are not accurate, and the low-order transfer function of the three-stage mathematical model is not precise enough with a lot of dynamic factors ignored, it results in the controller parameters designed not being directly applicable for practical use, which can only provide a theoretical basis. This paper proposes a method for modifying control parameters with the operating characteristics of GCU.
The operating characteristic of the generator controller is a function relation between the output voltage of the main generator o U and the excitation current F i . For the same o U  shown as Figure 11, F i  increases with downward in frequency due to the same ΔD. Thus, in case of the same control parameters, it causes voltage fluctuation to meet the requirements at low speed, but becomes large at high frequencies. Therefore, parameter modification is required for the purpose of improving the voltage regulation accuracy. If the regulator uses proportional control, the following Equation (18) can be obtained, where, P K is the proportional coefficient of the controller, () ek is the difference between the output voltage and the reference value of the generator: Therefore, when the frequency increases, due to the increase in excitation voltage from  In practice, since the motor parameters are not accurate, and the low-order transfer function of the three-stage mathematical model is not precise enough with a lot of dynamic factors ignored, it results in the controller parameters designed not being directly applicable for practical use, which can only provide a theoretical basis. This paper proposes a method for modifying control parameters with the operating characteristics of GCU.
The operating characteristic of the generator controller is a function relation between the output voltage of the main generator U o and the excitation current i F . For the same ∆U o shown as Figure 11, ∆i F increases with downward in frequency due to the same ∆D. Thus, in case of the same control parameters, it causes voltage fluctuation to meet the requirements at low speed, but becomes large at high frequencies. Therefore, parameter modification is required for the purpose of improving the voltage regulation accuracy. If the regulator uses proportional control, the following Equation (18) can be obtained, where, K P is the proportional coefficient of the controller, e(k) is the difference between the output voltage and the reference value of the generator: Therefore, when the frequency increases, due to the increase in excitation voltage from v F1 to v F2 , K P should be reduced proportional to (v F1 /v F2 ) × K P1 , where K P1 represents proportional coefficient at low frequency. Figure 11. GCU operational characteristics using same PI under different frequencies.

Experimental Verification
The designed DSP-based GCU was built to test the theoretical analysis; a JF-30 generator (Avic, Xi'an, China) was adopted as the generator under test, as shown in Figures 12 and 13, with a Labviewbased test system (National Instruments, Austin, TX, USA) for measuring and analyzing the output voltage. The rated power of driving motor is 160 KVA, the rated power of the JF-30 generator is 30 KVA, and the rated output voltage is 115 V. TMS320F28335 (Texas Instruments, Dallas, TX, USA) is adopted as the digital DSP. Detailed parameter values can be noticed from Appendix B.   Table 2 shows the generator steady state output voltage under the control of GCU using single voltage control loop at different speeds with no load, which was maintained at about 115 V, and the maximum error is 0.35% (0.4 V). So GCU can keep the output voltage stable under no-load conditions. Figure 11. GCU operational characteristics using same PI under different frequencies.

Experimental Verification
The designed DSP-based GCU was built to test the theoretical analysis; a JF-30 generator (Avic, Xi'an, China) was adopted as the generator under test, as shown in Figures 12 and 13, with a Labview-based test system (National Instruments, Austin, TX, USA) for measuring and analyzing the output voltage. The rated power of driving motor is 160 KVA, the rated power of the JF-30 generator is 30 KVA, and the rated output voltage is 115 V. TMS320F28335 (Texas Instruments, Dallas, TX, USA) is adopted as the digital DSP. Detailed parameter values can be noticed from Appendix B.

Experimental Verification
The designed DSP-based GCU was built to test the theoretical analysis; a JF-30 generator (Avic, Xi'an, China) was adopted as the generator under test, as shown in Figures 12 and 13, with a Labviewbased test system (National Instruments, Austin, TX, USA) for measuring and analyzing the output voltage. The rated power of driving motor is 160 KVA, the rated power of the JF-30 generator is 30 KVA, and the rated output voltage is 115 V. TMS320F28335 (Texas Instruments, Dallas, TX, USA) is adopted as the digital DSP. Detailed parameter values can be noticed from Appendix B.   Table 2 shows the generator steady state output voltage under the control of GCU using single voltage control loop at different speeds with no load, which was maintained at about 115 V, and the maximum error is 0.35% (0.4 V). So GCU can keep the output voltage stable under no-load conditions.

Experimental Verification
The designed DSP-based GCU was built to test the theoretical analysis; a JF-30 generator (Avic, Xi'an, China) was adopted as the generator under test, as shown in Figures 12 and 13, with a Labviewbased test system (National Instruments, Austin, TX, USA) for measuring and analyzing the output voltage. The rated power of driving motor is 160 KVA, the rated power of the JF-30 generator is 30 KVA, and the rated output voltage is 115 V. TMS320F28335 (Texas Instruments, Dallas, TX, USA) is adopted as the digital DSP. Detailed parameter values can be noticed from Appendix B.   Table 2 shows the generator steady state output voltage under the control of GCU using single voltage control loop at different speeds with no load, which was maintained at about 115 V, and the maximum error is 0.35% (0.4 V). So GCU can keep the output voltage stable under no-load conditions.  Table 2 shows the generator steady state output voltage under the control of GCU using single voltage control loop at different speeds with no load, which was maintained at about 115 V, and the maximum error is 0.35% (0.4 V). So GCU can keep the output voltage stable under no-load conditions. Combined with the previously described method, the controller parameters are modified to obtain better dynamic performance. Table 3 is in contrast of modified K P (K P = 4.034) and before (K P = 5) with the rated load. It shows that modified controller parameters contribute to smaller voltage modulation and more accurate steady-state voltage. It can be seen from Table 4 that the steady-state voltage value of the rated load is slightly lower when compared with no load, but still, the GCU can keep the output voltage stable under different frequencies. The load change has great influence on the dynamic performance of the generator controller. The generator output voltage with dynamic load changing conditions, for example, load connection and disconnection, under the speed of 7600 r/min, 8000 r/min and 8200 r/min, were described, respectively in Figures 14-19, in which the red line is the normal AC voltage transient envelope required by the standard. Figure 20 shows the variation of the output voltage of the generator during the whole load connection and disconnection process under the speed of 8000 r/min. Closed loop experiments show that the generator controller designed in this paper can complete the function of voltage regulation, and meet the requirements of the standard. and disconnection, under the speed of 7600 r/min, 8000 r/min and 8200 r/min, were described, respectively in Figures 14-19, in which the red line is the normal AC voltage transient envelope required by the standard. Figure 20 shows the variation of the output voltage of the generator during the whole load connection and disconnection process under the speed of 8000 r/min. Closed loop experiments show that the generator controller designed in this paper can complete the function of voltage regulation, and meet the requirements of the standard.

Conclusions
In order to satisfy the voltage regulation and protection requirement of a variable speed variable frequency generation system of future more electric aircraft, this paper provides a detailed design of a digital generator controller unit. To be more precise, a dual DSP structure was adopted to ensure higher reliability, and the controller was designed with multi-control loops; analysis of the influence of the controller parameters on stability was provided. Moreover, the parameters of the designed controller will be changed adaptively according to the varying frequency. Different RMS calculation methods have also been compared in order to find a more accurate method with higher computing efficiency. Experimental test bed was built and the results were also provided and analyzed. In general, the new GCU can fulfill better performance under a wider operating frequency range.

Appendix A
A more detailed description of the mathematical model of the three-stage generation system is provided bellow.
The stator voltage equation and flux linkage equation of main synchronous generator under dq0 coordinate are shown as (A1) and (A2).
The exciter is three-phase AC generator, but cancels the damping winding. So mathematical model of exciter as follows: According to the structure and principle analysis of permanent magnet synchronous machine, it can be determined that its mathematical model is basically the same as that of electric excitation synchronous machine.

Appendix B
Parameters of the generator is listed in the following Table A1.