Encoder base for high-speed counting module - Database & Sql Blog Articles

Photocoupler

1 Encoder base 1.1 Photoelectric encoder Encoder is a kind of sensor, which is mainly used to detect the speed, position, angle, distance and counting of mechanical motion. Many motor controls need to be equipped with encoder for motor controller as commutation. , speed and position detection, etc., the application range is quite extensive. According to different classification methods, encoders can be divided into the following types:
Ø According to the detection principle, it can be divided into optical, magnetoelectric, inductive and capacitive.
Ø According to the output signal form, it can be divided into analog encoder and digital encoder.
Ø According to the encoder method, it is divided into incremental encoder, absolute encoder and hybrid encoder.
The photoelectric encoder is a digital sensor integrating light, machine and electric technology. It mainly uses the principle of grating diffraction to realize the displacement-digital transformation. The photoelectric geometric displacement on the output shaft is converted into pulse or digital by photoelectric conversion. sensor. A typical photoelectric encoder is composed of a code wheel, a detection grating, a photoelectric conversion circuit (including a light source, a photosensitive device, a signal conversion circuit), a mechanical component, and the like. The photoelectric encoder has the advantages of simple structure, high precision and long life, and is widely used in precision positioning, speed, length, acceleration and vibration.
Here we mainly introduce the incremental encoders and absolute encoders that are commonly supported by the SIMATIC S7 series of high-speed counting products.
1.2 Incremental Encoders Incremental encoders provide a sensing method for discretization, incrementing, and displacement (speed) of continuous displacement. The incremental encoder is characterized in that each output pulse signal corresponds to an incremental displacement, which is capable of generating a pulse signal equivalent to the displacement increment. The incremental encoder measures the relative position increment relative to a certain reference point and cannot directly detect the absolute position information.
As shown in Figure 1-1, the incremental encoder is mainly composed of a light source, a code wheel, a detection grating, a photodetection device, and a conversion circuit. A radial light-transmissive slit having the same pitch is engraved on the code wheel, and an adjacent one of the two light-transmissive slits represents an increment period. The detecting grating is engraved with a light-transmitting slit corresponding to the code discs of the two groups A and B for passing or blocking the light between the light source and the photodetecting device, the pitch of the two is equal to the pitch on the code wheel, and two The group of light transmission slits are staggered by 1/4 pitch, so that the signals output by the photodetecting device are 90° out of phase. When the code wheel rotates with the measured rotating shaft, the detecting grating does not move, and the light is transmitted to the photoelectric detecting device through the transmission slit on the code wheel and the detecting grating, and the photoelectric detecting device outputs two sets of phases which are different by 90°. The electrical signal of the sine wave, the electrical signal is processed by the signal of the conversion circuit, and the rotation angle or speed information of the measured axis can be obtained.
Digital camera
Figure 1-1 Incremental encoder schematic In general, the incremental photoelectric encoder outputs A and B pulse signals with a phase difference of 90° (so-called two-phase quadrature output signals), according to A, B The sequential relationship between the two phases makes it easy to determine the direction of rotation of the encoder. In addition, the code wheel generally provides an N-phase flag (indication) pulse signal for use as a reference zero, and a zero mark signal is issued every one rotation of the code wheel.
Digital camera
Figure 1-2 Incremental encoder output signal
1.3 Absolute Encoder Absolute Encoder The principle and components of the absolute encoder are basically the same as those of the incremental encoder. Unlike the incremental encoder, the absolute encoder uses different numbers to indicate each different incremental position. It is a sensor that directly outputs digital quantities.
Digital camera
Figure 1-3 Absolute encoder schematic diagram shown in Figure 1-3, the absolute encoder has a number of concentric code channels on the circular encoder disk in the radial direction, each of which has a transparent and opaque sector The interphase composition, the number of sectors of adjacent code channels is doubled, and the number of code channels on the code disc is the number of bits of its binary digit. On one side of the code wheel is a light source, and on the other side there is a light-sensitive element corresponding to each code channel. When the code wheel is in different positions, each photosensitive element converts a corresponding level signal according to whether it is illuminated or not, and forms a binary number. Obviously, the more code channels, the higher the resolution. For an encoder with n-bit binary resolution, the code wheel must have n code channels.
According to different coding methods, two types of absolute encoders (binary code disk and gray code code disk) are shown in Figure 1-4.
Digital camera
Figure 1-4 Absolute encoder encoder The absolute encoder is characterized by the fact that no counter is required. A fixed digital position corresponding to the position can be read at any position of the rotary shaft, that is, the absolute value of the angular coordinate can be read directly. . In addition, there is no cumulative error in the absolute encoder relative to the incremental encoder, and the position information is not lost when the power is removed.
2 Encoder output signal type In general, the signal level obtained from the photodetector of the encoder is low, the waveform is irregular, and cannot be directly used for control, signal processing and long-distance transmission, so it is also needed in the encoder. The signal is amplified, shaped, and the like. The processed output signal is generally similar to a sine wave or a rectangular wave. Because the rectangular wave output signal is easy to digitally process, it is widely used in control systems.
The signal output of the incremental photoelectric encoder has various signal forms such as open collector output, voltage output, line drive output and push-pull output.
2.1 Open collector output The open collector output is an output circuit with the emitter of the output circuit as the common terminal and the collector floating. Depending on the type of transistor used, it can be divided into an NPN open collector output (also known as a sink output, when the logic 1 is 0V, as shown in Figure 2-1) and a PNP open collector output (also known as Source output, when logic 1, the output voltage is the power supply voltage, as shown in Figure 2-2. This type of output circuit can be used in the event that the encoder supply voltage and the voltage of the signal receiving device are inconsistent.
Digital camera
Figure 2-1 NPN open collector output
Digital camera
Figure 2-2 PNP open collector output For the PNP type open collector output encoder signal, it can be connected to the leakage input module. The specific wiring principle is shown in Figure 2-3.
Note: The encoder signal of the open-collector output of the PNP type cannot be directly connected to the module of the source input.
Digital camera
Figure 2-3 PNP-type output wiring principle For the NPN-type open collector output encoder signal, it can be connected to the source input module. The specific wiring principle is shown in Figure 2-4.
Note: The encoder signal of the open-collector output of the NPN type cannot be directly connected to the module of the sink input.
Digital camera
Figure 2-4 Wiring principle of NPN output
2.2 Voltage output type The voltage output is based on the open collector output circuit. A pull-up resistor is connected between the power supply and the collector. This allows a stable voltage state between the collector and the power supply. 2-5. This type of output circuit is typically used with the encoder supply voltage and the voltage of the signal receiving device being identical.
Digital camera
Figure 2-5 Voltage output type
2.3 Push-Pull Output The push-pull output mode consists of two triodes, PNP and NPN, respectively, as shown in Figure 2-6. When one of the transistors is turned on, the other transistor is turned off and the two output transistors operate in parallel.
This form of output has high input impedance and low output impedance, so it can also provide a wide range of power supplies at low impedance. Since the input and output signals have the same phase and wide frequency range, they are also suitable for long-distance transmission.
The push-pull output circuit can be directly connected to the NPN and PNP open-collector input circuits, ie, to modules with source or sink inputs.
Digital camera
Figure 2-6 Push-pull output
2.4 Line drive output As shown in Figure 2-7, the line drive output interface uses a dedicated IC chip. The output signal conforms to the RS-422 standard and is output in differential form. Therefore, the line drive output signal has stronger anti-interference ability and can be applied. In the case of high-speed, long-distance data transmission, it also has the characteristics of fast response and strong anti-noise performance.
Digital camera
Figure 2-7 Line drive output

Note: In addition to the interface types of the encoder outputs listed above, many manufacturers now have encoders with intelligent communication interfaces, such as PROFIBUS bus interfaces. This type of encoder can directly access the corresponding bus network and read the actual count value or measured value by means of communication, which will not be described here.
3 High-speed counting module and encoder compatibility The high-speed counting module is mainly used to evaluate various pulse signals of the access module, and is used to count and measure the pulse signals output by the encoder. The full range of Siemens SIMATIC S7 products have modules that support high-speed counting and can be adapted to a wide range of applications.
Depending on the function of the product, the type of input signal supported by each product's high-speed counting function is also different, and special attention should be paid to system design or product selection. Table 3-1 below gives the compatibility information between Siemens high-speed counting products and encoders for reference.
Table 3-1 Compatibility between high-speed counting products and encoders

SIMATIC S7 series incremental encoder absolute encoder 24V PNP24V NPN24V push-pull 5V differential SSIS7-200 /
S7-200 SmartCPU integrated HSC√√√--S7-1200CPU integrated HSC√√√--S7-300CPU31xC integrated HSC√-√--FM350-1√√√√-FM350-2√-√-- SM338----√S7-400FM450-1√√√√-ET200S1Count 24V√√√--1Count 5V---√-1SSI----√S7-1500TM Count 2x24V√√-- TM PosInput2--- √√ET200SPTM Count 1x24V√√√--TM PosInput1---√√
√ compatible; - not compatible
4 Frequently Asked Questions for Encoder Use 4.1 Which parameters to consider when selecting the encoder: When selecting the encoder, you can consider the following parameters:
Ø Encoder type: Determine whether to use incremental encoder or absolute encoder according to the application and control requirements.
Ø Output signal type: For incremental coding, determine the output interface type (source type, sink type) as needed.
Ø Signal voltage level: Confirm the voltage level of the signal (DC24V, DC5V, etc.).
Ø Maximum output frequency: Confirm the maximum output frequency, resolution, and number of bits according to the application and requirements.
Ø Installation method and external dimensions: comprehensive consideration of installation space, mechanical strength, shaft status, appearance specifications, mechanical life and other requirements.
4.2 How to judge whether the encoder is good or bad can judge the quality of the encoder by the following methods:
Ø Connect the encoder to the high-speed counting module of plc, and judge whether the encoder output is correct by reading the actual pulse number or code value.
Ø View the encoder output waveform through the oscilloscope and judge whether the encoder is normal according to the actual output waveform.
Ø Measure the encoder output signal voltage through the voltage file of the multimeter to judge whether the encoder is normal. The specific operation method is as follows:
1) When the encoder is an NPN transistor output, measure the voltage between the positive pole and the signal output line with a multimeter. • The output voltage is close to the supply voltage when turned on. • The output voltage is close to 0V when turned off.
2) When the encoder is a PNP transistor output, measure the voltage between the negative pole of the power supply and the signal output line with a multimeter. · The output voltage is close to the supply voltage when turned on. · The output voltage is close to 0V when turned off.
4.3 Reasons for inaccurate counting and corresponding avoidance measures In practical applications, there are many reasons for inaccurate counting or measurement. The main points should be noted:
Ø The field environment where the encoder is installed has jitter, and there is looseness between the encoder and the motor shaft.
Ø The rotation speed is too fast and exceeds the maximum response frequency of the encoder.
Ø The pulse output frequency of the encoder is greater than the highest frequency of the counter input pulse.
Ø Interference is caused during signal transmission.
Avoidance measures for the above problems:
Ø Check the mechanical installation of the encoder, whether it is slipping, skipping teeth, gear gap is too large, etc.
Ø Calculate whether the highest pulse frequency is close to or exceeds the limit.
Ø Ensure that the maximum pulse frequency that the high-speed counter module can receive is greater than the pulse output frequency of the encoder.
Ø Check if the signal line is too long, use shielded twisted pair cable, ground it as required, and take necessary anti-interference measures.
4.4 How to deal with idle encoder signal lines In practical applications, you may encounter signal lines that are not needed or are not supported by the module, for example:
Ø For AB quadrature encoders (A, B, N) with zero signal, the module does not support N-phase input or does not require Z signal.
Ø For differential output signals (A, /A, B, /B, N, /N), the module does not support the input of the reverse signal (/A, /B, /N).
For these signal lines, no special processing is required, and you can give up without using it!
4.5 Incremental Signal Multiple Evaluation Can Improve Counting Frequency For incremental signals, multiple evaluation modes can be configured, including dual evaluation and quadruple evaluation. The quadruple evaluation means that the positive and negative edges of signals A and B are judged at the same time, and the count value is obtained, as shown in Figure 4-1. For the quadruple evaluation mode, since four pulses are processed (four evaluations) for one pulse, the count value read is four times the actual number of input pulses, and the measurement resolution can be improved by multiple evaluation of the signal. .
Digital camera
Figure 4-1 Quadruple evaluation principle diagram Through the above analysis of the incremental signal multiple evaluation principle, it can be seen that the multiple evaluation only multiplies the count value on the basis of the original count pulse, but actually the actual input pulse frequency. No effect, so it will not increase the maximum counting frequency of the module. For example, the FM350-2 has a maximum counting frequency of 10 kHz, so even if it is configured in a quadruple evaluation mode, its maximum counting frequency is 10 kHz.

Solar home energy storage power supply

SHENZHEN CHONDEKUAI TECHNOLOGY CO.LTD , https://www.szsiheyi.com