Fuzzy logic-based synchronization control system of generators under conditions of frequency instability

ABSTRACT


INTRODUCTION
In recent decades, autonomous electric power system (AEPS) have been increasingly developed to generate electrical energy in regions where diesel and diesel gas generator units (DGGU) have been used as power units.However, a significant disadvantage that restricts the application of DGGU, as noted in [1], [2], is the presence of fluctuations in the shaft speed, and accordingly, in the generator voltage frequency.This fluctuation is due to the significant nonlinearity of gas and diesel engines and the change in these engines' parameters when the load changes, as demonstrated in [3], [4].This complicates the generator synchronization process and distribution of power between generators while in parallel operation.Recent work [5] has demonstrated that the range of voltage frequency fluctuations may be within ±5 Hz.Such frequency fluctuations have a negative impact on the generator synchronization process.Past research [6]- [8] has attempted to solve the issue of generator synchronization in diesel-generator AEPS.However, these papers do not address the impact of random voltage frequency fluctuations of the connected generator.Due to such fluctuations, in the time between generating a signal to connect the generator to the bars and closing  ISSN: 2302-9285 Bulletin of Electr Eng & Inf, Vol. 12, No. 6, December 2023: 3215-3227 3216 the contacts of the circuit breaker itself, the synchronization conditions may change, disrupting the normal operation of power consumers and sometimes even leading to an emergency situation.This issue may be solved by the parametric optimization of the regulator of the DGGU speed control system; such an approach would reduce the magnitude of voltage frequency fluctuations, as indicated in [9].In addition, this solution is applicable to static operation modes of power units operating in parallel for a total load (i.e., after generator synchronization has occurred).As indicated in [10], solving the generator synchronization issue is one way to increase the efficiency of AEPS operation.Moreover, the issues of generator synchronization process simulation to assess the impact of violation of synchronization conditions on the quality of the power within the AEPS network and its operation as a whole remain relevant.The available models of AEPS, as described in [11]- [13], use diesel generator units, which limits the application of these models and does not allow to study procedures in electric power systems operating under conditions of low power quality with frequency fluctuations characteristic of diesel gas units and voltage spikes or sags due to commutation of powerful electricity consumers.Therefore, relevant outstanding issues include solving the issues of automating diesel gas plants using modern digital systems, constructing adequate models that represent procedures in real electric power systems with DGGU, and improving the quality of electricity.
The development of the modern autonomous electric power industry has been accompanied by the introduction of complex algorithms for monitoring and control, data collection and processing, forecasting and decision-making, and these algorithms are based on microprocessor control systems.Digital systems capable of real-time management are very complex hybrid objects to analyze.Various parts of the system have various natures (comprising, for example, continuous objects and the discrete control parts), but the system is generally described by a complex combination of differential equations, algebraic equations, inequalities, and logical conditions [14], [15].Under these conditions, analyzing the behavior of digital control and automation system becomes more complicated and requires computer simulations.A useful computer model should reflect both continuous and discrete parts of a system.The representation of a discrete part of the model in the form of a digital state machine would allow one to design software to practically implement a synchronization system using a microcontroller.
The purpose of this paper is first to develop models of the precise automatic synchronization of a generator in the form of a digital state machine that captures AEPS behavior to study the generator synchronization process under conditions of significant frequency fluctuations.This work also examines the maximum possible deviations from acceptable synchronization conditions and studies the application of fuzzy logic when implementing the generator synchronization process.Finally, this work describes software that employs methods of conceptual simulation to monitor and control the generator synchronization process in an automated fashion.
Generator synchronization is executed either during power shortages or when the operating generator is experiencing a load that exceeds 80% of the rated power.The study of speed fluctuation procedures, the results of which are presented in [5], has used developed hardware and software to demonstrate that the greatest speed fluctuations of diesel gas units are observed in the idle mode.When the load of a diesel gas generator is increased, the root-mean-square deviation σ of the speed fluctuations procedure decreases.Consequently, when a DGGU is loaded to 80% of the rated power, the speed fluctuations disappear (σ=0) [5].Generator synchronization (or generator-to-network) occurs when one generator is almost completely loaded, that is, no speed fluctuations are registered, and a second generator is operating in idle mode, so its output voltage frequency fluctuations are maximal due to the instability of the diesel gas unit speed.The development of an AEPS computer model has been based on the following details and requirements: i) dynamic procedures are available (frequency fluctuations, load commutation); ii) the results of the experiment must be repeated in a computer model with engineering precision; iii) the AEPS computer model and its control systems should be user friendly; and iv) the generator synchronization system should be implemented in the form of a digital state machine to enable further application in hardware and software systems.

