Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Proceedings of 6th International Conference of Young Scientisis on Solutions of Applied Problems in Control and Communications

..pdf
Скачиваний:
4
Добавлен:
15.11.2022
Размер:
6.07 Mб
Скачать

Implementation of role-playing game application

Designed and implemented game is created based on object-oriented approach. RPG application is programmed by using Windows Forms. Classes and their objects are virtual equivalents of gaming objects, equipments, characters, locations and situations in the game or user variables. The application is based on the mutual interactions of these objects. Most of the objects keep their data in text or image files. Text files are created using the scripting language Lua and keep numeric or text values. These files imported and processed RPG application using external libraries LuaInterface. The files are saved in the data folders of RPG applications. Files have specified extension by to objects. This determines which files and how they have RPG application to import, and then processed. Import from files allows quickly and effectively modify or create new objects.

The imported data will be used for creating game objects that are save in lists of data type Dictionary with identifying name of the object. Where the game situation asks for object, these lists provided via identification name.

Also, all of the text data in the visual interface is imported from text files, allowing quick modification and proofreading, or offering the ability to easily to implement another language to game.

The concept of role-playing game is implemented based on the model- view-controller architecture. This architecture divided application into logical units and more-transparent the source code. It also allows easy modification of algorithms without having to interfere with the GUI and to modify the user interface without any direct danger to the game mechanics.

Implementation of finite state machine structure

Designed FMS software structure implemented in RPG application is created using the object-oriented design. FMS mechanisms are divided into different classes, which handle the process. Software structure FMS uses encapsulation, inheritance and polymorphism. As well as RPG application structure of FMS is subject to the Model-View-Controller architecture. It is very important to keep this architecture due to quick modifications and proofreading, or the possibility to easily implement another language to locations.

The whole structure consists of fifth primary classes of section Model:

StateMachine, State, Transition, StateFactory and TransitionFactory.

51

Class StateMachine is primary class of FMS. He is responsible for initializing FMS, controlling states and transitions and provides data for GUI.

Constructor set default start state to current st ate and ensure initialized of static class StateFactory and TransitionFactory.

Method PosTrans provides a list of transitions, which condition is true and relevant in formations for section View.

Method AutoAction find the transition, which condition is true and is executed automatically, without selected by the user.

Method ExTrans find the transition, which is selected by the user and ensure to execute of the transition action and set new current state.

Class State is abstract class, which represents state of FMS. Includes following private attributes:

idName is identifying name of the state,

exploration represents the possibility of interaction with equipment in the locations,

stat determines to display statistics and player's interaction with inventory,

transitions is list of transitions for which this state is start state,

part is a numerical index reflecting the current part of location, the initial index for each state is value 1. Index is used to display some of the text on GUI, or can used by conditions of transitions,

enabled determines approach to transition for which this state is final state,

object is a unique value that characterizes the state, e.g. whether it type of location is map, combat or trade.

Class Transition is abstract class, which represents transition of FMS. Includes following private attributes:

idName is identifying name of the transition,

startState is start state of transition,

finalState is final state of transition,

auto determines whether the transition execute automatically, without selected by user,

hide determines whether the transition disabled after its execution,

point is value of x and y coordinates on GUI.

The essence of transition methods are following:

Condition evaluates whether the condition of transition is true,

Action executed to mechanics of game and provides the data for GUI.

52

Class StateFactory is a static class that is responsible for initializing all generated states. Instantiated conditions are saved in the attribute states. The essence of classes is generated methods that provide access to save or new instances.

Class TransitionFactory is a static class that is responsible for initializing all generated transitions. Instantiated conditions are saved in the attribute transitions. The essence of classes is generated methods that provide access to save or new instances.

Conclusion

Effectiveness of structure of FMS and source code generator was tested using professional adventure settings Khyber’s Harvest [3]. Data from this book was easy and quick transformed to configure files of FMS. This files was import, generate and export via source code generator to RPG application. Finally was game adventure successfully tested by role-plaing game application.

