Background technology
1992, in the world First power system all-digital real-time simulation device RTDS ground by Canadian Manitoba direct currents
Study carefully center to succeed in developing.Relative to physical simulation, RTDS has and is not limited, ensured by original system scale and structural complexity
The safety of studied and pilot system, with good economy and convenience, can be used for designing system in future performance
The advantages of prediction, and which is in the complication system accuracy of simulation of the direct current transportation containing AC system and FACTS devices,
The accreditation for being verified and extensively sending out.Through the development of several years, RTDS became electric system simulation and has studied requisite work
One of tool.
And it is increasingly sophisticated with power system, the electric system simulation scale based on RTDS is also increasing, RTDS from
The power system component of band and control element can not meet different simulation study personnel to large-scale electrical power system control
The particular demands of protection simulation, are that this RTDS company has provided the user self-defined platform in more than RTDS2.00 versions
CBuilder, the compatible major part C language form of this platform, user can as needed using its various component models of exploitation and reality
When simulated program, provide possibility for the complicated mass computing program of exploitation.The element developed by CBuilder can be divided into electric power
System element and control element, as long as can be as good as with RTDS component library models, freely can be adjusted by compiling, self-definition model
With and strict real time execution.These are all the extensive control protection for having particular demands(Such as DC control protection etc.)Emulation carry
The possibility realized is supplied.
Currently for the emulation of the extensive control protection of this particular demands(Such as direct current transportation control protection)Have following
Two kinds of solutions, both solutions are all based on the self-defined element translation and compiling environments of CBuilder of RTDS to realize.
1)Directly one being write with self-defined element development platform CBuilder that RTDS is provided the user, there is complicated control
The self-defined element of defencive function processed(As module is controlled in direct current pole).
2)Extensive control protection simulation is write with self-defined element development platform CBuilder that RTDS is provided the user
Each sub-function module, then RTDS provide Draft simulation modeling instruments in carry out Logical Configuration, build it is in large scale,
The complicated control protection simulation model of function.
Although above two scheme can realize that some have the extensive control protection of particular demands imitative to a certain extent
Very, but which all has certain defect and bottleneck during realization rate and realization.
The first scheme is feasible in theory, but there is many limitation and inconvenience during practical operation
Property:1)The CBuilder programming language environment that RTDS is provided is a species C language, although compatible most of C programmer lattice
Formula, but its C compiler is unable to body support structure, pointer and function call, and this makes which big in terms of scale simulated program is write
It is big limited, and inconvenience is brought to writing for large scale emulation program.2)The CBuilder programming language rings that RTDS is provided
The mode that border pure code is write, therefore there is programmed readability not in the large scale emulation program using CBuilder programmed environments
By force, the congenital deficiency such as transplantability difference and program debugging inconvenience.
Second scheme, is limited due to being carried simulation modeling instrument Draft by RTDS, as control protection element is imitated
The expansion of true scale is impracticable.The simulation modeling instrument Draft that RTDS is carried, when the original of the phantom on 1 Rack
When number of packages amount is more than 5000, the compilation speed of phantom drastically will slow down, and the time for compiling once is substantially left at 30 minutes
The right side, or even often there is the situation of model compilation failure in Jing.Only by taking direct current transportation control protection simulation as an example, typically in a Rack
In need to emulate pole control, stand and control and the program such as protect, number of elements is up to more than 6000 individual even more many, thus frequently can go out
The situation of existing model compilation failure, the huge inconvenience that the compiling and operation to phantom all brings.
The content of the invention
It is an object of the invention to provide a kind of self-defined element programs method for packing of RTDS, self-defined to solve current RTDS
It is caused to phantom to realize that element programs encapsulation is all based on the self-defined element translation and compiling environments of CBuilder of RTDS
Compiling and operation bring the problem of very big inconvenience.
The present invention provides a kind of self-defined element programs method for packing of RTDS for solving above-mentioned technical problem, the method
Step is as follows:
1)Basic functional components block according to needed for specific demand is write;
2)The fundamental functional modules write are controlled into relay protective scheme functional configuration on a large scale;
3)By extensive control protect configuration program generate the RTDS that can directly use in the Draft modeling tools of RTDS from
Define element;
4)Simulation modeling is carried out using system element that component module and RTDS carry and control element is automatically generated, to big
Scale domination protection carries out simulation study.
The step 1)Middle basic functional components block write method is as follows:
A. defined function module title and functional block description;
B. input pin and output pin and types of variables are defined;
C. generation module code skeleton, writes block code;
D. the basic functional components block that completes will be write and is stored in fundamental functional modules storehouse.
The step 2)In extensive control relay protective scheme functional configuration generating process it is as follows;
A. set up a Logical Configuration engineering, and the control defence program that emulated is carried out point by logic function program bag
Page;
B. determine the input and output of control protection, generate the input and output pin of the self-defined elements of RTDS;
C. control relay protective scheme functional configuration;
D. intelligent sequencing and program checkout are carried out to relay protective scheme configuration, is positioned where going wrong to program.
The invention has the beneficial effects as follows:The present invention carries out various large-scale electrical power system controls by friendly software interface
The graphical configuration programming of protection simulation, and generate the self-defined component module suitable for RTDS simulation modelings.The present invention breaks through
The emulation limitation of Draft, and RTDS data processing times are substantially reduced, the simulation efficiency for improving RTDS is nearly 5 times, in this base
On plinth, the present invention can realize large-scale electrical power system(Such as DC transmission system, alternating current-direct current combined hybrid system)Primary system and two
Subsystem complete simulation, is greatly expanded the simulation capacity of RTDS, solution on the basis of the primary system emulation that RTDS is carried
RTDS emulation elements of having determined are limited, control protection element sequence is limited and many of the T1~Tn of direct current transportation control protection simulation
The problems such as emulation bottleneck such as level calculation cycle.
Specific embodiment
Below in conjunction with the accompanying drawings the specific embodiment of the present invention is further described.
For adapting to increasingly sophisticated power system Research Requirements, for particular requirement, large-scale electrical power system control protection
RTDS emulation(Such as direct current transportation controls protection simulation etc.)Increasingly paid attention to by electric system simulation personnel.This
It is bright, it is proposed that a kind of method of the self-defined element programs encapsulation of RTDS, easily and flexibly can be entered by friendly software interface
The various large-scale electrical power systems of row control the graphical configuration programming of protection simulation, and automatically generate suitable for RTDS simulation modelings
Self-defined component module.General flow chart is as shown in figure 1, specific process is as follows:
1. basic functional components block is write(Little element is write)
One function is complicated, and electric power in large scale completely controls protection simulation program, is by substantial amounts of simple base
Plinth function element block(I.e. little member block)What configuration was realized, the realization of the such as various control functions of direct current transportation pole control system needs to adopt
Egf block(Sample), logical operation module(AND、OR), proportional plus integral control module(PICH), mathematics operation module(ADD、
SUB、MUL、DIV), delays time to control module(PDF、PDE), monostable trigger module(MOF), filter module(IIR2、MF32), lock
Phase ring module(TGSY), frequency tracking module(FNX)Deng 86 basic functional components blocks.Therefore, carrying out extensive control guarantor
Before shield configuration, first required basic functional components block will be write according to particular demands.
Now with simple three input additions(ADD3)Illustratively basic functional components block as a example by basic functional components block
Write method:
The first step:Defined function block title(ADD3)And functional block description(Three input additions);
Second step:Define input pin(x1、x2、x3)And output pin(y1)And types of variables(double);
One can now be automatically generated with defined function block title, functional block description(Three input additions), input pin
(x1、x2、x3)And output pin(y1)Three input additions(ADD3)Base components block, as shown in Figure 2:
3rd step:Generation module code skeleton, writes block code.Automatic code generating framework is as follows:
4th step:These are write the basic functional components block for completing and is stored in fundamental functional modules storehouse.
2 are controlled relay protective scheme functional configuration on a large scale using basic functional components block
There is the basic functional components block of particular demands, it is necessary to complex control is carried out using these basic functional components blocks
The VIS simulation of defencive function.One complicated control defencive function generally has substantial amounts of logic function program bag composition,
As control simulated program in DC engineering pole includes CC_C1 program bags altogether(Analog input and output is realized, control difference is calculated, control
Device processed is selected, Converter controller, the function such as trigger setting), CC_T2 program bags(Protection input, locking, ESOF orders are closed
Ring controls defencive function, the function such as controller and triggering restriction), CC_T3 program bags(Communicate with P3, unblock order, current margins
The functions such as compensation), CC_T4 program bags(The functions such as preparation unblock, current margin compensation, trigger pulse enable)Etc. a large amount of programs
Bag.Therefore, it can different logic function program bag point during extensive control defence program logic function configuration
Not in different Logical Configuration program pages(Page1, Page2, Page3, Page4 etc.)In carry out configuration to strengthen Logical Configuration journey
The readability of sequence.
Illustrate the program circuit of extensive control relay protective scheme functional configuration below by taking simple zero-sequencedirectional protection as an example,
Programmed logic is as shown in Figure 3:
The first step is to set up a Logical Configuration engineering, and to the control defence program that emulated by logic function program bag
Carry out paging.Zero-sequencedirectional protection program is fairly simple, can just complete in a program page, therefore only builds a program page
Page1;
Second step is to determine the input and output of control protection, and input and output defined in here step can automatically generate RTDS certainly
Define the input and output pin of element.Zero-sequence current protection we define 5 inputs(IA, IB, IC and ID, T1), six outputs
(3I0, C0_1,3I0.abs and TRIP0, TRIP1, TRIP2), wherein IA, IB, IC are the electric current inputs of protection, and ID and T1 is to protect
The definite value input of shield, TRIP2 is the outlet of protection, and 3I0, C0_1,3I0.abs and TRIP0, TRIP1 are the centres in program
Variable, any intermediate variable of program can be drawn, and this also provides the facility of maximum for the links debugging of program, greatly
Reduce greatly the debugging difficulty of program.
3rd step is control relay protective scheme functional configuration, by taking zero-sequencedirectional protection as an example, can be divided mainly into two parts, one
It is divided into calculating zero-sequence current, another part is action logic, specific procedure is shown in Fig. 3.
4th step is intelligent sequencing, program checkout, and this step is eliminated loaded down with trivial details manual collated using automated intelligent sequence
Journey, and the program checkouts such as input and output, variable naming, the ground that the program of being automatically positioned goes wrong is carried out to Logical Configuration program
Side, so far, extensive control relay protective scheme functional configuration is just completed.
3 generate the self-defined elements of RTDS
Configuration program is protected to automatically generate the RTDS that can directly use in the Draft modeling tools of RTDS extensive control
Self-defined element(Element includes graphic file * .def and code file * .h, * .c), component module is as shown in Figure 4.
4 applications automatically generate the system element that component module and RTDS carry and control element and carry out simulation modeling, to big
Scale domination protection carries out simulation study, so far, realizes programming and RTDS automatic components to extensive control defence program
Automatically generate.
The programming process of the present invention is flexible, and program debugging is convenient, completes the big element of a large amount of little elements to
Encapsulation, in the Draft modeling tools of RTDS, whole logic function is realized only by a big element, is greatly reduced
Draft modelings and the difficulty of model compilation.The present invention specially increased scheduling week on the basis of the encapsulation process of other softwares
The simulation of phase(For the emulation of the multi-level calculating cycle of direct-current power transmission control protection system)Sort with page automatic intelligent, especially
The automatic intelligent sort method of special disposal feedback is which increased, additionally, the present invention breaches the emulation limitation of Draft, and
RTDS data processing times are substantially reduced, only 5 times of the simulation efficiency of RTDS is improved, RTDS can be real after present invention encapsulation
Existing large-scale electrical power system(Such as DC transmission system, exchange combined hybrid system etc.)The complete simulation of primary system and electrical secondary system,
The simulation capacity of RTDS is greatly expanded on the basis of the primary system emulation that RTDS is carried, and solves RTDS emulation elements
Many level calculation cycles of T1 Tn of restriction, control protection element sequence restriction and direct current transportation control protection simulation etc. imitate
The problems such as true bottleneck.