Testing remote protection from COMTRADE files
Description of the model
This example shows testing the remote protection algorithm by reading waveforms from COMTRADE files. The COMTRADE files are pre-generated in a power system model in which various short circuits (short circuits) are modeled.
COMTRADE file generation
To generate current and voltage waveforms, a power system model with two-way power supply and a two-circuit overhead line (overhead line) is used, where the first circuit is divided into two parts: L1_1 and L1_2. Their length varies through variables L1_1 and L1_2 thus, the point KZ K2 moves along the overhead line relative to the power systems. There are also short circuit points K1 and K3 on the buses of the C2 and C1 power systems, respectively. All short circuits are three-phase. The time of occurrence of the short circuit is changed by setting the parameter Exposure time in blocks c1, c2, c3 connected to the control ports of the short circuit blocks. The response time of the short circuit unit is set to 0.5 seconds, and for its shutdown — 10 seconds. Since the simulation time is 1.5 seconds, with a response time of 10 seconds, the short circuit unit will not have time to turn on.
At the beginning of the overhead line L1_1, the current is measured, and the voltage is measured on the busbars of the power system C1. The measured signals are transmitted to the [To COMTRADE] block(https://engee.com/helpcenter/stable/ru/fmod-electrical-sinks/to-comtrade.html ). For more information about using the To COMTRADE block, see the example Recording events in the power system in COMTRADE файл. The intended installation location of the DZ is the beginning of the overhead line L1_1.
The scheme of the power system:
The model's appearance:
Model Parameters:
Power system parameters 1:
The active resistance of the direct sequence is 0.393 ohms
The inductive resistance of the direct sequence is 4,276 ohms.
The active resistance of the zero sequence is 0.494 ohms
The inductive resistance of the zero sequence is 4.02 ohms
Equivalent EMF– 230 kV
The EMF phase angle is 10°.
Power system parameters 2:
The active resistance of the direct sequence is 4.85 ohms
The inductive resistance of the direct sequence is 25.604 ohms
The active resistance of the zero sequence is 10.607 ohms
The inductive resistance of the zero sequence is 53.347 ohms.
The equivalent EMF is 220 kV
The EMF phase angle is 0°.
Overhead line parameters:
Length 100 km
The resistivity of a straight line is 0.0958 + j 0.4038 ohms/km
The resistivity of the zero-sequence line is 0.3471 + j 1.2432 ohms/km
The specific capacity of the direct sequence is 8,411 nF/km
The specific capacity of the zero sequence is 6.745 nF/km.
The following experiments are performed in the model:
- Short circuit at point K1 on the tires of the C2 power system. Only 2 DZ stages are expected to be triggered.
- Short circuit at point K2 on overhead line 1, 10 km from the busbars of the C1 power system. The 1st and 2nd stages of the DZ are expected to be triggered.
- Short circuit at point K2 on overhead line 1, 50 km from the busbars of the C1 power system. The 1st and 2nd stages of the DZ are expected to be triggered.
- Short circuit at point K2 on overhead line 1, 90 km from the busbars of the C1 power system. Only 2 DZ stages are expected to be triggered.
- Short circuit at point K3 on the buses of the C1 power system. DZ steps are expected to fail.
The settings table, which displays the various parameters for each experience, includes the response time of the short-circuit blocks and the expected behavior of the protection steps.:
| Experience Number\ Parameter | Time of operation of short circuit No. 1, s | Time of operation of short circuit No. 2, s | Time of operation of short circuit No. 3, s | Line length L1_1, km | Operation of the 1st stage of the DZ | Operation of the 2nd stage of the DZ |
|---|---|---|---|---|---|---|
| 1 | 0,5 | 10 | 10 | 50 | 0 | 1 |
| 2 | 10 | 0,5 | 10 | 25 | 1 | 1 |
| 3 | 10 | 0,5 | 10 | 50 | 1 | 1 |
| 4 | 10 | 0,5 | 10 | 90 | 0 | 1 |
| 5 | 10 | 10 | 0,5 | 50 | 0 | 0 |
The COMTRADE files are written to the data folder, which is created in the folder with this script. COMTRADE file generation:
# importing required modules
using Plots, DataFrames
model_name = "The power system";
model_name in [m.name for m in engee.get_all_models()] ? engee.open(model_name) : engee.load( "$(@__DIR__)/$(model_name).engee");
# data for changing experimental conditions
exp_data = DataFrame(
KZ1 = [0.5, 10, 10, 10, 10], # time of occurrence of KZ No. 1
KZ2 = [10, 0.5, 0.5, 0.5, 10], # time of occurrence of KZ No. 2
KZ3 = [10, 10, 10, 10, 0.5], # time of occurrence of KZ No. 2
L1 = [50, 25, 50, 90, 50], # The length of the left part of the 1 chain is
result1 = [0, 1, 1, 0, 0], # expected results of stage 1 operations
result2 = [1, 1, 1, 1, 0] # expected results of stage 2 triggers
)
# the path to this script
current_path = @__DIR__
# creating a data folder if there is none, COMTRADE files will be written there.
if !isdir("$(current_path)/data")
mkdir("$(current_path)/data")
end
# a cycle for generating COMTRADE files
for i in 1:nrow(exp_data)
# Overhead line length 1_1
L1_1 = exp_data[i, :L1]
# Overhead line length 1_2
L1_2 = 100 .- exp_data[i, :L1]
# transfer to the block "c1" of the time of occurrence of KZ No. 1
engee.set_param!(model_name*"/c1", "Time" => exp_data[i, :KZ1]);
# transfer to the block "c2" of the time of occurrence of KZ No. 2
engee.set_param!(model_name*"/c2", "Time" => exp_data[i, :KZ2]);
# transfer to the "c3" block of the time of occurrence of KZ No. 3
engee.set_param!(model_name*"/c3", "Time" => exp_data[i, :KZ3]);
# transfer of names of COMTRADE files in Exp_X format to the "COMTRADE" block
engee.set_param!(model_name*"/COMTRADE", "files_path" => "\"$(current_path)/data/Exp_$i\"");
# launching the model
engee.run(model_name);
end
Checking the remote protection algorithm
The verification of the remote protection algorithm in this example is performed using current and voltage waveforms recorded in the COMTRADE format. For this purpose, the emergency modes of the electrical network and short circuits are pre-modeled in a separate model of the power system. Энергосистема.engee, after which the transients are recorded as COMTRADE files. The received files are used as input effects for the remote protection model implemented in a separate model. ДЗ.engee.
The use of COMTRADE files allows you to feed pre-formed waveforms to the input of the algorithm, thereby reproducing the operating conditions of the protection as they occur in real operation. In this case, both the oscillograms obtained as a result of simulation and real transient oscillograms can be used for verification.
In addition, the use of COMTRADE files ensures repeatability and clarity of verification. The same set of waveforms can be used repeatedly to verify the algorithm, analyze the sensitivity and correctness of protection operation for various types of short circuits, transient resistances and damage locations. This approach allows you to focus on evaluating the logic of the protection algorithm.
A modified module from the [open repository] is used to read COMTRADE files (https://github.com/dgm1971/COMTRADE.jl?tab=readme-ov-file ). There is only one function in this module. read_comtrade. It has one input argument - the absolute or relative path to the file. For example "/user/data/Exp_1" or "Exp_1". The function returns an object of the type ComtradeData with fields:
filename::String- name of the halyards without extension;cfg::ComtradeCfg- configuration data;dat::DataFrame- a table with data where each channel is a column;hdr::String- content.hdrthe file;inf::String- content.infthe file.
The module supports the 1991, 1999 and 2013 standards. Expansion .cff introduced in 2013, it is not supported.
From the object ComtradeData The current and voltage waveform data is extracted into variables V and I like Matrix, where the 1st column contains the time, in 2-4 columns the signals. Variables are loaded into the model via the block From the workspace. The model's appearance:
Calculation of DZ parameters in accordance with Methodological guidelines for the calculation and selection of settings for remote protection of 110 kV power transmission lines and выше:
-
The response resistance of the first stage of the DZ is adjusted from the total resistance of the protected line (paragraph 4.3.2.3):
-
The second stage of the DZ reliably covers the protected line (clause 5.3.3.7.):
where
$k_{\text{отс}}$ – adjustment coefficient;
$\alpha$ – a coefficient that takes into account the reduction of the zone of the DZ stage, with which the agreement is being made;
$k_{\text{т}}$ – current distribution coefficient equal to the ratio of the primary current in protection 1 to the primary current in protection, which is matched in cascade mode. Based on the calculation results in the model $k_{\text{т}}=I_1/I_{10}=753.14/1801.49=0.418$;
$\text{𝑍}^{I}_{\text{уст}10}$ – the actuation resistance of the first protection stage 10 against phase-to-phase short circuits;
$\text{𝑑}$ – is determined according to (4.5) in the case of a circular characteristic.
-
The angle of maximum sensitivity of the resistance relay is taken equal to the angle of the line (paragraph 3.2.):
-
The 1st stage is triggered without time delay. The natural response time of the 1st stage is 0.02 s
-
Response time of the 2nd stage (expression 4.19):
Checking the remote protection algorithm using recorded COMTRADE files:
# connecting the COMTRADE reader module at the first startup
if !isdefined(Main, :COMTRADE)
include("$(@__DIR__)/COMTRADE.jl")
end
# adding the COMTRADE module
using .COMTRADE, Plots
# a variable with a script path
current_path = @__DIR__
# the name of the model with the DZ algorithm
model_rz = "DZ";
model_rz in [m.name for m in engee.get_all_models()] ? engee.open(model_rz) : engee.load( "$(@__DIR__)/$(model_rz).engee");
# getting a list of files in the data folder
files = readdir("$(current_path)/data")
# getting unique file names without extension
unique_names = unique(map(f -> splitext(f)[1], files))
# initializing a matrix for simulation results
results = Matrix{Any}(undef, length(unique_names), 2)
for i in 1:length(unique_names)
# reading COMTRADE files
data = read_comtrade("$(@__DIR__)/data/$(unique_names[i])")
# transferring data from COMTRADE to variables
global V = Matrix(data.dat[:, [:time, :Va, :Vb, :Vc]])
global I = Matrix(data.dat[:, [:time, :Ia, :Ib, :Ic]])
# launching the model
result = engee.run(model_rz);
# saving the operation signals of the DZ steps
Сраб1 = result["Srab1"].value;
Сраб2 = result["Srab2"].value
results[i,1] = Crab1
results[i,2] = Crab2
end
Processing of test results, comparing actual results and expected protection actions:
# checking whether there are logical units in the signals Crab1 and Crab2
With1_bool = [any(results[i,1]) for i in 1:size(results)[1]]
With2_bool = [any(results[i,2]) for i in 1:size(results)[1]]
# comparison of actual triggers and expected results
With1_vector = With Work1_bool .== exp_data[:, :result1]
With Lab2_vector = With Work2_bool .== exp_data[:, :result2]
# checking that the actual results match the expected ones
if all(With1_vector) & all(With Lab2_vector)
println("All experiments were successful")
else
if any(.!With Lab1_vector)
print("The first stage worked incorrectly in experiments no.:\n")
println(findall(!, With1_vector))
end
if any(.!With Crab2_vector)
print("The second stage worked incorrectly in experiments No.:\n")
println(findall(!, With2_vector))
end
end
Conclusion
This example shows the testing of the remote protection algorithm using COMTRADE files. COMTRADE files are pre-generated in the power system model where various short circuits occur. COMTRADE files are read using a modified module for working with COMTRADE.