# Patent application title: Method and System for Optimizing Downhole Fluid Production

##
Inventors:
Krzysztof Palka (Calgary, CA)
Jaroslaw A. Czyz (Calgary, CA)

IPC8 Class: AE21B4700FI

USPC Class:
417 42

Class name: Pumps condition responsive control of pump drive motor in response to pump speed

Publication date: 2008-10-02

Patent application number: 20080240930

## Abstract:

A method and system for pumping unit with an elastic rod system is applied
to maximize fluid production. The maximum stroke of the pump and the
shortest cycle time are calculated based on all static and dynamic
properties of downhole and surface components without a limitation to
angular speed of the prime mover. Limitations of structural and fatigue
strength are incorporated into the optimization calculation to ensure
safe operation while maximizing pumped volume and minimizing energy
consumption. Calculated optimal prime mover speed is applied to the
sucker rod pump by means of beam pumping, long stroke or hydraulic
pumping unit by controlling velocity, acceleration and torque of the
electric prime mover or by controlling pressure and flow rate in
hydraulically actuated sucker rod pumping system.## Claims:

**1-14.**(canceled)

**15.**A method for determining optimal variable angular velocity Ω of a prime mover (motor speed) of a pumping unit (pumpjack) equipped with a sucker rod connected to a downhole pump for pumping fluid from a well, where the said optimal angular velocity varies over a period of a single pumping cycle in such a way that well production is maximized while maintaining specified limits on stresses in the sucker rod and limits on the motor speed, torque, and energy consumption, comprising the steps of:(i) using a finite number of parameters p for representing the angular velocity Ω[p] of the motor as a function of one of variables selected from the group of variables comprising polished rod position s, crank position α (for beam pumping units only), or of time t, namely respectively Ω[p](s), Ω[p](α) or Ω[p](t), for an entire single pumping cycle;(ii) providing a dynamic model of the entire pumping system, including both the surface equipment (pumpjack with motor and polished rod) and downhole equipment (sucker rod with downhole pump), for calculating motor torque, stresses in the said sucker rod, and well output production rate in response to a given motor angular velocity Ω[p], the said well output production rate V(Ω) defined as the volume Vol(Ω) pumped during one cycle per cycle period T(Ω), i.e. V(Ω)=Vol(Ω)/T(Ω); and,(iii) determining parameters p, by means of a mathematical algorithm for solving nonlinear constrained optimization problems, for which the motor angular velocity Ω[p] maximizes the well production rate V(Ω) while the following constrains are satisfied:(a) minimum and maximum rod stresses during entire cycle, resulting from the imposed motor speed Ω, do not exceed specified limits;(b) motor torque required to impose the motor speed Ω does not exceed a specified limit during said cycle;(c) angular velocity Ω of the motor is identical at a beginning and end of pumping cycle;(d) angular velocity Ω of the motor does not exceed a specified limit over the course of pumping cycle; and(e) motor energy consumption per volume of pumped fluid, calculated from the motor torque and angular velocity during the course of pumping cycle, does not exceed a specified limit.

**16.**The method of claim 15, wherein said angular velocity Ω of the motor is represented in the form of a Fourier series, and said variable angular velocity is determined from the optimal set of Fourier coefficients.

**17.**The method of claim 15, further comprising:(i) representing the angular velocity Ω of the motor in the following form of Fourier series of polished rod position s in order to satisfy the constraint

**1.**(iii)(c): Ω [ p ] ( s ) = β Ω _ 0 [ 1 + i = 1 N ( γ i cos ( 2 π s / s 0 ) + λ i sin ( 2 π s / s 0 ) ) ] ( ` o ` ) where vector p=[β, γ

_{1}, . . . , γ

_{N}, λ

_{1}, . . . , λ

_{N}] consists of Fourier coefficients, Ω

_{0}is a typical operating constant speed for a given pumpjack, and s

_{0}denotes the polished rod double stroke length(ii) providing a mathematical model for calculation of displacements, forces and stresses in the sucker rod and the polished rod during a pumping cycle that would result from the polished rod motion imposed by applying a given variable angular velocity Ω of the motor;(iii) providing a mathematical model for calculation of the motor torque that is required to impose a given variable angular velocity Ω of the motor, the said model utilizing the polished rod force calculated in model

**3.**(ii) and the gravity and inertial forces acting on all the components of the pumpjack as defined by its geometry and mass distribution;(iv) providing a mathematical formula for calculation of motor energy consumption based on the motor torque and angular velocity;(v) providing a mathematical formula for calculating well output production V(Ω) based on the ratio of the downhole pump stroke length to the stroke period T(Ω); and(vi) providing mathematical algorithm for determining optimal distribution of motor instantaneous angular velocity over the course of each single pumping cycle by finding an optimal set p=[β, γ

_{1}, . . . , γ

_{N}, λ

_{1}, . . . , λ

_{N}] of Fourier coefficients such that pumping production V(Ω[p]) is maximized while the constrains listed in claim

**1.**(iii)(a)-(e) are satisfied; the said algorithm comprising the following steps:(a) selecting an initial vector p

_{0}of the Fourier coefficients and vectors Δp

_{i}of their increments for each parameter i=1, . . . 2N+1;(b) using predictive analysis that incorporates mathematical models described in (ii)-(v) above to calculate production V[p], power consumption P[p], motor torque M[p](s), and stress distribution σ[p](x,t) in the sucker rod for the entire cycle in response to the motor angular velocity Ω[p] determined from the equation `O` above at the following pointsp=p

_{0}and p=p

_{0}+Δp

_{i}(i=1, . . . 2N+1)(c) calculating partial derivatives of functions V[p], M[p](s), σ[p](x,t), Ω[p](s) and P[p] with respect to parameters p

_{i}(i=1, . . . 2N+1) using a finite difference method and the incremental values calculated in

**3.**(vi)(b) above;(d) using a first order Taylor expansion and the partial derivatives calculated in (c) above to produce linearized functions V[p], M[p](s), σ[p](x,t) Ω[p](s) and T[p] with respect to the small changes δp

_{i}of parameters p

_{i};(e) linearizing the optimization problem with respect to δp

_{i}by using said linear functions from

**3.**(vi)(d) in the constraints provided in claim

**1.**(iii)(a)-(e) as well as in the optimization function V[p];(f) using a linear programming method to find δp

_{i}that is the solution of the linear optimization problem defined in

**3.**(vi)(e), namely which maximizes the well production while satisfying the linear constraints on motor torque and speed, stresses in the sucker rod and power consumption;(g) replacing the initial vector p

_{0}with p

_{0}+δp and repeat steps

**3.**(vi)(b)-(f) until 6p becomes smaller than a selected threshold; and(h) converting function Ω[p](s) to the function of time or crank position.

**18.**The method of claim 15 wherein the optimal variable speed of the prime mover is determined such that one of the following performance indicators is minimized: prime mover energy consumption per volume of pumped fluid, maximum motor torque or the stress range in all the sucker rod segments, while the remaining of these indicators are maintained within the prescribed limits, and the pumping production volume achieves the pre-selected target.

**19.**A method for determining optimal velocity U of a polished rod connected with a sucker rod to a downhole pump for pumping fluid from a well, where the said optimal velocity varies over a period of a single pumping cycle in such a way that well production is maximized while maintaining specified limits on the polished rod velocity, stresses in the sucker rod and the energy required to induce the said polished rod velocity, comprising the steps of:(i) using a finite number of parameters p for representing the polished rod velocity U[p] as a function U[p](s) of polished rod position s or a function U[p](t) of time t, for an entire single pumping cycle;(ii) providing a dynamic model of the downhole equipment (sucker rod with downhole pump) for calculating stresses in the said sucker rod and well output production rate in response to a given polished rod velocity U[p], the said well output production rate V(U) defined as the volume Vol(U) pumped during one cycle per cycle period T(U), i.e. V(U)=Vol(Ω)/T(Ω); and,(iii) determining parameters p, by means of a mathematical algorithm for solving nonlinear constrained optimization problems, for which the polished rod velocity U[p] during said pumping cycle maximizes the well production rate V(U) while the following constrains are satisfied:(a) minimum and maximum rod stresses during said entire single cycle, resulting from the imposed polished rod velocity U do not exceed specified limits;(b) polished rod velocity U is equal to zero at the polished rod lowest and highest position;(c) polished rod velocity U does not exceed a specified limit over the course of the entire pumping cycle; and(d) energy required to induce the said polished rod movement over the period of one pumping cycle per volume of pumped fluid does not exceed a specified limit.

