Absolute encoder reading
Absolute encoder reading
The signal output of the absolute value encoder The signal output of the absolute value encoder has parallel output, serial output, bus type output, and transmission integrated output.
1. Parallel output:
The output of the absolute encoder is a multi-digit number (Gray code or pure binary code). Parallel output means that there are multiple high and low level outputs on the interface to represent the digital 1 or 0. For absolute encoders with low digits , Generally, the digital output is directly in this form, which can directly enter the I/O interface of the PLC or upper computer, the output is instant, and the connection is simple. However, parallel output has the following problems:
1. It must be a Gray code, because if it is a pure binary code, there may be multiple bit changes when the data is refreshed, and the reading will cause a code error in a short time.
2. All interfaces must be connected well, because if there is a bad connection point, the potential of this point is always 0, which causes an error code and cannot be judged.
3. The transmission distance can not be far, generally one or two meters, for complex environments, isolation is best.
4. For a large number of digits, many core cables are required, and good connections must be ensured, which brings engineering difficulties. Similarly, for encoders, there must be many node outputs at the same time, which increases the failure rate of the encoder.
2. Serial SSI output:
The serial output is through an agreement, there is a sequential data output in time, this agreement is called a communication protocol, the physical form of its connection is RS232, RS422 (TTL), RS485, etc.
Since the good manufacturers of absolute encoders are all in Germany, most of the serial output is matched with Siemens in Germany, such as SSI synchronous serial output.
SSI interface (RS422 mode), connected by two data lines and two clock lines, the receiving device sends interrupted clock pulses to the encoder, and the absolute position value is synchronously output to the receiving device by the encoder and the clock pulse. Triggered by the clock signal sent by the receiving device, the encoder starts outputting a serial signal synchronized with the clock signal from the high bit (MSB).
The serial output connection line is few, the transmission distance is long, the protection and reliability of the encoder are greatly improved.
Generally, high-bit absolute encoders use serial output.
3. Fieldbus type output
Fieldbus encoders are multiple encoders connected together by a pair of signal wires. By setting the address, the signal is transmitted by communication. The signal receiving device only needs one interface to read multiple encoder signals. The bus-type encoder signal follows the physical format of RS485, and the signal arrangement method is called the communication protocol. At present, there are multiple communication protocols in the world, each with its advantages, but not yet unified. The commonly used communication protocols for encoders are as follows:
PROFIBUS-DP; CAN; DeviceNet; Interbus, etc.
The bus-type encoder can save connection cables and receiving device interfaces, and has a long transmission distance. In the case of centralized control of multiple encoders, it can also greatly save costs.
4. Transmit integrated output
Electrical secondary equipment connected to absolute encoder:
The equipment connected to the absolute encoder can be a programmable controller PLC, a host computer, or a dedicated display signal conversion instrument, which then outputs the signal to the PLC or host computer.
1. Direct access to PLC or host computer:
If the encoder is output in parallel, it can be directly connected to the input/output contact I/O of the PLC or the upper computer, and the signal math format should be Gray code. The number of bits of the encoder will occupy the number of contact points of the PLC. If it is a 24V push-pull output, the high level is valid as 1, and the low level is 0; if it is an open collector NPN output, the connected contact must also It is NPN type, its low level is effective, and the low level is 1.
2. If the encoder is serial output, due to the limitation of the communication protocol, the subsequent electrical equipment must have a corresponding interface.
For example, SSI serial can be connected to Siemens S7-300 series PLC. There are special modules such as SM338, or S7-400 FM451 and other modules. For other brands of PLC, there are often no special modules or modules are very expensive.
3. If the encoder is a bus-type output, the receiving device needs to be equipped with a dedicated bus module, such as PROFIBUS-DP.
However, if you choose a bus-type output encoder, you cannot add other display instruments between the encoder and the receiving device PLC. If you need on-site display, you must transfer the signal from the PLC to the display instrument that matches the signal.
5 When parallel output, the data is read through the Gray code conversion instruction, but some PLCs do not have the Gray code conversion instruction and can only convert the Gray code into ordinary binary through the normal open, normally closed point and output coil. The program is shown in the figure below, taking 720P/R as an example: