A New Method for Angular Speed Measurement with Absolute Encoder

1 Abstract —The


I. INTRODUCTION
Generally, encoders are used in angular position and speed feedback of electric motors.The encoders are electromechanical devices that produce digital or analogue signals according to the movement of the motor shaft to which they are connected.They give information about the number of rotations of the shaft and its angular position.They are widely used in many industrial applications, such as robots, mobile cameras, computer numerical control (CNC) machines, automobiles, where the position and speed control are required.
The encoders that give the actual angular position of the shaft, even when it is not rotating, are called absolute encoders.Those that cannot do this are called incremental encoders.Absolute encoders are used where the angular position of the shaft must be known even at a zero speed.These encoders produce an output depending on the angular position of the shaft.This output always has the same value in the same position of the shaft.This means the presence of a numerical value corresponding to each angular position of the shaft.Even when the shaft is not rotating, the actual angular position of the shaft can be determined by looking at the output signal of the absolute encoder.However, incremental encoders do not have such a possibility.Incremental encoders assume that the position at which the shaft starts turning is zero.The incremental encoder is more useful if the angular position information at a zero speed is not needed.Some of the speed measurement applications using incremental encoders are available in [1]- [8].
In the angular speed measurements, where the encoders are used, there are two basic methods: frequency (M) and period (T).In M method, the frequency of the encoder output signal is determined.In this method, the timer/counter hardware of the microcontroller is used.At a sampling time determined by setting a timer, the pulses generated by the encoder are counted.The counter is used in the counting process.Rising or falling edge may be preferred in counting pulses.The value obtained from the counter at the end of the set time is divided by the number of pulses that the encoder produces in one revolution.This new value gives the number of rotations of the shaft at the time specified by the timer.This value is used to calculate the angular speed of the shaft.The speed obtained by this method is the average speed.
In T method, the period of the encoder output signal is found.This method uses the Capture/Compare/Pulse width modulation (CCP) feature of the microcontroller.The output of the encoder is connected to the CCP pin of the microcontroller.In this method using two consecutive pulses generated by the encoder, the timer is activated when the first pulse is captured.The timer is deactivated when a second successive pulse is captured.The period of the encoder signal is found using this value of the timer and the timer value obtained for a fixed period of time.The angular velocity of the shaft is calculated by using the period value found.The speed obtained by this method is instantaneous speed.It is useful in low speed regions.It is necessary to use a high-frequency microcontroller.
There is another method, in which these two methods are combined.Details of this method, called M/T, are available in [9]- [12].The authors in [13], [14] attempted to reduce the measurement errors by switching between these two methods A New Method for Angular Speed Measurement with Absolute Encoder at variable speed regions.
According to the results of the studies, in which these three methods are compared according to the simulation and test results in [3], [14]:  The M method is more successful at high speeds;  The T method is more successful at low speeds;  The M/T method is more successful in variable speed regions.
The encoders produce digital or analogue outputs.On digital outputs, the output can be binary coded, gray coded, or pulsed.In analogue outputs, the output range can be 0 V-5 V or 0 V-15 V.The M or T method gives accurate results for pulse output encoders.However, these methods cannot produce precise results on their own in encoders with analogue output in saw tooth type as in Fig. 1.Especially, they cause big errors at low speeds.In order to reach the studies related to the elimination of these errors, a literature review was conducted.Different approaches to encoders and measurement methods were found in the literature review.For example, in [15], [16], different approaches were proposed to improve the measurement performance of the absolute encoder by improving the architectural schemes and the image processing scheme.In [17], a study was done to reduce or compensate for errors that occur when incremental encoders are used.In cases, where the physical connection of the encoder is not possible, a video measurement technique is proposed in [18].A new absolute angle measurement method using a phase-encoded binary graduated disk was presented in [19].New encoders were introduced in [20]- [24].The angular position of a shaft was measured using two absolute encoders in [25].
However, no studies have been made to minimize the measurement error of absolute encoders with analogue outputs.In this study, a new method is proposed, which reduces the relative error ratio too much below 1 % in an absolute encoder that produces an analogue output ranging from 0 V to 5 V according to the angular position of the shaft.Unlike in the studies in literature, the M method and Analog Digital Converter (ADC) are used together.The proposed new method (M + ADC) aims to increase the measurement accuracy over the entire speed region.