**20.**The method of claim 19, wherein in order to satisfy the constraint

**5.**(iii)(b) the said polished rod velocity U is represented in the following form of Fourier series of polished rod position s, defined separately for the upstroke sε(0,s

_{0}/2) and downstroke sε(s

_{0}/2,s

_{0}) part of the movement (s0 is the polished rod double stroke length): U [ p ] ( s ) = i = 1 N u i U sin ( 2 π s / s 0 ) for s .di-elect cons. ( 0 , s 0 / 2 ) U [ p ] ( s ) = i = 1 N u i D sin ( 2 π s / s 0 ) for s .di-elect cons. ( s 0 / 2 , s 0 ) and wherein the said optimal variable polished rod velocity over the course of a single pumping cycle is determined from the optimal set of Fourier coefficientsp=[u.sub.

**1.**sup.U, . . . , u

_{N}

^{U}, u.sub.

**1.**sup.D, . . . , u

_{N}

^{D}].

**21.**The method of claim 19 wherein the optimal variable polished rod velocity is determined such that the stress range in all the sucker rod segments is minimized, while the pumping production volume and the energy required to induce the said polished rod movement over the period of one pumping cycle T achieve the pre-selected targets.

**22.**The method of claim 19 wherein the optimal variable polished rod velocity is determined such that the energy required to produce the said polished rod movement over the period of one pumping cycle per volume of pumped fluid is minimized, while the pumping production volume and the stress range in all the sucker rod segments achieve the pre-selected targets.

**23.**The method of claim 19 wherein the polished rod velocity is controlled by a hydraulically actuated pumping system, wherein the new operating parameters are applied to the pumping system by means of controlling pressure and flow rate within an actuation system of the pumping system to control velocity of polished rod as per calculated optimal motion.

**24.**The method of claim 19 wherein variable optimal prime mover angular velocity Ω is calculated from optimal polished rod velocity U using geometry of the pumpjack.

**25.**The method of claim 15 or claim 19 wherein measurements from an actual pumping system are used to improve system parameters in the mathematical model used in the optimization process, comprising the steps of:(i) measuring physical conditions of said pumping system during operation, namely said polished rod load and position, motor torque, energy consumption, tubing and casing pressure and well output;(ii) comparing the model of the pumping system results and the physical conditions as measured to verify and adjust the model of the pumping system parameters;(iii) calculating new optimal angular velocity Ω of the motor or new optimal velocity U of a polished rod, based on the model of the pumping system with adjusted system parameters.

**26.**The method of claim 15 or claim 24 wherein the prime mover is an electric motor or internal combustion engine, wherein the variable speed is applied to the pumping system by means of controlling instantaneous reducer ratio.

**27.**A system for controlling pumping speed in a pumpjack system, comprising:(i) an electric motor prime mover to control motion of the pumpjack;(ii) a variable frequency drive (VFD) controller for dynamically controlling instantaneous angular velocity of the prime mover within entire pumping cycle;(iii) downhole pumping components including a sucker rod to communicate motion of the pumpjack to a downhole pump;(iv) measuring means for monitoring operational conditions; and(v) a local control unit capable of transmitting instantaneous prime mover speed to a VFD and receiving instantaneous speed and torque of the prime mover from the VFD; a said unit comprising software that incorporates the model of the pumping system and numerical solution techniques for analyzing transmitted information, evaluating performance of the pumping unit and downhole components, and determining optimal prime mover speed according to claim 15, which are applied to control the prime mover speed at predetermined time steps within the entire pumping cycle.

**28.**A system for controlling pumping speed in a pumpjack system, comprising:(i) an electric motor prime mover to control motion of the pumpjack;(ii) a variable frequency drive (VFD) controller for dynamically controlling instantaneous angular velocity of the prime mover within entire pumping cycle;(iii) downhole pumping components including a sucker rod to communicate motion of the pumpjack to a downhole pump;(iv) measuring means for monitoring operational conditions; and(v) a local control unit capable of transmitting instantaneous prime mover speed to a VFD and receiving instantaneous speed and torque of the prime mover from the VFD; a said unit comprising software that incorporates the model of the pumping system and numerical solution techniques for analyzing transmitted information, evaluating performance of the pumping unit and downhole components, and determining optimal prime mover speed according to claim 24, which are applied to control the prime mover speed at predetermined time steps within the entire pumping cycle.

**29.**A system for controlling pumping speed in a pumpjack system, comprising:(i) an electric motor prime mover to control motion of the pumpjack;(ii) a variable frequency drive (VFD) controller for dynamically controlling instantaneous angular velocity of the prime mover within an entire pumping cycle;(iii) downhole pumping components including a sucker rod to communicate motion of the pumpjack to a downhole pump;(iv) measuring means for monitoring operational conditions;(v) a local control unit capable of transmitting instantaneous prime mover speed to a VFD and receiving instantaneous speed and torque of the prime mover from the VFD;(vi) signal transmission means for transmitting information in real time from the local control unit to a remote computing station;(vii) said remote computing station equipped with the software that incorporates the model of the pumping system and numerical solution techniques for analyzing transmitted information, evaluating performance of the pumping unit and downhole components, and determining optimal prime mover speed according to claim 15, which are applied to control the prime mover speed at predetermined time steps within entire pumping cycle; and(viii) means for transmitting optimal prime mover speed and the new operating parameters from remote computing station to the local control unit for controlling the prime mover speed.

**30.**A system for controlling pumping speed in a pumpjack system, comprising:(i) an electric motor prime mover to control motion of the pumpjack;(ii) a variable frequency drive (VFD) controller for dynamically controlling instantaneous angular velocity of the prime mover within an entire pumping cycle;(iii) downhole pumping components including a sucker rod to communicate motion of the pumpjack to a downhole pump;(iv) measuring means for monitoring operational conditions;(v) a local control unit capable of transmitting instantaneous prime mover speed to a VFD and receiving instantaneous speed and torque of the prime mover from the VFD;(vi) signal transmission means for transmitting information in real time from the local control unit to a remote computing station;(vii) said remote computing station equipped with the software that incorporates the model of the pumping system and numerical solution techniques for analyzing transmitted information, evaluating performance of the pumping unit and downhole components, and determining optimal prime mover speed according to claim 24, which are applied to control the prime mover speed at predetermined time steps within entire pumping cycle; and(viii) means for transmitting optimal prime mover speed and the new operating parameters from remote computing station to the local control unit for controlling the prime mover speed.

**31.**The system of claim 27, claim 28, claim 29, or claim 30 wherein the optimal prime mover speed is applied at predetermined polished rod positions.

**32.**The system of claim 27, claim 28, claim 29, or claim 30 wherein the optimal prime mover speed is applied at predetermined crank positions.

**33.**The system of claim 27, claim 28, claim 29, or claim 30 wherein the measuring means are for measuring polished rod load, polish rod position, tubing and casing pressure.

**34.**The system of claim 27, claim 28, claim 29, or claim 30 wherein the VFD comprises one of a dynamic braking resistor and a regenerative module.

## Description:

**FIELD OF THE INVENTION**

**[0001]**This invention relates to methods and systems for maximizing downhole fluid pumping using a sucker rod pumping system, and more particularly to methods and systems for maximizing fluid production by optimizing the sucker rod prime mover speed.

