Keywords

1 Introduction

Based on the Polish Standard PN-EN 50463-2 “Railway applications – Energy measurement on board a train”, DC energy meters were designed in 2013 to record the energy consumption of electric multiple units [1]. The costs incurred for the energy consumed are significant in the budget of each railway carrier, so the accuracy of determination is very important. An indication of the energy consumption of the on-board meter installed in the electric locomotive cab enables the driver to use the correct technique for train driving (the so-called eco-driving). Railway carriers frequently compare electricity consumption of similar railway vehicles operating on a route in order to avoid uneconomical transport operations.

Modern electric rolling stock is equipped with three-phase inductive drives [2]. The rotational speed of asynchronous traction motors is controlled by DC/AC semiconductor-type voltage bridge inverters. The method that is used to control the operation of the electric locomotive drive is based on a sine wave controller with a Space Vector Pulse Width Modulation (SVPWM), allowing the generation of a sinusoidally variable current flow at the output terminals of the inverter (on the AC side) [2]. The input circuit of this converter (on the DC side) is connected to the contact line via a pantograph. At the movable contact point of the electric locomotive and the contact line, a dynamically changing current peak occurs due to the non-linear switching load (high crest factor – CFi) [3]. This current is measured by a current transducer whose output terminals are connected to the input of the energy meter’s current channel via an operating amplifier.

In the electric energy transducer, the energy measurement is subject to an error that can be determined with the following relationship [3]:

$$ \delta_{wm} = \frac{{(CF)_{u} (CF)_{i} }}{{U_{m} I_{m} PF}}\delta_{ADC} $$
(1)

where: (CF)u, (CF)i – crest factor of the voltage and current signals of low-voltage input signals of the electric energy meter; Um and Im – voltage and current amplitudes of the above-mentioned input related to rated values; PF – power factor given as the quotient of active power and apparent power; δADC – resolution error of the ADC converter in the energy meter’s input channels.

In the measuring circuits of the electric energy meters, it is only possible to influence the peak of the output signals of the current and voltage transducers by changing their gain. Operation of the meter with input signals with values close to the reference voltage level of the ADC converter reduces the error δwm (relationship (1)) during the electric energy measurement. The deviation of the contact line supply voltage from its rated value (UN = 3 kV) is minor. Therefore, the voltage transducer is connected to the input channel of the electric energy meter via an operating amplifier with a selected fixed gain so that the value of the input signal is close to the upper limit of the measuring range of the energy meter’s voltage channel. Yet, the change of the peak value of the output signal of the current transducer covers the entire conversion range of the current input channel of the electric energy meter. To ensure that electric energy is measured with high accuracy under railway traction operating conditions, the output signal of the current transducer should be amplified continuously to reach the upper limit of the input range of the ADC converter in the energy meter’s input channel.

Manufacturers of electric energy meters use operating amplifiers at the input of the current channel, with programmable gain factor or those operating in parallel structure with selected fixed conversion factors. The authors of this paper proposed the use of smart correction that allows continuous determination of the conversion factor of the energy meter’s current channel. The operating principle of the fuzzy corrector is explained later in this paper.

2 Fuzzy Controller in the Automatic Gain Control System for the Input Values of the Electric Energy Meter

For the conversion factor corrector system associated with the current channel of the electric energy meter, the authors used three fuzzy controllers operating in parallel structure (marked in Fig. 1 as F1, F2 and F3). These controllers differ in the input voltage ranges and the corresponding gain values. The division into voltage input sub-ranges results in faster attainment of the desired value level (close to the reference voltage of the ADC converter of the energy meter’s input channel) by the rising and falling edges of the signal being measured.

Fig. 1.
figure 1

Block diagram of information propagation in the fuzzy controller in a smart gain correction system

The input signal of the fuzzy controllers is the vector x, which contains the following values: Vin – instantaneous peak output voltage of the current transducer (marked in Fig. 1 as CT) and its derivative determined numerically in the microprocessor system (MCU) and converted into geometrical degrees. The output signal of the above-mentioned smart controller is a scalar value representing the desired gain of the current signal of the energy meter’s input channel (marked in Fig. 1 as Ch1).

The operating principle of the controller is presented in a few steps below. The input vector – \( x = \left[ {\begin{array}{*{20}c} {v_{in} } & {\frac{d}{dt}\left( {v_{in} } \right)} \\ \end{array} } \right] \) of the fuzzy controller is sent to the fuzzifier to be transformed into a fuzzy set with a specific membership function. The role of the used membership functions is played by the Gaussian functions defined by the relationship [4] that, according to the expert, are suitable to achieve a smooth and continuous hypersurface of the fuzzy controller input/output [4].