II. THE PROPOSED METHOD
In addition to M method, the ADC value was also considered in the proposed method.For this reason, the absolute encoder output was connected to both the CCP pin and the ADC pin of the microcontroller to be used.First, the signal at the encoder output was counted according to the falling edge trigger during 1 second.Immediately, after the time elapsed, the analogue output value of the encoder was instantaneously read through the analogue channel.This analogue value was, then, processed and added to the number of pulses.The flow chart for this is shown in Fig. 2 As can be understood from Fig. 1 and Fig. 2, the frequency to be read from the oscilloscope to be connected to the encoder output is going to give the number of revolutions per second of the encoder.To calculate the number of revolutions per minute of the shaft, to which the encoder is connected, the frequency is multiplied by 60.For a better understanding of the proposed method, a sample calculation will be made.In this calculation, the signal shown in Fig. 3 will be used.As can be seen in Fig. 3, the total number of falling edges (P) in the signals generated by the encoder during 1 second is 6.Let's assume that Xt value at a point t2, where the timer is stopped, is 0.65.Similarly, let's assume that Xt-1 value at a point t1, where the timer is started, is 0.18.Accordingly, the frequency of this signal generated by the encoder (F) is calculated as follows 1 6 0.65 0.18 6.47 .

tt F P X X Hz
The number of revolutions of the shaft connected to the encoder (N) is calculated as in (2) 60 6.47 60 388.2 .
If the measurement was made using only the M method, the frequency of the signal would be 6 Hz and the speed would be 360 rpm.Therefore, a relative error of 7.8 % would occur in the measurement.

III. EXPERIMENTAL STUDY
An experimental study was carried out to test the validity of the proposed M + ADC method.In the experimental study, we used a mechanical system that we designed for the speed test of the battery-operated wheelchair.In this system consisting of two cylinders, the speed of the vehicle is determined by an absolute encoder connected to the cylinder.In the mechanical system, MRV50R8ANL5V360 absolute encoder with an analogue output (Fig. 1) is used.The maximum permissible rotational speed of the encoder is 1000 rpm.The mechanical system used in the experimental study is shown in Fig. 4. A simple board was designed to perform the proposed new method.With this board, basic applications, such as LED, ADC, temperature, buzzer, LCD, and USB can be done.The microcontroller on the board is PIC18F4550.The microcontroller is operated at 48 MHz thanks to PLL method.The designed board is shown in Fig. 5. Experiments were carried out at different speeds using the mechanical system and the board.The output signal of the encoder and its frequency information were monitored from the oscilloscope screen during the experiment.The frequency obtained using the proposed method was observed on the LCD screen on the board.
The images of the experiments performed at two different speeds using only M method are given in Fig. 6.In all experiments, the first channel of the oscilloscope was connected directly to the encoder output.The second channel was connected to the terminal of the 4.7 V Zener diode connected to protect the microcontroller.When the experimental results in Fig. 6 are examined, it becomes clear that the frequency on the LCD screen does not overlap with the frequency on the oscilloscope screen.It is seen that there is a measurement error of 0.78 % and 9.19 %, respectively, in Fig. 6(a) and Fig. 6(b).
The images of some experiments performed at different speeds using the proposed M + ADC method are shown in Fig. 7 All experimental results are shown in Table I.

1 .
Analog output signal of the absolute encoder.

Fig. 3 .
Fig.3.The output signal to be used in the sample calculation.

Fig. 4 .
Fig. 4. The mechanical system, in which the proposed measurement method is tested.

TABLE I .
THE EXPERIMENTAL RESULTS.