Results of study of quantization and discretization error of digital tachometers with encoder

The analysis of measuring channels of angular velocity with an encoder given by the authors made it possible for the first time to obtain an equation for estimating the quantization and sampling error for an exponential mathematical model describing the transient process of operation of electrical machines. The components of the mathematical model of this dynamic error are the sampling step and the derivative, which characterizes the rate of change of the measured value over time. It was found that the errors of quantization and sampling significantly depend on the value of the resolution z of the encoder. Moreover, an increase in z leads to a decrease in the sampling error, but the relative quantization error increases. To reconcile these components of errors, the laws of change in the distinguishing ability z of the encoder are adaptive to the dynamic properties of the change in angular velocity over time. Proved that to ensure the maximum speed of measuring the angular velocity during the transient process, it is advisable to implement the method of changing the distinguishing ability of the encoder on the internal timers of the microcontroller proposed adaptive to its dynamic properties, and the quantization of informative periods proportional to the measured angular velocity should be carried out in "adjoining intervals"


INTRODUCTION
Currently, to intensify the testing of electric machines, the vast majority of research is focused on the acceleration of tests carried out in the no-load experiment [1]- [4]. The main one here is the transient characteristic (variable angular velocity over time ( )), which is obtained in the dynamic mode of operation of the measuring object (electric machine) with practically zero moment of resistance on its shaft (МС ≅ 0). To ensure the maximum number of measured values of angular velocity during the transition process (3 ÷ 5) , most researchers [5]- [8] focused their choice on digital measuring channels with encoders, the main components of which are the following: measurements object OB, coupling shaft MC, encoder E, shaper F, device for the period selection T, f0 frequency generator G, "AND" logic gate for the TX period quantization, binary counter CT2, programmable PI interface (parallel or serial), MPS microprocessor system. In the generalized structural diagram shown in Figure 1, the hardware sequence of measurement data transformations is carried out in the vast majority [9]- [12]. 1. Encoder E converts the non-electric value angular velocity n into a sequence of electrical signals, the frequency of which is determined as

ABSTRACT
The analysis of measuring channels of angular velocity with an encoder given by the authors made it possible for the first time to obtain an equation for estimating the quantization and sampling error for an exponential mathematical model describing the transient process of operation of electrical machines. The components of the mathematical model of this dynamic error are the sampling step and the derivative, which characterizes the rate of change of the measured value over time. It was found that the errors of quantization and sampling significantly depend on the value of the resolution z of the encoder. Moreover, an increase in z leads to a decrease in the sampling error, but the relative quantization error increases. To reconcile these components of errors, the laws of change in the distinguishing ability z of the encoder are adaptive to the dynamic properties of the change in angular velocity over time.
Proved that to ensure the maximum speed of measuring the angular velocity during the transient process, it is advisable to implement the method of changing the distinguishing ability of the encoder on the internal timers of the microcontroller proposed adaptive to its dynamic properties, and the quantization of informative periods proportional to the measured angular velocity should be carried out in "adjoining intervals".
where is the resolution of the encoder. 2. The shaper F from the output quasi-sinusoidal encoder output signals forms pulses of a rectangular shape, the logic levels of which correspond to the levels of TTL logic. 3. The counting trigger T from the output frequency signals of the encoder, selects informative periods , proportional to the angular velocity . 4. In the logical "AND" gate, quantization takes place [10] by comparing the measured physical value of the period and the sample period 0 . As a result of a such comparison, conversion equations for the frequency measurement channel of the instantaneous values given by such a transformation function are obtained 5. Binary counter CT2 carries out the procedure of counting the number of sample periods 0 , which were quantized by periods .
9. From the conversion equation (3), the array of instantaneous angular velocity values is calculated by software The imperfection of the given approach is explained by the shortcomings [13]- [17] inherent in digital measuring devices, the circuitry of which is implemented according to a "hard" control scheme.