$$ \mu_{Gauss} (in,\,a,\,b) = \exp \left[ { - \left( {\frac{in - b}{a}} \right)^{2} } \right] $$
(2)

where: b – the centre of the membership function (core), a – width of the membership function, in – input variable of the fuzzy controller.

In the fuzzy inference system, the expert enters complex, intuitive heuristic rules into the database (Fig. 1 – Database), given by the relationship [4, 5]:

$$ \begin{aligned} & IF\,\underbrace {{\left( {V_{in} \,is\,big} \right)\,AND\,\left( {\frac{d}{dt}\left( {V_{in} } \right)\,is\,big} \right)}}_{p}, \\ & THEN\,\underbrace {{\left( {A\,is\,small} \right)}}_{k} \\ \end{aligned} $$
(3)

where: Vin – crisp value of the voltage output signal of the current transducer (marked in Fig. 1 as CT), \( \frac{d}{dt}\left( {V_{in} } \right) \)- derivative of the above-mentioned signal (expressed in geometrical degrees), big and small – linguistic values defined as fuzzy sets obtained from the universe (space within which the set is defined): Vin, \( \frac{d}{dt}\left( {V_{in} } \right) \) and A.

The rule used to process the fuzzy information given by the relationship (3) includes: input values of the controller specified in the complex conjunctive antecedent (p) connected using the AND conjunction, whereas the consequent (k) indicates the corresponding gain of the measuring channel – A.

In the fuzzy controller of the corrector system, Mamdani’s inference method was used, consisting in connecting antecedents and consequents (defined by the symbols p and k – relationship (3)) with the use of the t-norm operator. On the basis of numerous experimental computer tests in the computational software – Matlab/Simulink – using various implication operators, the best results of the input quantity were obtained while using the Larsene-type t-norm operator, i.e. PROD (product of the antecedents and consequents [10]). The final stage of the process that determines the smart conversion factor of the current input channel in the electric energy meter is to have it converted in the defuzzifier into a crisp value. In this block, due to a short response time, the so-called Centre of Maximum method was selected, as it performs the operation of determining the weighted average of the outputs for which the resulting membership function reaches a maximum of [8, 9].

The operating principle of smart gain corrector is as follows:

  1. 1.

    initial measurement of the peak value of output voltage Vin of the resistor RM of the energy meter’s current transducer (CT) by the ADC1 system (Fig. 1) and saving it to the processor memory (MCU) and numerical determination of its derivative;

  2. 2.

    conversion of the input data into the output value A, representing the desired gain, by the fuzzy controller blocks;

  3. 3.

    conversion of the digital output quantity of the fuzzy controller A into an analogue value Aa by the DAC converter (Fig. 1);

  4. 4.

    product operation of the analogue signals Vin × Aa and a monolithic multiplier (MULT – Fig. 1);

  5. 5.

    measurement of the output quantity of the MULT multiplier by the ADC2 converter (Fig. 1) in the input channel Ch1 of the electric energy meter.

2.1 Error Minimisation for the Fuzzy Controller