**BACKGROUND OF THE INVENTION**

**[0002]**Reciprocating oil pumps are traditionally operated by a beam pumping unit, as illustrated in FIG. 1 and described below, with a sinusoidal characteristic of reciprocating motion of a polished rod as dictated by the fixed speed of an electrical or gas prime mover and the geometry of the beam pumping unit. Conventionally, a constant crank speed is employed in the operation of the beam pumping unit; as a result, the geometry of the beam pumping unit dictates a rod speed which follows a curve which is sinusoidal in nature. Other types of pumping units, such as long stroke or hydraulically actuated pumping units, operate at a first constant speed of the polished rod during upstroke motion and at a second constant speed during down-stroke motion, with additional speed variability only during change of the direction of the motion. Some of the pumping units utilize variable control of prime movers to allow for easier change in fixed speed of the prime mover or the ability to choose variable speed of the prime mover in any desired portion of the pumping cycle.

**[0003]**A conventional sucker rod pumping system comprises surface equipment (the beam pumping unit, or pump jack), and downhole equipment (the sucker rod and pump) which operates in a well bore drilled into an oil reservoir. The interaction of the movable and stationary elements of the well and dynamic interaction with fluids present in the well creates a complicated mechanical system that requires precise design and control to be able to work in an efficient way.

**[0004]**In order to increase oil production, analysis and optimization of all of the elements of the sucker rod pumping system must be performed. The design of the oil well system equipment is usually performed on the basis of mechanical laws and special methods. and certain established analytical standards are required to enable development of a beneficial design and desired operation of the oil well. Such an analysis generally involves:

**[0005]**1. A dynamic-analysis of the sucker rod system when the dynamic forces and stresses acting on the sucker rod are calculated (dynamic wave equation),

**[0006]**2. a kinetic analysis of the surface equipment (pumping unit);

**[0007]**3. analysis of the performance of the bottom-hole pump (well evaluation software); and

**[0008]**4. analysis of the performance of the oil reservoir (inflow performance relation).

**[0009]**Such a system analysis presented in the prior art can provide correct and useful information on the original design of the well and on its performance, but only for the constant speed of the prime mover. Past attempts to increase well production have incorporated changing the components of the rod string and size of the pump, changing the overall rotational velocity of the crank, varying the speed within the stroke by choosing different constant crank speeds for upstroke and down-stroke with a variable frequency drive, or by utilizing ultra high slip electric motors to slow down speed of the prime mover during peak torque periods within a single stroke. Prior art has taught allowing for speed change of the prime mover as a response to the need for controlling pump-off conditions (U.S. Pat. Nos. 4,490,094; 4,973,226; and 5,252,031; please note that U.S. Pat. No. 5,252,031 is based on calculation of the down-hole pump behaviour as originally presented in U.S. Pat. No. 3,343,409), limiting loads on the rod string connecting surface unit with reciprocating pump and other components (U.S. Pat. Nos. 4,102,394 and 5,246,076; PCT Application No. WO 03/048578), optimizing pumping conditions of the pumping unit (U.S. Pat. Nos. 4,102,394 and 4,490,094), or converting the sinusoidal speed characteristic of the polished rod powered by a beam pumping unit to a linear characteristic throughout most of the upstroke and down-stroke motion (U.S. Pat. No. 6,890,156) to mimic long stroke behaviour with a typical pump-jack unit.

**[0010]**Most of the prior art methods and systems are based on various analyses of loads or energy on the polished rod and indirect detection of various problems with pump performance or fluid inflow to the well. U.S. Pat. No. 4,102,394, for example, teaches setting a different constant speed for the prime mover during upstroke movement as opposed to down-stroke movement to match inflow of the oil from the reservoir and to avoid pump-off conditions. The method of U.S. Pat. No. 4,490,094 determines and modifies the instantaneous speed of the prime mover for a pre-determined portion of the polished rod stroke, based on power output and work done by the prime. mover. PCT Application No. WO 03/048578 teaches the application of finite changes to the speed of the prime mover within one stroke, to limit the load acting on the polished rod within pre-established safe limits. U.S. Pat. No. 6,890,156 teaches finite changes to the speed of the prime mover so the speed of the polished rod reciprocated by the beam pumping unit remains constant for an extended period during upstroke and down-stroke periods. Speed changes are dictated by the geometry of the beam pumping unit and are resulting in shorter stroke time for the same maximum speed of the polished rod. No relation or effect on the effective stroke of the pump or impact on maximum or minimum force acting in the rod string is taken into consideration or intentionally changed.

**[0011]**For over a decade, various suppliers of variable frequency drives (VFD) for beam pumping provided an opportunity to change the speed of the crank and polished rod within a single stroke of the pump. Some of the drives, such as the ePAC Vector Flux Drive from eProduction Solutions or the Sucker-Rod Pump Drive from Unico, Inc., allow a user to incorporate variable speed of the crank and roil throughout a single stroke by means of an incorporated Programmable Logic Controller and industry standard ladder programming language.

**[0012]**In the prior art, the speed of the polished rod was altered in order to improve, but not optimize. certain aspects of pump operations, such as reducing loads in the rod string, and their teachings had focused on the kinematics of the pumping system by prescribing certain movements of the polished rod without analyzing the dynamics of the entire system, including the surface unit, rod string and downhole pump. The optimization process was limited to the design phase, where, based on the system requirements and the dynamic analysis of the entire pumping system, the physical parameters of the system (such as motor power, rod string materials and dimensions, etc.) were determined to meet the required production target and satisfy the limits on the loads on the system. However, the optimization of the design assumed a constant speed of the prime mover.

**[0013]**While trying to improve the design of a new pumping system or improve the operation of an existing system, there was no attempt to optimize its performance by optimizing the stroke period and the variation of the prime mover speed within a stroke. Implementing such an approach creates an opportunity to develop a method and a system that can address the highly nonlinear nature of the problem of oil production optimization, while at the same time reducing operating costs and providing for operation with safe loading factors.

**SUMMARY OF THE INVENTION**

**[0014]**The present invention seeks to provide a method and system for optimizing the sucker-rod pump prime mover speed in order to maximize oil production while at the same time reducing operating costs and providing for operation with safe loading factors. The optimization can be performs(for existing pumping systems as well as during the design phase of a new system. The presented optimization process and system focuses on finding and applying the optimal variable speed of the prime mover; however, the resulting optimal prime mover angular speed determines the optimal polished rod linear velocity, therefore--after minor modifications within the competence of a person skilled in the relevant art--the present method can also be applied to optimization of the polished rod velocity instead of the prime mover angular speed.

**[0015]**The present invention also seeks to provide the ability to automatically monitor, analyze, test, optimize, control, and manage a given well from a remote central location. The proposed system performs kinetic and dynamic analysis of the oil well equipment, and using various experimental data and mathematical modeling is able to optimize the well performance. Additional benefits include monitoring the pumping conditions and detecting unusual, deteriorating or detrimental operating conditions, and changing the pumping parameters in response to the detected changes.

**[0016]**According to a first aspect of the present invention, there is provided a method for controlling prime mover angular velocity and polished rod motion in a pumping system, the method comprising the steps of:

**[0017]**a) developing a mathematical model of the pumping system based on system data;

**[0018]**b) measuring physical conditions of the pumping system during operation;

**[0019]**c) comparing the mathematical model and the physical conditions as measured;

**[0020]**d) calculating optimal variable speed of the prime mover and new operating parameters to determine optimal polished rod, sucker rod and downhole pump motion; and

**[0021]**e) applying the optimal variable speed of the prime mover and new operating parameters to the pumping system.

**[0022]**According to a second aspect of the present invention, there is provided a system for controlling polished rod motion in a pumping system, the polished rod motion determined by actuation of a prime mover, the system comprising:

**[0023]**a) surface pumping components including the prime mover;

**[0024]**b) a controller for controlling the prime mover, which controller allows for dynamic changes of speed, acceleration and torque within one cycle;