MEASURING CHANNELS WITH MICROPROCESSOR CONTROL
The duality of the hardware and software implementation of microprocessor devices ( Figure 2) potentially provides greater flexibility and adaptability to the dynamic properties of measurement objects [10], [16], [18], which significantly expands their functional capabilities and improves static and dynamic metrological characteristics.
The disadvantage of this development direction of microprocessor tachometers is the quantization of only even or only odd periods. In the above "quasi-instantaneous" means, measurement information is obtained not in each period, but after a period, which does not allow for the transient characteristic ( ) with the required accuracy: -determine the numerical values of the amplitude and duration of synchronous dips in angular velocity; -to differentiate the experimentally obtained numerical values of the periods to construct the functional dependence of the change in acceleration over time; -to indirectly determine the value of the dynamic moment and dynamic mechanical characteristic -the phase "portrait" of the object of measurement. The solution to the problems highlighted above is the implementation of quantization [10], [12], [19]- [21] of each even and each odd periods (Figure 3), which are proportional to the instantaneous value of the angular velocity, which is implemented by the hardware and software of the microcontroller.
It is advisable to implement the quantization method in "adjacent" intervals on two internal timers of the microcontroller, and the analysis of metrological characteristics will allow to determine the parameter, knowledge of which will ensure its adaptation to the dynamic properties of the measurement object.