DEVELOPMENT OF THE COMPUTER SIMULATION MODEL
The following features were considered irrelevant to the current work.First, gaps and small inertia should be excluded from consideration.Moreover, the computer model needs neither capture the behavior of all structural elements of the gas diesel engine nor electromagnetic and thermal procedures.Oscillating procedures in the model should be implemented using a white noise generator and a generating filter to output a random procedure that is adequately similar to a real one.The diesel gas generator control system includes the following basic elements: i) a diesel gas generator as a controlled object; ii) regulators implementing the basic laws of diesel control and synchronous generator excitation; iii) a control device (actuator) to ensure the fuel pump rail motion; iv) a generator-associated load on the diesel and inherent losses in the diesel, and v) diesel speed frequency and generator voltage magnitude sensors.To simulate the speed frequency fluctuations of a diesel gas unit, a random procedure corresponding to the real one must be simulated, as indicated in past work [3].This issue has been solved in the present model using a white noise generator and a generating filter, and the noise generation is described by (1): where   () is the spectral density of the desired random procedure,   2 is a white noise variance, and   () is the complex transmission factor of the generating filter.
Thus, the type and numerical features of the spectrum of the simulated interference are determined by the type and numerical features of the transfer function of the generating filter in (1).A white noise source can be generated using pseudorandom sequence generation algorithms.A first-order aperiodic link can be used as a filter, the transfer feature of which has (2): where T0 is the integration time constant of the aperiodic link and k0 is the proportionality factor.To implement a digital filter using (2), a discrete transfer function is required: Where  =  −   0 ,  =  0 (1 − ), () is the output signal of the filter, Θ() is the input signal of the filter, and T is the sampling period.
The data used to determine the initial conditions of the model are the mean value of frequency runs fB during a certain time interval per the level fth, the mean number of runs NB for the time TB, the duration of the period τB of the frequency deviation from the rated one, and the probability of frequency deviation within the time interval ∆t.The mean deviations frequency can be determined using the following expression: where f0 is the fundamental power frequency.An increase in the mean runs frequency value can be achieved via the generation of rapidly oscillating procedures.Such procedures can be created by reducing the time constant of the generating filter.Thus, an additive random interference is generated by using a white noise generator, passing the obtained value through the generating filter, and adding a disturbing effect to the power unit speed control signal.
Figure 2 demonstrates a digital state machine that implements the algorithm to synchronize the generator system operation.The input signals of the digital state machine are the active voltage values of the operating (u2) and connected (u1) generator, the voltage frequency values of the operating (f1) and connected generator (f2), the beat voltage (du12), and a discrete signal to start the synchronization process.The output signals of the digital state machine are a signal to increase or decrease the generator excitation voltage, a signal to change the speed of the drive motor, and a signal to close the circuit breaker contacts.
The use of a digital state machine in the system allows us to consider the system from another point of view.With this solution, several controllers appear in the control system: one works with small deviations of the controlled value, and the other works with large deviations.For each of the controlled parameters (frequency and voltage of the generator being connected), its own regulator is used.In switching circuits, when one controller is operating, the other controller performs unnecessary calculations, i.e. is in idle mode.If, however, the controller is placed in the state block of the state machine, as is done in this research, then it will work only when the state is active, and there will be no calculations in the inactive state.It makes the use of the microprocessor in the control system more effective due to necessary calculations can be finished faster, more complex algorithms can be used.
The initial state of the state machine is the S0 state in which the internal variables required for the algorithm operation are initialized.Unless a command to start the synchronization process is available, the state machine switches to the SS0 state, which consists of SS1 (generator voltage control) and SS2 (diesel speed control) substates, which are the nested automata.A parallel decomposition is applied to SS1 and SS2 states.When the synchronization conditions are met, the state machine switches to the SS3 state, in which the voltage derivative difference is analyzed.The signal output for closing the circuit breaker contacts (three-phase breaker) is completed at a time that minimizes current surge and voltage sag.The described digital state machine is synchronous and is clocked by the CLK1 pulse generator.In the intervals between clock pulses, the digital state machine is in some way "blind" and has no information about the current state of the input values.Since the fluctuations in voltage and frequency in the network are random [2], therefore, it is possible that in a time equal to the period of the clock signal, the values will change and hence the derivatives of voltages, frequencies, and phase difference.Therefore, the correct choice of the frequency value of the clock signal of the digital machine is extremely important.
At the same time, random processes of voltage and frequency changes are low-frequency, and, as was shown in [5], the smallest value of the period of such oscillations is 0. frequency must be chosen at least in 10 times higher than this value.In this case, during the time required to switch the state of the digital machine, the network frequency parameters in the worst case can change by a value that is 10 times less than the period of frequency fluctuations, i.e. 0.5 Hz.When the system is operating at the border of the permissible frequency difference, which is 1 Hz (for example, if the network frequency is 50 Hz, and the frequency of the connected generator is 51 Hz), during the switching of the state of the machine, the synchronization conditions may be violated, which is unacceptable.In this case, there are 2 ways to solve the problem.On the one hand, you can set the allowable frequency difference, at which synchronization of the generators is possible, and set it equal to 0.5 Hz.In this case, even under the worst circumstances, the maximum difference between the frequencies of the network and the connected generator will not exceed 1 Hz.On the other hand, it is possible to increase the frequency of the clock signal of the digital state machine by another 10 times, and in this case, the maximum possible random change in the frequency of the mains voltage will not exceed 0.05 Hz.In this case, the permissible frequency difference, at which synchronization of the generators is possible, must be set at the level of 0.95 Hz.Thus, increasing the frequency of the clock signal of the digital machine of the synchronization system reduces the period of time during which the system is "blind".

