With the development of society, a large number of high-density and large-scale buildings have emerged, making fire escape routes more complicated and increasing the difficulty of escape when a fire occurs. For fire evacuation, how to make escape safer, more accurate and faster when a fire occurs is a new issue raised by the times for building disaster prevention. At present, most fire emergency sign lights exist as single units, and it is impossible to dynamically adjust the escape direction indication according to the changes at the fire scene. In addition, there is also a serious lag in the daily maintenance and inspection of emergency sign lights.
The main function of emergency sign lights is to start in case of fire, and the key to emergency start is whether the battery charging and discharging work properly. It is difficult to find product problems in time by relying on human maintenance and repair, which often brings many blind spots to escape and evacuation instructions in case of fire. Increasingly high public safety requirements have made fire emergency sign lights develop from independent work to intelligent fire emergency lights monitoring system. When a fire comes, the system can quickly and accurately collect information on the fire scene, intelligently select the best escape route, and guide people to escape correctly through hearing, vision and other senses by centrally controlling fire emergency lights in the form of light flow, voice and strobe. The system can also continuously inspect the operating status of intelligent emergency lights, detect lighting failures in time, and improve the reliability and emergency safety of the entire system.
Figure 1 shows the fire emergency lighting intelligent monitoring system with a dual ring bus topology, including upper monitoring computer, relay gateway and intelligent fire emergency lighting, which communicate with each other through a two-level RS-485 ring bus. All control commands are issued by the monitoring computer, transmitted to the relay gateway through the first-level bus loop, and then transmitted to each lamp by the relay gateway through the second-level bus loop network. After the lamp executes the command, it returns the execution result through the second-level and first-level loops in turn. In this system, the monitoring computer obtains fire source information from the fire alarm system (FANS), makes intelligent decisions to select the optimal escape route, transmits the command information to the relay gateway through the bus network, and then the relay gateway sends it to each lamp to indicate a safe and reliable escape route.
Figure 1 Fire emergency lighting system with dual ring bus.
The bus topology is simple, easy to control, and easy to expand, so most fire protection and access control systems currently use this topology. The ring network also has good reliability. If the ring bus is disconnected somewhere, it can be divided into two bus networks, connected to the two interfaces of the master station respectively, and the information exchange between the master station and the slave station can still be guaranteed, which greatly improves the reliability of network transmission. Another advantage of the two-level ring bus structure is that multiple loops can work in parallel, balancing and reducing the communication load on a single bus.
In an emergency, emergency lights and their monitoring systems have two power supply modes: centralized power supply and independent power supply. In an emergency, each lamp and all relay gateways in the centralized power supply system obtain working power from the same dedicated emergency power supply , while the working power of the independent power supply system is provided by the battery of each lamp or gateway. Therefore, it is very important to monitor the energy storage performance of the battery and ensure the availability of the battery. The battery voltage can be checked at any time through the control command, and it can also be checked regularly every month and every year.
1 Three-port gateway design
1.1 Overall structure
In the emergency light intelligent monitoring system shown in Figure 1, the relay gateway serves as the connection between the upper and lower loops and is a transfer station for exchanging data between the monitoring computer and the lamps. Its structure and function design are important contents of the entire system design.
Figure 2 is the overall structure of the independent power supply relay gateway. In the main power state, the working power is obtained through the mains. In the emergency state, the working power is provided by the built-in battery. The gateway has the functions of power conversion and battery charging and discharging control. In the entire fire emergency system, the relay gateway can query the status of the loop lamps through normal sampling and setting lamps. When communicating with the lower computer node, the first node ID and the function code and their data items and the data frame formed by the check code will be sent to the first node through the RS-485 bus, and then it will change to the receiving state, receiving the data frame sent by the first node and parsing it. When the lower computer node sends a fault alarm, the alarm information will be displayed on the LCD screen and the sound and light alarm will be activated. Since there is a timer in the monitoring host program , if the node fails to send back the data frame within a certain period of time, it will prompt an abnormality and remind relevant personnel to check. If no alarm information appears, the next node will be polled.
Figure 2 Structure diagram of an independently powered relay gateway.
The system uses the master-slave communication protocol, and both levels of the ring network use the RS-485 bus. In the system network topology, the relay gateway acts as the slave station of the first-level loop bus network, and is also the master station of the second-level loop. The relay gateway requires three serial ports, one of which is responsible for receiving the monitoring computer commands and sorting out the information of the lamps and the gateway itself and then feeding it back. The other two serial ports just form the loop master station, one for sending and one for receiving. If the loop is disconnected, both can be used for sending.
In this design, the STC12C5A32S2 (hereinafter referred to as STC12) microcontroller with two serial ports is selected as the main control chip. It has two asynchronous serial interfaces (UART), one synchronous serial port (SPI), and the same 256 B internal RAM as ordinary microcontrollers, as well as an extended 1 024 B external RAM, and 28 KB EEPROM . The large storage space facilitates the connection of lamps and the storage of large amounts of data [5]. The two serial ports of the STC12 microcontroller are designed as 1# and 2# RS-485 interfaces, which serve as the master station of the second-level loop. Another serial port needs to be extended to form 0# RS-485 interface, which serves as the slave station of the first-level loop.
1.2 Serial port expansion
There are two ways to expand the serial port: (1) Hardware expansion. Use the serial port expansion chip on the market (SP2338DP, GM8123 series).
Here, the frame format is not programmable [6]. (2) Software simulation method. According to the transmission format of serial communication, the timing of serial communication can be simulated by using the timer and the I/O port of the host to achieve the purpose of expanding the serial port. The start bit needs to be detected during the reception process, which can be processed using the query method or the interrupt method. During the reception and transmission process, the timing can be processed using either the query method or the timer interrupt method. However, this method requires a lot of CPU time and can only be used in applications with simple functions. It is not suitable for complex devices such as relay gateways.
Considering factors such as cost and performance, this design uses the synchronous serial port (SPI) of the STC12 microcontroller and another microcontroller with a serial port, STC11F04E (hereinafter referred to as STC11), to expand the serial port. The principle is shown in Figure 3. TX and RX are the data transmission signal and data receiving pins of the serial port respectively. RE is used to control the receiving or transmitting state of MAX485 .
The lower part of the figure shows the principle of the photoelectric isolation RS-485 interface. The three RS-485 interfaces use the same principle, but the working power supply of the MAX485 chip in the three interfaces is independent.
In Figure 3, SCK, MISO, and MOSI are the clock signal, master input signal, and master output signal of the SPI interface, respectively. The SPI interface of STC12 is defined to work in slave mode, and STC11 is used as the SPI master. Since the STC11 microcontroller does not have SPI function, the SPI master function must be simulated by software. Here, STC11 is only used as a transit station for byte data transmission, and no information frame verification, storage, or conversion is performed. The monitoring computer sends instructions, which are received by the serial port of STC11 and sent to STC12 through SPI for processing. STC11 then receives the return information through SPI, and then sends it to the monitoring computer through the serial port. In the design, STC12 tells STC11 to start the simulated SPI master function through the output falling edge of the SPI_TX pin, and reads a byte of data from the SPI interface register of STC12.
Figure 3 Circuit structure of using SPI to expand the serial port .
[page]
Figure 4 is a program flow chart of the MCU using the query method. RI and TI are the serial port receiving flag and sending flag respectively. TX_FLG = 0 means STC11 is in the receiving state, and TX_FLG = 1 means the sending state. The subroutine SPI_BYTE realizes the simulation of the SPI master station function.
Figure 4 Flowchart of the STC11 microcontroller with extended serial port.
1.3 Ring bus master station software structure
In the second-level loop communication, the relay gateway acts as the loop master, which is realized by two RS-485 ports consisting of serial port 1 and serial port 2 of the STC12 microcontroller. The three communication ports are equipped with independent receive (RX) buffer, transmit (TX) buffer and dedicated flag register.
The software structure of the master station for loop communication is shown in Figure 5. In normal operation, one of the two serial ports is used as a sender and the other as a receiver. The received data of the receiver is compared with the sent data of the sender. If they are equal, the loop bus is connected; otherwise, the bus has a circuit breaker fault, which is indicated by the flag bit LP_BRK=1.
Note: The serial port working cycle includes three parts: the serial port sending process, the waiting process for the lower computer to receive, and the serial port receiving process.
Figure 5 Ring bus master station communication flow chart.
When the loop bus is intact, the online lamps are always connected to both serial port 1 and serial port 2. When the loop is disconnected, send a command from serial port 2 (or serial port 1) to each lamp. If the correct response data is received, the lamp is recorded as being connected to the port, indicated by the flag ON_COM2 = 1 (or ON_COM1 = 1); if the response information times out or the returned information is incorrect, resend the same command data up to 3 times. If the correct response signal is still not received, it is determined that the lamp is not connected to the sending port, indicated by ON_COM2 = 0 (or ON_COM1 = 0). In this way, the location of the loop disconnection can be determined according to the different serial ports to which each lamp is connected.
When the loop is disconnected, both serial ports act as command senders, and the entire loop is divided into two single bus structures, which improves network transmission reliability.
The intelligent monitoring system of emergency lights is based on a two-level RS485 bus ring communication network. A three-port communication gateway is designed to realize the exchange of commands and status information between the monitoring computer and a large number of intelligent emergency lights. The monitoring computer manages the entire system, and the gateway is responsible for transmitting information sent to the intelligent emergency lights, and also feeds back the information received from the lamps to the monitoring computer.
In addition, the intelligent emergency sign lights in the loop can be directly controlled without the monitoring computer. After debugging, the preset functions are fully realized.
Previous article:Cortex-M3-based STM32 microcontroller handles advanced motor control methods
Next article:Design of shadow detection and removal method in pedestrian video detection
- Mir T527 series core board, high-performance vehicle video surveillance, departmental standard all-in-one solution
- Akamai Expands Control Over Media Platforms with New Video Workflow Capabilities
- Tsinghua Unigroup launches the world's first open architecture security chip E450R, which has obtained the National Security Level 2 Certification
- Pickering exhibits a variety of modular signal switches and simulation solutions at the Defense Electronics Show
- Parker Hannifin Launches Service Master COMPACT Measuring Device for Field Monitoring and Diagnostics
- Connection and distance: A new trend in security cameras - Wi-Fi HaLow brings longer transmission distance and lower power consumption
- Smartway made a strong appearance at the 2023 CPSE Expo with a number of blockbuster products
- Dual-wheel drive, Intellifusion launches 12TOPS edge vision SoC
- Toyota receives Japanese administrative guidance due to information leakage case involving 2.41 million pieces of user data
- 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!
- Rambus Launches Industry's First HBM 4 Controller IP: What Are the Technical Details Behind It?
- 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
- Ask a question about the make command
- Get it for free|Play with Espressif's new product ESP32-S3-Korvo-2 worth 400 yuan
- Design of Li-ion Battery Management System
- What is the resistance value of a 0Ω resistor? How much current can a 0Ω resistor pass?
- Features of Ad Hoc Networks
- APWM
- Power supply obstacles - practical experience
- Industrial computer case
- EEWORLD University Hall----Live Replay: Datang NXP-DNS Battery Management Chip Solution
- Static Electricity Protection Measures in Circuits