**[0025]**c) downhole pumping components including a rod string and downhole pump;

**[0026]**d) means for communicating motion of the prime mover to the downhole pumping components;

**[0027]**e) measuring means on the surface pumping components for monitoring operational conditions;

**[0028]**f) a local control unit;

**[0029]**g) signal transmission means for transmitting signals from the measuring means and the controller to the local control unit, for determining optimal prime mover speed and required prime mover new operating parameters; and

**[0030]**h) means for transmitting the new operating parameters to the controller.

**[0031]**In preferred embodiments of a method according to the present invention, the optimal variable speed of the prime mover is determined such that pump stroke length is maximized, stroke time is minimized, forces acting on components of the pumping system are minimized and energy consumption is minimized. Preferably, calculating new operating parameters comprises analysis of pumping system geometry and mechanical properties, the prime mover actuates the polished rod motion (wherein the new operating parameters are applied to the prime mover to achieve optimal polished rod motion), and the new operating parameters are applied to the prime mover by means of controlling velocity, acceleration and torque of the prime mover. Where the pumping system is an hydraulically actuated pumping system, the new operating parameters are preferably applied to the pumping system by means of controlling pressure and flow rate within an actuation system of the pumping system. The optimal variable speed of the prime mover may be achieved by an optimization method selected from the group consisting of theoretical techniques. experimental techniques, and a combination of theoretical and experimental techniques. which techniques would be known to one skilled in the art, and calculating the optimal variable speed of the prime mover may be performed as part of initial pumping system design using a predictive analysis method (without measuring physical conditions of the pumping system).

**[0032]**In preferred embodiments of a system according to the present invention. the measuring means are for measuring polished rod load, walking beam position, tubing pressure, and casing pressure, and the measuring means preferably comprise a transducer for measuring polished rod load, an optical encoder for measuring walking beam position, and pressure transducers for measuring tubing pressure and casing pressure. The controller may comprise one of a dynamic braking resistor and a regenerative module, but neither need be present. The system preferably comprises a remote computing station in communication with the local control unit. The local control unit preferably comprises programming incorporating mathematical modelling and numerical solution techniques capability, for analyzing the signals, determining the optimal prime mover speed, and determining the required prime mover new operating parameters.

**[0033]**In some preferred embodiments of the present invention, the pumping system has the ability to control the polished rod linear velocity according to a pre-programmed or self-adapting function of one of the following variables: time, polished rod position or crank rotation angle. A preferred embodiment of this invention uses a VFD for controlling the prime mover angular speed that produces the optimal polished rod linear variable velocity.

**[0034]**It is most efficient to assume that the angular velocity profile of the prime mover is controlled by a function Ω(s) of the polished rod position, although it can also be defined as a function Ω(t) of time or a function Ω(α) of crank angle. The position of the polished rod sε(0,s

_{0}) is defined for the full cycle, including the upstroke and down-stroke movement, and therefore so corresponds to the double length of the polished rod stroke. The present invention seeks to provide a method and system for optimizing the angular velocity profile Ω of the prime mover for the entire stroke cycle in order to achieve one of the following goals:

**[0035]**(I) maximize oil production

**[0036]**or

**[0037]**(II) achieve a predefined production target using a minimum energy consumption in the pumping unit,while satisfying the following constraints for the duration of the entire stroke period T:

**[0038]**(A) the maximum and minimum stress at any point xε(0,L) along the entire length L of the rod string doesn't exceed the limits allowed by the modified Goodman diagram:

**[0038]**σ min ( Ω , x ) = Min i .di-elect cons. ( 0 , T ) ( σ ( Ω , x , t ) ) ≧ 0 σ max ( Ω , x ) = Max i .di-elect cons. ( 0 , T ) ( σ ( Ω , x , t ) ) ≦ g ( σ min ( Ω , x ) )

**[0039]**where g(σ

_{min}(x)) depends on the material properties of the rod segment at point x;

**[0040]**(B) the motor speed variation is achievable for a given pumping unit, i.e. the torque M(Ω, s) doesn't exceed the allowable range (M

_{min}, M

_{max}) specified for the motor and the gear box:

**[0040]**M min ( Ω ) = Min i .di-elect cons. ( 0 , s 0 ) ( M ( Ω , s ) ) ≧ M min M max ( Ω ) = Max s .di-elect cons. ( 0 , s 0 ) ( M ( Ω , s ) ) ≦ M max

**[0041]**where M

_{min}<0 is the minimum allowable negative torque (can be equal to 0 in order to minimize the regenerative torque),

**[0042]**as well as the motor angular speed doesn't exceed the specified limit;

**[0042]**(s)<Ω

_{max}for sε(0,s

_{0})

**[0043]**(C) the angular velocity Ω(s) is the same at the beginning and end of the stroke due to a cyclic character of the pumping operation:

**[0043]**(0)=Ω(s

_{0}).

**[0044]**Because of an inherent time delay in the response of the motor angular velocity to the provided VFD) input, the realized motor speed is not the same as the input design speed, therefore it is more efficient to optimize directly the input speed than to find first the optical motor speed, and subsequently try to determine the input function that actually produces the required motor velocity. Therefore, the function Ω(s) describes rather the optimal design input speed for the VFD controller than the actual optimal motor speed. It needs to be noted that the effect of optimization of VFD input speed is equivalent to controlling the polished rod velocity in order to optimize the pump production and operation.

**[0045]**It has been observed that the optimal solution that maximizes the production usually has the following properties that are of additional benefit:

**[0046]**The energy use and the maximum stresses in the entire pump system are smaller for the optimal velocity profile Ω(s) than for the movement with the same cycle period and a constant motor speed equal to the average motor speed of the variable speed cycle

**[0047]**When optimizing the energy use to achieve the production target the stresses are reduced with respect to the movement with the same cycle period and a constant motor speed.

**[0048]**Once the optimal VFD input velocity is determined then a further reduction of the motor torque and energy use is achieved by re-adjusting the crank weights to the new operating conditions.

**[0049]**When the optimization is performed not on the existing pumping system, but during the design phase, then the design can be further improved based on the power and load requirements resulting from the prime mover speed determined from the optimization process. Making the design changes to improve the performance of the system powered by the prime mover optimal variable speed, e.g. increasing the diameter of the weakest segments of the rod string, will allow for further improvement of the system performance by applying the pumping system design and prime mover speed optimization processes iteratively.