RESULTS AND DISCUSSION
The simulation of the generator synchronization process is executed under low power quality conditions due to the connected generator's instable drive motor speed and because of voltage surges or sags in the operating generator caused by the commutation of powerful electricity consumers.Figure 3 presents oscillograms of the voltage and frequency (speed) of the connected generator's voltage during the synchronization process in the presence of disturbances.The circuit breaker that connects the generators for parallel operation closes at time t=20 s.The simulation results are presented in relative units.
Random voltage surges and sags violate the synchronization conditions and delay the procedure of switching the generators to parallel operation.The experimental data analysis in the paper [5] indicated that the maximum rate of frequency change in the idle mode was 0.2 Hz/s.To ensure acceptable conditions under which it is possible to synchronize generators, this frequency difference should not exceed 1 Hz, the voltage difference should not exceed 10% of the nominal voltage of the generators, and the phase difference should not exceed 10° [16].The synchronization process has been analyzed for boundary conditions.where Ud1 and Ud2 are the voltage amplitudes of the first and second generator and ω1 and ω2 are the voltage frequencies of the first and the second generator, respectively.However, if in (4), Ud1=Ud2=U, then the current value of the beat voltage changes according to (5): An experimental study of frequency fluctuations in [5] revealed that frequency fluctuations are completely absent in a generator operating at 80% of its rated load, that is, dω 1  = 0. Unless the frequency of the connected generator fluctuates, the expression ( 5) is as (6): The available synchronization systems described in [16] operate such that the generators are connected for parallel operation at zero phase difference.Such operation is ensured by analyzing the difference in the generator voltage frequencies.The advance time of the signal generation for the circuit breaker is calculated while considering the time of the circuit breaker operation.However, after the signal for closing the contacts of the circuit breaker is generated, the conditions of synchronization are subject to change.This change in conditions is due to the circuit breaker contact engaging time, which can be several hundred milliseconds.Unless (6) assumes that the maximum permissible voltage difference at which the synchronization can be completed is equal to 10% of the rated (38 V), this difference could, at worst, be 45.6 V, which violates synchronization conditions.To prevent violation of the generators' synchronization conditions due to the presence of speed fluctuations, the frequency difference derivative must be considered by the synchronization system operation algorithm.
To solve this assignment, it is proposed to use fuzzy logic when implementing a generator synchronization system (see Figure 4).The input signals of the system are the signals of the difference in linear voltages u, the generators' frequency difference signals, and the phase difference.The phase shift between two periodic voltages is determined using electronic phase meters.The beat is a periodic oscillation with a repetition frequency equal to the generators' frequency difference.When the beat voltage reaches its maximum, the generator voltages are in antiphase, and when the beat voltage is equal to zero, the generator voltages are in phase.The initial signal in the considered event is a pulses sequence that is generated by zero organs.Thus, the voltages of the operating generator and the connected generators are converted into a rectangular pulses sequence (Uc1 and Uc2 respectively).The exclusive-OR logic element is often used as a phase comparator of two digital sequences.The logic element output will generate the pulses, the duration of which is proportional to the phase difference [17]- [19].The initial sequence of pulses is described by (7): This sequence, which may be conditionally determined as a beat, is represented in a discrete form, where the periodic component has a period equal to the beat period.During its period, the A pulse's sequence duration increases from a minimum to a maximum and then decreases again to a minimum.Considering the case of voltage and frequency fluctuations, when developing a control system for a gas-diesel generator, such characteristics as standard deviation, dispersion, minimum and a maximum deviation of voltages, and frequencies difference should be taken into account.These values are used when setting up a fuzzy controller-setting the minimum and maximum values of input linguistic variables, the form of membership functions of input and output linguistic variables.Figure 5 represents a diagram explaining the principle of signal generation for measuring frequency and phase difference.The minimum pulse duration meets the boundary of the moment when the generator voltage phases coincide, and the maximum duration meets the boundary of the moment when these phases are in antiphase.The tφ pulse duration at the logic element output is related to the phase shift according to (8): where fs is the signals frequency.
The fuzzy regulator includes three basic units: i) a fuzzification unit, ii) a logical solution generation unit, and iii) a defuzzification unit.The fuzzification unit contains input linguistic variables xi, where i=1, 2,..., n; these linguistic variables include the generators' linear voltage difference Ud, the rate of change of the voltage difference (first derivative) of dUd/dt, a signal proportional to the frequencies difference of Δf and the rate of change of the frequencies' difference dΔf/dt, a signal proportional to the phase difference dφ, and the rate of change of the phase difference dφ/dt.The current values of the input variables are converted to linguistic ones.

