1. Connection between Siemens S7-1200 and incremental encoder
The digital input switch points of Siemens S7-1200 all provide a fast counter function for incremental encoder pulse signals. The single-phase signal reaches 200KHz, and the two-phase signal (which can be quadrupled and direction determined) reaches 80KHz. For the commonly used 2500PPR (resolution pulses per revolution), the fastest speed reaches 1920RPM (revolutions per minute).
The signal of the incremental encoder is a PNP unidirectional open-circuit signal. The recommended incremental encoder is a 10-30V push-pull output type, such as the GI58N incremental encoder.
2. Connection between S7-1200 and absolute encoder
The signal of the absolute encoder is not afraid of interference, and the data will not be lost during power outages. The PLC does not need to count the absolute encoder all the time, and does not need to calculate the interruption time for the CPU scan, thus saving CPU resources. Especially now that the market price of the absolute encoder has dropped significantly, and due to the improvement of data reliability, the use of the absolute encoder can save debugging time and reduce after-sales service costs. The actual use effect and cost performance are far better than those of the incremental encoder. More and more users tend to use absolute encoders in PLC position positioning.
Due to the economy of S7-1200, the more economical and convenient 4-20mA signal interface is preferred for connection with absolute encoders. Siemens S7-1200 plus SM1231 analog module can directly connect 2 absolute encoders with 4-20mA output interface.
Absolute encoders are divided into single-turn absolute encoders and multi-turn absolute encoders. Single-turn absolute encoders refer to encoders that rotate within 360 degrees or work within 0-180 degrees. For such encoders, 4mA corresponds to 0 degrees, 360 degrees (or 180 degrees) corresponds to 20mA, and the data in the PLC linearly corresponds to the angle value. Each value corresponds to a unique angle value. The data does not need to rely on counting, is not afraid of interference and power failure, and can be directly programmed and used. Single-turn absolute encoders are recommended to use GMS412.LB (code 9400S). This encoder can set the angle value and rotation direction corresponding to 20mA, and the zero offset. For example, 20mA can be set to correspond to 180 degrees, and the encoder works within 0-180 degrees.
In the PLC positioning control of length or height, the encoder is often required to rotate over a working range of 360 degrees, so a multi-turn absolute encoder is needed. There are two types of 4-20mA outputs of multi-turn absolute encoders. One type is a fixed-range multi-turn absolute value, such as 16 turns, 64 turns, and 256 turns, that is, the corresponding value of 20mA is the end point of 16 turns, 64 turns, or 256 turns. This type of encoder is more economical, and the recommended model is GEX60.LB.
The other type is an intelligent multi-turn absolute encoder. The 20mA can be set at any position between 1 and 4096 turns, and the zero offset can be set. The recommended model is GAX60.LB (code 9600). This encoder is widely used and has been successfully applied in many fields such as lifting, water conservancy, military industry, petroleum, chemical industry, and various industrial machinery.
3. Connection between S7-1200 and Modbus RTU signal
Siemens S7-1200 can be configured with the communication interface RS485, which can be connected to the RS485 signal of the absolute encoder, including single-turn absolute value and multi-turn absolute value. The RS485 signal of the absolute encoder has various forms, the more commonly used ones are simple RS485 broadcast mode (active broadcast transmission in master mode), free protocol with address sent by instruction (slave passive mode), Modbus RTU mode, etc. If only one absolute encoder is connected, the encoder active mode can be used, the protocol is simple and the signal is reliable, and if multiple encoders are to be connected (bus mode), the Modbus RTU mode can be selected, but this mode requires polling, and the data returned by each encoder is refreshed slowly, which is not suitable for fast-moving control.
Recommended active mode RS485 encoder, single-turn absolute value model is GES38.RDB, or GES60.RDB, or GMS412.LB (code 9400S); multi-turn absolute value model is GEX60.LB (64 turns), or GAX60.LB (code 9600) (4096 turns)
The recommended passive command mode RS485 encoder (can connect 1-9 encoders, including addresses) is GMS412.LB (code 9400S) for single-turn absolute value; GEX60.LB (64 turns) or GAX60.LB (code 9600) (4096 turns) for multi-turn absolute value.
The recommended encoder for Modbus RTU mode is GMS412.RMB for single-turn absolute encoders and GAX60.RMB for multi-turn absolute encoders (4096 turns).
4. Connection between S7-1200 and Profibus-DP signal
Siemens S7-1200 can be configured with Profibus-DP bus communication interface, which is the most commonly used output mode for European absolute encoders. Various European imported brand encoders can be selected, including domestic brand absolute encoders. This interface is a commonly used interface for Siemens, but the cost of the encoder with this interface is high, including the cost of configuring cable wiring. It is no longer suitable for the economy of 1200 and is not recommended here.
5. Practical cases
The connection between Siemens S7-1200 and the absolute encoder 4-20mA signal is used for simple positioning control;
Practical application introduction 1:
Single-machine and multi-machine control of water conservancy gate height, the lifting height of flood control, storage, water supply, sewage and other sluice gates across the country are lifted and closed by winch cranes (hoisting machines), and each gate station has 1-6 gate hoists. Siemens S7-1200PLC is connected to the 4-20mA interface of the absolute multi-turn encoder and configured with HMI, which can effectively complete such simple positioning control.
The encoder can be installed on the winch drum shaft or the reduction gear shaft. The number of revolutions required by the encoder is calculated in advance, and the 20mA output of the encoder is set to be greater than the number of revolutions, for example, 16 revolutions. In this way, each 1mA change in the 4-20mA output of the encoder corresponds to one revolution of the drum, and the height change of the gate lifting is calculated to control the opening and closing height of the sluice gate. The encoder model selected is the GAX60.LB (code 9600) recommended above, and the project application location: multiple sluices in Harbin, Northeast China, Changzhou, Jiangsu, etc.
Practical application introduction 2:
The hydraulic double cylinder lifting is controlled synchronously. Larger sluice gates need to be lifted by two hydraulic cylinders on the left and right to keep the positions synchronized to ensure smooth lifting and lowering of the gate. The original gate opening instrument of a sluice in Guangdong was only used for display. Because the reliability of the original display instrument was low and it could not complete the synchronous deviation correction and lifting control of the hydraulic cylinder, the user hoped to use a small and economical PLC plus HMI to replace the original instrument for display only, to improve the control reliability and programmability. The PLC selected Siemens S7-1200, and the encoder selected an absolute multi-turn encoder with a 4-20mA signal interface. Two GAX60.LB (code 9600) were installed with mechanical devices to correspond to the lifting heights of the left and right cylinders. The corresponding cylinder height of 6 meters corresponds to 20mA. The two 4-20mA signals were connected to the analog interface of S7-1200 and entered into the PLC to compare the two sets of data. The solenoid valves of the hydraulic systems of the left and right cylinders were controlled according to the height difference, and the flow of the left and right hydraulic oil circuits was adjusted to adjust the lifting or lowering speed and position difference of the cylinders to maintain the synchronous deviation correction and lifting control of the two cylinders. Siemens S7-1200 is equipped with two absolute encoder 4-20mA interfaces, which can well complete such synchronous deviation correction and lifting control source.
6. How to use PLC to connect the encoder and program
The hardware required is:
1. PLC: Siemens S7-1200-CPU1214C/DC/DC/DC, V4.1.
2. Encoder: E6B2-CWZ5B, PNP, incremental, 1000P/R
3. Encoder and PLC wiring
Brown: DC24V+
Blue: COM
Black: A, connected to I0.0
White: B, connected to I0.1
Orange: Z, connected to I0.3
The access points of AB can be defined by yourself, and do not have to be I0.0 and I0.1. Z cannot be changed.
4. Configure the high-speed counter; as shown below:
Here, select HSC1, select Enable high-speed counter, Count, A/B count, and Up count. Use the default address ID1000 as the counter address, or select others, which occupy four bytes.
5. Pay attention to the filter problem of the IO channel used; as shown below:
The old version of CPU shields the filter when using the high-speed counter, so there is no need to consider it. However, the V4.1 version of the CPU does not shield it, so you must pay attention to this filter and the encoder's pulse frequency. If it is not appropriate, it will be filtered out.
6. Monitor the test results; as shown below:
You can read it without writing a program. You only need some programs when you need some special functions, which are not introduced here.
7. Filter time and maximum frequency that can be detected; as shown below:
Previous article:Detailed steps of S7-1200 project download procedure
Next article:Features and differences of each series of Siemens PLC
Recommended ReadingLatest update time:2024-11-16 15:01
- Popular Resources
- Popular amplifiers
- Huawei's Strategic Department Director Gai Gang: The cumulative installed base of open source Euler operating system exceeds 10 million sets
- Analysis of the application of several common contact parts in high-voltage connectors of new energy vehicles
- Wiring harness durability test and contact voltage drop test method
- Sn-doped CuO nanostructure-based ethanol gas sensor for real-time drunk driving detection in vehicles
- Design considerations for automotive battery wiring harness
- Do you know all the various motors commonly used in automotive electronics?
- What are the functions of the Internet of Vehicles? What are the uses and benefits of the Internet of Vehicles?
- Power Inverter - A critical safety system for electric vehicles
- Analysis of the information security mechanism of AUTOSAR, the automotive embedded software framework
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- The wireless receiving signal brightness DBM is negative
- Million-dollar annual salary recruitment: Data algorithm engineer (video big data)
- TMS320F28377D_LED Experiment
- What are Classic Bluetooth and Bluetooth Low Energy?
- Just for good circuits! New forum section [Circuit Observation Room]
- EEWORLD University Hall----Live Replay: Datang NXP- New Energy Lithium Battery Management Solution with Impedance Detection Function
- The problem of confusion in the power-on reset of the microcontroller
- Download Gift|ADI's Latest Analog Dialogue Edition
- The STM32 branch adds receive buffer setting parameters during serial port initialization
- The role of parallel resistance and capacitance in signal lines