**[0050]**It should be noted that the optimal prime mover speed and the resulting polished rod velocity determined by the present invention are different than those prescribed in the prior art. For example, U.S. Pat. No. 6,890,156 teaches adjusting the prime mover speed to obtain a constant speed of the polished rod during most of the stroke length (which doesn't necessary optimize the production and reduce loads), while the optimal movement of the polished rod obtained by the present method is not constant in general.

**[0051]**To overcome the limitations of the prior art, the present invention seeks to analyze current performance and calculate and apply the most advantageous variable speed of the prime mover to maximize fluid production for an existing sucker rod pumping system. Some prior art systems would require system components to be changed to achieve any increase in production volume, or otherwise would have to compromise safety conditions it higher fixed speed of the prime mover were to be attempted. Operating costs would also increase since larger components and higher energy consumption would be necessary.

**[0052]**As in the prior. art, the measurements of the surface card provide the displacement and force in the polished rod that allow for calculation of the following values that are of importance from the perspective of optimization:

**[0053]**Forces and stresses in the entire rod string that are used for checking condition (A) of the optimization process

**[0054]**Effective plunger stroke length that is used for estimation of the oil output that needs to be maximized according to optimization problem (I), or needs to achieve the prescribed production target according to optimization problem (II)

**[0055]**The motor torque measurements provide means for controlling condition (B) of the optimization process. The angular velocity measurements can be used for modelling the delay between the VFD input and the actual motor velocity profile if mathematical modelling is used instead of the physical measurements for finding the response of the pump/well system to a given VFD input velocity. The calculations of the plunger stroke length and the stresses in the rod string based on the surface card measurements are performed using the methods described in literature that employ either the finite difference method or Fourier transformations (e.g. U.S. Pat. No. 3,343,409). The plunger stroke length and the stresses in the rod string, as well as the loads on the surface unit, including tile motor torque, can alternatively be calculated without relying on the surface card measurements, by simulating the response of the rod string to the imposed movement of the polished rod using the improved predictive analysis based on original work of Gibbs as presented in the Journal of Petroleum Technology in July 1963. This approach might produce less accurate results, but it is necessary if the physical tests cannot be performed or the measurements cannot be collected, e.g. during the design phase, or the number of test must be limited in order to minimize the disruption of the well production.

**[0056]**The present invention is directed to controlling prime mover speed and, in doing so, polished rod motion so that the downhole pump is reciprocated with any stroke length required to maximize production within the fatigue load limits of the sucker rod. In addition, any desired speed of the downhole pump and behaviour pattern can be controlled to overcome excessive friction, gas lock, or other detrimental downhole conditions.

**[0057]**A detailed description of an exemplary embodiment of the present invention is given in the following. It is to be understood, however, that the invention is not to be construed as limited to this embodiment.

**BRIEF DESCRIPTION OF THE DRAWINGS**

**[0058]**In the accompanying drawings, which illustrate an exemplary embodiment of the present invention:

**[0059]**FIG. 1 is a schematic view of a system according to the present invention;

**[0060]**FIGS. 2a and 2b present a flowchart illustrating a preferred process for use in software development for an embodiment according to the present invention;

**[0061]**FIG. 3 is a chart illustrating prime mover angular velocity before and after optimization;

**[0062]**FIG. 4 is a chart illustrating polished rod linear velocity before and after optimization;

**[0063]**FIG. 5 is a chart illustrating polished rod forces vs. displacement and plunger pump forces vs. displacement during operation of a pump with constant prime mover velocity and with optimized speed of prime mover; and

**[0064]**FIG. 6 is a chart illustrating gearbox torque before and after optimization where optimal condition was prescribed as minimization of regenerative torque acting in the gearbox.

**DETAILED DESCRIPTION OF A PREFERRED EMBODIMENT**

**Optimization Method**

**[0065]**Referring now to the summary of the present invention set out above. the optimization problem (I) is defined as finding the VFD input angular speed profile Ω(s) that maximizes the average fluid volume pumped per unit time. The volume pumped during one stroke as a result of the imposed VFD input speed Ω(s) is equal to:

**where**

**[0066]**A

_{p}--plunger cross-sectional area

**[0067]**η--pumping efficiency coefficient

**[0068]**U

_{P}(Ω)--plunger stroke length (the product ηU

_{P}is called an effective stroke length).

**[0069]**Therefore. the optimization goal of maximizing the production per unit time can be mathematically defined as finding the VFD input speed profile Ω(s) that maximizes the following functional V(Ω), while satisfying the constraints (A-C):

**V**( Ω ) = Vol ( Ω ) T ( Ω ) = A p η U P ( Ω ) T ( Ω ) = Maximum ( Ω ) ( 1 )

**[0070]**where T(Ω) is the stroke period resulting from applying the input velocity Ω(s).

**[0071]**Similarly, the optimization problem (II) can be defined as finding the VFD input speed profile Ω(s) that minimizes the motor power use P(Ω), while satisfying the conditions (A-C) together with the following additional constraint:

**V**( Ω ) = Vol ( Ω ) T ( Ω ) = A P η U P ( Ω ) T ( Ω ) = V 0 ( D )

**where V**

_{0}is a prescribed production target.

**[0072]**The power use P(Ω) can be measured directly by VFD or can be calculated as the work done by the motor per unit time, therefore the following functional needs to be minimized:

**P**( Ω ) = W ( Ω ) T ( Ω ) = Minimum ( Ω ) ( 2 )

**where W**(Ω) is the work done by the positive motor torque during one. stoke

**W**( Ω ) = ∫ 0 T M ( Ω , t ) ω ( Ω , t ) t

**where W**(Ω) is the work clone by the positive motor torque during one stoke

**W**( Ω ) = ∫ 0 T M + ( Ω , t ) ω ( Ω , t ) t

**where**: ω(Ω,t) is the motor angular rate described as a function of time.

**[0073]**M.sub.+(Ω,t) is the positive motor torque defined as:

**M**+ ( Ω , t ) = { 0 if M ( Ω , t ) ≦ 0 M ( Ω , t ) if M ( Ω , t ) > 0.

**[0074]**In order to solve the above optimization problems, i.e. problem (I) with constraints (A-C) or problem (II) with constraints (A-D), we need the ability to obtain the following information in response to any input velocity Ω(s):

**[0075]**production value V(Ω), or equivalently, plunger stroke length U

_{P}(Ω) and stroke period T(Ω)

**[0076]**the distribution of stresses σ (Ω,x,t) for the entire rod string xε(0,L) and stroke period tε(0,T

_{0}), and based on this σ

_{min}(Ω,x) and σ

_{max}(Ω,x) as defined in Condition (A)

**[0077]**the motor torque M (Ω, s) for the entire stroke length sε(0,s0) and based on this M

_{min}(Ω) and M

_{max}(Ω) as defined in Condition (B)

**[0078]**prime mover power use P(Ω), or equivalently, the work W(Ω) over a stroke period T(Ω)

**[0079]**The above information for a given input velocity Ω(s) can be obtained in a variety of ways, ranging from totally experimental to purely theoretical. In general, the experimental methods are more accurate, but at the same time require more effort in installing the instrumentation, performing tests and collecting data for each input function Ω(s). Usually, the most efficient approach is to combine both of these methods.

**[0080]**Following is a brief description of some possible approaches;

**[0081]**The production can be measured directly in the experimental way, provided the necessary equipment is available, or can be calculated based on the plunger stroke length and strode period, either measured or calculated.

**[0082]**The stroke period T(Ω) for a given input velocity Ω(s) can be measured directly by applying this input to the VFD of a real pump/well system, or can be calculated theoretically, assuming the motor velocity follows the VFD input velocity with a constant time delay.

**[0083]**The plunger stroke length can be measured experimentally, e.g. by installing accelerometers at the plunger, or can be calculated in two ways: 1) using the mathematical model of the plunger movement based on the surface card measurements, i.e. the polished rod displacement and force; 2) applying a purely theoretical method by calculating the polished rod movement as a function of the motor speed and using the predictive analysis to find the plunger response to this movement.

**[0084]**The stresses along the rod string could be measured experimentally, e.g. by installing strain sensors at various locations (although it is rather impractical), or can be calculated in two ways: 1) using a mathematical model of the rod string displacements and forces based on the surface card measurements; 2) applying a purely theoretical method by calculating the polished rod movement as a function of the motor speed and using the predictive analysis to find the distributions of the stresses in the rod string.

**[0085]**The motor torque can be measured directly from the VFD output by applying the desired VFD input velocity to the pump/well system or ran be calculated, using the equations of dynamic equilibrium of the surface unit. based on the theoretically calculated force in the polished rod obtained from the rod string dynamic model.

**[0086]**The motor power consumption can be measured directly from the VFD output by applying the desired VFD input velocity to the pump/well system, or can be calculated theoretically based on the work done by the theoretically calculated torque for the imposed motor angular velocity.

**[0087]**The optimization problems (I) and (II) are very similar from the mathematical point of view and can be solved using the same methods; therefore, a possible solution will be presented for case (I) only. The solution of problem (I) can be achieved by, but is not limited to, the following iterative approach that was chosen to address the highly nonlinear nature of this problem.

**[0088]**The function Ω[p](s) describing any allowable VFD input speed that meets the condition (C) can be presented in the following form of Fourier series:

