1. Ordinary counter
Let's learn about ordinary counters first, taking C0 as an example. See the figure below. When X0 has a rising edge, C0 will count once. When C0 counts to 1000, it will stop counting and the C0 counter switch will act. When programming, it is recommended to use the RST instruction to reset C0, otherwise C0 will be in an overflow state after the count exceeds the limit.
2. High-speed counter
The difference between high-number counter and ordinary counter is:
1. High-frequency counting can identify pulses with higher frequencies
2. The high-speed counter can be called. The input terminal X will not be reflected in the program. For example, in the following table, after calling the counter C235, there will be no X0 input terminal in the program. Just connect the wires at the input terminal.
As shown in the following table, this is our single-phase high-speed counter
If I connect the photoelectric sensor to X0, then C235 is its dedicated counter. Every signal sensed by X0 will be counted by C235. We can use the following program to store the number of pulses sensed by X0 into D235. (Similarly, C236 records the number of pulses of X1; C237 records the number of pulses of X2...),
Before starting the counter, there are generally two programs to write:
To start the special register corresponding to the counter (for example, C235 corresponds to M8235, C236 corresponds to M8236, etc.), you need to define the direction first, whether it is count up or count down.
It is recommended to reset C235 before starting. (Someone asked if C235 can still count after overflow. The answer is that it can still count, but it is 32 bits, so it can only count to 32 bits)
Of course, the counting frequency of the counter has a limit. The receiving speed of the ordinary FX series X point is 50KHz, which means that it can receive and conduct 50,000 times in 1 second.
3. Use of encoder (taking incremental encoder as an example)
The incremental encoder can use the principle of photoelectric conversion to output three groups of square wave pulses A, B and Z; the phase difference between the two groups of pulses A and B is 90 degrees, which can determine the rotation direction of the motor, and the Z phase outputs one pulse per revolution for reference point positioning. The principle of this encoder is simple, mechanically averaged, and has a service life of tens of thousands of hours. It has strong anti-interference ability and high reliability. However, it cannot output the absolute position information of the shaft rotation.
According to the encoder principle, we connect the encoder to the PLC, as shown in the following figure (the figure below takes C251 as an example)
Two-phase high-speed counter (C251~C255) The A-phase and B-phase signals determine whether the counter counts up or down. When the A-phase is ON and the B-phase changes from OFF to ON, it counts up; when the A-phase is ON and the B-phase changes from ON to OFF, it counts down.
The following figure shows the basic instructions for counting using C251.
The first instruction: Before starting C251, perform a reset operation
The second instruction: X12 is used to start the C251 counter. X12 is not used for data collection (X1 and X2 are used for data collection and cannot appear in the program).
The third instruction: After C251 counts overflow, start Y2 operation
The fourth instruction: M8251 is the forward and reverse flag. For example, when the encoder runs in the forward direction, M8251 is connected, and vice versa.
Note: After the C251 counter overflows, it can continue counting.
Previous article:Application cases of frequency converters in water equipment control systems
Next article:12 Practical Knowledge Sharing of Frequency Converter
Recommended ReadingLatest update time:2024-11-16 11:30
- 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
- 【Perf-V Evaluation】Chip Temperature Collection
- [Domestic RISC-V Linux Board Fang·Starlight VisionFive Trial Report] Successfully communicated with DWIN screen
- Looking for unboxing test of AWR1642BOOST
- What happens when a low-speed AD collects a high-frequency signal? (Those who have tried it or done a circuit experiment are welcome to come in!)
- 【RT-Thread Reading Notes】Chapter 7-10 Reading Notes
- Xunwei-IMX6ULL-QT application_porting ssh on the development board
- msp430 writes ADS1115
- 【TI recommended course】# Master the design of flyback power transformer and circuit#
- MicroPython Hands-on (33) - Weather Forecast for the Internet of Things
- [2022 Digi-Key Innovation Design Competition] 4. Run a simple interface directly