References

1.Polák Maroš. Fuzzy-based Decision Making in RPG. STU-MTF, Reg. No.: MTF-5262-6510. – 2013.

2.Bourg David., Seeman Glenn. AI for Game Developers. O'Reilly. – 2004.

3.Baker Keith. Khyber’s Harvest. Renton: Wizards of the Coast, Inc. –

2009.

53

РАЗРАБОТКА КОМПЬЮТЕРНОГО ПРОГРАММНОГО ОБЕСПЕЧЕНИЯ НА ОСНОВЕ КОНЕЧНЫХ АВТОМАТОВ ДЛЯ RPG

Марош ПОЛАК

Словацкий технологический университет в Братиславе, факультет материаловедения и технологии в г. Трнава, Словакия

(e-mail: maros.polak.sk@gmail.com)

Аннотация. Данная работа затрагивает тему конечных автоматов

вразвитие компьютерных игр, в частности ролевых игр. Основная цель исследования заключается в разработке и реализации структуры конечных автоматов в приложении ролевых игр, для проектирования и управления объектами и их взаимодействием. Следующая цель заключается

вреализации генератора кода на основе создания структуры конечных автоматов для генерации исходного кода состояний и переходов в проект игрового приложения.

Ключевые слова: конечные автоматы, компьютеры, создание исход-

ного код, ролевая игра

54

BUILDING OF AUTOMATIC CONTROL SYSTEMS OF THE SUCKER ROD PUMPING UNIT MOTOR

Aleksandr KOSTYGOV1, Alexey SHACHKOV2

Perm National Research Polytechnic University, Perm, Russia

(1e-mail: dekan@etf.pstu.ru, 2e-mail: ajiexa_@mail.ru)

Abstract. This article describes building of automatic control systems of the sucker rod pumping unit motor. Given block diagram of the automatic control systems for sucker rod pumping unit based on «thyri stor converter – induction motor», adjustable-frequency electric drive and vec tor control of induction motor. Special attention is paid to the advantages and disadvantages of automatic control systems of the sucker rod pumping unit. In the work described algorithms for automatic regulation of the dynamic level of oil in the well and providing the desired law of rod hanger center motion by changing the instantaneous speed at the motor shaft of the pumping unit. The obtained results will be use in the development of sensorless vector control system of the sucker rod pump.

Keywords: sucker rod pumping unit, thyristor converter – induction motor, unregulated electric drive, vector control, sucker rod pump, adjustable-frequency electric drive.

Introduction

Nowadays, Russia is one of the leading places in the world in the production and export of oil. To develop the oil fields began in the twentieth century. Now many oil fields are in the final stages of development and are characterized by a low volume of oil production. Instead of gushing oil extraction way is increasingly used sucker rod pumping unit (SRPU), which on average is about 50 % of the total number of oil wells. When using SRPU increase depreciation and energy costs. Therefore, the increase of energy efficiency and optimum use of SRPU equipment are the main factors for the further development of the oil industry.

The electric drive performs the role of the main consumer of electricity, therefore, the development of a control system that will allow optimum use of the engine, it is highly relevant task in our time. Also promising direction is to develop new methods and algorithms for SRPU drive control, which will increase the life of the equipment.

Today take place the introduction of adjustable-frequency electric drives in the oil industry, as they have several advantages: the possibility of smooth adjustment the average and instantaneous speed of the crank shaft; a wider range of speed control; high energy saving; increase the life of the equipment. But so far, adjustable-frequency electric drives are not widely used in the oil industry, because they haven't fully explored kinematic, dynamic and energetic processes occurring in these systems.

55

Main part

In the operation of oil wells widespread acquired such types of pumping units, as sucker rod pumping units, electrical submersible pumps and electroventilee pumps. Listed pumping units have their advantages and disadvantages.

