IMPROVING METROLOGICAL PROPERTIES OF ELECTRIC TRACTION ENERGY METERS USING FUZZY CONTROLLERS

Summary. This paper presents the possibility of using a fuzzy controller to correct metrological properties of an electric traction energy meter. So far, no algorithms based on fuzzy logic to determine the desired conversion value of the current channel of the electricity meter have been applied. Currently, for the mentioned channel, conventional methods of gain determination are used, based on a sequential algorithm that controls operation of the programmable gain amplifier. The proposed corrector is designed for smart and continuous modification of the conversion factor of the low-voltage input part of the current channel in the electric energy meter. The authors have performed an accurate analysis of the current function in the main circuit of an electric locomotive by creating a model of a traction inverter subject to asynchronous motor load. An essential concept is this paper is to present the possibility of having a multi-input fuzzy controller split into two-input controllers connected in parallel and cascade. By performing a computer simulation of systems used for correcting metrological properties of electric traction energy meters, it has been proven that the applied fuzzy systems, based on an expert’s knowledge of digitally controlled PGA (Programmable Gain Amplifier) type operational amplifiers, are advantageous.


INTRODUCTION
Directive 2001/16/EC of the European Parliament and of the Council of 19 March 2001 on the interoperability of the trans-European conventional rail system requires the Member States to take direct measurements of the electric energy consumed by rolling stock [1].Based on Polish Standard PN-EN 50463-2: "Railway applications -Energy measurement on board trains" issued by CENELC (Comité Européen de Normalisation Electrotechnique) in 2013, DC devices were designed to record the energy consumed by electric train units (e.g.LE 3000plus meter manufactured by PKP Elester).
Modern high-voltage insulated gate bipolar transistors (IGBT) are can be used to apply asynchronous motors in drive units of railway vehicles, which are operated on the overhead contact line at rated U N = 3 kV [2].Such solid-state relays are controlled by means of field-oriented control (FOC) to be able to control separately the current of the rotor providing torque and magnetising current to generate magnetic flux in the drive machine of the electric locomotive [3].Immediate control of the torque value and its smooth regulation, independently of the rotational speed of the rotor, can be used to obtain high dynamics of the drive.Such solutions are becoming competitive with the DC motors applied in traction drive units.
The electric energy consumed by railway vehicles used for freight purposes is determined based on the product of the values of electrical signals, i.e. main load current I d , voltage of the contact network U N and a unit of time (measurement duration).In order to adapt measuring ranges between the tested B. Dominikowski, K. Pacholski, J. Anuszczyk, A. Gocek signal source and the low-voltage input range of the channel in the electric energy meter, one can use electronically aided current and voltage transducers, insulation amplifiers manufactured by LEM (with signal conversion or high-voltage resistive shunts) [4].
Due to variability of the torque load, manufacturers of electric energy meters use two measuring ranges in the low-voltage current input channel as follows: high and low ranges with the voltage gain factors K high and K low , which are controlled digitally or manually by short-circuiting corresponding terminals of the integrated circuit [5].
In order to visualise the scale of the problem associated with measuring the main current of the supply line (i d ) loaded by the electric multiple unit, the authors have created a model simulating the travel of a wheel set equipped with asynchronous traction motors with Field Orientation Control Space Vector Pulse Width Modulation (FOC SVPWM).These drive units, installed in upgraded electric train units in Poland, come in the following types: EU07A, EN57 and EW60 [6].The computer model of the train unit was developed on the basis of catalogue data of electric drive subassemblies, the main components of which are: • FT-300-3000 voltage inverter manufactured by Medcom (bridge connection consisting of six solid-state valves -6T), as presented in Fig. 1 (PC block) [7,8], • LK-450X6 asynchronous traction motors (S1 motor -see Fig. 1) [6]; • OLC overhead contact line of the YwsC120-2C-M type (used on the railway line e20 in the second section of the West-East Pan-European Transport Corridor) with the unitary resistance of R = 0.0676 Ω/km [10].The primary side of the current and voltage measuring transducers (TI, TU) of the electric traction energy meter is connected: • at the supply voltage of the electric locomotive (point P U -see Fig. 1); • at the main supply circuit of the electric locomotive (point P I -see Fig. 1).
In the event of a voltage drop on the line down below 90% of U N , the train unit is not able to use its full power.For an assessment of the electric locomotive supply system, average effective voltage U AVGeffective , measured at the pantograph, is applied.The voltage is determined by assuming that all train units are operated within a given zone and at peak hours, based on the relationship [10]: where U pi -instantaneous average DC voltage at the pantograph of the i th train, I di -absolute value of the instantaneous fundamental component current as flowing through the pantograph of the i th train, T i -integration time, n -number of train units along the tested railway route.The completed analysis of the results obtained by computer-based testing of traction inverters, which load the contact line, concludes that the supply line voltage U AVGeffective at the measuring point P U (Fig. 1) changes to the small extent relative to the rated value of U N = 3 kV.However, the main current of the electric locomotive depends on the type of movement (start-up, travel at a fixed speed, acceleration and braking) performed by the electric locomotive.In order to observe how the peak value and the current rise factor of a loaded contact line change, the authors created a computer model to simulate the travel of the passenger rolling stock equipped with a drive unit (Pesa Bydgostia -ED74) with four TMF59-39-4 asynchronous motors (continuous power: 4×500 kW) manufactured by TSA (Traktionssysteme Austria), with one-side supply on a conventional line.The simulation was divided into four time intervals of the train unit travel corresponding to: I -start-up, II -acceleration (v 2 >v 1 ), III -braking and IV -travelling at a fixed speed v 3 <v 2 .In these time intervals, from the measuring point P 1 (Fig. 1), values of the current signal were sampled as shown in Fig. 2.  The highest peak current i d powering the electric locomotive corresponds to start-up (time interval I -see Fig. 2a), whereas the lowest value is obtained while braking (time interval III).The rate of current rise during the computer simulation of the current waveform (as defined by the coefficient -SR=|di d (t)/dt| max ) does not exceed the value of 420 A/µs.Fig. 2 also shows that, for a reduced time base, there are two waveform representing the rms current i d and a coefficient characterising the rate of current i d changes given in geometric degrees, being input signals of the fuzzy controller discussed later in this paper.The change of the peak current in one phase of stator winding in the traction motor is presented as a function of time in Fig. 2b.
In order to present the distortion rate of the main current of the electric locomotive, the authors determined the peak factor (Fig. 3), which is defined as the product of the maximum value of the signal (i d ) MAX and its value RMS(i d ).For an ideal sine curve, the peak factor is 1.414 (3 dB); the value becomes greater as the analysed signal becomes more distorted [11].
The greatest distortion of the current signal i d (time intervals III to IV -see Fig. 3) occurs when the speed of the passenger train unit changes; at this particulate moment, there are problems with the measurement based on conventional methods.After transformation of the measured current to the secondary side of the current transducer of the electric energy meter, it is necessary to amplify the signal accordingly so that voltage measurement in the current channel can be performed at the highest resolution possible.Electric energy meters use conventional methods of converting voltage gain of the current and voltage input channels based on the use of operational amplifiers with a fixed or programmable conversion factor (PGA type systems) [5].As explained later in the text, the paper presents an innovative solution for the continuous generation of voltage gain for a fast-changing function of time, using the principles of fuzzy logic.

