introduction
Photoelectric encoders are commonly used in modern motor control systems to detect the position and speed of rotating shafts. They are high-precision angular position measurement sensors that convert the mechanical geometric displacement on the output shaft into pulse or digital quantities through photoelectric conversion. Due to their high resolution, fast response speed, and small size, they are widely used in motor control systems.
2. Fiber Optic Implementation of Signal Transmission for Absolute-Type Photoelectric Encoders
Encoders are classified into absolute encoders and incremental encoders according to their signal output form. Absolute photoelectric encoders have advantages such as direct interface with PLC modules, ARM or FPGA devices, and no cumulative error, but they are expensive, have complex manufacturing processes, and are not suitable for miniaturization. Absolute encoders come in two types: single-turn and multi-turn. A single-turn absolute encoder automatically returns to zero after one revolution; a multi-turn absolute encoder automatically returns to zero after reaching the maximum number of revolutions and the maximum count value. Absolute encoders generally use Gray code disks for encoding. In Gray code, only one bit changes when transitioning between any two adjacent numbers. Taking a 24-bit binary code disk with a resolution of 24 as an example, if the absolute encoder uses a binary 8421 code disk, as shown in Figure 1, one or more binary positions change between two sequential codes. For example, when two sequential binary codes change from 0111 to 1000, all bits of the binary code change their state. Readings obtained at the transition moments of state changes may be erroneous. That is, position synchronization and sampling become very difficult.
Using a binary Gray code disk, as shown in Figure 2, only one binary bit changes position between the two sequential codes, from the last bit to the first bit. This makes position synchronization and sampling accurate, simple, and feasible. For the conversion relationship between natural binary code and Gray code, please refer to relevant literature.
Absolute encoder signal outputs typically include parallel output, serial output, bus-type output, and integrated transmitter output. A brief introduction to these output methods follows.
2.1 Parallel Output
Absolute encoders output multi-bit codes (Gray code or pure binary code). Parallel output involves multiple high and low level outputs on the interface to represent 1 or 0 of the code. For absolute encoders with a low bit count, this format is generally used to directly output the code, which can be directly connected to the I/O interface of a PLC or host computer. The output is instantaneous and the connection is simple. However, parallel output has the following problems:
① It must be Gray code, because if it is pure binary code, multiple bits may change when the data is refreshed, and the reading will cause errors in a short time.
② All interfaces must be properly connected, because if there is a single poorly connected point, the potential at that point will always be 0, causing an error code that cannot be determined.
③ The transmission distance should not be too far, generally one or two meters. For complex environments, isolation is best.
④ For a large number of bits, many core cables are required, and good connections must be ensured, which brings engineering difficulties. Similarly, for encoders, there are many node outputs at the same time, which increases the failure rate of the encoder.
2.2 Synchronous Serial (SSI) Output
Serial output refers to the sequential output of data according to a pre-defined time agreement. Physical connection methods include RS232, RS422 (TTL), and RS485. An SSI interface, such as RS422 mode, uses two data lines and two clock lines. The receiving device sends an interrupt clock pulse to the encoder, and the encoder outputs the absolute position value synchronously with the clock pulse to the receiving device. Triggered by a clock signal from the receiving device, the encoder begins outputting a serial signal synchronized with the clock signal. Serial output requires fewer connection lines, allows for longer transmission distances, and improves the reliability and protection of the encoder. High-bit absolute encoders generally use serial output.
2.3 Fieldbus-type output (asynchronous serial)
Fieldbus encoders consist of multiple encoders connected together with a pair of signal lines. By setting an address, signals are transmitted via communication. The receiving device only needs one interface to read signals from multiple encoders.
Bus-type encoder signals follow the RS485 physical format. Currently, there are various communication protocols, each with its own advantages, and no unified standard has been established. Commonly used communication protocols for encoders include: PROFIBUS-DP; CAN; DeviceNet, etc.
Bus-type encoders can save on connecting cables and receiving device interfaces, have a long transmission distance, and can also greatly reduce costs when multiple encoders are centrally controlled.
2.4 Integrated Transmitter Output
Its signal has been converted in the encoder and then directly transmitted and output. It has analog output of 4-20mA, RS485 digital output, 14-bit parallel output, etc.
For the common output signal form of absolute encoders, namely synchronous serial output (SSI), a fiber optic transmission method is proposed to improve the encoder signal's anti-interference capability and the convenience of construction and wiring. An industrial serial fiber optic modem directly modulates RS-232/422/485 electrical signals into optical signals for transmission over fiber optics, solving the problems of electromagnetic interference, ground loop interference, and lightning damage. This improves the reliability, security, and confidentiality of data communication, making it suitable for a control system with special requirements for electromagnetic interference environments. As shown in Figure 3, the synchronous serial RS-422 data signal output from the encoder is converted into a TTL signal by an interface conversion circuit, and then converted into an optical signal for transmission by a photoelectric conversion device. Similarly, the RS-422 clock synchronization signal is converted by the receiving end in the same way, except that the wavelengths of the converted data signal and clock synchronization signal are not equal, and then propagated through multimode fiber.
3. Fiber Optic Implementation of Incremental Photoelectric Encoder Signal Transmission
Incremental photoelectric encoders do not have counting or interface circuits, are relatively inexpensive, and are commonly used in practical engineering.
An incremental photoelectric encoder mainly consists of a light source, a code disk, a detection grating, a photoelectric detection device, and a conversion circuit, as shown in Figure 4. The code disk has radially spaced light-transmitting slits with equal pitch, with each adjacent slit representing one incremental cycle. The detection grating has two corresponding light-transmitting slits, A and B, on the code disk, allowing light to pass between the light source and the code disk, thus enabling the photoelectric detection device to detect the light signal. The light-transmitting slits A and B are equal in pitch to those on the code disk, but they are offset by 1/4 pitch, resulting in a 90° electrical angle phase difference in the signals output by the photoelectric detection device. Two orthogonal square wave pulse trains, A and B, with a 90° phase difference, represent the rotation of the measured shaft by a certain angle. The phase relationship between A and B reflects the rotation direction of the measured shaft. That is, when phase A leads phase B by 90°, the rotation direction is forward; when phase B leads phase A by 90°, the rotation direction is reverse. The Z signal is a pulse signal representing the zero position, which can be used for zeroing, alignment, and resetting the counter.