**Ω [ p ] ( s ) = β Ω _ 0 [ 1 + i = 1 N ( γ i cos ( 2 π s / s 0 ) + λ i sin ( 2 π s / s 0 ) ) ] ( 3 )**

**where**

**[0089]**p=[ρ

_{1}, . . . , p

_{1}N+1]=[β, γ

_{1}, . . . , γ

_{N}, λ

_{1}, . . . , λ

_{N}] is the vector of optimization variables/parameters

**[0090]**Ω

_{0}--prime mover typical constant operational speed for the specific well and pumping unit

**[0091]**N--selected number of terms in the Fourier series, usually not exceeding 4

**[0092]**The purpose of optimization is to find the vector of parameters p for which the function Ω[p](s) maximizes the production V(Ω) defined by (1), while meeting the conditions (A) and (B). Due to the nonlinear nature of this problem, the optimal solution will be found using an iterative approach, starting from some initial set of parameters usually selected based on experience. The closer the initial values are to the optimum the faster the convergence to the optimal point will be achieved. Typically those initial parameters are assumed as follows:

=1

1ε(-0.1,0.1) depending on the sucker-rod material (fibreglass or steel)

1=0 for i>1

2=0.2, γ

_{1}=0 (i=1 or i>2)

**[0093]**Now any operational parameters of the pumping system controlled directly or indirectly by the VFD input velocity Ω[p](s), such as the production V(Ω[p]), prime mover torque M(Ω[p], s) and stresses in the rod string σ (Ω[p], x,t) can be treated as functions of the parameter vector p:

**V**[p]=V(Ω[p]))

**M**[p](s)=M(Ω[p],s) sε(0,s0)

[p](x,t)=σ(Ω[p],x,t) xε(0,L); tε(0,T) (4)

**[0094]**Using one of the methods described earlier, we can determine the values of all the above functions at the starting point p=p

_{0}. Then we will search for such a vector δp=[δp

_{1}, . . . , δp

_{2}N+1] for which the functions α [p

_{0}+δp] and M[p

_{0}+δp] satisfy the constraints (A) and (B), and for which the maximum of the function V[p

_{0}+δp] is reached in the vicinity of point p

_{0}

**V**[p

_{0}+δp]=Maximum(δp) (5)

**[0095]**The functions V, M and σ of parameters p are not available in analytical form and depend on those parameters in a highly nonlinear way; their determination can even involve physical tests. However, these functions can be approximated at point p

_{0}by linear functions of δp using the first order Taylor series;.

**V**[ p 0 + δ p ] = V [ p 0 ] + i = 1 2 N + 1 [ ∂ V ∂ p i [ p 0 ] δ p i + ∂ 2 V ∂ p i 2 [ p 0 ] δ p i 2 ] ( 6 a ) M [ p 0 + δ p ] ( s ) = M [ p 0 ] ( s ) + i = 1 2 N + 1 [ ∂ M ∂ p i [ p 0 ] ( s ) δ p i + ∂ 2 M ∂ p i 2 [ p 0 ] ( s ) δ p i 2 ] ( 6 b ) σ [ p 0 + δ p ] ( s , t ) = σ [ p 0 ] ( s ) + i = 1 2 N + 1 [ ∂ σ ∂ p i [ p 0 ] ( s , t ) δ p i + ∂ 2 σ ∂ p i 2 [ p 0 ] ( s , t ) δ p i 2 ] ( 6 c )

**where the partial derivatives of functions V**, M and σ are calculated from the finite differences for each i (i=1, . . . , 2N+1) using the following formulas;

**∂ V ∂ p i [ p 0 ] = V [ p 0 + Δ p 1 ] - V [ p 0 ] Δ p i ∂ M ∂ p i [ p 0 ] ( s ) = M [ p 0 + Δ p 1 ] ( s ) - M [ p 0 ] ( s ) Δ p 1 ∂ σ ∂ p i [ p 0 ] ( s , t ) = σ [ p 0 + Δ p 1 ] ( s , t + i ) - σ [ p 0 ] ( s , t ) Δ p i ( 7 )**

**where**

**Δ p i = [ 0 , , Δ p 1 , 0 ] t + i = T [ p 0 ] T [ p 0 + Δ p i ] t T [ p ] = T ( Ω [ p ] ) .**

**[0096]**Different input parameters p=p

_{0}+Δp

_{i}(i=1, . . . , 2N+1) produce variations of the motor speed that can result in a slightly different stroke period T [p

_{0}+Δp

_{i}] than for p=p

_{0}. in order to be able to superimpose stresses σ (Ω[p],x,t) along the roc string for the same moment during the cycles with different periods the time t can be scaled to a constant reference period T [p

_{0}], e.g. time t defined for the period T [p

_{0}+Δp

_{i}] was converted to time t.sub.+ defined for the period T [p

_{0}].

**[0097]**When calculating the partial derivatives using the finite difference method the values Δp, should be selected in a way that ensures a quick convergence to the optimal solution of the nonlinear problem. In order to keep under control the error resulting from the approximation of a nonlinear problem, the following additional constraints are imposed on the values δp,

|δp

_{i}|<θΔp, (i=1, . . . , 2N+1) (E)

**where**θ is initially set to 1, but needs to be reduced if convergence problems are encountered.

**[0098]**As can be see from Eqs. (6a-c) the highly nonlinear optimization problem (I) has been reduced to finding the minimum of a linear function V[p

_{0}+δp] apt of vector δp subject to linear constraints (A), (B) and (E). The solution of this problem can be obtained by those skilled in art using any of the known methods of linear programming.

**[0099]**Having calculated the optimal vector δp

_{0}for the approximate optimization problem we can repeat the entire process starting from a new point p

_{1}=p

_{0}+δp

_{0}that should be closer to the optimal solution of the original nonlinear problem than point p

_{0}. This process can be repeated until there is no change in the optimal vector p from the previous iteration, i.e.

**δ p = i 2 N + 1 δ p i 2 < ( 8 )**

**where**ε is a selected threshold for the convergence criterion.

**[0100]**The most efficient method is to perform the optimization process in two stages. In the first stage we would find the theoretical optimal solution based only on the predictive analysis without performing tests on the real pump/well system to determine its response to different input velocities (only the basic tests to determine the system parameters would be performed initially). In the second stage we would find the actual optimal solution starting from that theoretical solution by utilizing the responses of the real system to different input velocities required by the optimization algorithm. The transition between those two stages requires changing the optimization parameters from the motor speed to the VFD input velocity. This requires transforming the Fourier series parameters to reflect the time delay between the VFD input velocity and the motor response, which however is fairly straightforward. Adopting this two stage approach may limit the physical tests of the system to only one iteration.

**Application Method**

**[0101]**As one skilled in the art would appreciate, to calculate optimized prime mover. speed, evaluation of current pumping system performance must be based on accurate feedback of the system behaviour. Accurate position of the polished rod is preferably determined by utilization of an optical encoder, non-contact magneto-resistive rotary position sensor or similar high precision rotary position transducer mounted on the centre bearing of the beam pumping unit or crank. The present invention preferably continuously monitors and transfers all well operating conditions to a centrally-based computer that calculates optimal prime mover speed and corresponding prime mover operating parameters. New parameters are then transferred to a local well controller via wired or wireless means of data transfer. A closed feedback loop between a local controller and the centrally-based computer allows the mathematical model to correct and adjust its parameters to achieve the most accurate representation of the physical state of the downhole and surface components, and it also allows for detecting trends and changes in operating conditions. The controller also allows for detection of any detrimental condition outside of the preset range of loading factors on every component of the pumping system. The amount of rpm, acceleration and torque for every portion of the cycle is accordingly based on following optimal prime mover speed to maximize total volume production while maintaining safe working parameters.

**Surface Equipment and Prime Mover**

**[0102]**The surface equipment is used to provide the oscillating motion to the sucker rod and the pump at the bottom of the well. The pumping unit usually comprises:

**[0103]**a walking beam with "Horsehead";

**[0104]**a base;