AUTOMATIC GAIN CONTROL
The literature [12,13] provides a measurement system model to be used for amplification of the input signal of the ADC converter accordingly so that its entire dynamic range can be used.In order to select the appropriate value of the gain of the input signal to the analogue-digital converter, the corrector uses "the procedure of adaptation of parameters of the measurement system to parameters of the converted signals" [14].The design of the gain correction system proposed by the authors, using an MPY 634 analogue multiplier, is presented in Fig. 4.
The procedure used to determine the desired value of the voltage gain A i of the analogue output signal V in along the meter's current channel (ch 2 ) is based on the measurement taken by an auxiliary system (measuring circuit with an analogue-to-digital converter (ADC F ) -see Fig. 4) of the peak input voltage V in together with its conversion into an rms value, using the AD 736 true RMS system.The measurement data from the auxiliary circuit are recorded in the microcontroller (MCU) internal memory.Main input signals of the fuzzy system implemented in the central processing unit are the rms value of the low-voltage signal of the current channel and the derivative of the signal obtained by numerical computation.The fuzzy controller determines the gain value, which is converted into an analogue signal (A i ) by the AD converter (AD 5501 circuit with the voltage range of +60 V).The determined value, which represents analogue gain, is sent to input terminals of the MPY 634 analogue multiplier, which performs the product operation with the signal V in .The connected resistors (R 1 =10 kΩ, R 2 = 90 kΩ) set a unitary factor of multiplier gain.The correction system features an AD 210 isolation amplifier which, once connected to terminals of the PWR system of the unipolar voltage +V s provides galvanic separation (using toroidal transformers T2, T2) of voltage regulators (IP, OP) powering the ADC F and DAC F converters.Apart from separation of earth potentials "0 1 " and "0 2 ", the main task of the insulation amplifier is to protect the MCU data collection system from disturbance originating from measurement circuits while being converted by the T3 transformer.