The main factors determining the accuracy of input signal conversion into output signals in the rule-based fuzzy controllers are, but not limited to, an appropriate number of fuzzy rules stored in the controller’s base and appropriate spacing of the cores of the membership functions of fuzzy sets (in the rules) along the input and output axes [4]. For generation of a fuzzy controller input/output hyperspace in the gain corrector, the applied method often consists in numerical computation of a series of gain values based on the relationship A(j) = level/Vin(j) [V/V] (where ‘level’ is the desired input voltage of the ADC2 converter in the current channel Ch1 of the electric energy meter) for the input signal Vin changing at a fixed step – j, from 0 V to 5 V. At the determined gain points A(j), the cores Core(µV(j)(Vin(j))) = 1 of the membership function µVin(j) of the peak voltage value of the energy meter’s output current transducer are established in the fuzzy sets V(j). The same number of cores is spaced at 90˚/j steps and Vin(j) for the axis of the fuzzy controller input space. The lines drawn from the vertices of the membership function cores create an evenly-intersecting orthogonal grid of the controller plane. In the case of curved-out input/output areas of the fuzzy system, shorter distances between the nodes are used in such sectors (the nodes created by the rule stored in the database, given by the relationship (3) [4]. If the inferencing fuzzy controller of the gain corrector is so designed, it becomes a universal system able to operate in each measuring channel equipped with an ADC converter. Low accuracy of the solution is its disadvantage. According to the authors, the parameters of the fuzzy controller conversion function should be appropriately selected for a specific application, ensuring more accurate operation.

Due to the high dynamics of changes in the actual current of the contact line under load applied by modern asynchronous drives, the value of Vin should be continuously amplified to the value level:

  • level1 = 4 V (i.e. 80% of the reference voltage equal to 5 V of the ADC2 converter in the current channel Ch1 of the electric energy meter) – for the slope in relation to the time axis of this signal converted into geometrical degrees: from 0˚ (constant component) to 75˚;

  • level2 = 3 V (i.e. 60% of the reference voltage equal to 5 V of the ADC2 converter in the current channel Ch1 of the electric energy meter) – for the signal with a slope of >75˚.

The fuzzy controller presented in this paper was designed to operate in the automatic input-gain control system of the traction current channel of the electric energy meter. For this purpose, a suitable expert with knowledge and experience in the field of traction drives was selected. The expert analyses the input data of the fuzzy controller by isolating the most common clusters of information and selecting their representative and then transferring the set of rules to the base. With this analysis, it is possible to minimise the fuzzy controller error by locating the nodes of the input space division grid X \( \left( {X \in V_{in} \times \frac{d}{dt}\left( {V_{in} } \right)} \right) \) of the fuzzy controller cluster centres. For this purpose, the fuzzy system designer uses the analysis method of k-means clustering. The number of data groups (parameter k) to be obtained is entered by the expert at the beginning of the k-means algorithm. In the next step, the k representatives of the emerging groups are randomly selected so that they are as far apart from each other as possible. In the next step of the k-means algorithm, all elements of the input universe of discourse of the fuzzy controller –X are assigned to the closest initial group (cluster). For each group, based on the arithmetic mean of the coordinates of the elements included, the centre ci (i = 1, …, k) (centroid) is determined. The next step is to recalculate the allocation of elements to the groups based on the computed distances from the determined centroids. The new centres are calculated as long as there is data migration between the adjacent groups. In the k-means method, an optimum division of data into clusters is provided by the determination of such groups that minimise the criterion function given by the relationship [6]:

$$ J = \sum\limits_{j = 1}^{k} {\sum\limits_{i = 1}^{n} {\underbrace {{\left\| {x_{i}^{(j)} - c_{j} } \right\|^{2} }}_{dm}} } $$
(4)

where: dm – distance measure, k – number of groups (clusters), cj -centroid for the group j, n – size of the set (groups)

The operating mode of the k-means method is shown in Fig. 2 for the input space of the fuzzy controller, created on the basis of the actual current signal of the contact line under load (this waveform was published in [7]) and its derivative. The effect of the applied data clustering is data grouping into clusters from G1 to G5.

Fig. 2.
figure 2

Data grouping of the input space of the fuzzy controller using the k-means method, the symbols marked on the graph indicate the data included in the group: G1. -▲, G2. -◊, G3.-□, G4. 5 -●, G6. -×, the centroids of each group (C1, …, C5) are marked as ► (filled with white color)

Between the cores with the values 60, 65, 70 and 75˚ of the membership function: \( \mu_{{\frac{d}{dt}\left( {V_{in} } \right)_{1} }} \), …,\( \mu_{{\frac{d}{dt}\left( {V_{in} } \right)4}} \) (Fig. 2: axis \( \frac{d}{dt}\left( {V_{in} } \right) \) titled “before change”) designated as “before change”), determined classically for the designed fuzzy controller (without preliminary input data analysis), there is G1 as an example data group (elements marked with ▲), as shown in Fig. 2. The group is represented by the centroid c1 with its coordinates (c1x, c1y). According to the authors, the expert should introduce here new membership functions in the input space of the fuzzy controller µvc1 and µdvc1 with the core for the Vin axis in the place of the X-coordinate c1x = 72 V and for the \( \frac{d}{dt}\left( {V_{in} } \right) \) axis for the Y-coordinate c1y = 0.2˚ (Fig. 2 axis \( \frac{d}{dt}\left( {V_{in} } \right) \) designated as “after change 1”). The output space of the smart controller remains unchanged. In the controller rule, the function µvc1 is related to the function µA (fuzzy gain output function) so that the product of their cores depending on the input voltage slope Vin is close to the level1 or level2 limit. This type of procedure should be performed for the remaining determined data groups (G2, …, Gk). It is essential not to exceed the admissible number of rules stored in the fuzzy controller database, as given by the relationship [4]:

$$ N_{R} = \left( {N_{S} } \right)^{{N_{in} }} $$
(5)

where: NR - number of fuzzy rules, Nin - number of model inputs, NS - number of input fuzzy sets (identical for each input of the fuzzy controller).

If it is not possible to provide an additional membership function due to the limitation resulting from the relationship (5), the existing cores should be moved accordingly so that the closest one is at the coordinates specifying the centroid of the given group, as shown graphically in Fig. 2 (axis \( \frac{d}{dt}\left( {V_{in} } \right) \) designated as “after change 2”).

The authors completed a computer simulation of the classically designed fuzzy controller with appropriately spaced membership functions of the universe of discourse. Computer analysis is aimed at verifying the usefulness of the k-means method to obtain segregation of controller input data before entering the rules into the database of the smart system.

Figure 3a shows two input signals Vin1, Vin2 of the ADC2 converter, obtained by computer simulation, which are the product of the input value Vin (experimental linear signal with a slope of 50˚) with the gain generated by the smart corrector. The quantity Vin1 is a response to the gain of the fuzzy controller whose parameters, such as spacing of function cores, the associated input plane X, selection of the membership function type, implication and t-norm operators, were not properly selected and tuned. The signal Vin2 was generated based on the expert’s additional knowledge of the most common data clusters in the input space of the fuzzy controller.

Fig. 3.
figure 3

Signal waveforms: (a) input Vin1, Vin2 of the ADC2 converter, (b) error range, (c) the difference between the signal and the full matching – output level1 and the multiplier

The waveform Vin2 (Fig. 2), generated by the classically designed fuzzy controller with tuned parameters and excellent knowledge, is qualitatively better than the waveform Vin1. Properly selected membership functions provided the elimination of the peak while switching between the adjacent controllers operating in parallel structure – see Fig. 3a. Figure 3b shows the same waveforms as in Fig. 3a with marked vertical ranges r whose length is equal to the difference between the desired input value of the ADC2 converter and the value generated by the smart gain corrector (Fig. 3c).

In the computer simulation program, a set of linear signals of different slopes (from 0˚ to 89˚ at a step of 5˚) was applied to the input terminals of the classically designed smart conversion corrector with tuned parameters. The tests indicate that the corrector with the tuned parameters made it possible to reduce the difference between the level1 = 4 V and the input signal (Vin2) of the ADC2 converter by approaching the level1 by the maximum value of Δe = 0.63 V in relation to the output signal (Vin1) of the classically designed corrector (increasing the use of the dynamic range of ADC2 by 15.75%).

The actual output signal from the traction current transducer CT [7] with a maximum raising rate of 420 V/µs was applied to input terminals of the gain corrector in Fig. 1. Reducing the required voltage input level to level2 for signals featuring such high dynamics protects against the loss of the information measured by the measuring system. Figure 4 shows two waveforms (Vin3 and Vin4) being the product of the response of the fuzzy controller with classically selected and tuned parameters (based on the results obtained from the k-means algorithm) and the voltage signal across the resistor RM of the CT transducer as generated by the actual current of the traction contact line under load.

Fig. 4.
figure 4

Voltage waveforms: Vin3, Vin4 of input ADC2 transducer of the current ch1 channel (Fig. 1) of the electric energy meter, resulting from the product with the conversion factor of the fuzzy controller featuring the input/output plane designed classically and tuned based on the results of the k-means algorithm.

In Fig. 4, the horizontal line marked with the variable level2 means the limit value for dynamic waveforms, enabling the measurement without any loss of the measured information (signal value higher than the reference voltage of the ADC2 converter). The correctness of the appropriate spacing of support points (nodes) of the input/output plane of the fuzzy controller operating in the gain corrector is proved by the waveform Vin2, located below the value level2 in Fig. 4.

The quality of the smart amplification corrector with the tuned parameters, as shown in Fig. 1, is much better than that of the classically designed corrector system, with respect to the dynamically changing signal at the input terminals. For this signal, the computer program was used for numerical determination of the maximum difference between the required level2 = 3 V, which was equal to approx. 1.2 V for the classically designed controller (Fig. 4, marked with the z symbol), while the perfect knowledge corrector reduced that value to the level of 0.2 V, within the same area of operation.

3 Summary

This paper presents a block diagram and the operating principle of the conversion factor corrector system [11] associated with the electric energy meter’s current channel. The proposed system is suitable for continuous generation of a value representing the desired gain of the input signal of the energy meter’s current channel. To design the fuzzy controller, intuitive rules of conduct formed by the expert were used. The experienced operator’s excellent knowledge acquired by means of an analysis of input data clusters provides significant support in improving the quality of output signal generation by the smart corrector. The method selected to group the input data of the k-means fuzzy controller allowed the appropriate setting of the membership function cores along the axis of the input plane. The completed computer testing of the rule-based gain control algorithm with appropriately shifted cores of the membership functions have shown effectiveness with respect to every input signal.

The application of the Gaussian rule-based gain control function allows significant limitation of the peak of the transducer input voltage (Fig. 3a) of the electric energy meters’ current channel at the instant of switching between the controllers operating in parallel structure.