**[0105]**a pitman;

**[0106]**a crank with counterbalance weights; and

**[0107]**a gearbox and motor.

**[0108]**By optimizing speed of the prime mover to properly apply motion of the polished rod to rod string and pump, efficiency of the pumping unit can be improved, power costs can be reduced, stresses in the rod string can be reduced and pumping unit balance can be improved.

**[0109]**Under the condition of variable motor speed, all of these elements rotate and move with variable velocity and acceleration. The effects of acceleration result in dynamic forces and moments that affect the performance of the pumping unit as a whole. For example, acceleration affects gearbox torque, motor power consumption, the strength of the walking beam and wearing of the gearbox, etc. Proper loading of the gearbox is of extreme importance, as an under-loaded unit operates at low mechanical efficiency. The overloaded unit can be easily damaged and then requires excessive maintenance. The calculation of the dynamic torque values and prediction/optimization of the performance of the pumping unit is possible only if the correct data about the weights and moments of the inertia of the moving and rotating elements of the pumping unit is known. This data is required for evaluation of the performance before any optimization can be performed. In accordance with the preferred embodiment, most of the information that is necessary to calculate torques, counterbalance loads, etc. is obtained automatically.

**Sucker Rod and Pump Performance**

**[0110]**A sucker rod is a long elastic rod consisting of several lengths of different cross-sections. The rod is attached at one end to the walking beam of the pumping unit by means of the horsehead and polished rod, and to the downhole pump at the other end. It is necessary to keep the stresses and safety factors of the rod within the recommended guidelines corresponding to the fatigue strength of the material of the rod. The estimation of the stresses in the rod is performed using a mathematical model of the rod string, based on one of the following:

**[0111]**the loads in the polished rod measured at the surface (diagnostic analysis)

**[0112]**estimation of the forces acting on the plunger at the bottom of the well (predictive analysis).

**[0113]**The calculation of the stresses in the rod string creates complex mechanical and mathematical problems due to the fact that:

**[0114]**the elastic rod string is very long and undergoes nonlinear displacements and possibly buckling;

**[0115]**the rod has complex three-dimensional geometry;

**[0116]**the rod moves inside the tubing, not only along the tubing but also laterally;

**[0117]**the rod is in contact with the tubing in unpredictable places along the rod; and

**[0118]**the rod is submerged in a viscous fluid.

**[0119]**The mathematical model of the rod string requires detailed and precise information on many parameters to be able to precisely define the sucker rod loads and stresses. it is accordingly necessary to fire establish an appropriate mathematical model of the rod string dynamics with correct values of the parameters, and then solve using available and effective mathematical methods. The additional information necessary for the optimization process is the available measured data obtained at the well. Instantaneous measurements of the flow from the well arm the production rate, with pattern recognition toots being used for the identification of the bottom-hole diagrams, provide a large amount of the information that can be used. The system software replicates the dynamic behaviour of the system using the measured surface dynamometer card and the measured production rate. The software can automatically select best pumping conditions to reduce the ma loads and determine the profile of the motor speed within the pumping cycle as required for desirable pump motion. It can select the optimal value of the pumping speed, and determine the optimal prime mover speed. All of these changes can be made with minimum expenditure, and operating cost reduction can be achieved since no physical changes to the configuration of the surface unit, rod string or pump are necessary (as long as the unit contains all the required components of the present invention).

**Applications**

**[0120]**While numerous applications of the within techniques and methods for controlling the prime mover speed and, consequently, the polished rod motion will now be obvious to one skilled in the art, certain applications are seen as being of particular utility within the field of downhole fluid production.

**[0121]**Using the techniques and methods taught herein, for example. the performance and optimum operating parameters of the reciprocating pump located below trio fluid level of the well and connected to a reciprocating mechanism on the surface with an elastic sucker rod system can be determined by:

**[0122]**a) calculation of the performance of the elastic sucker rod and pump by any appropriate numerical method that would be known to one stilled in the art to accurately identify and calculate all variables in the mechanical system of the sucker rod, downhole pump and surface unit with dynamically changing velocities and accelerations of all the components that possess mass and inertia of such a system, changing mechanical and viscous friction, etc., and

**[0123]**b) calculation of the optimized performance and optimized behaviour of the surface unit such as, but not limited to, beam pumping, long strode or hydraulically actuated unit with a prime mover operating with intentionally prescribed non-constant rotational velocity within a single reciprocating cycle to produce the desired optimized behaviour of the polished rod, rod string and downhole pump.

**[0124]**The methods and techniques taught herein can also provide the means for improving pumping performance of a sucker rod pumping system by controlling pumping system behaviour which comprise:

**[0125]**a) a variable frequency drive and electric prime mover, with or without a braking or regenerative unit, to control reciprocating motion of the surface unit as per optimized parameters within a single cycle of the motion with non-constant rotational velocity, acceleration and torque;

**[0126]**b) a local control unit that may be a programmable controller or digital processor based computer with single or multitasking operating system, separate or an integral part of the variable frequency drive, to input desired characteristics of reciprocating motion of the surface unit to the variable frequency drive at a minimum rate of 24 times within a single reciprocating cycle;

**[0127]**c) a local data acquisition unit mat may be a programmable controller or digital processor based computer with single or multitasking operating system, separate or an integral part of the variable frequency drive, to record time, angular velocity, acceleration and torque parameters of the variable frequency drive, load and position of the polished rod, tubing pressure and casing pressure, and optional flow rate within a single reciprocating cycle; and

**[0128]**d) a remote computing station with closed feedback loop via a communication link to optimize and control the local control unit. The remote computing station may be remotely located or located locally and control one or any other number of local control units.

**[0129]**This system is discussed in further detail below.

**[0130]**The techniques and methods taught herein can also enable automatically changing operating parameters of the sucker rod pumping unit in response to changing conditions in the well or in surface components by:

**[0131]**a) establishing real-time always-on communication with the pumping unit local controller via Internet network that may be wired or wireless via radio, wireless cell or satellite communication network;

**[0132]**b) calculating optimized operating parameters using any appropriate numerical method that would be known to one skilled in the art and programming these into a local well controller alarm or shut-down detection means to detect within a single stroke step if operating conditions of the pumping unit are exceeding predetermined values;

**[0133]**c) implementing corrective action as programmed into the local control unit, which corrective action may be an alarm condition, immediate shutdown, slow shut down within single cycle or switching to predetermined emergency operating conditions;

**[0134]**d) initiating communication with a remote computing station immediately or within a predetermined time period;

**[0135]**e) implementing a corrective action routine into the remote computing station to automatically analyze the new condition of the pumping unit that has exceeded previously calculated best operating conditions;

**[0136]**f) automatically, or with assistance of personnel, downloading new operating parameters to the local control unit to correct behaviour of the pump in the new conditions; and

**[0137]**g) automatically, or with assistance of personnel, downloading new operating parameters to the local control unit to change distribution rate of chemical agents in response to increased friction in the well due to deposit of various substances.

**[0138]**As a final example of the utility of the present invention, the within techniques and methods can be employed to automatically prevent or remove gas lock condition at the pump, by:

**[0139]**a) detecting gas lock condition from forces acting on the plunger during down-stroke motion;

**[0140]**b) calculating bubble point pressure as occurring during flow of fluid that may be oil with or without water and gas through the narrowest section of the standing valve opening;

**[0141]**c) calculating optimal motion of the plunger to minimize velocity of the plunger during upstroke motion in order to minimize velocity of the fluid and the pressure drop in the fluid at the standing valve and keep it above bubble point pressure; and

**[0142]**d) controlling velocity and acceleration of the prime mover within calculated optimal motion to minimize or remove gas lock condition with precise polished rod movement.

**[0143]**These are only a few examples of how the present invention can be applied to address a number of practical operational situations experienced in the field of downhole fluid production, employing the methods and system taught herein.

**System**

**[0144]**Referring now in detail to the accompanying drawings, there is illustrated an exemplary embodiment of a system according to the present invention.

