The decoding circuit of rotary encoder
Technical field
The utility model relates to the decoder circuit technical field, is specifically related to be used for the decoding circuit of rotary encoder.
Background technology
Early stage what use is parameters such as potentiometer regulation voltage or electric current, is the mechanical conductive contact chip change resistance value of sliding on resistive element because potentiometer uses.If the contact chip of slide block and resistive element contact resistance become big or disconnect in use for some time, will cause the fluctuation of electric power output voltage, life of product there is very big influence, even when out-put supply changes significantly, also can burns subscriber equipment.Its advantage is that the user can arbitrarily change the rotation speed, and is easy to adjust.Along with development of science and technology, digitized processing is applied to power source products, by the Digital Circuit Control electric current and voltage, and with computer current use with automatic control system in, increase work efficiency greatly.But use potentiometer to be unfavorable for control able to programme (control slide block cost height automatically, and damaged).Adopt two buttons (increase, reduces) by CPU control voltage or electric current and other more parameters.Button long service life, and the user does not regulate electric current and voltage when having gone bad, and the equipment that out-put supply can the influence of fluctuations user use.Maximum shortcoming is with whenever by once can only unit of increment, regulates when meticulous very loaded down with trivial detailsly, as the voltage of control output 1000V, whenever by once increasing or reduce 1V, adjusts from 0V to 1000V so, and the user will be by 1000 buttons.
Occurred rotary encoder afterwards, it is by the change transitions of mechanical angle physical quantity being become a kind of device of the signal of telecommunication; In the classification of transducer, he belongs to angular displacement sensor.The rotary encoder elementary diagram as shown in Figure 1.By rotating handles, Nei Bu two switch alternate runs wherein.Output signal has three terminals of A, B, C to constitute, and C is a common, and signal (revolve turn around 24,36 or more pulse output) is judged in A, B output.Signal output waveform as shown in Figure 2.The A output square-wave pulse that clockwise rotates when rotary encoder leading with 90 ° at B end, B holds leading A to hold 90 ° when being rotated counterclockwise on the contrary.So just need the phase demodulation demodulation to export clockwise pulse and pulse counterclockwise respectively.As shown in Figure 3, sort signal also needs to decode actual use waveform signal, so that turn clockwise counting circuit and be rotated counterclockwise counting circuit identification.
Comprehensive above design feature is used selection rotary encoder replacing key-press at system control cpu, can be to be beneficial to the pulse signal that digital circuit is handled and export as potentiometer by Spin Control.Only need decoding clockwise or counterclockwise just can very simple replacing key-press.
Summary of the invention
The technical problems to be solved in the utility model is: the decoding circuit that provides a kind of rotary encoder to use, the purpose of realization rotary encoder replacing key-press in different control circuits.
To achieve the above object of the invention, the technical scheme that the utility model adopted is:
The decoding circuit of rotary encoder comprises A input, B input, E output, F output, two d type flip flops, two three inputs and door and three inverters;
The A input is connected respectively to the D input port of first d type flip flop and the D input port of second d type flip flop,
The B input is connected respectively to the input port of first inverter and the trailing edge of second d type flip flop triggers port,
The trailing edge that the delivery outlet port of first inverter is connected respectively to first d type flip flop triggers the input port of the input port of port, the one or three input and door and the two or three input and door,
The Q output port of first d type flip flop and second d type flip flop is connected to the input port of the one or three input and door, first d type flip flop and second d type flip flop
Output port is connected to the input port of the two or three input and door,
The one or three input is connected to the E output with the output port of door by second inverter,
The two or three input is connected to the F output with the output port of door 106 by the 3rd inverter.
This practical beneficial effect is: combine with rotary encoder, replace early stage potentiometer that uses and the button in the digital control circuit afterwards, have and arbitrarily to change rotation speed, advantage easy to adjust, long service life, cost are controlled the low advantage of slide block more automatically.
Description of drawings
Fig. 1 is the rotary encoder schematic diagram;
Fig. 2 is the rotary encoder output signal;
Fig. 3 is decoding circuit signal output waveform figure of the present utility model;
Fig. 4 is decoding circuit figure of the present utility model;
Fig. 5 is an application example structured flowchart of the present utility model;
Wherein, 1, the decoding circuit of rotary encoder, 101, first inverter, 102, first d type flip flop, the 103, the 1 input and door, 104, second inverter, 105, the 3rd inverter, the 106, the 23 input and door, 107, second d type flip flop, 2, rotary encoder, 3, other control circuit.
Embodiment
Below in conjunction with accompanying drawing embodiment of the present utility model is done and to be described in detail:
The decoding circuit of rotary encoder comprises A input, B input, E output, F output, two d type flip flops, two three inputs and door and three inverters;
The A input is connected respectively to the D input port of first d type flip flop 102 and the D input port of second d type flip flop 107,
The B input is connected respectively to the input port of first inverter 101 and the trailing edge of second d type flip flop 107 triggers port,
The trailing edge that the delivery outlet port of first inverter 101 is connected respectively to first d type flip flop 102 triggers the input port of the input port of port, the one or three input and door 103 and the two or three input and door 106,
The Q output port of first d type flip flop 102 and second d type flip flop 107 is connected to the input port of the one or three input and door 103, first d type flip flop 102 and second d type flip flop 107
Output port is connected to the input port of the two or three input and door 106,
The one or three input is connected to the E output with the output port of door 103 by second inverter 104,
The two or three input is connected to the F output with the output port of door 106 by the 3rd inverter 105.
The A input of the decoding circuit 1 of rotary encoder links to each other with the A of rotary encoder 2 end, the B end of B input and rotary encoder 2 links to each other, the E output is connected to the counting circuit that turns clockwise of other control circuit 3, and the F output is connected to the counting circuit that is rotated counterclockwise of other control circuit 3.Realize replacing the function of button in the electrical apparatus control circuit.
The utility model is not limited to above-mentioned example, in claims of the present utility model institute restricted portion, and various distortion that those skilled in the art can make without creative work or revise the protection that all is subjected to this patent.