MAIN METROLOGICAL CHARACTERISTICS
For further research, as an initial mathematical model of the angular velocity of electric machines, we will use a trivial ( Figure 4) exponential model where Ω -synchronous speed of the electric motor rotation, - As a result of the interaction of the hardware and software of the microcontroller, the analogue value is replaced, which has  an infinite number of values in the specified measurement range (from min to max ), due to the limited number of its instantaneous values (because Д ≠ 0), a discretization error occurs [22] Thus, obtain a mathematical model for estimating the sampling error. The angular acceleration of the shaft movement of the object of measurement in the transient mode of its operation is determined as The sampling step for a digital tachometer with microprocessor control is determined as follows [10] Here, ADC is the duration of the analog-to-digital conversion, which is equal to the measured period ADC = , FL is the time required to execute the Flag subroutine waiting for the flag, DR is the time to execute the Driver software driver.
Considering the fact that during the measurement of the angular velocity in the "adjacent" intervals, the waiting subroutines for the flag and the Driver software driver are executed after the completion of quantization, then Д = ADC = .
In this regard, the sampling frequency [23] of the angular velocity measuring channel is defined as Now present the encoder conversion equation (1) in the following form: and the discretization step, respectively Substitute (7), (8), (11) into (6) and obtain a mathematical model for estimating ( Figure 5) the sampling error of the digital angular velocity measurement channel in "adjacent" intervals To analyse the relative error of quantization, we will first obtain the transfer function of the microprocessor tachometer Considering (13), the mathematical model for estimating the quantization error in the transient mode of operation of the measurement object will have the form Analysis of the quantization error equation (Figure 6) shows that its reduction can be ensured by two methods: 1. Reducing resolution z of the encoder; 2. Increasing the quantization frequency 0 of the quartz resonator G. The second approach has the limitation 0 ≤ . The quantization frequency is limited by the limit frequency of the crystal resonator of the microcontroller MCU.
In turn, decreasing in the resolution z of the encoder leads to an increasing in the sampling error ( Figure 6), which is not acceptable for dynamic measurements.
The following conclusion can be drawn from the above graphic dependences of quantization and discretization errors: Quantization and discretization errors significantly depend on the resolution value z of the encoder. Moreover, increasing z leads to decreasing in the sampling error, but the relative quantization error increases. To reconcile these component errors, it is necessary to obtain the laws of change of the encoder's resolution z, adapted to the law of angular velocity change in time.
Using (12), we obtain the law of change in the resolution of the encoder in the process of increasing the angular velocity from 0 to Ω, compliance with which will ensure the value of the dynamic sampling error, which does not exceed the normalized value ∆ Д ≤ ∆ ДН  Similarly, from (14) we will get the law of the encoder resolution changing, which implementation will ensure the normalization К ≤ КН of the quantization error Graphic dependences of the change in encoder resolution = ( ) during dynamic measurements of angular velocity = ( ) during the transient process of the measurement object are shown in Figure 5.
To present the quality of measurement results based on the concept of measurement uncertainty, which is currently recommended by international standards [24]- [28], the following method of calculating the standard uncertainty of type B, which arises due to the existence of the discredit error Bd ( ), is proposed in the assumption on the normal distribution law of the components of the digital angular velocity measurement channel where p is the coverage coefficient, which for a normal distribution law is taken as equal to 1.96 at a confidence level of p=0.95 [29], [30]; Д ( ) is the discrediting error of the digital angular velocity measurement channel.
Substituting the maximum value of the sampling error ∆ Д Н ≤ 0.2 rpm (Figure 6, b) into equation (17), we obtain the standard sampling uncertainty of type B, which is equal to Bd ( ) = 0.1 rpm for a confidence level of 0.95.
As follows from the conducted studies of the quantization error ( Figure 6, a), its value does not exceed 0.5 % at an angular speed of 1500 rpm. The standard uncertainty of type B, due to the presence of the quantization error [32], assuming its uniform distribution law, is calculated using the expression For the given object of measurement (for example, a threephase asynchronous motor UAD-34 with a nominal rotation speed Ω = 1500 rpm and = 0.5, a coupling of the membrane type, an encoder LIR-120A (z=65536) and a debugging a board based on a dual-core 32-bit microcontroller TMS320F28379D, containing 1 MB of flash memory, 128 kB of RAM and having a sample frequency 0 =8 MHz formed from the clock frequency of a quartz resonator, a method of normalizing the error [22] of the Д ( ) discretization and a method of normalization is proposed [33], [34] quantization errors K ( ) by determining the change in resolution of the encoder, which corresponds to the change in the time coordinate in the transient process of measurement object: .
A microcontroller such as the TMS320F28379D has twelve 32-bit general-purpose timers in its structure, which is quite enough to carry out this kind of dynamic measurements with the adaptation of the z resolution of the encoder to the dynamic properties of the measurement object: -timer 0 is programmed to the mode of the real-time counter, which every 0.01 s generates a control signal at its output, according to which the value of the binary code of the coefficient k of its list is recorded in the counter of timer 1 ; -every 0.01 s, the value of the list coefficient k is recorded in timer 1 to form at its output a frequency signal ⁄ , proportional to the resolution Д ( ) or К ( ) according to (20) or (21); -in timer 2 , even periods of the frequency signal ⁄ from the direct output of timer 1 are quantized.
-in timer 3 , odd periods of the frequency signal ⁄ from the inverse output of timer 1 are quantized.
Therefore, the method of quantization in "adjacent" intervals takes place in two timers 2 and 3 of the microcontroller. Quantization of and periods occurs in both timers. First, as a result of counting the periods 0 of the sample frequency of the quartz resonator 0 from the leading edge to the trailing edge of the even period in the second 2 timer, and then from the leading edge to the trailing edge of the odd period in the third 3 timer. Thus, each of the programmable timers of the microcontroller works in two modes: -Quantization (from rising edge to falling edge); -Transfer and memorization of measurement information (from falling edge to rising edge); -Additional speed of the proposed method is provided by the transfer and recording of measured information to the RAM in DMA mode (direct access to memory) without the participation of the computing core, freeing its resources for other, priority tasks during the measurement process.
This hardware and software implementation of quantization in " adjacent " intervals ensures maximum speed of measurement and guarantees sufficient time for transferring and memorizing a large volume of quantization results in the MPS RAM. And the implementation of the method of error normalization [22] of discretization Д ( ) or the quantization error [23], [34] К ( ) by changing the resolution z of the encoder in the real-time measuring mode of operation allows to increase the accuracy of dynamic angular velocity measurements.

CONCLUSIONS
The analysis of well-known digital angular velocity measurement channels with an encoder made it possible to solve two extremely important tasks for metrology -increasing the accuracy and speed of dynamic measurements of the angular velocity of the measurement object operating in real time.
For the first time, an equation for estimating the quantization and discretization error was obtained for an exponential mathematical model that describes the transient process of the electric machines operation. The components of the mathematical model of these dynamic errors are the quantization and discretization steps and the derivative, which characterizes the rate of change of the measured quantity over time.
It is proved that quantization and discretization errors significantly depend on the value of encoder resolution z. Moreover, an increasing in z leads to a decreasing in the sampling error, but the relative quantization error increases. In order to reconcile these component errors, the laws of changing the resolution z of the encoder were obtained, which make it possible to adapt to the dynamic properties of the change in angular velocity over time For the selected object of measurement (for example, a threephase asynchronous machine UAD-34 with a nominal speed of rotation Ω = 1500 and τ = 0.5), a coupling coupling of the membrane type, an encoder LIR-120 (z=65536) and dualcore 32-bit microcontroller TMS320F28379D, methods of normalizing the value of the sampling error ∆ ДН and the quantization error КН are proposed. The normalization of these error components is carried out in the process of dynamic measurements of the angular velocity n during the transient process of the measurement object, changing the resolution z of the encoder, thus ensuring the fulfilment of the condition: ∆ Д ≤ ∆ ДН or К ≤ КН It was established that in order to ensure the maximum speed of the angular velocity measuring during the transient process of the measurement object, it is advisable to implement the proposed adaptive to its dynamic properties method of changing the resolution of encoder on the internal timers of the microcontroller, and to carry out the quantization of informative periods proportional to the measured angular velocity in "adjacent intervals".