Figure 5. Signal generation
The resulting membership function for the control effect on the controlled object in the defuzzification unit is generally converted into a numerical value by determining the "center of gravity" of the plane of the figure that lies under the graph of the resulting membership function.The abscissa of the center of gravity Sc=S(uc, μc) of the area covered by the resulting function μ(u) within the change of the variable u from U1 to U2 can be determined by ( 9) [20]: In ( 9) can be numerically integrated using the trapezoid method and a sampling interval of u0 to obtain (10): In the paper a mamdani type fuzzy regulator designed in MATLAB is used.The input variables are as follows: the generator linear voltages difference, the rate of change of the voltage difference, the generators' frequency difference, the rate of change of the frequency difference, the phase difference between the voltages and the phase difference derivative.Linguistic terms meeting certain strong value ranges are set for each variable.The input variable u (voltage difference) includes five terms: NM indicates a negative mean, NZ indicates a negative mean close to 0, Z indicates a mean of zero, PZ indicates a positive mean close to 0, and PM indicates a positive mean.The following three terms are used for the input variable of "rate of change of voltage difference" (du): NZ indicates a negative value, Z indicates a minor close to zero, and PZ indicates a positive minor.Figures 6(a When constructing the membership functions of linguistic variables, direct methods were used (method of relative frequencies, parametric, and interval methods).It is the methods that should be used for measurable properties, values, and attributes, such as voltage, frequency, and phase difference.When using direct methods, an absolutely exact pointwise specification of the membership function μ(x) is often not required.As a rule, it is enough to fix the form of the membership function and the characteristic points, according to which the discrete representation of the membership function is approximated by a continuous analogue.The choice of trapezoidal membership functions is due to the convenience of software implementation and the reduction the required computing resources.As noted in [14], [17], during the experimental verification of the system operation, the form of terms and, possibly, their number is adjusted to achieve the required indicators of control quality.This adjusting process can take several times the time it takes to design a system.The rule database for NZ, Z, and PZ is shown in Table 1.At the fuzzification stage, the values of all input variables of the fuzzy inference system (obtained by a method external to the fuzzy inference system, for example, by using sensors) are assigned specific values of the membership functions of the corresponding linguistic variables.These variables are used in the IF-THEN conditions that form the fuzzy rule database of the fuzzy inference system.Fuzzification is considered complete if the degrees of truth μA(x) of all elementary logical statements of the form "β is α" included in the fuzzy production rules hold, where α is some set with a known membership functions μA(x) and A(x) is the value belonging to the sets of the linguistic variable β.The curvilinear relationship of the excitation control pulse's period depends on the values of the fuzzy regulator input and is described in When using a digital state machine and a difference scheme for calculating derivatives, at the moment of switching between states, the calculation of the derivative will be invalid, since the delay in the integration step will lead to the fact that it will contain not the previous value in time, but the value stored at the time the block was turned off (the moment of state changing).Therefore, in its basic application, a digital state machine generates fluctuations during state changes.When using fuzzy logic, the input of each of the regulators receives vectors of values, that contain frequencies difference and acceleration of the frequencies difference, voltages difference and acceleration of the voltages difference.The value of the frequencies difference is taken from the first vector and compared with a constant of 1.05 Hz.The value of the constant is chosen to be greater than the value of the allowable frequencies difference, and in this region, fluctuations caused by switching states of the digital state machine do not affect the operation of the synchronization system.Similarly, it is implemented for the voltage regulator, for which the value of the constant is 39 V, which is more than 10% of the nominal generator voltage of 380 V and beyond of acceptable value of voltages difference.The operator's automated working station (AWS) to control the generator synchronization process is presented in the form of a software package that solves the assignments of data collection, processing, and displaying.To develop the graphical interface for the operator's AWS, methods of conceptual simulation of data procedures and intelligent systems have previously been used [21]- [23].The following range of procedures and objects may refer to the common conceptual model of the graphical interface:  І = 〈, , ,   ,   ,   ,   ,   ,   , , , , 〉 where  = {  } is the multiplicity of imaging and data processing procedures;  = {  } is the multiplicity of data objects;  = {  } is the multiplicity of graphic objects;   ,   ,   establish a correspondence between the individual objects of the model and multiplicity of subordinate sub-objects;   ,   ,   are the adherence to procedures that partially determine the execution sequence; InD are the input data objects of the procedure; InG are the input graphic objects of the procedure; OutD are the output data objects of the procedure; and OutG are the output graphic objects of the procedure.Multiplicity of imaging and data processing procedures  = {  } may refer to the high-level functions that generate dot patterns (raster representation of objects, visible contours of objects, et cetera), the approximation of piecewise functions (graphic representation of objects), incoming data processing functions, control package generating functions, and procedures of distribution in execution threads.The multiplicity of data objects  = {  } may refer to incoming data packages, variables, and related structures associated with controls.The multiplicity of graphic objects  = {  } is represented in the form of a range of displays (graphic, pointed-type, bar-graph, and numerical), controlled objects (input/output elements and status display), and the visible area of the monitoring system.One of the basic components of the graphic model is the concept of graphic attributes.Attribute sets describe the basic properties of graphic objects, such as the line style, line color, a contour's size, and the background color [21]- [23].The graphic attributes model may be described as (12):   = 〈,   ,   ,   ,   ,   , , 〉 (12) where  = {  } is the multiplicity of graphic attributes;   is a graphic image;   ,   are the multiplicity of names of graphic attributes;   ,   are the multiplicity of names of types of graphic attributes; InC is a procedure requesting the attribute value; and OutC is the initializing procedure for the set of requested attributes of a graphic object.A graphic resources model is defined as (13): = 〈,   ,   ,   ,   ,   , , , 〉 where  = {  } is the multiplicity of graphic resources and DelR is the procedure for graphic resource imaging.
The interface of software tools for monitoring and controlling the generator synchronization procedure has been developed using methods of conceptual simulation of data procedures and intelligent systems and is shown in Figure 8.The dialog box controls display the following parameters: i) voltage oscillograms of the operating generator (network) and the generator connected for parallel operation; ii) voltage frequencies of the operating generator (network) and the connected generator; iii) the difference in generator voltage frequencies; iv) the phase difference between generator voltages; v) the acceptable frequency difference value; and vi) the advance time value of the signal generation to engage the circuit breaker contacts.The group of "frequency" data imaging elements contains text elements to display the frequency values of the operating generator and the generator connected for parallel operation.The group of "diesel unit speed" graphic imaging elements allows the operator to control the generation of pulse signals to control the diesel unit speed.The group of "generator excitation" graphic imaging elements allows one to control the generation of pulse signals, thus controlling the excitation of the connected generator.) and the generator that are being connected (curve 2) are presented.The microprocessor system of synchronization of generators, which is used in the conditions of high frequency instability, was developed and implemented at the facilities of Inter Electro LLC, Mykolaiv, Ukraine.Distinctive system features in comparison with the existing ones are: i) proactive control of the process of generating a signal to close the contacts of the circuit breaker, which gives the system the property of adaptability; ii) taking into

