PLC dual-redundancy power supply module supporting checking of operation quality information and control method
By using a dual-redundant hardware architecture and control logic, the PLC power module solves the risk of single-power-supply failure and the defects of redundancy switching in PLC power modules. It achieves real-time fault location and rapid redundancy switching, reduces costs, and improves system reliability and maintenance efficiency.
Patent Information
- Application Number
- CN202511381395.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-25
- Publication Date
- 2025-12-12
AI Technical Summary
Existing PLC power modules suffer from issues such as the risk of single-power-supply failure, lack of fault diagnosis function in redundancy switching, and high cost of industrial UPS, resulting in low system reliability and maintenance efficiency.
Employing a dual-redundant hardware architecture and control logic, it enables real-time monitoring of power supply operation quality information, recording of abnormal data, and rapid redundancy switching. This includes the main and slave power supplies, microcontroller units, non-volatile memory units, and communication modules. Data acquisition and automatic switching are triggered by timer interrupts, reducing costs.
It enables real-time fault location, rapid redundancy switching, and low-cost power supply modules for PLC systems, improving system safety and maintenance efficiency while reducing user maintenance costs.
Smart Images

Figure CN121124309A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of industrial automation control technology, and in particular to a PLC dual-redundant power supply module and control method that supports viewing operational quality information. Background Technology
[0002] In industrial automation control systems, the PLC is the core control device, and the stability of its power supply directly determines the continuous operation capability of the entire control system. The power supply module is a key component for PLC power supply, so the reliability, operational quality monitoring capability, and fault response capability of the power supply module are of paramount importance.
[0003] In existing technologies, PLC power supply solutions have three major problems: 1. Downtime risk of single power supply module: Traditional PLCs generally use a single power supply module. Once the module experiences faults such as abnormal voltage, current overload, or excessive temperature, it will directly cause the PLC to shut down, leading to production line shutdown, loss of production data, and serious economic losses. 2. Diagnostic defects of diode redundancy switching: Some solutions use diodes to achieve power redundancy switching in order to improve reliability. However, this solution can only achieve "passive switching after a fault" and cannot provide fault diagnosis function. It cannot distinguish the fault type (such as voltage abnormality, current abnormality or temperature abnormality) and cannot locate the fault point, resulting in fault diagnosis taking up to several hours and maintenance efficiency being extremely low. 3. Cost dilemma of industrial UPS power supply: In scenarios with extremely high requirements for power reliability (such as chemical explosion protection and power dispatching), industrial UPS (uninterruptible power supply) is used as an external redundant power supply. Although there are industrial UPS on the market that support operation quality monitoring, the purchase cost of a single unit is high, and the annual maintenance cost accounts for 15%-20% of the purchase cost, which is not conducive to the promotion of small and medium-sized industrial scenarios.
[0004] Therefore, there is an urgent need for a PLC power supply module and control method that combines the four functions of "low cost", "real-time monitoring", "precise fault location" and "rapid redundancy switching" to fill the gap in existing technology. Summary of the Invention
[0005] The purpose of this invention is to overcome the problems of the prior art and provide a PLC dual-redundant power supply module and control method that supports viewing operational quality information. Through a dual-redundant hardware architecture and supporting control logic, it realizes real-time monitoring of power supply operational quality information, abnormal data storage and recording, redundancy switching in case of failure, and data export functions. The core objective is to solve the problems of "difficult fault location and invisible real-time status" of existing power supply modules. At the same time, it reduces costs through hardware integration design and efficient control strategies, ensures convenient maintenance, and meets the power supply requirements of industrial PLC systems.
[0006] The above objectives are achieved through the following technical solutions: A PLC dual-redundant power supply module and control method that supports viewing operational quality information includes a main power supply and a slave power supply that are redundant backups of each other, as well as control logic for data monitoring, abnormal data storage, data export and redundancy switching. The main power supply and the slave power supply have the same hardware structure, both including an AC input module, a rectification and filtering module, a power conversion module, a protection module, an analog signal acquisition module, an analog-to-digital converter (ADC), a microcontroller unit (MCU), a non-volatile memory unit, a temporary memory unit, a communication module, and a status indication module. The control logic includes: scanning the number of power modules after the PLC is powered on to determine the master and slave power supply identities; triggering the analog-to-digital converter (ADC) to collect power operation data through a timer interrupt, and storing the processed data in the temporary storage unit; storing abnormal data in the non-volatile storage unit; responding to the PLC's data requests through the communication module to export the data; and automatically switching the slave power supply to the master power supply and outputting the normal operating voltage when the voltage of the PLC's rack backplane drops to a preset threshold due to a master power supply failure.
[0007] Preferably, the microcontroller unit (MCU) is a GD32F3 series chip; the non-volatile memory unit is the MCU's on-chip NorFlash; the temporary storage unit is the MCU's on-chip static random access memory (SRAM); the communication module is a 485 communication module; and the status indicator module is an LED indicator, including a RUDA light for displaying redundancy status and a SYNC light for displaying operating status.
[0008] Preferably, the AC input module is a 220VAC input module; the rectifier and filter module is used to convert the AC power received by the AC input module into stable DC power; the power conversion module is used to regulate the power of the stable DC power to output the operating voltage of the main power supply and the slave power supply; the protection module includes a short circuit protection submodule, an over-temperature protection submodule, an under-voltage protection submodule and an over-current protection submodule.
[0009] Preferably, the master / slave power supply identification rule is as follows: after power-on, all power supply modules are independent power supplies by default, outputting the normal operating voltage of the PLC; when the PLC scans two power supply modules (redundant configuration), the first scanned power supply module is identified as the master power supply, and the second scanned module is identified as the slave power supply, and the slave power supply switches to outputting a preset voltage lower than the normal operating voltage; when the PLC scans one power supply module, the module maintains its independent power supply identification and outputs the normal operating voltage.
[0010] Preferably, the normal operating voltage of the main power supply is 24V, and the preset voltage of the slave power supply is 22V; when the main power supply fails, the preset voltage threshold of the rack backplane is 22V, and after the slave power supply switches to the main power supply, it outputs 24V to restore the normal operating voltage of the rack backplane.
[0011] Preferably, the analog-to-digital converter (ADC) collects power supply operation data including input voltage, output voltage, output current, rack backplane voltage, and MCU internal temperature; the processing and storage in the temporary storage unit specifically involves: converting the raw digital signal collected by the ADC into a true value reflecting the physical quantity using a preset formula, and then updating and storing the true value in the temporary storage unit in real time; the preset formula is: true value = ADC raw value × MCU reference voltage / ADC resolution, and the ADC resolution is not less than 12 bits.
[0012] Preferably, the abnormal data storage is specifically implemented as follows: when the microcontroller unit (MCU) determines that the power operation data collected and processed by the analog-to-digital converter (ADC) exceeds a preset threshold, the abnormal data is classified and stored in the non-volatile storage unit according to its type; the abnormal data types include abnormal input voltage data, abnormal output voltage data, abnormal output current data, abnormal backplane voltage data, and abnormal MCU internal temperature data; when the non-volatile storage unit is full, new abnormal data is written from the beginning, and only the maximum and minimum values exceeding the threshold within 1 second are recorded.
[0013] Preferably, the data export is specifically implemented as follows: after the communication module receives the 485 bus data request message sent by the PLC, the microcontroller unit (MCU) reads the current real-time data from the temporary storage unit and the historical abnormal data from the non-volatile storage unit, fills the data according to the preset message format and calculates the CRC checksum; the communication module switches to the sending mode to send the data to the PLC, clears the sending buffer after the sending is completed and switches back to the receiving mode, and enables the IDLE interrupt to avoid message packet loss or length overflow.
[0014] Preferably, the redundancy switching triggering method includes two types: First, the microcontroller unit (MCU) periodically sends heartbeat packets to query the main power supply status, and when a main power supply failure is detected, it sends a control message to switch the slave power supply to the main power supply; Second, when the slave power supply detects through the analog quantity acquisition module that the voltage of the rack backplane has dropped to a preset threshold, it directly and automatically switches to the main power supply and adjusts the output voltage; and before triggering the redundancy switching, the voltage signal of the rack backplane needs to be filtered, specifically by continuously detecting the voltage signal 10 times, with a 1-millisecond interval between each detection, and only when the 10 consecutive detection values are all at the preset threshold is the main power supply failure determined.
[0015] Preferably, it also includes mains power failure data protection logic: the power module is equipped with an onboard energy storage unit. When the mains power fails, the onboard energy storage unit provides emergency power to the microcontroller unit (MCU) and the non-volatile storage unit. The power supply duration is not less than 100 milliseconds, ensuring that the microcontroller unit (MCU) writes abnormal data with an input voltage of 0 and environmental variables (including upper and lower limits of parameter thresholds and data buffer indexes) into the non-volatile storage unit. The erase / write control strategy of the non-volatile storage unit is: when storing data in the current storage page, the next page is erased in advance, and the erase / write of each storage block is controlled evenly to extend the service life.
[0016] This invention provides a PLC dual-redundant power supply module and control method that supports viewing operational quality information. It can acquire power supply voltage, current, temperature, and other parameters in real time to provide early warnings of faults. Abnormal data is categorized and stored for accurate troubleshooting. The dual-redundant design allows for rapid switching to ensure the PLC does not crash, and its cost is far lower than that of industrial UPS systems. During power outages, a large onboard capacitor maintains power supply to ensure critical data is written to disk, significantly improving system safety, reliability, and maintenance efficiency. Specific advantages are as follows: 1. Real-time monitoring: The PLC can obtain real-time information such as voltage, current, and temperature of the power module at any time, promptly detect potential faults in the power module, perform preventive maintenance, and improve system safety.
[0017] 2. Precise Fault Location: Power supply anomaly information is stored and recorded. Even if the power module hardware is not damaged, all stored anomaly information can be retrieved, facilitating troubleshooting. Historical data analysis can also be used to assess the stability of the automated control system, aiding in future upgrades and maintenance.
[0018] 3. Improve system reliability: Adopting a dual redundant power supply design, when one power supply module fails, it can quickly switch to the other module to ensure the normal operation of the PLC system.
[0019] 4. Reduced costs: Compared to expensive industrial UPS power supplies that support viewing operational quality information, it has a lower cost; while reducing user maintenance costs, its functionality is not compromised. Attached Figure Description
[0020] Figure 1 This is a hardware block diagram of a PLC dual redundant power supply module and control method that supports viewing operational quality information, as described in this invention. Figure 2 This is a general design block diagram of a PLC dual redundant power supply module and control method that supports viewing operational quality information, as described in this invention. Figure 3 This is a flowchart of the power-on initialization process in the PLC dual redundant power supply module and control method that supports viewing operation quality information as described in this invention. Figure 4 This is a flowchart of the infinite loop handling process in the main function of a PLC dual redundant power supply module and control method that supports viewing operational quality information, as described in this invention. Detailed Implementation
[0021] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. The described embodiments are merely some, not all, of the embodiments of the present invention. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
[0022] This solution provides a PLC dual-redundant power supply module and control method that supports viewing operational quality information. It is suitable for industrial scenarios with high requirements for PLC (Programmable Logic Controller) power supply reliability and real-time monitoring of power supply status, such as intelligent manufacturing production lines, chemical process control, and power system monitoring. It can realize real-time acquisition of power supply operation data, anomaly recording, fault redundancy switching, and data export, ensuring the stable operation of the PLC system.
[0023] The technical solution of this invention consists of two parts: a "dual-redundant hardware architecture" and "full-process control logic." The hardware architecture is as follows: Figure 1 As shown, the correspondence between software functions and hardware peripherals is as follows: Figure 2 As shown, the power-on and operation process is as follows: Figure 3 and 4 As shown, details are as follows: 1. Dual-redundant hardware architecture, such as Figure 1 As shown, the hardware components of the main power supply and slave power supply (AC input module, rectification and filtering module, power conversion module, etc.), the connection relationship of each module, and the connection method with the PLC rack backplane are illustrated. It is clear that the main power supply outputs 24V by default and the slave power supply outputs 22V by default. The VDown signal detection unit is connected to the MCU GPIO pin, providing an intuitive reference for the dual-redundant hardware architecture.
[0024] The main power supply and the slave power supply have completely identical hardware structures, differing only in their default output voltage. Both include the following core modules, which work together to achieve the functions of "data monitoring, anomaly storage, data export, and redundancy switching": AC input module: Serves as the power supply input for the power module, receiving external AC power (220VAC) and suppressing mains voltage surges and lightning interference through a built-in surge protector, protecting the internal circuitry from impacts; Rectifier and filter module: Connected after the AC input module, it is used to convert the AC power received by the AC input module into stable DC power. The AC power is rectified into DC power through the rectifier bridge, and then the ripple in the DC voltage is filtered out by the filter capacitor and inductor. The output is a stable DC voltage with a ripple coefficient of ≤1%, which provides the power supply basis for the subsequent power conversion module. Power conversion module: Connected after the rectifier and filter module, its core function is to regulate the power of stable DC power to output the working voltage of the main power supply and the slave power supply. By controlling the on and off time of the power switching transistor (such as MOSFET) through the MCU, the DC voltage is stepped down or stabilized to meet the PLC's power supply voltage requirements. Protection Module: Connected in parallel between the power conversion module and the subsequent output circuit, this module provides multi-dimensional hardware protection for the power supply module, including a short-circuit protection submodule, an over-temperature protection submodule, an under-voltage protection submodule, and an over-current protection submodule. The short-circuit protection submodule detects a short circuit in the main circuit using a current sensor, triggering the power switch to turn off. The over-temperature protection submodule detects the internal temperature of the module using a thermistor, stopping the output when the temperature exceeds a threshold (e.g., 85°C). The under-voltage protection submodule detects an under-voltage input or output voltage (e.g., input voltage < 180VAC) and cuts off the output. The over-current protection submodule detects an output current exceeding a threshold (e.g., > 5A), limiting the current or cutting off the output to prevent hardware damage. Analog signal acquisition module: used to acquire key physical parameters of power supply operation, including input voltage, output voltage, output current, PLC rack backplane voltage and MCU internal temperature. Voltage signals are acquired through voltage sampling resistors, current signals are acquired through current sampling resistors, and temperature signals are acquired through temperature sensors (mounted on the MCU surface). All acquired signals are continuously changing analog signals. Analog-to-digital converter (ADC): Connected between the analog signal acquisition module and the MCU, it is used to convert the "analog signal" output by the analog signal acquisition module into a "digital signal" that the MCU can recognize. The ADC must have a resolution of no less than 12 bits to ensure sampling accuracy and avoid the impact of signal conversion errors on data accuracy. Microcontroller Unit (MCU): As the core control unit of the power module, it is electrically connected to the ADC, non-volatile memory unit, communication module, status indicator module, and power conversion module, and is responsible for coordinating the work of each module to realize core functions such as data processing (such as ADC digital signal conversion), status control (such as LED indicator switching and power module voltage regulation), and task scheduling (such as interrupt handling and message queue management). Non-volatile memory unit: used for long-term storage of abnormal data and environmental variables (such as upper and lower limits of parameter thresholds, data buffer indexes), data is not lost after power failure - using MCU on-chip NorFlash, no external storage chip is required, reducing costs; and when NorFlash is full, new abnormal data is written from the beginning to overwrite, ensuring that the storage function is continuously available; Temporary storage unit: Used to temporarily store power operation data after real-time processing. It is characterized by fast read and write speed and is suitable for real-time monitoring requirements. It is the on-chip SRAM (Static Random Access Memory) of the MCU. The MCU will refresh the data in the SRAM in real time to ensure that it always saves the latest operating parameters. Communication module: Used to realize bidirectional data interaction between the power supply module and the PLC. It is responsible for receiving data request messages sent by the PLC and sending real-time data and historical abnormal data to the PLC. The 485 communication module supports half-duplex communication. Before sending data, the CRC checksum needs to be calculated to avoid message loss or length overflow. Status indicator module: Used to intuitively display the operating status and redundancy status of the power module, so that on-site maintenance personnel can quickly judge the status. It consists of LED indicators, including the RUDA redundancy light (indicating redundancy establishment, normal or fault status) and the SYNC synchronization light (indicating whether the module is working normally or abnormally). Onboard energy storage unit: This is an emergency power supply component for when the mains power fails. It is used to provide short-term power to the MCU and non-volatile memory unit. The large onboard capacitor can maintain power supply for about 100 milliseconds, ensuring that critical data (such as abnormal values with an input voltage of 0 and environmental variables) can be written to the non-volatile memory unit when power is lost, thus avoiding data loss.
[0025] 2. Full-process control logic, such as Figure 2-4 As shown; where Figure 2 The demonstration shows the one-to-one correspondence between the four core functions of the power module (data monitoring, abnormal data storage, data export, and redundancy switching) and the MCU peripherals (ADC, NorFlash, 485 communication module, and VDown signal detection unit), clearly demonstrating the "function-hardware" relationship logic. Figure 3 The startup process after the module is powered on is shown in the order of "peripheral initialization → GPIO slot number reading → LED status setting → message queue initialization → NorFlash environment variable reading → 485 receive mode setting", clarifying the execution conditions and processing methods of each step. Figure 4 The demonstration module displays the task scheduling logic during normal operation, including message queue judgment, processing flow of two types of messages, VDown signal judgment and processing, and judgment of NorFlash early erasure, fully covering the core aspects of software operation.
[0026] The control logic revolves around "master-slave identity determination - real-time data monitoring - anomaly storage - data export - redundancy switching - power failure protection," with each step closely interconnected, as detailed below: (1) Determining the identity of master and slave power sources By default, each power module is an independent power supply after power-on, outputting the normal operating voltage for the PLC. After power-on, the PLC scans the number of power modules to determine master / slave status. If the number of scans is 2 (redundant configuration): the first scanned power module is identified as the main power supply and maintains the normal operating voltage; the second scanned module is identified as the slave power supply and switches to output a preset voltage lower than the normal operating voltage (the normal operating voltage of the main power supply is 24V, and the preset voltage of the slave power supply is 22V). If the scan quantity is 1 (independent configuration): This module maintains its independent power supply status and outputs normal operating voltage; In uninterrupted power supply mode: when a new module is added to the original main power supply location, the new module becomes the slave power supply; when a redundant power supply is subsequently added to the original independent module, the original module becomes the main power supply.
[0027] (2) Real-time data monitoring (based on timer interrupt) To ensure real-time monitoring, the ADC is periodically sampled using a timer interrupt. The process is as follows: The timer triggers an interrupt at a fixed period (e.g., 100 milliseconds). After the interrupt is triggered, the MCU controls the ADC to acquire the input voltage, output voltage, output current, backplane voltage, and MCU temperature signal of the analog acquisition module. After the ADC converts the acquired analog signal into a digital signal, the MCU uses a preset formula (true value = ADC acquired original value × MCU reference voltage / ADC resolution) to convert the digital signal into a true value reflecting the physical quantity. The converted actual values are refreshed and stored in a temporary storage unit (SRAM) in real time, providing basic data for subsequent status judgment and data export; The MCU compares the actual value with the preset thresholds (such as voltage 22-26V, temperature -40-85℃) in the non-volatile memory unit. If the data is abnormal, it is temporarily saved and the status indicator module (SYNC light) is switched to the abnormal state; if the data is normal, the SYNC light is restored to the normal state.
[0028] (3) Abnormal data storage When the MCU detects that the running data exceeds a preset threshold, it initiates the abnormal data storage process: Abnormal data is classified according to the type of abnormality (input voltage abnormality, output voltage abnormality, output current abnormality, backplane voltage abnormality, MCU temperature abnormality) and stored in the corresponding area of the non-volatile memory unit (NorFlash). The stored content includes the numerical value of the abnormal data and the timestamp of the occurrence, and only records the maximum and minimum values that exceed the threshold within each second to avoid storing redundant data; When the non-volatile storage unit is full, new abnormal data is written from the starting address of the storage area to overwrite the data, ensuring that the storage function is not interrupted. To address the characteristic of non-volatile memory cells (NorFlash) that "can only be written from 1 to 0, and the entire page needs to be erased to write from 0 to 1", the MCU erases the next page in advance when storing data on the current memory page; at the same time, it controls the uniform writing and erasing of each memory block to avoid overwriting of a single block and extend the life of the memory cell.
[0029] (4) Data export The communication module (485 module) responds to data requests from the PLC, enabling the export of real-time data and historical anomaly data. The PLC sends a data request message to the power module via the 485 bus, and the communication module receives the message and transmits it to the MCU. Depending on the message type, the MCU reads current real-time data from the temporary storage unit (SRAM) or historical abnormal data from the non-volatile storage unit (NorFlash); Data is filled according to the preset message format (distinguishing between five types: reply module channel, identity update confirmation, time synchronization confirmation, threshold setting confirmation, and data reply), and the CRC checksum is calculated and appended to the end of the message; The communication module switches to transmit mode and sends the filled message to the PLC. After transmission is complete, the transmit buffer is cleared, the module switches back to receive mode and enables the IDLE interrupt, waiting for the next request.
[0030] (5) Redundancy switching When the main power supply fails, two triggering methods are used to switch from the power supply to the main power supply, ensuring that the PLC's power supply is uninterrupted: Method 1 (Heartbeat Detection): The MCU periodically sends heartbeat packets to query the status of the main power supply. If a main power supply failure is detected (such as no response to the heartbeat packet timeout), a control message is sent to the slave power supply to switch its status to the main power supply. At the same time, the power conversion module of the slave power supply is controlled to output the normal operating voltage (24V). Method 2 (Backplane Voltage Detection): The backplane voltage of the PLC rack is detected in real time from the power supply through the analog signal acquisition module. When the backplane voltage drops to the preset threshold (22V), the main power supply is automatically switched directly and the power conversion module outputs 24V voltage to pull the backplane voltage back to the normal range. Signal filtering: To avoid false switching caused by environmental interference, the backplane voltage signal needs to be filtered before switching - the voltage signal is continuously detected 10 times, with a 1-millisecond interval between each detection. Only when the 10 consecutive detection values are all at the preset threshold is the main power supply fault determined and the switching is triggered.
[0031] (6) Mains power outage data protection When the mains power fails, critical data is protected through onboard energy storage units (large capacitors): After the mains power fails, the onboard energy storage unit immediately provides emergency power to the MCU and non-volatile memory (NorFlash) for a duration of no less than 100 milliseconds; After the MCU detects that the input voltage is 0, it quickly writes the value of "Input voltage abnormal (0V)" and the timestamp to NorFlash; If the abnormal data is the last data in the current storage page, record the page index that needs to be erased (to be erased after the next power-on). Finally, the environment variables (parameter threshold upper and lower limits, data buffer index) are written to NorFlash (data is written to disk). After completion, the power module stops working until it is powered on and reset.
[0032] As a specific embodiment of this solution, it includes: Step (1): Power-on initialization specific steps, such as Figure 3 As shown Step (101): Initialize the relevant peripherals, such as GPIO, UART, ADC, etc.
[0033] Step (102): Read the GPIO slot number. If the installation position is incorrect, the power module will not work and the LEDs will not light up.
[0034] Step (103): Set the RUDA redundancy light status to redundancy establishment in progress, and set the SYNC synchronization light status to power module working normally.
[0035] Step (104): Initialize the message queue.
[0036] Step (105): Read the variables stored in Flash, such as the upper and lower limits of the parameter threshold, the index and length in the buffer, etc.
[0037] Step (106): Set the 485 mode to receive and enable IDLE interrupt.
[0038] Step (2): The main function loops infinitely to receive and process messages, such as... Figure 4 As shown.
[0039] Step (201): Determine if the message queue is empty. If it is not empty, proceed to the next step. Otherwise, keep looping to determine the message queue.
[0040] Step (202): Obtain the message type. There are two types of messages: one is the message for sending serial port packets, and the other is the message for storing abnormal data records.
[0041] Step (203): If it is a serial port message, continue to obtain the message type. There are five message types: reply module channel message, reply identity update confirmation message, reply time synchronization confirmation message, reply threshold upper and lower limit setting confirmation message, and reply data message. Fill in different data according to different message types and calculate the CRC checksum. Switch 485 mode to send mode, clear the send buffer after sending, and then set 485 mode to receive mode, enabling the receive interrupt.
[0042] Step (204): If it is a message recording abnormal data, continue to retrieve which type of abnormal data was recorded. There are five types of abnormal data: input voltage abnormal data, output voltage abnormal data, output current abnormal data, backplane voltage abnormal data, and temperature abnormal data. Different types of data are stored in different areas of NorFlash. Figure 4 As shown. Calculate the address where the current data is stored in NorFlash, record the data and timestamp, and update the index. Finally, determine if the next data is on a new page; if so, it needs to be erased beforehand.
[0043] Step (205): Determine if there is a VDown signal. If there is a VDown signal, pause message queue processing. If the VDown signal is invalid, resume message queue processing.
[0044] Step (3): Timer interrupt task handling: Step (301): Determine if there was any abnormal data in the previous second. Flash only records the maximum and minimum values exceeding the threshold within 1 second. If so, send a message queue to main.
[0045] Step (302): Collect ADC data and perform formula conversion.
[0046] Step (303): Check if the data exceeds the threshold. If the value is abnormal, temporarily save it and set the corresponding LED status. If the value is normal, restore the LED to the normal state. If the backplane voltage drops to 22V, directly switch the output voltage to 24V to pull the backplane voltage back to 24V.
[0047] Step (4): VDown signal processing: Step (401): Detect the VDown GPIO pin 10 times consecutively, with a 1-millisecond interval between each detection. If the pin is high for all 10 consecutive detections, the VDown signal is considered valid, and the valid flag is set.
[0048] Step (402): If the main function reads the valid VDown flag and there is no message being processed or the previous message has been processed, then pause message queue processing and set the pause message queue flag.
[0049] Step (403): After confirming that there are no pending messages, the VDown signal jumps to the VDown processing function, writes the input voltage of 0 and the timestamp to the Flash. If the data is the last page, the page index to be erased is recorded, and the page is erased again on the next power-on. Finally, the environment variables are written to the Flash (disk write), and the power module stops working until it is reset by power-on.
[0050] The above description is merely illustrative of the embodiments of the present invention and is not intended to limit the present invention. For those skilled in the art, any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A PLC dual-redundant power supply module and control method that supports viewing operational quality information, characterized in that, This includes a main power supply and a slave power supply that are redundant backups of each other, as well as control logic for data monitoring, abnormal data storage, data export and redundancy switching; The main power supply and the slave power supply have the same hardware structure, both including an AC input module, a rectification and filtering module, a power conversion module, a protection module, an analog signal acquisition module, an analog-to-digital converter (ADC), a microcontroller unit (MCU), a non-volatile memory unit, a temporary memory unit, a communication module, and a status indication module. The control logic includes: scanning the number of power modules after the PLC is powered on to determine the master and slave power supply identities; triggering the analog-to-digital converter (ADC) to collect power operation data through a timer interrupt, and storing the processed data in the temporary storage unit; storing abnormal data in the non-volatile storage unit; responding to the PLC's data requests through the communication module to export the data; and automatically switching the slave power supply to the master power supply and outputting the normal operating voltage when the voltage of the PLC's rack backplane drops to a preset threshold due to a main power supply failure.
2. The PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information as described in claim 1, characterized in that, The microcontroller unit (MCU) is a GD32F3 series chip; the non-volatile memory unit is the MCU's on-chip NorFlash; the temporary storage unit is the MCU's on-chip static random access memory (SRAM); the communication module is a 485 communication module; and the status indicator module is an LED indicator, including a RUDA light for displaying redundancy status and a SYNC light for displaying operating status.
3. The PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information as described in claim 1, characterized in that, The AC input module is a 220VAC input module; the rectifier and filter module is used to convert the AC power received by the AC input module into stable DC power; the power conversion module is used to regulate the power of the stable DC power to output the operating voltage of the main power supply and the slave power supply; the protection module includes a short circuit protection submodule, an over-temperature protection submodule, an under-voltage protection submodule and an over-current protection submodule.
4. The PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information as described in claim 1, characterized in that, The master / slave power supply identification rules are as follows: after power-on, all power supply modules are independent power supplies by default, outputting the normal operating voltage of the PLC; when the PLC scans two power supply modules, the first scanned power supply module is identified as the master power supply, and the second scanned power supply module is identified as the slave power supply, and the slave power supply switches to outputting a preset voltage lower than the normal operating voltage; when the PLC scans one power supply module, the module maintains its independent power supply identity and outputs the normal operating voltage.
5. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 4, characterized in that, The normal operating voltage of the main power supply is 24V, and the preset voltage of the slave power supply is 22V. When the main power supply fails, the preset voltage threshold of the rack backplane is 22V. After the slave power supply switches to the main power supply, it outputs 24V to restore the normal operating voltage of the rack backplane.
6. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 2, characterized in that, The analog-to-digital converter (ADC) collects power supply operation data including input voltage, output voltage, output current, rack backplane voltage, and MCU internal temperature. The process of storing the processed data in the temporary storage unit specifically involves converting the original digital signal acquired by the analog-to-digital converter (ADC) into a real value reflecting the physical quantity using a preset formula, and then updating and storing the real value in the temporary storage unit in real time. The preset formula is: True value = ADC acquired original value × MCU reference voltage / ADC resolution, and the ADC resolution is not less than 12 bits.
7. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 1, characterized in that, The specific implementation of the abnormal data storage is as follows: when the microcontroller unit (MCU) determines that the power operation data collected and processed by the analog-to-digital converter (ADC) exceeds a preset threshold, it stores the abnormal data in the non-volatile memory unit according to its type; the abnormal data types include abnormal input voltage data, abnormal output voltage data, abnormal output current data, abnormal backplane voltage data, and abnormal MCU internal temperature data; when the non-volatile memory unit is full, new abnormal data is written from the beginning, and only the maximum and minimum values exceeding the threshold within 1 second are recorded.
8. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 1, characterized in that, The specific implementation of the data export is as follows: after the communication module receives the 485 bus data request message sent by the PLC, the microcontroller unit (MCU) reads the current real-time data from the temporary storage unit and the historical abnormal data from the non-volatile storage unit, fills the data according to the preset message format and calculates the CRC checksum; the communication module switches to the sending mode to send the data to the PLC, clears the sending buffer after the sending is completed and switches back to the receiving mode, and enables the IDLE interrupt to avoid message packet loss or length overflow.
9. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 1, characterized in that, The redundancy switching is triggered in two ways: In the first method, the microcontroller unit (MCU) periodically sends heartbeat packets to query the main power supply status. When a main power supply failure is detected, a control message is sent to switch the power supply from the main power supply to the main power supply. The second method involves the power supply automatically switching to the main power supply and adjusting the output voltage when the voltage of the rack backplane is detected by the analog acquisition module to drop to a preset threshold. Furthermore, the voltage signal of the rack backplane needs to be filtered before triggering the redundancy switch.
10. A PLC dual-redundant power supply module and control method for supporting the viewing of operational quality information according to claim 1, characterized in that, It also includes mains power failure data protection logic: the power module is equipped with an onboard energy storage unit. When the mains power fails, the onboard energy storage unit provides emergency power to the microcontroller unit (MCU) and the non-volatile storage unit. The power supply duration is not less than 100 milliseconds, ensuring that the microcontroller unit (MCU) writes abnormal data with an input voltage of 0 and environmental variables into the non-volatile storage unit. The erase / write control strategy for the non-volatile storage unit is as follows: when storing data on the current storage page, the next page is erased in advance, and at the same time, each storage block is controlled to be erased and written evenly to extend its service life.
Citation Information
Cited By
Redundant communication control system and method of power unit
CN121596720A
