In large-scale industrial control systems, the starting and stopping of equipment at all levels have a certain impact on the operating status of the entire system. The collection of switching signals of these devices and the recording of action timing are also particularly important. Therefore, it is necessary to design a switching signal acquisition card to collect these signals to provide a basis for the detection, analysis, and query of equipment operating status and production accidents.
The 16-channel switching signal acquisition card introduced in this article uses Philips LPC2131 ARM microcontroller as the core. With a sampling period of 0.5ms, it can collect 16 switching input signals, measure the switching waveform and occurrence time in real time, and Upload the data to the host computer historical database with a resolution of 1ms. At the same time, historical data can be fully queried through cooperation with the host computer software to analyze system operation.
The measurement card has a UART communication interface and is networked with the controller. After the collected data is sent to the controller for processing, it is then sent to the workstation to display the status. At the same time, the time and status of the event are recorded, and the recorded data is stored in the workstation history. database.
Signal acquisition card
The acquisition card uses 16-channel LED lights on the main panel of the card to indicate channel signal status. At the same time, isolation is achieved between channels and between channels and the bottom plate, and electromagnetic shielding from the site is achieved. To ensure that the measured signal is not interfered with. The specifications of the capture card module are shown in Table 1.
At the same time, the acquisition card is connected to the controller through the UART communication interface, and the communication physical layer uses the CAN bus driver chip TJA1040 to send the collected data to the controller.
Capture card hardware design
The hardware circuit of the 16-channel switching signal acquisition card consists of five parts: signal acquisition circuit, microcontroller system, communication interface circuit, external pins, and human-machine interface. The schematic diagram of the hardware circuit structure is shown in Figure 1.
Figure 1 Hardware structure diagram of switching measurement card
Switch signal acquisition circuit
The switching signal acquisition circuit is to collect various switching signals on site and send them to the processing chip. In the actual design, Philips LPC2131 ARM microcontroller is used.
The measurement principle of the signal acquisition circuit is: 16 on-site switching signals are connected to the card measurement terminals. Taking into account the fluctuation and interference of on-site signals, in order to ensure the stable and reliable operation of the system and prevent various on-site and power supply interference from affecting the system Impact, a photoelectric coupler is used in the channel to isolate the inside of the card from the field input signal, thereby achieving accurate measurement of the signal. In the actual design, the PS2701 photoelectric coupler is used, and the structural block diagram of the card measurement path is shown in Figure 2.
Figure 2 Switch signal acquisition circuit
Later, considering the simplicity of signal inversion, the photocoupler was changed to PS2705, which realized the function of signal inversion, so the actual measurement circuit was further simplified as Figure 3.
Figure 3 Simplified switching signal acquisition circuit
The signal after isolation and conversion by the optocoupler is connected to the data bus of the processing chip through a bidirectional bus driver, and the data is sent to the processing chip LPC2131 for processing.
The single-chip system processing chip is Philips LPC2131, which is a microcontroller based on a 32-bit ARM7TDMI-STM CPU that supports real-time simulation and embedded tracking, and has 32kB of embedded high-speed Flash memory. A 128-bit wide memory interface and a unique acceleration architecture enable 32-bit code to run at maximum clock rates. At the same time, LPC2131 has strict control over the code size and can use 16-bit Thumb mode to reduce the code size by more than 30% with very little performance loss. The LPC2131's smaller package and extremely low power consumption make it ideal for use in small systems such as access control and POS machines. The wide range of serial communication interfaces and on-chip 8kB of SRAM make the LPC2131 ideal for communication gateways, protocol converters, soft modems, voice recognition and low-end imaging, providing them with huge buffer space and powerful processing capabilities. Multiple 32-bit timers, 1 or 2 10-bit 8-way ADCs, 10-bit DACs, PWM channels and 47 GPIOs as well as up to 9 edge or level-triggered external interrupts make it particularly suitable for industrial control systems.
The single-chip microcomputer system uses LPC2131 as the core and has 8K flash memory on-chip, so there is no need to expand the external ROM; to recall the historical data of the switching value, the relevant information must be easy to store and not easy to lose, so that it can be effectively stored after the system loses power. of saved data. The data information it measures includes the year, month, day, hour, minute, second, millisecond when the switching value occurs, as well as the switching value status of each channel at that time.
Figure 4 Microcontroller system circuit block diagram
At the same time, due to the influence of various interference and other factors during system operation, the program often runs away after running in an infinite loop. The system also uses a simple hardware WATCH DOG circuit.
Communication interface circuit
In order to enable the measurement card to effectively send the collected data to the controller, the card is designed with a UART circuit. Through the serial port, the card can complete tasks such as data transmission, parameter adjustment, and clock calibration according to the operating commands of the host computer.
The card uses TJA1090 communication chip, which is specially designed for serial communication mode. The output end is also connected with a voltage regulator protection circuit. The interface circuit is shown in Figure 5.
Figure 5 Communication interface circuit
Card module specifications and external circuit pins
The card is connected to the card base through dedicated pins to transmit the collected signals. The external circuit pins of the card are shown in Figure 6.
Figure 6 External circuit pin diagram
Human-machine interface
The card uses serial port communication to communicate with the controller, and then uploads the measured signal to the host computer, which is displayed on the configuration screen of the host computer. The human-machine interface is friendly, and the data can be used for system configuration, historical data query and other operations. At the same time, it can be implemented Process control SOE query, through the accompanying SOE software, can achieve functions such as jitter removal, peak clipping, and valley clipping, and realize SOE accident recall and query, and its accuracy can reach 1ms level.
Capture card software design
The card software design adopts a functional module structure. All software includes main program, interrupt service subroutine, etc. The main program is used to patrol and execute the commands sent by the host computer. The interrupt service subroutine is divided into an overflow interrupt subroutine and a serial port interrupt subroutine. The former is used to collect switch value jump signals, and the latter is used to receive data from the host computer.
main program
After the card is charged, enter the main program. First, determine whether the card is a power-on reset. If it is not a power-on reset, it will directly enter the patrol detection stage after the crash recovery process; if it is a power-on reset, the card will first perform self-test and initialization, including setting the stack pointer and clearing the card. Memory, set time constants, etc., and then allow interruption and enter the normal circuit processing program, which can realize parameter setting, switch jump time, status collection and other functions. If it is detected in the main program that the received data flag bit defined in the program is set, it indicates that the microcontroller has received the data sent by the host computer, and the data receiving process is completed by the serial port interrupt subroutine. According to the data from the host computer, the measurement card responds accordingly, or sends back data, or sets parameters.
interrupt service routine
The signal collection service subroutine mainly completes the collection of switching signals that occur, and is implemented by overflow interrupts, which are interrupted every 0.5ms.
The communication service subroutine mainly refers to the subroutine for receiving data from the host computer, which is implemented by serial port interrupts. Most of the data sent back to the host computer is switch record information, the amount of data is large, and it is mainly completed in the main program. At the same time, you can set the baud rate during communication, which can be achieved in the card parameter settings.
Conclusion
At present, the card has been put into use in the desulfurization monitoring system of units #10 and #11 of Nantong Tianshengang Power Plant in Jiangsu Province. All performance indicators meet the original design requirements, and the operation is reliable and in good condition. It can be widely used in the industrial processes of chemical industry, metallurgy, electric power and other industries to realize functions such as switching value collection and accident recall.
Previous article:Teach you how to use the LPC54102 dual-core kit firmware library SPI
Next article:Application solution for robot arm controller based on LPC2138 microprocessor
- Popular Resources
- Popular amplifiers
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
- Is this the worst impedance processing you have ever encountered?
- PCB panelization
- RPG game ported using RP2040 and MicroPython
- For large project files containing nios, timing constraints, and layout and routing, modify the internal module names and some variable names.
- What is output impedance? What is impedance matching?
- High-frequency transformer sandwich winding method: primary wrapped in secondary? Or secondary wrapped in primary?
- Detailed description of I2C bus protocol and timing, getting started is no longer difficult
- Send a WDS configuration software for SI4463
- LM1875 Op Amp
- OpenBLT is an open source bootloader with comprehensive functional information, supporting USB, CAN, 232 and TCP/IP