Figure 1 Bulletin
of Electr Eng & Inf ISSN: 2302-9285  Fuzzy logic-based synchronization control system of generators under … (Mahmoud M. S. Al-Suod) 3217 represents an AEPS computer model used to study the automatic, precise generator synchronization process under conditions of frequency fluctuations.

Figure 1 .
Figure 1.MATLAB model of an AEPS

Figure 2 .
Figure 2. Implementation of the generator synchronization system in the form of a digital state machine 2 s.The digital state machine clock Bulletin of Electr Eng & Inf ISSN: 2302-9285  Fuzzy logic-based synchronization control system of generators under … (Mahmoud M. S. Al-Suod) 3219

Figure 3 .
Figure 3. Changing the voltage and frequency of the connected generator during the synchronization process

Figure 6 .
Figure 6.Membership functions: (a) the terms of the "voltages difference" variable and (b) of the terms of the "rate of change of the voltage difference" variable

Figure 7
Figure 7(a).The fuzzy output surface for the pulse signal of the diesel gas unit's frequency control has the form given in Figure 7(b).When using a digital state machine and a difference scheme for calculating derivatives, at the moment of switching between states, the calculation of the derivative will be invalid, since the delay in the integration step will lead to the fact that it will contain not the previous value in time, but the value stored at the time the block was turned off (the moment of state changing).Therefore, in its basic application, a digital state machine generates fluctuations during state changes.When using fuzzy logic, the input of each of the regulators receives vectors of values, that contain frequencies difference and acceleration of the frequencies difference, voltages difference and acceleration of the voltages difference.The value of the frequencies difference is taken from the first vector and compared with a constant of 1.05 Hz.The value of the constant is chosen to be greater than the value of the allowable frequencies difference, and in this region, fluctuations caused by switching states of the digital state machine do not affect the operation of the synchronization system.Similarly, it is implemented for the voltage regulator, for which the value of the constant is 39 V, which is more than 10% of the nominal generator voltage of 380 V and beyond of acceptable value of voltages difference.

Figure 7 .
Figure 7. Pulse period relationships: (a) the excitation system depending on the voltage difference and (b) the speed regulator depending on the frequency difference

Figure 8 .
Figure 8. Operator's AWS interface for monitoring and controlling the generator synchronization process

Table 1 .
Structure of fuzzy system