FUZZY CONTROLLER IN THE AUTOMATIC GAIN CONTROL SYSTEM
In the system for correcting the conversion factor for the low-voltage input signal of the current channel in the electric energy meter circuit, the authors of this paper used fuzzy controllers, which were interconnected in cascade and implemented in the microcontroller (MCU) (Fig. 5) [15].
Operation of the said fuzzy system is based on fuzzy models which feature the following inference procedures: • Mamdani, • Takagi-Sugeno-Kanga (TSK).
Fig. 4. Diagram of the automatic gain control system with feedback, where: MPY 634 -analogue multiplier, AD210 -insulation amplifier with signal conversion, MCU -microcontroller, 0 1 , 0 2 , GND -separated grounds, A i -amplification generated by the fuzzy controller, V in -low-voltage input signal of the current channel of the electric energy meter, ADC F -AD converter in the auxiliary circuit of the gain corrector, IP, OP -separated voltage sources [14] Both controllers are operated in the system configured as Multi Input Single Output (MISO), featuring a single scalar output which generates a value representing voltage gain to ensure that metrological properties of the input current channel of the electric energy meter are maintained.The cascade connection creates a flexible system.When it is impossible to measure the slip of the rotational speed of the electric drive motor (Fig. 5 -input #2), the final fuzzy controller may be excluded from the gain correction system by sending an appropriate 2-bit combination to control inputs of the switches: S1=1 (upper pole activated) and S2=1 (conductive state -closed).
The value of the voltage signal representing gain is limited by the input voltage range of the DAC F converter, being operated in the corrector's feedback circuit.The system applied by the authors can be used to generate the limit value equal to A i(analogue) = 59.985, which makes it possible to amplify the signal with the minimal value of V in = 0.075 V to the voltage level of 4.5 V. Due to a high value of the factor cf (crest factor) and SR (slew rate) of the tested current signal, the authors used three parallel fuzzy controllers with the same fuzzy rules defining various gain ranges: • small: for small values of the signal v in ≥ 0.075 V→ gain range: A i (0…80 V/V), • low: for low values of the signal v in ≥ 0.225 V→ gain range: A i (0…20 V/V), • high: for high values of the signal v in ≥ 1.125 V→ gain range: A i (0…4 V/V).
With this division into sub-ranges, the leading and trailing edges of the measured signal reach the desired value level of 4.5 V faster.
Fig. 5 presents the connections of the fuzzy controllers in the gain determination system as implemented in the microcontroller (MCU -see Fig. 5) of the current channel ch 2 in the energy meter (Fig. 4).
The Mamdani fuzzy controller (Fig. 5: three blocks in parallel: small, low, high) has the following input signals: • rms value of the input signal I RMS of the current channel in the meter, determined by the AD 736 external integrated circuit (input #B -see Fig. 5); • rate of rise of the rms value of the input signal in the meter's current channel (input #A -see Fig. 5).In order to determine the final output value y=A i from three blocks, there is the function out_Mam which assumes arguments of the determined gain from individual blocks -u 1 , u 2 , u 3 -and the I RMS value of the low-voltage signal of the current channel ch 2 in the electric energy meter (Fig. 5).For Takagi-Sugeno-Kanga (TSK) fuzzy controller, the input signals of the final logic controller are as follows: • slip of the rotational speed (input #C -Fig.5) of the asynchronous motor on the electric locomotive, defined by the relationship [16]: where n s -rotation speed of the magnetic field as results from the number of poles and frequency of the current supplying the motor stator, n -rotational speed of the rotor measured by an incremental encoder used for the method of controlling the operation of electric drive motors on the rail vehicle (EI -see Fig. 1); • gain A i set by the Mamdani fuzzy controller.By splitting the fuzzy system into two separate controllers, the form of functional rules of the gain determination system is more similar to the natural language.A great advantage of the controller cascade connection is the avoidance of multidimensionality defined by the relationship [15]: where N R -number of rules, N S -number of fuzzy sets, N I -number of controller inputs.
Based on the relationship given by the formula (3), one can state that the number of rules N R describing the principle of the gain corrector rises exponentially as the input number of the system N I increases.The number N R should be possibly low, and as such the fuzzy model becomes more legible and numerical computation performed by the microcontroller are minimised.The accuracy of the fuzzy model depends on the number of rules, i.e. the lower number of rules, the more deteriorated parameter.

Fuzzy controller based on Mamdani inferencing, including the sup-min extension controller principle
The Mamdani fuzzy controller presented in this paper uses the T-norm of the MIN type (µ A∩B (X)=min(µ A (x), µ B (x))=T(µ A (x), µ B (x)).Operating principles of the Mamdani fuzzy system are defined the i th rule by the relationships (4) [15]: Improving metrological properties of electric traction energy meters… 153 where: x=V in -current (sharp) rms input voltage of the ADC F converter, y -change rate of the value x, z -gain value in the meter's current channel; A, B, C -linguistic names of fuzzy sets.
The accuracy of the corrector fuzzy model depends on properly established rules, which include the information on the structure of the modelled system for the determination of the desired gain value.The selection of the membership function type, defuzzification method, used operators and inference method, affect the bending of the plane representing corrector functioning.The premise of the fuzzy rule (IF x is A AND y is B…, where x ε X, y ε Y) defines a point in the input sets X and Y, whereas the consequent (…THEN z is C, where z ε Z) the relationship (4) -point in the output space Z.The accuracy of representation of the input→output area of the modelled gain determination system can be increased for a fixed density of the division grid (number of rules) by proper arrangement of support points of the model area (points P 1 , P n -see Fig 6 .)as defined by its set of fuzzy rules R (n) (relationship 4) [15].
Based on these assumptions, a three-dimensional plane of corrector system operation was designed.
The model of the Mamdani fuzzy controller implemented in the gain corrector system consists of sets of rules R (1) , R (2) , ..., R (n) , each of which defines one point (P 1 , P 2 , …, P n ) on the input-output plane of the fuzzy system.All the points are subject to interpolation depending on the applied fuzzy logic apparatus, creating a hypersurface which defines a corresponding gain value in the meter's current channel.
A diagram of the Mamdani controller as implemented in the microcontroller system is presented in Fig. 7.
The main blocks creating the Mamdani controller in Fig. 7 are as follows: 1. Fuzzification device (block #1) -fuzzification consisting in the transformation of real number values entered in the fuzzy system though the terminal P1 of the microprocessor (Fig. 7) into values of the fuzzy set domain. 2. Rule memory (base) (block #2) which contains sets of fuzzy rules R (k) , 3. Inferencing block (block #3) based on approximate inferencing to use fuzzy statements in the premise and consequent, using the Generalised Modus Ponens (GMP) tautology.As conjunctive premises with the logic conjunction "AND" are used (relationship 4) in this paper, the Mamdani (MAX-MIN) implication operator is applied for inferencing [15].The values of input quantities (low-voltage input signal of the electric energy meter's current channel) can be treated as fuzzy singletons.Using the Mamdani implication method, it is possible to determine the weight of the rules based on the relationship [15,17]: where µ Ai (x i ) -membership function of a sharp value x i =RMS(v a/c ) in the fuzzy set A i , µ Bi (y i )membership function of the sharp value y i =atan{RMS(v a/c )}×180/π in the fuzzy set B i .
Decision (D) -made in the fuzzy environment (D=A i ∩B i , ∩ -set intersection operator) is the fuzzy set C created as a result of intersecting fuzzy sets A and B with the membership function defined by the relationship [15,17]: where w 1 -weight of the fuzzy rule with the index -1, µ C1 '(z) -membership function resulting from the aggregation of the premise comprising two simple premises with the logic conjunction "AND" (T(µ A1 (x), µ B1 (y)).
The inference for the two rules (relationship 4) gives the fuzzy set C with the membership function defined by the formula [15,17]: where µ C (z) -resulting fuzzy set C with the membership function µ C (z), z -input linguistic variable.
The relationship (7) is referred to as "MAX-MIN", which is commonly used due to its easy implementation in the microcontroller system.Fig. 6.Hyperplane representing operation of the Mamdani controller Fig. 7. Architecture of the fuzzy controller with Mamdani inferencing [15] 4. The defuzzification device (sharpening) (block #4) makes it possible to represent the input fuzzy sets from the inferencing block as one sharp value A i giving the desired gain in the current channel in the electric energy meter (output terminal of the microcontroller P3 at the port P -see Fig. 7).For sharpening the input value, the authors applied the Centre of Gravity (COG) method, wherein the output value is the projection of the centre of gravity of the shape defined by the output fuzzy set.Defuzzification relative to the centre of the area, in the discrete form, is determined by the following relationship [15]: where µ(y i ) -membership function of the resulting output fuzzy set, y -output linguistic variable. 1): →P 1 (x 1 ,y 1 ,z 1 ) R (n) : →P n (x n ,y n ,z n ) Rotate surface x=RMS(V in ) x * R (1) :

TSK (TAKAGI-SUGENO-KANGA) fuzzy cotroller
The TSK inference model in the applied fuzzy systems has gained the greatest popularity due to its simple stages of fuzzy inferencing [15].In this controller, the consequent function is not defined as fuzzy, but as sharp instead.Therefore, the defuzzification system is not required, which facilitates fuzzy inferencing [15].
The knowledge base of the TSK fuzzy system contains rules such as If-Then defined by the relationship [15,17]: where I -number of the rules in the knowledge base, x 0n = [x 01 , x 02 ] T -input singleton, A n (i) -linguistic value of the premise, y=f i (x 0 ) -function in the conclusion of the i th rule R (i) .
The functions which are most frequently used in the consequent of the fuzzy rule (relationship 9) are linear functions (degree-one polynomial), given as [15,17]: where x 01 -sharp output value from the Mamdani controller to represent voltage gain of the meter's current channel (relationship 8), x 02 -slip of the asynchronous traction motor (relationship 2) The degree of activation of the i th fuzzy rule (relationship 10) is determined on the basis of the formula [15,17]: where * T -denotes T-norm (usually Mamdani minimum implication or Larsen's implication -PROD algebraic product operation), µ A (x) -assigning membership function For many fuzzy rules (I>1) (relationship 9), the output signal of the TSK controller is defined as the weighted average of the signals y (i) (x 0 ), corresponding to individual rules [15,17]: where y (i) =f i (x 0 ) -determined location of the singleton in the consequent of the i th rule, F (i) (x 0 )activation degree of the i th rule.
The TSK controller in the cascade configuration with the Mamdani system corrects the obtained gain A i depending on operating state of the drive motor (there are three operating states of an electric machine: start-up, motor action and braking) -relationship 2.
Using an additional signal of rotational speed slip of the electric drive machine in the fuzzy system, which determines the gain in the meter's current channel, is associated with an increase in current during start-up of the rolling stock.It must be noted that the knowledge of the process and control strategies as well as system reliability is based on the expert's experience.The application of an additional plane in the fuzzy system improves the quality of dynamic measurement.

FINDINGS
Having considered the adaptation of the signal source range to the conversion range of the ADC M converter, the authors assume that the limit input value of the meter's current channel will be the signal reaching 80% of the reference voltage of the analogue-to-digital converter (source V ref -see Fig. 4).Suitability of programmable systems of amplifiers and fuzzy control in the gain corrector system (Fig. 5) for measuring rolling stock energy was verified by adding a family of voltage signals V in (with various peak values and various rates of rise) to the input -see Figs.8a and 9a.First, the corrector system input received linear signals with a small slope (relative to the X-axis -time) which, converted into geometric degrees, give 5°, 10°, 20° and 30° (Fig. 8).
Responses of the correction system, including the PGA type amplifier (V adc(PGA) ) and the fuzzy controller (V adc(FLC) ), to the experimental input signal (V in ) , which is a degree-one polynomial, are presented in Fig. 8.In order to ensure the proper course of the experiment identifying metrological properties of the tested correction systems, signals featuring higher rise factors, i.e. 40°, 50°, 60° and 70°, respectively, were applied to the inputs (Fig. 9).As shown in Figs. 8 and 9, the proposed fuzzy method outclasses qualitatively traditional algorithms for all tested corrector input signals.Due to the operating method of the programmable amplifier (amplified value that is a power of the digit 2) in the current channel of the meter, there is a sawtooth wave -marked in the plots as V adc(PGA) .Fig. 9 shows a flaw in the adjustable amplifier systems.For the input value, which is close to the saturation level V sat (Figs.9c-d), the PGA amplifiers have no programmable value that is less than 1, and hence the measured information is lost and a large measurement error occurs (Figs.9g-h).For slowly rising signals, the described correction methods operate in the same manner, which is presented by the plot of the difference between the desired value 80% V ref and the amplified voltage using the PGA operational amplifiers and the FLC fuzzy system (Fig. 8e).However, as the rising steepness of the input signal increases (from 20° -see Fig. 8b), the difference between the desired value and the input value of the meter's current channel increases for the traditional method using amplification with PGA systems (Fig. 8f), which confirms that the proposed measurement method relating to a fast-changing current waveform in railway traction is superior.

SUMMARY
This paper presents a method used for gain factor modification as regards the current channel in a traction electric energy meter.The error occurring during the determination of electric energy is inversely proportional to the value of the input signal of the ADC M converter operated on the mentioned channel.In order to obtain the appropriate gain factor, the authors used: fuzzy corrector with the Mamdani minimum-type inference rule base and Takagi-Sugeno controller.The simulationbased testing concludes that the worst results of adapting the signal source range to the ADC M conversion range are obtained when amplifiers with a programmable gain factor are used, in particular for fast-changing currents.This is caused by amplifier gain which can assume binary values being powers of the digit 2, i.e. 1, 2, 4,…, 128.

Fig. 1 .
Fig. 1.Diagram of 6T type traction voltage inverter controlled by FOC SVPWM with arranged measuring points of the main current (i d ), voltage (U N ) and mechanical speed (n), where: T1,.., T2 -power solid-state relays, S1 -inductive drive motor, R -running rail, EI -incremental encoder with reversible counter, SS -traction substation, TI -current transducer installed on the electric locomotive, TU -voltage transducer installed on the electric locomotive, p -pantograph, LPF -LC low-pass filter, G -gear transmission [9]

Fig. 3 .
Fig.3.Function of time of the shape factor cf calculated every 0.01 ms and determined for the input function id of the main current of the electric locomotive operated on the route

Fig. 5 .
Fig. 5. Block diagram of the fuzzy system used to determine gain based on the input vector representing respectively: I RMS -rms current i d (t), d(I RMS (t))/dt -rate of rms current rise.Diagram key: s -electric motor slip, A i , A-outputs of Mamdani and TSK models representing the gain value, bs -bit flow

Fig. 8 .
Fig. 8. Waveforms in the system used for gain correction of the input signal of the ADC M current channel in the electric energy meter at the test signal slope V in : a) 5°, b) 10°, c) 20° and d) 30° and their errors: e)-h)

Fig. 9 .
Fig. 9. Waveforms in the system used for gain correction of the input signal of the ADC M converter of the current channel in the electric energy meter for the test signal slope V in : a) 40°, b) 50°, c) 60° and d) 70° and their errors: e)-h)