**[0145]**Referring to FIG. 1, a typical oil well beam pumping unit consists of many moving parts that will produce significant inertia forces if accelerated or decelerated on top of typical static forces. A horsehead 1 connects the rod system 9 and pump 10 with the walking beam 2 using bridle cables and rod hanger. A pitman arm 3 connects the walking beam 2 to the crank 5 with attached counterweights 6. The crank S is attached to a shaft of the gearbox 4 that is powered through a belt system by the prime mover 7.

**[0146]**The rod system 9 and pump 10 are subjected to mechanical friction (due to interaction of the pump 10 with the barrel and the rod 9 with tubing), fluid friction (due to the rod 9 moving in the viscous fluid and viscous fluid moving in the tubing and through the valves of the pump 10), and force due to hydrostatic pressure and inertia of the fluid. The rod system 9 is an elastic connection between surface components and the downhole pump 10. The elastic behaviour is greatly influenced by the dimensions and material properties of each rod section and by the depth of the well. Due to the elasticity of the rod 9 and cyclic changes in the polished rod force, velocity, and acceleration, the sucker rod 9 is vibrating in longitudinal and transverse directions in the well.

**[0147]**Four measuring means or transducers are mounted on the pumping unit. Load measuring means or a transducer 11. which may be a strain gauge load cell, is connected to the polished rod and provides an output signal that is proportional to the load. A high accuracy, position measuring means, which may be an optical encoder 8, is mounted on the centre bearing and is anchored to the Samson post; it provides accurate position measurement of the walking beam 2 regardless of rotational speed or acceleration. Two pressure transducers are mounted on the wellhead, namely a tubing pressure transducer 12 and a casing pressure transducer 13; they provide an accurate pressure signal to property evaluate pump behaviour during every cycle.

**[0148]**The beam pumping unit is driven by the prime mover 7, which may be a high efficiency Nema B motor, to reciprocate the polished rod in any required motion pattern. The polished rod is connected through various tapers of the sucker rod 9 with the downhole pump 10. The present invention is directed to controlling the polished rod motion so that the downhole pump 10 is reciprocated with any required stroke length to maximize production within the fatigue load limits of the sucker rod 9. In addition, any desired speed of the downhole pump 10 and behaviour pattern can be controlled to overcome excessive friction, gas lock and other detrimental downhole conditions.

**[0149]**As illustrated in FIG. 1. a position signal 17, a load signal 18, a tubing pressure signal 19 and a casing pressure signal 20 are transmitted to a local control unit 21 that converts, computes and stores this information by means of digital storage that may be, but is not limited to, a hard drive or solid state memory modules. Additional speed and torque signals 16 are transmitted to the control unit 21 from a typical variable frequency drive controller 14 that controls behaviour of the prime mover 7 through voltage, current and frequency of the power supplied to the electric prime mover 7. The prime mover 7 and variable frequency drive controller communicate by means of a signal 15. The variable frequency drive controller 14 may include a dynamic bracing resistor and various other components, and may be of any appropriate type commercially available. The local control unit 21 transmits all gathered information via communication unit to a remote computing station 23 that may be a high computing power desktop computer with a multitasking operating system. Various means of communication 22 may be, used such as wired radio, Internet, wireless cell network, telephone network or satellite communication. The communication link facilitates a closed loop feedback system between the local control unit 21 and the remote computing station 23.

**[0150]**Downhole and surface operating conditions are analyzed and optimized by means of software based on the process summarized in FIGS. 2a and 2b, which includes both predictive and diagnostic analysis. Steps 30 to 44 are set out in FIG. 2a, with subsequent steps 46 to 60 in FIG. 2b.

**[0151]**FIGS. 3 to 6 provide operational data from a 9,057 feet deep well that was one of four test sites employed for validation of the present invention. A conventional geometry pumping unit (640-365-168) was connected to a 1.76 inch diameter heavy wall rod pump by a steel sucker rod string assembled from five sections of different diameters. Data was obtained from a typical fixed speed and from optimized mode with optimal variable angular velocity of the prime mover. The downhole pump stroke length was verified by measurement of production volume over a 24 hour period. Fluid level measurement data was used to verify calculated forces on the plunger. Long-term data collection in excess of six months was performed to ensure sustainability of performance and to allow for further development of hardware, optimization technique, and software.

**[0152]**FIG. 3 provides a chart illustrating measured prime mover speed for two cases: a constant speed resulting in pumping rate of 6.3 strokes per minute (SPM) and the optimized variable prime mover speed that results in 7.6 SPM.

**[0153]**FIG. 4 provides a chart illustrating measured polished rod linear velocity before and after optimization. It is clear that the optimal speed is not constant at any portion of the stroke, as prescribed by some prior art, and is significantly different from the typical one resulting from a constant prime mover angular velocity.

**[0154]**FIG. 5 provides a chart illustrating measured polished rod and calculated plunger forces vs. displacement during operation of a pump with constant angular velocity and the optimal variable velocity of prime mover. The constant angular velocity corresponding to 6.3 SPM produces the pump stroke of 114 inches as calculated by evaluation software and confirmed by actual fluid flow measurements from the well on the surface. As a result of applying the optimal variable speed to the prime mover, the stroke period has reduced to the equivalent of 7.6 SPM, and the pump strove length has increased to 143 inches as calculated by the evaluation software and confirmed by the actual fluid flow from the well on the surface. The resulting dramatic increase in production is due both to increase of the pump stroke length (25%) and reduction of the stroke time (20%). There was no increase in the forces acting on any component of the well, and due to utilizing inertia of the rotating weights the electric power demand was decreased by 27%. For those skilled in art it will be obvious that for any typical well, by increasing the constant speed of the prime mover in order to increase the pump stroke rate from 6.3 SPM to 7.6 SPM, a much smaller increase in the pump stroke would be realized, while electric power demand and forces acting on the system would significantly increase.

**[0155]**FIG. 6 provides a chart illustrating measured gearbox torque acting in the gearbox before and after optimization. As gearbox torque was significantly under the maximum rated torque, the objective was to lower the regenerative torque to its minimum in order to lower negative impact on longevity of the gearbox.

**[0156]**The optimal speed, acceleration. and torque of the prime mover. and the safe operating limits, are calculated and transferred together to the local control unit 21. The response of the unit after minimum one full cycle is then transferred via communication unit back and analyzed in the remote computing station 23. If the optimized parameters are satisfied (such as calculated pump stroke length, stroke time, power consumption, loads and stress level in the rod system and surface components, fluid velocity at the standing valve, maximum and minimum motor torque or any other), calculations are not performed anymore unless deterioration of the well performance is detected in the future. Periodically. for every predetermined time interval, the remote unit 23 or local unit 21 will initiate communication to check the status of the pumping unit. The local control unit 21 will provide the variable frequency drive 14 with the calculated rpm, and acceleration for a minimum 24 steps within each cycle, and will monitor behaviour of the pumping unit during each step according to safe operating parameters such as maximum and minimum load on polished rod, motor torque, gearbox torque, polished rod displacement. tubing pressure. casing pressure and stroke time.

**[0157]**If any of the safe operating parameters are outside of the prescribed values, the local unit 21 will initiate corrective action such as slow down or shut down of the unit and an alarm message will be generated and sent to the remote computing station 23 via the closed. loop feedback system. Last operating conditions will be transferred to the remote computing station 23 and new optimized operating parameters will be computed and transferred to the local unit 21.

**[0158]**While a particular embodiment of the present invention has been described in the foregoing, it is to be understood that other embodiments are possible within the scope of the invention and are intended to be included herein. It will be clear to any person skilled in the art that modifications of and adjustments to this invention. not shown, are possible without departing from the spirit of the invention as demonstrated through the exemplary embodiment. The invention is therefore to be considered limited solely by the scope of the appended claims.

User Contributions:

Comment about this patent or add new information about this topic: