CHOICE OF THE OPTIMAL PARAMETERS OF MEASURING THE SHAFT ROTATION FREQUENCY OF THE HYDRAULIC TRANSMISSION OF THE LOCOMOTIVE USING MICROCONTROLLER

Dep. «Electronic Computing Machines», Dnipropetrovsk National University of Railway Transport named after Academician V. Lazaryan, Lazaryan St., 2, Dnipro, Ukraine, 49010, tel. +38 (056) 373 15 89, e-mail ivzhuk@mail.ru, ORCID 0000-0002-3491-5976 Dep. «Electronic Computing Machines», Dnipropetrovsk National University of Railway Transport named after Academician V. Lazaryan, Lazaryan St., 2, Dnipro, Ukraine, 49010, tel. +38 (056) 373 15 89, e-mail klugran@i.ua, ORCID 0000-0001-9939-0755


Introduction
Today in Ukraine, the hydraulic transmission is tested using the outdated test-benches designed in Soviet times, in particular at the repair plants of diesel locomotives and military equipment with hydraulic transmission. Also, there is no standardization of the production of these test-benches.
As part of the work for improvement and modernization of the existing hydraulic transmis-sion test-bench at DZRT «Promteplovoz» plant it was revealed that the installed thereon analogue control devices are out-of-date. In the first stage of development in accordance with the plant test program the most necessary and critical 13 process parameters were selected. Information about which received from the sensors is processed by the microcontroller and PC [9].
Information about the rotation frequency of the drive motor, the generator, the turbine shaft is measured using D-2MMU-2 tachometer sensors [6], which transmit the pre-processed analogue signal to a special converter and then to ATMEL microcontroller for its further processing and transmission by USB 2.0 interface to the computer [9]. D-2MMU-2 sensor is nothing but an alternator, which has a critical flaw -at relatively low speeds (established experimentally at about 80 min -1 ) the voltage amplitude produced by the alternator is not sufficient for the normal error-free measurements (at speeds of about 60 min -1 , the amplitude is about 1V, and at 2000 min -1 -40 V). It is clear that at very low speeds the amplitude will be several tens of millivolts. To measure such a low voltage in the plant conditions is practically impossible, since, firstly, long communication lines from the testbench to the measuring equipment may have low voltage blanking and, secondly, at the plant there is a large number of different sources of electromagnetic interferences, which may be laid on communication lines and erroneously recorded as the beginning of rotary motion on the test-bench.
On the basis of available equipment of hydraulic transmission testbench it was designed the rotation frequency sensor of optical type based on the existing sensor 2MMU D-2 [13]. According to the results of plant tests using the sensor prototype it was established the necessary and sufficient time for scanning the control sensor microcontroller, which allowed making changes in the measurement algorithm.

Purpose
In the calculations, it was found that changes in instrumental and methodological errors [4], which may be a result of missing and/or averaging the averaging, require further investigation. Also, as a result of the tests, the measurement statistics were obtained, which indicates the presence of interfer-ence that requires the development of filtering mechanisms. It is necessary to identify the exact nature of the interference, which in turn can simplify, and, perhaps, completely eliminate the filtering mechanisms by making corrections to the hardware and software part of both the sensor and its interface circuit with the computer of the test bench.
To improve the designed sensor [13] (in order to choose a rational number of the disk teeth and the optimal algorithm for calculating the rotational frequency), it is necessary to calculate the instrumental and methodological errors that arise during the measurements. Obviously, the instrumental error should increase in proportion to the increase in the number of teeth (due to inaccuracy in their manufacture), and the methodological error on the contrary should fall with the increase in the number of teeth.

Methodology
To calculate the instrumental error, let us represent the calculation of the rotation frequency ω using the known formula: where ω -is the measured rotation frequency If the measurement error τ is neglected, then the relative measurement error [13] has the form: where L  -is the difference between the actual and theoretical length of the arc L [mm].
Substituting (1) in (2), it is obtained a formula for calculating the relative error (instrumental), taking into account the dependence on the number of teeth: where N -is the number of teeth of the sensor disk. When using the formula (1) for measuring the rotational frequency the acceleration that may oc-cur is not taken into account, as a result of which a methodological error arises. To calculate the methodological error, we will calculate the rotational frequency using the following formula: Without considering the instrumental error, the actual rotational frequency can be expressed in terms of the measured rotational frequency at the end of the next measurement period (under the condition of uniform acceleration) according to the formula: where ω act -actual rotational frequency  (1) that Т   . It was calculated and established that the performance of all assembler commands involved in the measurements is quite small value. The influence of this error ε Δ is illustrated in Fig. 1.
As it can be seen from Fig. 1, under the given technical conditions, this error is extremely small and it can be neglected.
In this case, the absolute methodological error will have the following form: Taking into account (3) and (4), the formula for the relative (methodological) error is: The graphs of the dependence of the instrumental and methodological errors on the number of teeth in the disk with different input parameters are shown in Fig. 2 and Fig. 3.
As it can be seen from Fig. 2, approximately starting from the value of the rotational frequency equal to 200 min -1 , it is enough to use a wheel with one tooth (intersection of methodological and instrumental errors is the optimum point). Fig. 3 shows that at meas  = 20 min -1 , to minimize the error it is sufficient to use about 9 teeth. The acceleration а was chosen as high as possible.
Summarizing the obtained result, and also in order to simplify the calculating algorithm of rotational frequency, it was decided to modify the calculation algorithm as follows: up to 50 min -1 (valid at the average acceleration a = 1.15 min -1 /s 2 [13]) to perform calculations as earlier, taking into account each period of the signal from the sensor (for a disc of 10 teeth). Starting from the rotational frequency greater than 50 min -1 it was decided to take into account the duration of ten signal periods from the sensor as one measurement period, i.e. simulate a single-tooth disc. This condition practically does not contradict the conclusions made in the work [13], as there it was justified the sufficiency of using every 8 th sample of the rotational frequency. In the process of testing the projected sensor the interferences were detected (Fig. 4). As can be seen from Fig. 4, there is some kind of interferences in the signal from the sensor, as indicated by the spectrum of the signal obtained using the fast Fourier transform [1,5].
These low-frequency interferences are easily filtered, for example, by arbitrary finite impulse response (FIR) filter [5,11]. For this purpose, the FIR filter of the 10 th order was used filtering the frequencies up to 10 Hz. As one can see from Fig.  4 has filtered the supposed interferences partially. However, there are visible residual beatings of unknown origin. Of course it is impossible to assert that this interference is of a different nature or it is the specificity of the hydraulic transmission opera-tion (high-precision reference sensor is not available at the factory). These residual interferences can also be easily filtered by moving average algorithm [12] for example, as it is shown in Fig. 5.
But the expediency of such an action is extremely doubtful. Firstly, it is unknown whether this is the interference (presumably, in the plant's environment there would be more high-frequency interferences). Secondly, it is possible that such deviations in the signal can be caused by some fault of the software or hardware parts of the designed test bench. As a result, it is necessary to conduct additional studies. As a result of studies the errors in the program part of the stand were not found. But a potential source of interference was found in the hardware (electronic) part of the stand.
The pulse driver (which go to the input of the microcontroller) was nothing but a Schmitt trigger CD40106BM [8] manufactured by Texas Instruments. And, as it is known, such triggers have a wide range of thresholds for both operation and release of the logical unit. This effect is shown in Fig. 6 taken from the official documentation.
Since the fronts of the incoming pulses from the sensor are quite heavily overloaded (as it is shown in Fig. 7), the signal at the output of the driver (Schmidt trigger CD40106BM) will always be of unequal duration, taking into account the specificity of its operation shown in Fig. 6. Analysis of the existing microcircuits of singlepass Schmitt triggers showed that they have similar characteristics, as well as for the Schmitt trigger CD40106BM. The way out of this situation is the use of two-input Schmitt triggers, where it is possible to set a fixed operation voltage due to the use of backward communication. The study of the market of existing microcircuits of two-input Schmitt triggers and operational amplifiers was conducted. As a result, it was found that the use of microcircuits of two-input Schmitt triggers is not rational: the operational amplifier makes it possible to set operating voltage more flexible and accurate with minimal deviations, and its cost does not exceed the cost of the Schmit trigger. Therefore, it was decided to make own pulse driver using the operational amplifier LM124 [10].
The driver is constructed according to the scheme shown in Fig. 8  To calculate the driver [3,7], the following input conditions are accepted: The supply voltage U sup = 4.7 V; The operate voltage U op = 3 V; The maximal voltage at the output of the amplifier, the received one 1-2 V less than the supply voltage U max = 3.46 V; The minimum voltage at the output of the amplifier is U min = 0.3 V.
The driver is constructed according to the scheme in Fig. 8.
To calculate the positive feedback resistor R2, it is necessary to determine the hysteresis ΔU of the amplifier. It has been experimentally established that ΔU = 0.3 V is sufficient for stable operation. Resistor R1 was selected with a nominal of 39 kOhm. Accordingly, based on the results of calculations, R2 = 452.4 kOhm.
To form the bias voltage E0 of the operating point of the amplifier switching, it is calculated by the formula: Thus, Е0 = 2.85 V. Resistor R4 was selected with a nominal value of 3.3 kOhm. Correspondingly, according to the results of calculations 3 2142.11 R  Ohm. To check the accuracy of calculations, it is also necessary to calculate the operating and release voltages of the operational amplifier. To do this, the speed of switching а sw , is required, which for the selected amplifier is 0.1 V/ms [3,7]. The operating voltage U 0→1 is calculated by the formula: The release voltage U1→0 is calculated by the formula: 1 0 min According to the results of calculations, , and 1 0 2.55 V U   . Simulation of this calculated circuit of the driver confirmed the accuracy of calculations. The oscillograms of the operation simulation are shown in Fig. 9.
Real tests of the new pulse driver were also carried out. The graph of the performed measurements is shown in Fig. 10. As can be seen from Fig. 10 there is practically no interference in the results obtained. This allows us to talk about identifying and complete eliminating the source of data distortion in the developed hydraulic transmission testing system. In this case, the application of digital filtering algorithms is not necessary. For the projected optical sensor of the rotational frequency based on the existing D-2MMU-2 sensor, the analysis of the methodological and instrumental errors was performed. Based on the data obtained, a more rational variant of the frequency calculation algorithm was proposed, and the num-ber of teeth of the sensor disk was justified. The nature of the interferences that occur during data collection was investigated. As a result, the main source of measurement distortion was established and the method for improving the hardware of the hydraulic locomotive test bench, which eliminated this source, was proposed.

Originality and Practical Value
The studies of the dependence of the methodological and instrumental errors of the designed rotational frequency sensor were conducted. Rational mechanisms for filtering the interferences that occur when fixing the rotational frequency have been proposed. Additional studies have shown the need for hardware refinement of the signal conditioner circuit. The conducted researches allowed establishing a rational number of the sensor disk teeth, which made it possible to improve the measurement algorithm. It was also proposed hardware improvement of the signal conditioner circuit from the sensor, which made it possible to get rid of interferences. The results of the measurements during the studies are the initial data for further research to determine the technical state of the hydraulic transmission UGP 750-1200 during the factory post-repair tests.

Conclusions
The dependence of the instrumental and methodological errors of the developed tachometric sensor of the optical type was investigated. Based on the studies carried out, it is proposed to modify the algorithm for calculating the rotational frequency as follows: up to 50 min -1 (valid at the average acceleration a = 1.15 min -1 /s 2 [13]) to perform calculations taking into account every second period of the signal from the sensor ( for 10 teeth disk), and starting from the rotational frequency greater than 50 min -1 to take into account the duration of ten periods of the signal from the sensor as one period, i.e. to simulate a disk with one tooth. It was found that the use of a 10-tooth disc is rational. In order to eliminate distortions in the measurements, calculation and testing of the pulse driver from the sensor based on the operational amplifier LM124 was performed on the basis of the used Schmitt trigger CD40106BM.