Software Complex for Sensorless Control of an Electrical Submersible Pump

The article describes design principles of sensorless observing and control system of electrical submersible pump (ESP)’s induction motor based on dynamic state estimation using an unscented Kalman filter (UKF). The artificial lift method with electrical submersible pumps in the oil industry is associated with measurements of technological parameters from which oil fluid flow rate is one of the most important. To develop sensorless control and parameters observing system, the design principles of flow rate observers were proposed. The main possible scenarios for flow rate observation are considered, including those using surface-mounted sensors. This article also considers issues relating to the limitations in flow rate observation by usage pump catalog characteristics, involving control electric drive test signals changing the pump rotational speed. Overcoming these problems is proposed for the electrical submersible pump’s flow rate observing system based on a machine-learning model. The simulation results using a complex electrical submersible pump model confirming the efficiency of the proposed methods are provided.


I. INTRODUCTION
F OR ELECTRICAL submersible pump monitoring the data from telemetry systems that process information about pressure, temperature, vibration, cable insulation resistance, and other technological processes parameters to ensure stable operation, control, optimization, and for real-time decision making are used [1].
Nowadays, the largest produced oil share is obtained by means of electrical submersible pumps (ESPs) [2], [3], [4].All information collected from the surface and underground ESP parts can be used to optimize the ESP operation processes and determine its technological parameters.An important factor is to increase the oil production process's economic efficiency, which can be achieved on the basis of information from a variety of sensors.The oil production process's economic efficiency is especially relevant during low oil price periods [5], [6], [7], [8].Recently, there is an anomaly in the oil cost behavior on the trading floors.Thus, in May 2020 for the first time in history, the oil cost has fallen below zero.Also for the first time, the correlation between the oil prices and the COVID-19 pandemic was deduced.In the future, it is possible that such scenarios will be repeated.ESP control methods improvement to solve the oil production process economic efficiency increasing challenge is one of the key factors of the oil-producing companies competitiveness' rising in the energy resources market.Thus, this task is actual for the researchers.
When planning the technological modes of an oil-and gasproducing enterprises, an important objective is the energy consumption assessment of the electrical complex equipment.Most of the electrical and mechanical equipment operates in nonnominal modes, respectively, this equipment has nonnominal operating parameters [9].
At present, the nature of energy consumption is insufficiently taken into account in managing energy resource, which requires the solution of the mathematical description and synthesis of energy and technological models as the basis for assessment of the current state and the required increase in the energy efficiency of whole enterprise [10].
Nowadays, telemetry systems are used to monitor the ESP technological parameters, which consist of both the surface part and the underground part.The underground part of telemetry systems is located in an aggressive environment, where at any time an unpredictable event can damage the measuring instruments [11], [12], [13].Accordingly, such conditions affect the instruments' service life.Besides, in the most common telemetry systems design, where dc communication signal is transmitted over the three phases, there is no tolerance to single-line-to-ground fault that could damage the downhole telemetry electronics.One of the sensors' failures can lead to a critical situation in which the operator will not have sufficient information to reconstruct the entire technological process picture.Damage of submersible measuring devices is usually accompanied by its uninstallation.This process is undesirable because it is expensive and time-consuming: the well suffers a loss of production rate, and expensive equipment is required to lift and then lower the ESP (all this operation can take several days) [14], [15].Due to the described disadvantages, it is desirable to reduce the usage of measuring devices to a minimum [16], [17], which will increase the reliability of the entire installation [18].This can be achieved through the use of indirect methods for evaluating the ESP technological parameters.
ESP consists of a large number of different elements.The greatest interest from the ESP control point of view is the submersible electrical motor (SEM) [19].In the electric drive theory, state observers, which are usually used not only to estimate the electric motor internal variables but also to estimate shaft mechanism variable states have found their application [20], [21], [22], [23], [24].From this point of view, it is possible to assess the ESP underground parameters without using additional measuring equipment, from parameters obtained from the frequency converter current and voltage sensors, or from a measuring system that includes measuring phase voltages and currents after the transformer with specialized sensors such as Hall effect current and voltage transducers.
A variety of different estimators are used to estimate the electric motor state variables, which can be divided into measuring ones and based on the motor electromechanical processes.The measuring estimators' operation principle is to use motor properties magnetic inhomogeneity.Recently, measuring estimators using the method of high-frequency injection have been very popular in [25], [26], and [27].At the same time, these estimators cannot be used in the case under consideration, since the use of these estimators implies hardware and software intervention in the frequency converter.Estimators based on electromechanical motor processes include motor reference adaptive systems (MRAS) and observers based on the Kalman filter.The MRAS estimation accuracy directly depends on the motor parameters setting accuracy [28].At the same time, the cable line resistance, which is an unknown parameter, has to be taken into account in the SEM model.Therefore, the MRAS estimator application is not an optimal solution.In turn, the Kalman filter allows for estimating the cable line resistance value by including it in the ordinary differential equation (ODE) system describing the SEM [29].
The flow rate is the ESP's main parameter.Nowadays, the well flow rate is widely measured with automated group metering units.At the same time, the well flow rate is measured discretely with a long time interval, which can lead to ESP emergency conditions' untimely identification.Therefore, there is a need to use algorithms to measure the well flow rate with less discreteness.Since the developed system is sensorless, it implies the use of indirect methods for assessing the flow rate using a digital ESP model.