Sucker rod pumping units are used in the operation of marginal and medium production wells. The range of the filing of SRPU varies from 0,2 m3 / day to 60 m3 / day , the descent maximum depth of the pump

2500 m, the maximum viscosity of pumped fluid – 0,3 PA·s, the maximum solids content of 0,3 % [1].

As sucker rod pumps mechanical drives are typically used conventional balancer type and chain drives pumping unit. Chain drives are used when technological conditions required low-speed modes of operation with constant speed, reducing the maximum values of the dynamic loads on the elements of the pumping unit [2].

Fig. 1. Balancer type pumping unit and sucker rod pump

56

Figure 1 shows a pumping unit, where 1 – electric motor; 2 – V-belt

drive; 3 – reduction gear;

4 – crank; 5

– connecting rod;

6 – balancer;

7 – head of balancer; 8 – rope suspension;

9 – wellhead rod;

10 – wellhead

gland; 11 – rods column;

12 – pump

cylinder; 13 – pump plunger;

14 – discharge valve; 15 – suction valve; 16 – tubing column.

Usually SRPU equipped with a mechanical actuator in the form of balance type pumping units (Fig. 1). Then the system works as follows: electric motor of pumping unit (PU) 1 through V-belt transmission 2 and reduction gear 3 transmits to the rotational motion of PU crank 4; a crank mechanism together with PU balancer 6 converts the rotary motion of the crank into a reciprocating motion of wellhead rod 9 which, through the rods column 11 is transmitted to pump plunger 13; a plunger, performing a reciprocating motion in pump cylinder 12, pumps the oil into the tubing string 16, the oil reaches the surface on tubing column.

In the case of SRPU unregulated drives the performance of the pump is controlled by changing the stroke length of the wellhead rod or the frequency of the pumping unit balance wheel oscillations. Stroke length of the wellhead rod is controlled by changing the distance from the crank shaft center to the point attachment of the connecting rod to the crank. The oscillations frequency of the pumping unit balance wheel is controlled by changing the gear V-belt transmission ratio, that is, to replace the pulley on the motor shaft. In the above cases, the regulation of the pump speed is not always provides the optimal operation of the pumping unit according to technological requirements.

The SRPU Unregulated electric drive has the following disadvantages [3]:

the inability of performance smooth adjustment for matching the pump performance with the well flow rate at a given downhole pressure;

when starting and stopping of SRPU on the motor shaft appear significant dynamic loads, which reduce the life of the equipment;

the power factor average value of the SRPU unregulated drives has a value of 0,4...0,5, due to low load electric motor factor of the pumping unit.

For optimal operation modes of the pumping unit according to technological requirements and to eliminate some of these drawbacks apply adjustable electric drives of the pumping unit. As adjustable electric drives of the pumping unit are used electric drive based on the «TC-IM» and adjust- able-frequency electric drives.

57

1. Automatic control system of SRPU on the based on "TC-IM."

Electric drive on the basis of «thyristor converter – induction motor» used in periodic mode of operation, i.e. when the performance of the pump exceeds the well flow rate. In the periodic pumping unit operation mode, the motor is switched on when the liquid level in the oil well reached a given maximum value and switched off when the liquid level reached a given minimum value.

In the control system of electric SRPU drive using periodic mode of operation, thyristor converter performs a smooth start and stop of motor, resulting in reduced dynamic loads on the elements of the unit, increases the reliability of operation and increases the life of the equipment.

Consider the block diagram of automatic control system of sucker rod pumping unit, developed on the based of the system TC-IM (Fig. 2). The device has a microprocessor control system (MPCS), containing a dedicated controller that implements the functions of the drive control and technology controller (TC). There are specialized controllers that allow real-time control of sucker rod pump and protective turns off the motor in case of emergency situations. Also, the system includes current sensors Iphase, voltage sensor of supply Uc and voltage sensor of motor Ua (CS, VS1 and VS2), and balancer position sensors of S (PS) and the force sensor of F in rod (LG). As a position sensor is used photoelectric or inductive sensor.

