Simple and practical method of measuring angle with code wheel

       In the measurement and control system, it is often necessary to collect various angle parameters or to measure the speed of the rotating mechanism with an angle sensor. The more mature angle sensors on the market include self-incrementing machines, potentiometers, code discs, Hall elements and gear counters. This paper designs a design scheme of photoelectric encoder, the hardware structure is very simple, the cost is low, the stability is good, the life is long, and it can meet the precision requirements under various conditions.

                                           

 

working principle:

(1) Generation of the signal:

Hardware structure: The device used for signal acquisition in this code disc is a pair of light-emitting tubes and receiving tubes, and each tube has two sets of transceivers.

Realization process: place a circular black and white coding film with the same width between the light-emitting tube and the receiving tube, so that the three are in parallel planes, align the center of the light-emitting tube and the receiving tube, and make the coding film can be wound around. Its axis rotates. After power-on, the light-emitting tube will continuously emit signals, but since the film is the same black and white, when the black part is facing the light-emitting tube, the signal sent by the light-emitting tube will be blocked, so that the receiving tube cannot receive the signal; When the white part is facing the light-emitting tube, the signal from the light-emitting tube will pass through the film and shoot to the receiving tube. In this way, two continuously changing sine waves are obtained at the receiving end.

(2) The principle of direction discrimination

Figure 2 shows the principle of direction discrimination

The width of the coded film is twice the distance of the transceiver, and the positional relationship between the two transceivers should satisfy B=(0.7n+0.35)+A, and n=0 in the figure.

Similarly, when the film is rotated to the right, the A and B signals change in the opposite direction. In this way, the direction determination is realized through the different changing laws of the A/B signals.

(3) Signal processing:

Figure 3 is the code wheel signal processing circuit diagram

                                   

The main task of this circuit is to convert the resulting raw analog signal into a digital signal, that is, analog-to-digital conversion.

The 0V generated by the sensor is a sine wave signal with the oscillation center, which is converted into a sine wave signal with +2.5V as the oscillation center after being processed by the follower. By adjusting the potentiometer, its waveform reaches the best state, and then the sine wave signal is amplified by 10 times through the amplifier. At this time, due to the stretching effect of amplification, the signal whose position is between 0-5V has very steep rising and falling edges. After being shaped by Schmitt trigger, it is output to the single-chip microcomputer in the form of square wave. The waveform is shown in Figure 4:

1.3 Signal control and transmission

                                  

                                           

                                          

                                                 

                                                    

                                                       

                                                    

                                                     

                                                      

                                     

                                                

  

            

                                                      

 

                                                       

                                                     

 

                                                      

                                                    

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325220905&siteId=291194637