II. ESP COMPLEX MODEL
To build a complex ESP model, it is necessary to use mathematical and simulation models of the ESP parts.The developed ESP complex model includes the following elements: SEM mathematical and imitation model with a vector control model; electric centrifugal pump imitation model; transformer imitation model; cable line imitation model, and mathematical model of fluid flow to the bottom of the well.
Fig. 1 shows the block diagram of the developed ESP sensorless control and parameters observing system.In this case, the input signal will be the ESP flow rate q.
ESP control is carried out using a flow rate regulator, a vector control system for an induction submersible motor with internal speed and current control loops, an unscented Kalman Filter (UKF), an SEM electromagnetic torque observer, and an ESP flow rate observing system.The desired flow rate is maintained at the expense of the flow rate regulator, which compares the target flow rate with the flow rate received from the flow rate observing system and, if necessary, generates a reference for the speed ω ref .The speed regulator generates the current reference I ref to the current regulator.The current regulator forms the stator voltage vector U S and transfers it to the windings of the submersible induction motor.The projections of stator voltage U S and stator current I S on the αβ-axis are used by UKF to estimate motor variables.The torque observer uses stator flux linkage ˆ S and stator current Î S to estimate electromagnetic torque T e .The speed ω r (ω r = ω • z p -electric rotor speed, where z p -number of pole pairs) and the electromagnetic torque T e are the input parameters of the flow rate observing system, which estimates the ESP flow rate current value.

A. SEM Mathematical and Imitation Model
In the ESP selected for modeling, the SEM is represented by an induction motor.The IM model assumes taking into account the processes occurring in the motor.For this, it is necessary to take into account the relationship between the electromagnetic and electromechanical processes occurring in the IM.To account for these processes, models of the IM electrical and mechanical parts are required.The electrical part model is based on the IM electromotive force (EMF) equilibrium equation.The electric motor mechanical part is described by an equation that takes into account the action of the torques on the shaft.The IM equivalent circuit is used to research transient and steady-state operating modes, and the given equivalent circuit parameters can be used when adjusting the control system regulators.In many sources [30], [31], [32], when synthesizing current and speed regulators of the vector control model, the IM -shaped equivalent circuit parameters are used (Fig. 2).Fig. 2 contains the following parameters ⃗ R -rotor flux linkage vector, R S -stator resistance, R R -rotor resistance, L M -mutual inductance, L σ -leakage inductance, ⃗ I S -stator current vector, ⃗ I R -rotor current vector, and ⃗ I M -mutual current vector.
Dynamic equilibrium for the -shaped equivalent circuit is represented by the stator and rotor equations in vector form reduced to a stationary stator where ⃗ U R -rotor voltage vector.The best way to write dynamic equilibrium equations for the IM vector control system regulators synthesis is their representation in a rotating coordinate system with the stator current projection orientation along the rotor flux linkage where ω 1 -the d-q coordinate system angular velocity rotation.
In a rotating coordinate system d-q, which has the same angular rotation velocity as the rotor flux linkage vector, the vector equation (3) will be written in the following form [21], [33]: To describe the IM model mechanical part, the torques acting on the IM shaft are used where ω-rotor mechanical angular speed, T å -IM electromagnetic torque, T L -resistance torque, C-friction factor, and J -moment of inertia.
To ensure sufficient reliability of sensorless parameters observing and accurate control of the ESP, it is necessary to solve the control system synthesizing problem.To solve this problem, an imitation model of the electric motor control system is required as a complex ESP model part.
The ESP SEM control method significantly affects the robustness and accuracy of the sensorless SEM control system.This is largely due to the nature of the load torque on the IM shaft, which has a variable character with zones of underload and negative moments.As shown in [33], [34], and [35], electric motor vector control has a better performance compared to scalar control when using sensorless methods of IM control, therefore it will be considered further.The IM vector control system functional diagram is shown in Fig. 3.
To orient the rotating coordinate system and perform coordinate transformations (Fig. 3), information about the rotor flux linkage vector angular position is needed, which can Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.