Fig. 2. Block diagram of the automatic control system of sucker rod pumping unit

58

The control system unit of electric drive generates control pulses of the thyristors in accordance with the job received from the technology controller. In this block implements the functions of the control pulse-phase system, the ramp-function generator, speed controller, modes linearization and logical discriminator block. Also in the block are protection against incorrect mains voltage phase sequence, extinction phase, underload current, currents imbalance impermissibly. When are not using the speed sensor, the control system carries out the work of the thyristor starter in embodiments, the cutoff current, supply voltage shaper of the motor during starting and braking or feedback on signal from the speed observer. The technology controller provides automatic operation of the drive in start-stop mode with periodic switching time Tr, and disable the pause time T0 with sequential rotation of stop positions at upper dead point or bottom dead point. The technology controller provides measurements of force in rod, enabling automatic control of the average performance of the pump. In this block there is a protection and automatic diagnosis of typical faults in the work of the sucker rod pumping unit: rods overload warning; detection of the rods breakage, breakage of connecting rod rods, breakage of belts, impaired balance [4].

The basic mode of operation of the automatic control system is the given value stabilization mode of the dynamic level, determined on the basis of effort values control algorithms in stock near UDP and BDP.

Automatic control system of the dynamic level is developed on the basis of the level meter with continuous assessment of the dynamometers parameters.

The advantages of electric SRPU drives based on the «TC-IM» that they have a relatively low cost, high reliability and easy to maintain. Currently, these electric drives are the most common SRPU drives type used in periodic pumping mode. The disadvantages of electric SRPU drives based on the «TC-IM» is the low energy performance and the inexpediency of smooth adjustment of the pump speed using the TC in a continuous operation mode.

2. Automatic control system of SRPU on the based on adjustable-frequency electric drive

In the operation of oil wells, there is a need to maintain one of the process parameters at a given level in terms of wear, reducing well flow rate, reduction of reservoir pressure. Technological parameters are the downhole

59

pressure, the flow rate or the dynamic level. It is clear that for these purposes it is necessary to apply automatic control system of technological parameters.

Regulation of technological parameters is realized by changing pumping unit balancer oscillation frequency. The balancer oscillation frequency depends on the shaft speed of the motor, which is controlled using a frequency converter. The electric motor allows smoothly change the average speed of the pumping unit crank shaft in speeds wide range and smoothly pump performance adjustment over a wide range.

Presents the control system of the frequency-adjustable electric SRPU drive, includes control dynamic level system of oil in the well. The dynamic regulation of the oil level in the well is implemented by changing the average rotation speed of the motor shaft.

Along with the adjustment of the dynamic oil level in the well, the fre- quency-adjustable electric SRPU drive provides the given law of rod hanger center motion, to reduce the maximum forces in the elements of the pumping unit due to the change of the instantaneous speed of the pumping unit motor shaft, during the period of the balancer oscillations. Thus, the control SRPU system has also automatic control instantaneous speed system of pumping unit motor shaft rotation.

In the control system based on adjustable-frequency electric drive (Fig. 3) regulation of the rod hanger center motion parameters is implemented by adjusting the parameters of crank motion.

Adjustment of the law of rod hanger center motion is implemented by the control signal with average speed ACS. The control signal represents a desired average crank rotation speed. And the average pumping unit crank rotation speed determines the balance oscillation period duration.

The evaluator of pumping unit crank motion parameters calculates the crank motion parameters required to provide given law of rod hanger center motion. Using the automatic control system of the instantaneous rotation speed, is implemented adjustment of the pumping unit crank motion parameters, which provides the given law of rod hanger center motion.

The system is based on adjustable-frequency electric drive has the best energy performance and best energy saving opportunities.

The use of adjustable-frequency electric drive leads to a significant increase in the power factor of the drive to 0.9. Electric sucker rod pumping unit drives are able to smoothly adjust the pump performance that provides the most optimal mode of operation.

60