TABLE I INDUCTION MOTOR IMITATION MODEL PARAMETERS
be calculated by various methods.In the developed system a simple rotor flux linkage observer, based on ( 2) and ( 4) and using the stator flux linkage projection on the axes αβ, obtained by UKF.
When calculating the rotor flux linkage, a constant component accumulates [33], which leads to a bias in the result.This is called the direct integration problem [36].The following formulas are used to calculate the rotor flux linkage vector.The differential equations are represented in the complex domain The developed vector control system model was investigated by simulation.The submersible induction motor parameters used in the imitation model are presented in Table I.

B. Electric Centrifugal Pump Imitation Model
When simulating an ESP, it is also necessary to take into account the main part of the ESP, i.e., electric centrifugal pump.Unlike most technological objects, the description of an electric centrifugal pump using a differential equations system contains some fundamental difficulties.First, the differential equations system describing an electric centrifugal pump contains a large number of uncompensated nonlinearities.Second, this approach is not universal, since the differential equations system will correspond to only one specific pump [37], [38], [39].Accordingly, the use of such an approach is undesirable in the system being developed.
A possible approach to building an electric centrifugal pump simulation model is to describe the pump by its technological and frequency characteristics.Such information is always contained in the pump passport.Most pump manufacturers provide this information for a 1-or 100-stage pump.It should be noted that the type of pump characteristics remains unchanged for any number of stages, only the dimension of the axes on the graphs changes [40].
Regarding the electrical centrifugal pump imitation model developed in the MATLAB Simulink software environment.The model also contains the model of an SEM presented by IM, well, transformer, cable line, and pumping pipes models.The system works as follows-voltage from the transformer model goes to the cable line, from the cable line voltage is supplied to the motor winding, the SEM spins up, transferring rotational motion to the electric centrifugal pump, and the pump starts pumping oil liquid out of the well.
The adequacy of the simulation results was verified against measurement results obtained from a well operating the same pump (Novomet VNN5-30 [41]) with the number n st = 135 of stages and with the density of the oil liquid ρ = 974 kg/m 3 .Table II provides a comparison of real and simulated data-SEM speed, SEM torque on the shaft, and pump capacity (flow rate).
Based on the results obtained in Table II, it can be concluded that the simulation results are close to real ones.Some inaccuracy in the simulation result is due to the fact that during the ESP operation, some element parameters could change slightly.

III. SYNTHESIS OF UKF AND THE SEM TORQUE
ESTIMATOR To use the flow rate estimation algorithm, which is introduced further in the article, it is important to know the mechanical power, produced by the SEM, and this turns out to be a big problem.SEM placed in an aggressive environment and has strict restrictions on construction capability, with this set of conditions, placement of speed and torque sensors is very difficult and sometimes impossible, even if there is a possibility to place it, there is a problem of transmitting the information.The downhole part of ESP has only one communicational channel, which is tied to the neutral wire.This way, the described problem translates into the design of SEM state estimators, which should give speed and electromagnetic torque as outputs.The sphere of electric drives is always in seek of new ways of estimating the motor states, based on a set of traditional, high-performance estimators which are used in a lot of control applications.The essence of these types of estimators is to find an adaptive law (commonly it is a PI-controller) [4], which adapts the rotor model, by tuning the mechanical speed parameter.All observers of this type require knowledge of voltage, applied to the stator winding.With application to a submersible pump, there is a problem, due to a long cable line, across which voltage drop appears.In most cases, ohmic resistance is significantly higher than stator resistance, so the direct calculation of electromagnetic torque is met with difficulties.To use surface voltage measurements, the cable line resistance should be accounted for, which cannot be directly measured in the operating mode.
Since the induction motor is a nonlinear system, described by five states, a linear Kalman filter cannot be used.The classical and very popular approach for Kalman filter design for induction motor is linearizing the system about the point of current estimate, which is the extended Kalman Filter (EKF).
Usage of EKF gives good enough results to include it in the conventional IM control strategies, such as field-oriented control, direct torque control, or scalar control.In comparison with the EKF, UKF does not require the linearization step, which can cause poor and sometimes unstable performance in applications with low-cost microprocessor units [42], [43].UKF has better properties on convergence, and recovery and gives more optimal results in the sense of estimate variance minimization [44].In the scope of the ESP system, UKF was chosen as an estimator for several reasons.ESP system has strong nonlinearities, regarding the SEM angular velocity and load torque and UKF handles nonlinearities in the more "proper" way by applying an unscented transform, which in the case of the nonlinear system results in the more accurate state estimate.Despite the computational complexity of UKF which lies in the predict step (integration of ODEs 2n + 1 times, where n is the system's order), it is still not as computationally heavy as other methods which proven their reliability in the state estimation of nonlinear system, such as moving horizon estimator or the particle filter.
The algorithms and methods for sensorless SEM control involve observing the SEM parameters, such as the SEM shaft rotation speed and the torque on the SEM shaft.The electric motor rotation speed ensures optimal fluid withdrawal from the well by maintaining the required dynamic fluid level.In addition, it is necessary to know the torque on IM the shaft, since it helps in solving the problem of estimating the virtual well flow rate.
Thus, to solve the problem of sensorless SEM parameters observing and control, in the system, it is necessary to provide the following state observers' software implementation: the UKF to observe the SEM shaft rotation speed and the observer of the torque on the SEM shaft.In this case, it is necessary to take into account the influence of the cable line across which the unmeasured voltage drop appears.And to get precise voltage drop estimation it is unwelcome to account for cable line resistance as some specific constant value from passport or field tests.Because the actual value of ohmic resistance varies in the range of tenths from the measured value, this inaccuracy can cause undesired fluctuations in estimated parameters, the value of which may not reflect the actual operating state of the ESP.Besides the ohmic resistance, the model of the cable line also includes reactance in the form of capacitance, the value of which is considered to be approximately 10 −9 F/m, and this value does not differ by more than one order in the majority of cases.It should be noted, that the Kalman filter only account for the active part of the electrical impedance, this decision was made because of the satisfactory results of parameter estimation with admitted simplification.

A. UKF Synthesis With Application to SEM
UKF uses a system of the first-order stochastic differential equations and a set of discrete-time observables, which can be generally described with the expressions given in the following: where x-state of the system, u-control input, z k -the measurement at the kth iteration, β-system parameters, w d -zero mean white process noise; and n k -observation measurement noise at the kth iteration.With application to the SEM, dimensionalities are: In the ESP modeling section, the induction motor was described with the use of the model in the stator reference frame αβ.It is possible to represent the induction motor model using only stator variables, this representation gives a positive impact on the Kalman filter performance, caused by the presence of more variables that are coupled with control inputs, this implementation ensures the accuracy of the integration step.The transition from rotor flux linkage to the stator is accomplished with the use of the following expression: Substitution of this expression into the stator equilibrium equations results in the first-order ODE for stator current in space-phasor form, without explicit use of rotor flux linkages The decomposition of gotten expression into αβ components results in two differential equations for the UKF.The following two states are the stator flux linkages, which are described by stator equilibrium equations with one modification in them.Since voltage drop appears not only on the stator winding but also across the whole cable line, it is necessary to add submersible line resistance to the stator resistance.Note that line resistance is not just a parameter, it is the new state of the system, described by a differential equation, which implies that cable resistance does not change over time.The description of induction motor concludes with the modeling of the mechanical part, which reflects the relationship between mechanical shaft rotational speed, electromagnetic torque, and load torque [reference to (10)].
Load torque comes directly from the break horsepower expression (BHP), which is the mechanical power, required to drive the pump and can be expressed as a product of electromagnetic torque and mechanical rotor angular speed.ESP units come with catalog characteristics, which describe head, BHP, and efficiency (ratio of mechanical and hydraulic powers).Catalog characteristics come as a family of curves, to describe these characteristics in a function form, polynomial interpolation is accomplished.By using affinity laws and polynomial interpolation between points, gathered from a catalog, the function of the following form may be achieved: where a n -polynomial coefficient and q op -production flow rate at the operating point.Dividing this function by mechanical rotor speed results in the direct expression for load torque.Which comes in the Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
form of the following polynomial (this polynomial realistically enough describes pump and compressor load): Expression (12) describes the load torque of a pump in a range of operating angular velocity values, except for the "shut-down" mode of an installation.The divergence of estimated load torque values depends on the accuracy of BHP polynomial which gathered either from catalog characteristics or by means of interpolation on the test data set.
Two coefficients (k1 and k2) of the presented polynomial define the value of the load torque depending on the current value of the angular velocity value, so it can be used to describe the transients in the load.Subsequent reasonings are based on the proportional dependence between load torque and angular velocity rates of changes, which implies neglect of flow dynamics [45].By taking the time derivative, following expression obtained: In this way proportional relationship of rates of change defined with an affine function.At time reaching steadystate condition, proportionality constant converges at a specific value by taking this into account it is possible to make zeroth-order approximation and consider this variable as pseudoconstant c p , which then can be included in the system of ODEs for the Kalman filter.With made assumptions in mind, the system of nonlinear ODEs for UKF will take the following form, as in (14), shown at the bottom of the next page.

B. Unscented Transform
The unscented transform (UT) is the essence of the UKF, which allows computing mean and covariance of sigma points, transformed by a nonlinear vector field.The idea behind this algorithm is to pass a set of sigma points (Gaussian random variables) through a nonlinear function and then by utilizing an UT get weighted mean and covariance as the output, which characterizes a new prior estimate of the system.There are many algorithms for the implementation of UT transform, which define how many sigma-points to pass, how to pull out these points from the Gaussian distribution, and how to estimate mean and covariance of a transformed set.In this article, general UT is used, which was originally established by Rudolph Van der Merwe in his Ph.D. thesis [46] and since then used in many scientific and industrial applications.A set of equations that define sigma points for general UT are given in the following: where n = 8, according to (14); ith and (i-n)th subscripts indicate the corresponding column of the matrix square root; λ -parameter, which defines the spread of the sigma points around the mean estimate xk , defined as follows: where α and κ are primary and secondary scaling parameters, correspondingly.
Each point has two weighting coefficients that are used for mean and covariance computation, zeroth sigma point has different weights for the mean and covariance computation, and the rest of the points got the same weights for both of the statistical moments where β evaluates the significance of the incorporation of the prior knowledge of the mean distribution x.These parameters are then used in predict and update steps of the UKF To get a transformed set of sigma-points Y, each of the prior sigma points should be passed through the Runge-Kutta integration scheme, which integrates equations described earlier ( 14) where Z-set of prior states, transformed by the measurement function h, which in the case of the induction motor is linear, and can described in the matrix form, shown below; µ z -weighted mean of sigma-points converted into measurements; z-measurements vector; y-residual; and P z and P x k -covariance matrices The actual measurement vector consists of three components: a, b, and c stator currents, gathered from current sensors.In the sphere of electric drives, it is conventional to transform three-phase measurements into two-phase equivalent, which results in simplification of the measurement matrix.However, the noise has to be considered, which is introduced by each of the sensors and there are three of them.Transformation of three-phase noise into two-component equivalent noise, performed with the use of definition for measurement uncertainty, which reflects the behavior of noise, introduced in measurements where T αβ -Clarke transform matrix of size 3 × 2. By assuming that sensor measurements are uncorrelated the following expression for matrix R appears, in terms of variance, that characterizes white noise n k : where σ 2 a , σ 2 b , and σ 2 c -noise variance terms for each of the three current sensors.
Implementation of UKF was accomplished in the Simulink environment.To implement update-predict steps, the "MATLAB function" block was used.The submersible cable line was modeled as a series RL-branch, with an ohmic resistance of 1.47 and inductance of 1.5 mH, line parameters are the same for each of the phase.
The predict and update step of the Kalman filter uses covariance matrices Q and R to parametrize system and measurement noise.Determination of the R matrix can be done experimentally, by investigating variations for threephase measurement current.(Consider filtered signal as a mean, and then come to variance calculations).
The design process of the Q matrix depends on the noise source (we assume that noise entering system directly from voltage measurements), in the case of induction motor noise introduced with voltages, which can be determined as uncertainties in generated control inputs or the measurement noise coming from voltage sensors.Either way, the equations describing the Q matrix have the same form, since noise has the same entries to the system (via voltages).Noise entry matrix L has the following form: With a presence of noise entering the system through matrix L, the system of ODEs will look as follows: where ũSα and ũSβ -sensor noise in αβ reference frame.With a knowledge of matrix L, it is possible to find the covariance matrix Q by definition By assuming that measurement noise from individual voltage sensors is independent, expected value will take form of a diagonal matrix Q with a noise variance of each sensor on the diagonal where σ 2 u Sα and σ 2 u Sβ -variance of noise measurement in αβ reference frame.As a result of noise discretization and reduction of ( 26), matrix Q will look as follows: Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
In either way, with the noise coming from the uncertainty in control action or from the voltage measurements, the parametrization of Q matrix is defined by the variance of the noise introduced in the signal.
For the voltages which come in the form of measurements, the determination of noise variance comes down to the experiment of applying a constant voltage to a motor winding.Then with a basic data analysis method variance of the noise for each voltage sensor can be determined.By applying the same transformation as in (22) to voltages, variance in αβ reference frame can be found.Also, in the same experiment noise parameters for current measurements can be determined.
For the voltages which come in a form of control action there is no intuitive methods for determining the variance, since it covers modeling uncertainties, which are hard to define.In this case, variance values could be determined iteratively via a series of experiments until the satisfactory performance of the filter is reached.Or there is also methods which use adaptive and optimization approach for tuning Q [47], [48].In a lot of works dedicated to the investigation of Kalman filter with application to induction motor, just use of a diagonal matrix Q seems to give good results [29], [42], [43].
Measurement noise matrix is (with the same variance for each state: 0.5 (A) 2 ) The choice of initial P covariance matrix builds on the assumption that the motor was in the idle state that said no voltage was applied to the stator winding.This assumption results in diagonal terms of P being close to zero 2  (0.01/3) 2 (Wb) 2 (0.01/3) 2 (Wb) 2 (0.01/3) 2 (rad/s) 2 (0.5/3) 2 (Ohm) The following diagonal elements of matrix P were chosen via three standard deviations, which is the value by assuming the state to be with the probability of 99.7%, then dividing this value by three and rising it to the second power gives variance of the following state.
To prove the viability of the theory given above, three ESP operating state scenarios were considered: 1) static operating point at four standard angular velocities, determined by the range of operating frequencies in the manufacturer catalog; 2) step-down change of operating point; 3) variations of cable line ohmic resistance at static ESP operating point.

C. UKF Performance Given Static Operating Point Condition
The aim of this scenario is to give the UKF a test of typical ESP operational conditions (from startup to steady state) on a range of standard operating frequencies.Line resistance is initialized as 1 , while the real is 1.47 .
The submersible cable line estimated ohmic resistance is shown in Fig. 4. It should be noted that the cable line is modeled with reactance taken into account in the form of capacitance.The real ohmic resistance has a value of 1.47 , and the output of the UKF converges at the value, which is slightly higher.
Generally, in all the considered scenarios the estimated stator currents have the same change compared to the measurements.High-frequency noise introduced with the current sensors is attenuated because of the low-pass action, introduced by the Kalman filter (Fig. 5).Regarding the stator flux linkages, they are evaluated with consideration of ohmic cable line resistance, which results in more accurate estimates compared to the "stator model" based estimation technique.
The simulations were performed at the set of operating points, determined with the range of operating frequencies, given in the catalog characteristics.Thus, the low-speed operating point corresponds to an operating frequency of 35 Hz and high speed to 80 Hz.Estimated angular velocities with corresponding ground truth and their root-mean-square error (RMSE) are given in Fig. 5.
Estimated load torque and the pseudoconstant c p , describing load dynamics are shown in Fig. 6.Approximations made result in the lag of estimated load torque compared to the real, but approaching steady state it gives a very accurate estimation of the on-shaft load, this can be seen from the evaluated RMSE, given in Fig. 6.

D. UKF Performance Under Condition of Operating Point Change
With the control system design goals (flow-rate regulation) it is necessary to test the UKF performance under operating point change conditions.The test has proceeded as follows: pump startup; reaching steady-state conditions for one operating point; at the ninth second of simulation change of operating point is accomplished from 50 to 35 Hz; reaching steady state for the second operating point.Results are presented in Fig. 7.

E. UKF Performance Under Condition Cable Line Ohmic Resistance Change
To analyze the performance of the proposed Kalman filter, it should be tested under conditions of sudden resistance change, despite the introduced cable line ohmic resistance variations related to the emergency state of ESP.During the simulation, cable line ohmic resistance was subjected to Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.resistance change multiple times: resistance drop, resistance recovery, and resistance rise.Results are presented in Fig. 8.

F. Observer of Electromagnetic Torque on SEM Shaft
Consider an observer of the electromagnetic torque on the motor shaft-this object performs the task of evaluating the current torque on the motor shaft.First, the observer under consideration is required for the well flow rate observing system implementation.Second, the torque observer reduces the ESP cost, since torque sensors are expensive equipment.
Since the SEM in the developed system is represented by the IM, some used formulas have already been prescribed in the vector control system synthesis.To implement the torque observer, first of all, it is necessary to pass to the IM stator model in a fixed coordinate system αβ [32], [33].First, write down the equilibrium equation of the stator winding (1) in a slightly modified form, as well as the equations of the vector ratio By transformations, obtain the following equation describing the rotor flux linkage through the stator current and voltage: The relationship obtained in (32) describes the IM stator model.
It should be borne in mind that the rotor flux linkage calculation directly by (32) is accompanied by the problem of integrating the current and voltage obtained from the measuring devices, which over time will certainly lead to an Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.increase in the calculation error.This problem can be solved by replacing the integrator with an aperiodic link [49].The possibility of using such a replacement is explained by the fact that the initial characteristics of these links are similar and, accordingly, at high frequencies, this will not affect the results.It should be borne in mind that the use of this approach can negatively affect the simulation results at low frequencies, since amplitude-phase distortions will appear in the calculations of the rotor flux linkage.
Transforming (32) for use in a fixed coordinate system αβ and replacing the integrating link with an aperiodic one, obtain an equations system (7), which will describe the IM stator model.
The rotor flux linkage evaluation will allow determining the electromagnetic torque on the motor shaft since to determine the torque it is necessary to know the rotor flux linkage and stator current Thus, (33) makes it possible to estimate the current torque on the SEM shaft and implement the torque observer.It should be noted that the evaluation accuracy primarily depends on the accuracy of the IM parameters used in the equivalent circuit, while these parameters may undergo slight changes during the ESP operation due to temperature changes.
In addition, in the torque observer, it is necessary to use a low-pass filter, due to which the obtained torque will be smoother, which will ensure greater correspondence to reality.Consider Fig. 9, the red line is the electromagnetic torque obtained from the "ideal sensor" and the black line is the electromagnetic torque obtained from the state observer.The figure shows that the observed SEM torque coincides with the real one.Thus, it can be concluded that the torque observer is working correctly and accurately estimates the torque.

IV. ESP FLOW RATE OBSERVING SYSTEM
When developing a system for sensorless ESP control and parameters observing, one cannot limit it to observing only SEM parameters.It is also necessary to estimate the instantaneous well flow rate, since this parameter helps to recreate the operating state of the pump and provides the possibility of feedback control.It is important to note that it is not always possible to place flowmeter as a part of downhole equipment; in such a way, the flow-rate estimator allows to augment the set of estimated parameters of the pump.

A. Flow Rate Observing System Based on Predefined Pump Catalog Characteristics
One of the way to estimate flow-rate production is to compare the on shaft mechanical power (estimated BHP) and one determined by catalog characteristics of the ESP [45], which taken as a base for polynomial interpolation.The implementation builds around the working principle of integral action of a PID-regulator.On shaft brake horsepower is taken as a reference to which a certain capacity corresponds.The polynomial function evaluated at this capacity value matches the reference value.The integrator ensures the zero steadystate error of the described observation process.
At the output estimator gives two potential operating points.Further identification of the actual ESP state required digital manometer and accomplished by matching measured and calculated head drop.For more detailed acquaintance with the estimation principle, you can refer to [50].
Despite the significant theoretical basis, this method of calculating the flow rate is rarely used in practice.First, the calculation requires accurate determination of a large number of different ESP parameters, while some parameters are dynamic, while others are difficult to accurately determine value even with sensors and other special measuring equipment.Second, this method require redundant steps to get the result, which are the placement of digital manometer and speed change at the operating state, which can be complicated from unit to unit [51].Therefore, the ESP flow rate must be estimated using other indirect methods.

B. Flow Rate Observing System Based on Machine-Learning Model
A possible solution is to estimate the flow rate using statistical data analysis methods.Some ESP dynamic observables and static known values will be the input parameters, and the flow rate will be the output parameter.It is possible to implement a well-flow rate observing system for such a structure using machine learning algorithms.Since such a task corresponds to a typical regression task.
Consider the ESP flow rate observing system based on a machine-learning model.The output parameter will be the well flow rate.The input parameters will be the SEM shaft rotation speed, the torque on the SEM shaft, and the oil liquid density.These parameters were not chosen by chance, they have the greatest impact on the well flow rate.Other ESP parameters were also considered.For example, the oil liquid temperature, the oil liquid viscosity, SEM vibrations, and so on.It was experimentally determined that these parameters do not have a large effect on the flow rate, and taking into account some of these parameters would complicate the development of an ESP complex model, and would also have a negative impact on the speed and quality of simulation the processes occurring in the ESP (an example of such a parameter is the SEM winding temperature).
To estimate the models' accuracy, the used dataset was divided into training and test subset in a ratio of 1000 to 200.To estimate the models' accuracy, trained machine learning models evaluate the well flow rate for each test subset instance.The model's performance was evaluated using the mean square error metric The models' results are presented in In addition, Table III shows the maximum error value made by the model when evaluating the ESP flow rate on test values.
Authorized licensed use limited to the terms of the applicable license agreement with IEEE.Restrictions apply.
Analyze the machine-learning model results presented in Table III.All the considered machine learning models, when properly configured, have shown good results and can be used in a flow rate observing system.The difference in the errors magnitude in different models can be explained by the model properties.The linear regression main disadvantages are the laboriousness of finding model coefficients and the inability to adequately model nonlinear processes, which is the reason for the large error value, since the function of type f (ω, T e , ρ) is nonlinear.The k-nearest-neighbors algorithm does not create models and works only on training sample data, which affects the error magnitude.The support vector machine main regression is its instability to noise.The data under consideration is noisy, so the constructed models have a large max error.The best result was shown by the random forest regression with the number of trees n t = 40.This model was chosen as the basis for the ESP flow rate observing system.The random forest regression estimation accuracy increases as the trees number increases.Thus, a larger trees number gives a better result.The flow rate estimation accuracy obtained using 40 trees is high.This is the optimal trees number to work with the available computing power.Most of the hardware computing power used is spent by the UKF.

V. LIMITATION OF STUDY
All considered results are from simulation with corrections which accuracy must be confirmed by comparing the simulation and pump catalog data results.The authors bring the simulation data closer to real ones by adding Gaussian white noise to the measured values.From another point of view, test measurements on a real well are associated with a wide set of hardware solutions that require independent research.This work is currently in the process.This article presents only the software part of virtual flow rate system without technological sensors.The future work will be devoted to the development of a telemetry system, a system for collecting data from current and voltage sensors, studying real data from the ESP and comparing it with simulation results.In addition, it is necessary to solve the problem associated with the industrial controller's technical capabilities, since the developed system requires large computing power, especially the UKF.
Data used for the machine learning model partially comes from the ESP complex model.We had to resort to this, since the oil company only provided the authors with data from three wells operating ESPs with centrifugal pump VNN5-30, at three different speeds.Obviously, this amount of data will not be enough to train the machine learning model, then most of the data were generated using the developed ESP complex model.

VI. CONCLUSION
The ESP and SEM operating modes parameters determination is an important task, both from the viewpoint of the equipment correct selection at the well design stage, and from the viewpoint of energy efficiency at the its operation stage [52].
Based on the research results, the ESP complex model was developed, including models of transformer, cable line, submersible motors with vector control model, electrical centrifugal pump, and fluid flow to the bottom of the well.The ESP complex model results adequacy was confirmed by comparing the measurement results and the data obtained in the simulation.Also, the ESP sensorless control and parameters observing system was developed and adjusted which is based on the ESP electromagnetic torque observer and UKF.
The proposed Kalman filter designed for ESP gives good estimation results with little deviations from the reference parameters.The angular frequency deviation values does not exceed 0.1 rad/s in a steady state; the load torque deviation values does not exceed 0.5 N•m in a steady state; the cable line resistance deviation values does not exceed 0.05 in a steady state.Thus, information can be used to monitor technological process without any additional equipment used to measure the cable line resistance.In addition, UKF gives a desirable response with the sudden change of technological parameters (which unlikely to appear in the real technological process), this fact proves the reliability of the system model used in Kalman filter.
Considering the flow rate observing system, several machine-learning models were used.Most of them gives a desirable flow rate estimation result.Random forest regression best captures model that describes relationships between mechanical motor variables (load torque and mechanical angular frequency), fluid parameters and flow rate as an output of the model.Random forest regression fits well in the current tasks, since ESP operated at a certain range and never going through borders, which established in the catalog characteristics.Therefore, the main random forest regression disadvantage (extrapolation) does not apply to the considered task.Since it gives the best accuracy (the error is less than 0.1 m 3 /day) this model was chosen as a primary method.

5 .
Results of estimating SEM parameters with UKF.The left part shows both stator currents and fluxes, estimated currents are compared with measurements.The right part shows results of estimating angular frequency at the recommended operational range and RMSE to ground truth for each of the operating points.6.Results of estimating load-determining parameters with UKF.The left part shows estimated and ground truth load torques with RMSE for set of operating points.The right part shows results of estimating pseudoconstant cp.

Fig. 7 .
Fig. 7. Results of estimating SEM parameters with UKF under condition of operating point change.

Fig. 8 .
Fig. 8. Results of estimating SEM parameters with UKF under condition of cable line resistance sudden change.
Manuscript received 5 September 2023; revised 24 October 2023; accepted 28 October 2023.Date of publication 22 November 2023; date of current version 2 January 2024.This work was supported by the Ministry of Science and Higher Education of the Russian Federation, in accordance with the decree of the Government of the Russian Federation: 09.04.2010, number 218 (PROJECT 218), under Agreement 075-11-2021-052 (24 June 2021) in the framework of the program of activities of the Perm Scientific and Educational Center "Rational Subsoil Use".The associate editor coordinating the review of this article and approving it for publication was Prof. Chao Tan.(Corresponding author: Bernd Krause is with the Department of Computer Science and Languages, Anhalt University of Applied Sciences, Köthen 06366, Germany.Digital Object Identifier 10.1109/JSEN.2023.3331354

Table III .
The table also shows the RMSE, since this value represents the greatest interest for research 2 n.