Composite power management method for power controller

By employing a composite power management method with a power controller, the system automatically selects between battery power or an external DC power source, thus resolving the issue of insufficient output power in the charging circuit. This ensures stable power supply to the equipment under various conditions and enhances the reliability and safety of the power system.

CN122137088APending Publication Date: 2026-06-02SHANGHAI LIUJIYI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHANGHAI LIUJIYI TECHNOLOGY CO LTD
Filing Date
2026-03-12
Publication Date
2026-06-02

Smart Images

  • Figure CN122137088A_ABST
    Figure CN122137088A_ABST
Patent Text Reader

Abstract

This invention relates to a composite power management method for a power controller, comprising the following steps: Step 1, during the power-on initialization phase, the system prioritizes automatic selection of battery power to ensure that the power requirements of the device are met. If the battery is faulty or not connected, the system automatically selects direct power supply from an external DC power source. Step 2, after the power-on initialization phase is completed, the device enters the operation phase. The device power supply system starts, the microcontroller unit begins operation, and, in conjunction with the composite power management circuit of the power controller, ensures continuous power supply to the device from either the battery or the external DC power source. This invention achieves automatic selection of multiple power sources, effectively avoiding the limitation of device output power driven by charging circuits.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a composite power management method, specifically to a composite power management method for a power controller. Background Technology

[0002] In applications where batteries are used as the power source, if there is an abnormality in the battery charging and discharging circuit or the battery itself, the equipment will be unable to operate normally due to the power supply failure.

[0003] To improve the reliability of the equipment's power supply system, a common approach is to use a parallel power supply scheme between the charging power supply and the battery. This scheme allows the charging circuit to power the equipment independently after the battery is removed. However, this power supply scheme is not applicable when the output power of the charging circuit is lower than the battery's discharge power.

[0004] Taking the power supply scenario of motor drive controller as an example, when the motor is stationary, the charging power can meet the standby operation requirements of the drive controller; however, when the motor starts running, the required power increases significantly, and the output power of the charging circuit cannot support the normal operation of the motor. Summary of the Invention

[0005] To address the aforementioned problems in the existing technology, the present invention provides a composite power management method for a power controller.

[0006] To solve the above-mentioned technical problems, the present invention adopts the following technical solution: a composite power management method for a power controller, characterized in that the composite power management method for the power controller employs a composite power management circuit for the power controller, and the composite power management method for the power controller includes the following steps: Step 1, power-on initialization phase: prioritize automatic selection of battery power supply to ensure that the power requirements of the equipment are met. If the battery is abnormal or not connected, automatically select direct power supply from external DC power supply. Step two: After the power-on initialization phase is completed, the equipment enters the operation phase. The equipment power supply system starts up, the microcontroller unit starts running, and the composite power management circuit of the power controller switches the priority of continuous power supply from the battery or external DC power source as needed.

[0007] Preferably, the composite power management circuit includes a power input interface, an output interface, a charging circuit, a relay, a first resistor, a second resistor, a third resistor, a first transistor, a second transistor, and a third transistor. The power input interface includes an external DC power input positive terminal, a battery input positive terminal, and a common terminal for connecting the external DC power supply and the battery after they share a common ground. The output interface includes an output positive terminal and an output negative terminal. The relay includes a relay coil and relay contacts, and the relay contacts include normally open contacts and normally closed contacts. The two ends of the first resistor are respectively connected to the external DC power input positive terminal and the base of the first transistor. The two ends of the resistor are connected to the positive input terminal of the battery and the base of the second transistor, respectively. The two ends of the third resistor are connected to a general-purpose input / output interface of the microcontroller and the base of the third transistor, respectively. The base of the first transistor and the first resistor are both connected to the collector of the second transistor. The base of the second transistor and the second resistor are both connected to the collector of the third transistor. The emitters of the first, second, and third transistors are all grounded. The relay coil is connected to the collector of the first transistor. The output interface, the positive input terminal of the external DC power supply, and the positive input terminal of the battery are all connected to the relay contacts.

[0008] Preferably, the relay contacts are connected to a charging circuit. When the composite power management circuit of the power controller preferentially selects battery power, the charging circuit is a charging management unit that supplies power to the battery from an external DC power source.

[0009] Preferably, step one specifically adopts the following mode: Mode 1, when connected to a battery: Regardless of whether an external DC power supply is connected, the voltage at the positive input terminal of the battery is high. This high level causes the second transistor to generate a base current and conduct, pulling the collector potential of the second transistor down to a low level. This low level clamps the base potential of the first transistor, causing the first transistor to cut off. The relay coil does not operate due to de-energization, and its corresponding relay contacts remain in normal operation. At this time, the positive input terminal of the battery is connected to the positive output terminal of the output interface through the normally closed contact of the relay contact. The positive and negative output terminals of the output interface correspond to the positive terminal of the battery and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the battery. Mode 2, when connected to an external DC power supply and not connected to a battery: The voltage at the positive input terminal of the external DC power supply is high. This high level provides a base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct; the relay coil is energized accordingly, and its corresponding relay contact is activated; at this time, the positive input terminal of the external DC power supply is connected to the positive output terminal through the normally open contact of the relay contact. The positive and negative output terminals of the output interface correspond to the positive input terminal of the external DC power supply and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the external DC power supply.

[0010] Preferably, when the general-purpose input / output interface of the microcontroller outputs a high level, this level signal provides a base bias voltage to the third transistor via the third resistor, causing the third transistor to generate a base current and conduct. After the third transistor is turned on, its collector potential is pulled down to a low level. This low level clamps the base potential of the second transistor, ensuring that the second transistor is in the off state. At this time, the base voltage of the first transistor is not clamped by the collector level of the second transistor and enters the following two operating states: In operating state one, if the external DC power supply is working normally and its external DC power supply input positive terminal and the common terminal connected after the external DC power supply and the battery share a common ground are both correctly connected, the high level of the external DC power supply input positive terminal will provide a base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct; the relay coil will then be energized, and its corresponding relay contacts will engage, specifically manifested as the normally open contact closing and the normally closed contact opening; in this state, the external DC power supply input positive terminal establishes a path with the output positive terminal through the normally open contact of the relay contacts, and the output positive terminal and output negative terminal of the output interface are connected to the external DC power supply input positive terminal and the common terminal connected after the external DC power supply and the battery share a common ground, respectively, and the equipment is powered by the external DC power supply; In the second working state, if the external DC power supply is abnormal, that is, there is no voltage output at the positive terminal of the external DC power supply input, the relay coil cannot be energized and the relay contacts remain in the initial state. At this time, the positive terminal of the battery input is connected to the positive terminal of the output interface through the normally closed contact of the relay contacts. The positive and negative terminals of the output interface correspond to the positive terminal of the battery input and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The equipment is in battery power supply mode.

[0011] Preferably, the microcontroller unit is connected to a human-machine interface. The microcontroller unit includes an analog-to-digital conversion pin, which is connected to a fourth resistor and a fifth resistor. The fourth resistor and the fifth resistor are connected in series, and the fifth resistor is connected to the positive input terminal of the battery.

[0012] Preferably, when the control general-purpose input / output interface changes from a high output level to a low output level or a high output impedance, the base bias voltage of the third transistor disappears, and the third transistor is turned off. At this time, the base voltage of the second transistor is not clamped by the collector level of the third transistor and enters the following two operating states: In operating state three, if the voltage at the positive input terminal of the battery is normal, the high level at the positive input terminal will cause the second transistor to generate a base current and conduct, pulling its collector potential down to a low level. This low level will clamp the base potential of the first transistor, causing the first transistor to be cut off. The relay coil will not operate due to de-energization, and the relay contacts will remain in normal condition. The positive input terminal of the battery will be connected to the positive output terminal of the output interface through the normally closed contact of the relay contacts. The positive and negative output terminals of the output interface correspond to the positive input terminal of the battery and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The equipment is powered by the battery. In operating state four, if the voltage at the positive terminal of the battery input is abnormal, the base bias voltage of the second transistor disappears, and the second transistor is cut off. At this time, the base voltage of the first transistor is not clamped by the collector level of the second transistor. The high level at the positive terminal of the external DC power supply input continuously provides the base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct. The relay coil remains energized, and its relay contacts engage, specifically manifested as the normally open contacts closing and the normally closed contacts opening. The positive and negative terminals of the output interface are connected to the positive terminal of the external DC power supply input and the common terminal connected after the external DC power supply and the battery share a common ground, respectively, and the equipment remains powered by the external DC power supply.

[0013] Compared with the prior art, the present invention has at least the following advantages: First, this invention enables automatic selection of multiple power sources. During the power-on initialization phase, it prioritizes and automatically selects battery power to ensure that the power requirements of the equipment are met. When the battery is abnormal or not connected, it automatically selects to directly power the equipment from an external DC power source, effectively avoiding the limitation of the output power of the equipment driven by the charging circuit.

[0014] Second, during the stable operation phase of the equipment, this patent achieves steady-state uninterrupted power supply under reasonable control logic. In addition, by switching to external DC power supply priority, the charging and discharging circuits of the battery can be completely disconnected, further avoiding the safety hazards caused by the continuous charging of faulty batteries, and effectively improving the safety performance of the power system.

[0015] Third, throughout the entire process from power initialization to stable equipment operation, the power management circuit designed in this patented technology can achieve the following precise control logic: the circuit automatically prioritizes battery power supply; if the external DC power supply is normal, it charges the battery normally; when an abnormality is detected in the battery, the external DC power supply switching mechanism is triggered and the system switches to external DC power supply; if the external DC power supply is also in an abnormal state, the switching operation will fail, and the system will maintain the battery power supply mode; after the battery fault is resolved, the circuit supports the battery priority power supply control function. This patented technology ensures the scientific and rational nature of the control logic during the power switching process. Furthermore, under any operating state of the equipment, the automatic switching control circuit integrates a hidden function for power effectiveness detection, eliminating the need for additional detection modules. As long as either the external DC power supply or the battery power supply remains normal, uninterrupted and stable power supply to the equipment can be guaranteed. In summary, this patented technology, based on a simplified circuit topology design, achieves the core function of power switching while simultaneously considering the optimized design of control logic and the function of power supply voltage effectiveness detection. It realizes a simple and reliable design that integrates voltage detection, logic optimization, and power switching, effectively improving the stability and practicality of power management. Attached Figure Description

[0016] To more clearly illustrate the specific embodiments of the present invention, the accompanying drawings used in the specific embodiments will be briefly described below. In all the drawings, the elements or parts are not necessarily drawn to scale.

[0017] Figure 1 This is a circuit diagram of the circuit used in the composite power management method of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be described in detail below. Obviously, the described embodiments are merely some embodiments of this invention, and not all embodiments. Based on the embodiments of this invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this invention.

[0019] In view of the shortcomings of the prior art, the inventors of this invention, through long-term research and extensive practice, have proposed the technical solution of this invention. The technical solution, its implementation process, and principles will be further explained below with reference to the accompanying drawings and specific implementation examples in the embodiments of this application.

[0020] See Figure 1The present invention discloses a composite power management method for a power controller. This method employs a composite power management circuit within the power controller and includes the following steps: Step 1, power-on initialization phase: prioritizes automatic selection of battery power supply to ensure that the power requirements of the equipment are met. If the battery is abnormal or not connected, it will automatically select direct power supply from an external DC power source to effectively avoid the output power limitation of the equipment driven by the charging circuit. Step two: After the power-on initialization phase is completed, the device enters the operation phase. The device power supply system starts up, and the micro controller unit (MCU) begins to run. In conjunction with the composite power management circuit of the power controller, it switches the priority of continuous power supply from the battery or external DC power source as needed.

[0021] The composite power management circuit includes a power input interface P1, an output interface P2, a charging circuit, a relay, a first resistor R1, a second resistor R2, a third resistor R3, a first transistor Q1, a second transistor Q2, and a third transistor Q3. The power input interface P1 includes an external DC power input positive terminal DC, a battery input positive terminal BAT, and a common terminal COM for the external DC power supply and battery grounding. The output interface P2 includes an output positive terminal OUT+ and an output negative terminal OUT-. The relay includes a relay coil Y1A and a relay contact Y1B, with Y1B consisting of a normally open contact and a normally closed contact. The two ends of the first resistor R1 are connected to the external DC power input positive terminal DC and the base of the first transistor Q1, respectively. The second resistor R1... The two ends of resistor R2 are connected to the positive input terminal BAT of the battery and the base of the second transistor Q2, respectively. The two ends of the third resistor R3 are connected to the general-purpose input / output interface GPIO1 of the MCU and the base of the third transistor Q3, respectively. The base of the first transistor Q1 and the first resistor R1 are both connected to the collector of the second transistor Q2. The base of the second transistor Q2 and the second resistor R2 are both connected to the collector of the third transistor Q3. The emitters of the first transistor Q1, the second transistor Q2, and the third transistor Q3 are all grounded. The relay coil Y1A is connected to the collector of the first transistor Q1. The output interface P2, the positive input terminal DC of the external DC power supply, and the positive input terminal BAT of the battery are all connected to the relay contact Y1B.

[0022] A capacitor C is provided between the positive output terminal OUT+ and the negative output terminal OUT- of the output interface P2. The capacitor C is used to ensure the continuous power supply of the microcontroller MCU during the switching between external DC power supply and battery power supply, so as to avoid power failure.

[0023] The relay contact Y1B is connected to a charging circuit. When the composite power management circuit of the power controller preferentially selects the battery for power supply, the charging circuit is a charging management unit that supplies power to the battery from an external DC power source. A typical charging circuit includes three working modes: trickle charging, constant current charging, and constant voltage charging.

[0024] Step one specifically adopts the following pattern: Mode 1, when connected to a battery: Regardless of whether an external DC power supply is connected, the voltage at the positive input terminal BAT of the battery is high. This high level causes the second transistor Q2 to generate a base current and conduct, pulling the collector potential of the second transistor Q2 down to a low level. This low level clamps the base potential of the first transistor Q1, causing the first transistor Q1 to be cut off. The relay coil Y1A does not operate due to de-energization, and its corresponding relay contact Y1B remains in normal condition, i.e., the normally open contact is open and the normally closed contact is closed. At this time, the positive input terminal BAT of the battery is connected to the positive output terminal OUT+ of the output interface P2 through the normally closed contact of the relay contact Y1B. The positive output terminal OUT+ and the negative output terminal OUT- of the output interface P2 correspond to the positive terminal BAT (positive) of the battery and the common terminal COM (negative) of the external DC power supply connected to the battery after sharing a common ground. The device is powered by the battery. Mode 2, when connected to an external DC power supply and not connected to a battery: The voltage of the positive DC input of the external DC power supply is high. This high level provides a base bias voltage to the first transistor Q1 through the first resistor R1, causing the first transistor Q1 to generate a base current and conduct; the relay coil Y1A is energized accordingly, and its corresponding relay contact Y1B is activated, that is, the normally open contact closes and the normally closed contact opens; at this time, the positive DC input of the external DC power supply is connected to the positive output OUT+ through the normally open contact of the relay contact Y1B. The positive output OUT+ and negative output OUT- of the output interface P2 correspond to the positive DC input of the external DC power supply and the common terminal COM connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the external DC power supply.

[0025] When the general purpose input / output interface GPIO1 of the microcontroller unit (MCU) outputs a high level, this signal provides a base bias voltage to the third transistor Q3 via the third resistor R3, causing Q3 to generate a base current and conduct. After Q3 conducts, its collector potential is pulled down to a low level. This low level clamps the base potential of the second transistor Q2, ensuring that Q2 is in the off state. At this time, the base voltage of the first transistor Q1 is not clamped by the collector level of the second transistor Q2, and it enters the following two operating states: In operating state one, if the external DC power supply is working normally, and its external DC power supply positive terminal DC and the common terminal COM connected after the external DC power supply and the battery share a common ground are both correctly connected, the high level of the external DC power supply positive terminal DC will provide a base bias voltage to the first transistor Q1 through the first resistor R1, causing the first transistor Q1 to generate a base current and conduct; the relay coil Y1A will then be energized, and its corresponding relay contact Y1B will engage, specifically manifested as the normally open contact closing and the normally closed contact opening; in this state, the external DC power supply positive terminal DC establishes a path with the output positive terminal OUT+ through the normally open contact of the relay contact Y1B, and the output positive terminal OUT+ and output negative terminal OUT- of the output interface P2 are connected to the external DC power supply positive terminal DC and the common terminal COM (negative terminal) connected after the external DC power supply and the battery share a common ground, respectively, and the device is powered by the external DC power supply; In operating state two, if the external DC power supply is abnormal, i.e., there is no voltage output at the positive DC input terminal, the relay coil Y1A cannot be energized, and the relay contact Y1B remains in its initial state, i.e., the normally open contact is open and the normally closed contact is closed. At this time, the positive input terminal BAT of the battery is connected to the positive output terminal OUT+ of the output interface P2 through the normally closed contact of the relay contact Y1B. The positive output terminal OUT+ and the negative output terminal OUT- of the output interface P2 correspond to the positive input terminal BAT (positive terminal) of the battery and the common terminal COM (negative terminal) connected after the external DC power supply and the battery share a common ground, respectively. The device is in battery power supply mode.

[0026] In summary, under normal external DC power supply conditions, regardless of whether the positive input terminal BAT of the battery is energized, controlling the GPIO1 interface to output a high level will prioritize the external DC power supply. If the external DC power supply malfunctions, the switch from battery power to external DC power supply cannot be completed, and the device will continue to be powered by the battery.

[0027] The microcontroller unit (MCU) is connected to a human-machine interface (HMI). The MCU includes an analog-to-digital converter (ADC1), which is connected to a fourth resistor R4 and a fifth resistor R5. The fourth resistor R4 and the fifth resistor R5 are connected in series. The fifth resistor R5 is connected to the positive input terminal (BAT) of the battery. Based on actual operating parameters, the rechargeable power and output power parameters of the power controller in each operating mode are pre-calculated and adjusted. These parameters are then written to the MCU via the HMI function. The HMI includes local and remote human-machine interaction modes. Common implementations of local human-machine interaction include button input and display output. Common implementations of remote human-machine interaction include data transmission via a wireless communication chip and remote monitoring via a cloud platform.

[0028] During equipment operation, the positive input terminal BAT of the battery forms a closed loop through the fourth resistor R4, the fifth resistor R5, and the common terminal COM connected to the external DC power supply and the battery's common ground. The analog-to-digital conversion pin ADC1 of the microcontroller unit (MCU) can collect the voltage signal across the fourth resistor R4 in real time, and then calculate the real-time battery charge. Based on the set values ​​of battery charge inflow and outflow, the theoretical battery charge change trend can be calculated. When the real-time battery charge deviates from the theoretical charge change trend, it can be identified as a fault or abnormal condition such as battery life degradation. For example, in conventional applications, to maintain a continuously healthy battery charge, the charging power is designed to be greater than the actual average discharge power. If the real-time power consumption of the equipment is not greater than the average discharge power, but the battery charge remains unchanged or continues to decrease, under the premise that the external DC power supply is charging normally, it can be identified to a certain extent as an abnormal fault such as battery life degradation. At this time, the MCU's general-purpose input / output interface GPIO1 outputs a high-level signal to realize the switching of priority power supply from the external power supply.

[0029] With the GPIO1 interface outputting a high level, when the GPIO1 interface is controlled to output a low level or a high impedance, the base bias voltage of the third transistor Q3 disappears, and the third transistor Q3 is cut off. At this time, the base voltage of the second transistor Q2 is no longer clamped by the collector level of the third transistor Q3, and it enters the following two operating states: In operating state three, if the voltage at the positive input terminal BAT of the battery is normal, the high level of the positive input terminal BAT will cause the second transistor Q2 to generate a base current and conduct, pulling its collector potential down to a low level. This low level will clamp the base potential of the first transistor Q1, causing the first transistor Q1 to be cut off. The relay coil Y1A will not operate due to de-energization, and the relay contact Y1B will remain in normal condition, with the normally open contact open and the normally closed contact closed. The positive input terminal BAT of the battery will be connected to the positive output terminal OUT+ of the output interface P2 through the normally closed contact of the relay contact Y1B. The positive output terminal OUT+ and the negative output terminal OUT- of the output interface P2 correspond to the positive input terminal BAT (positive terminal) of the battery and the common terminal COM (negative terminal) connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the battery. In operating state four, if the voltage at the positive terminal BAT of the battery input is abnormal, the base bias voltage of the second transistor Q2 disappears, and the second transistor Q2 is cut off. At this time, the base voltage of the first transistor Q1 is not clamped by the collector level of the second transistor Q2. The high level of the positive DC terminal of the external DC power supply input continuously provides the base bias voltage of the first transistor Q1 through the first resistor R1, causing the first transistor Q1 to generate base current and conduct. The relay coil Y1A remains energized, and its corresponding relay contact Y1B engages, specifically by closing the normally open contact and opening the normally closed contact. The positive output OUT+ and negative output OUT- of the output interface P2 correspond to the positive DC terminal (positive) of the external DC power supply input and the common terminal COM (negative) connected after the external DC power supply and the battery share a common ground, respectively, and the device remains powered by the external DC power supply.

[0030] In summary, under the premise that the general-purpose input / output interface GPIO1 outputs a high level, after a reasonable delay, the control logic switches the port to a low level or a high impedance state. If the battery input positive terminal BAT is powered normally, the selection of battery power supply can be achieved.

[0031] In practical applications, after the battery fault is resolved, the general-purpose input / output interface GPIO1 can be controlled to switch from a high level to a low level or a high impedance state, and the device can continue to be powered by the battery.

[0032] Additionally, when the device is powered by an external DC power supply, the normally closed contact of relay Y1B is open, and the normally open contact is closed. In this state, on the one hand, the connection between the charging circuit output and the battery input positive terminal BAT is disconnected through the normally closed contact of relay Y1B; on the other hand, the normally open contact of relay Y1B short-circuits the input and output terminals of the charging circuit, forming a bypass. In other words, under this operating condition, the battery stops charging and also stops discharging to the power controller. This function effectively prevents continuous charging and discharging of the battery under abnormal connection or fault conditions, thereby preventing dangerous phenomena such as explosions and avoiding the escalation of accidents.

[0033] When the device is in battery-powered mode, if an external DC power supply is connected normally, the positive DC input of the external DC power supply will provide input voltage to the charging circuit. The positive output terminal of the charging circuit charges the battery through the normally closed contact of relay contact Y1B.

[0034] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Although the present invention has been disclosed above with reference to preferred embodiments, it is not intended to limit the present invention. Any person skilled in the art can make some modifications or alterations to the above-disclosed technical content to create equivalent embodiments without departing from the scope of the present invention. Any simple modifications, equivalent changes and alterations made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the scope of the present invention.

Claims

1. A composite power management method for a power controller, characterized in that, The power controller's composite power management method employs a power controller's composite power management circuit, and includes the following steps: Step 1, power-on initialization phase: prioritize automatic selection of battery power supply to ensure that the power requirements of the equipment are met. If the battery is abnormal or not connected, automatically select direct power supply from external DC power supply. Step two: After the power-on initialization phase is completed, the equipment enters the operation phase. The equipment power supply system starts up, the microcontroller unit starts running, and the composite power management circuit of the power controller switches the priority of continuous power supply from the battery or external DC power source as needed.

2. The composite power management method for a power controller according to claim 1, characterized in that, The composite power management circuit includes a power input interface, an output interface, a charging circuit, a relay, a first resistor, a second resistor, a third resistor, a first transistor, a second transistor, and a third transistor. The power input interface includes an external DC power input positive terminal, a battery input positive terminal, and a common terminal for connecting the external DC power supply and the battery after they share a common ground. The output interface includes an output positive terminal and an output negative terminal. The relay includes a relay coil and relay contacts, with normally open and normally closed contacts. The two ends of the first resistor are connected to the external DC power input positive terminal and the base of the first transistor, respectively. The second resistor... The two ends of the first resistor are connected to the positive input terminal of the battery and the base of the second transistor, respectively. The two ends of the third resistor are connected to a general-purpose input / output interface of the microcontroller and the base of the third transistor, respectively. The base of the first transistor and the first resistor are both connected to the collector of the second transistor. The base of the second transistor and the second resistor are both connected to the collector of the third transistor. The emitters of the first transistor, the second transistor, and the third transistor are all grounded. The relay coil is connected to the collector of the first transistor. The output interface, the positive input terminal of the external DC power supply, and the positive input terminal of the battery are all connected to the relay contacts.

3. The composite power management method for a power controller according to claim 2, characterized in that, A capacitor is provided between the positive and negative terminals of the output interface. The capacitor is used to ensure the continuous power supply of the microcontroller unit during the switching between external DC power supply and battery power supply, so as to avoid power failure.

4. The composite power management method for a power controller according to claim 2, characterized in that, The relay contacts are connected to a charging circuit. When the composite power management circuit of the power controller preferentially selects battery power, the charging circuit is a charging management unit that supplies power to the battery from an external DC power source.

5. The composite power management method for a power controller according to claim 2, characterized in that, Step one specifically adopts the following pattern: Mode 1, when connected to a battery: Regardless of whether an external DC power supply is connected, the voltage at the positive input terminal of the battery is high. This high level causes the second transistor to generate a base current and conduct, pulling the collector potential of the second transistor down to a low level. This low level clamps the base potential of the first transistor, causing the first transistor to cut off. The relay coil does not operate due to de-energization, and its corresponding relay contacts remain in normal operation. At this time, the positive input terminal of the battery is connected to the positive output terminal of the output interface through the normally closed contact of the relay contact. The positive and negative output terminals of the output interface correspond to the positive terminal of the battery and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the battery. Mode 2, when connected to an external DC power supply and not connected to a battery: The voltage at the positive input terminal of the external DC power supply is high. This high level provides a base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct; the relay coil is energized accordingly, and its corresponding relay contact is activated; at this time, the positive input terminal of the external DC power supply is connected to the positive output terminal through the normally open contact of the relay contact. The positive and negative output terminals of the output interface correspond to the positive input terminal of the external DC power supply and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The device is powered by the external DC power supply.

6. The composite power management method for a power controller according to claim 2, characterized in that, When the general-purpose input / output interface of the microcontroller outputs a high level, this level signal provides a base bias voltage to the third transistor via the third resistor, causing the third transistor to generate a base current and conduct. After the third transistor is turned on, its collector potential is pulled down to a low level. This low level clamps the base potential of the second transistor, ensuring that the second transistor is in the off state. At this time, the base voltage of the first transistor is not clamped by the collector level of the second transistor and enters the following two operating states: In operating state one, if the external DC power supply is working normally and its external DC power supply input positive terminal and the common terminal connected after the external DC power supply and the battery share a common ground are both correctly connected, the high level of the external DC power supply input positive terminal will provide a base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct; the relay coil will then be energized, and its corresponding relay contacts will engage, specifically manifested as the normally open contact closing and the normally closed contact opening; in this state, the external DC power supply input positive terminal establishes a path with the output positive terminal through the normally open contact of the relay contacts, and the output positive terminal and output negative terminal of the output interface are connected to the external DC power supply input positive terminal and the common terminal connected after the external DC power supply and the battery share a common ground, respectively, and the equipment is powered by the external DC power supply; In the second working state, if the external DC power supply is abnormal, that is, there is no voltage output at the positive terminal of the external DC power supply input, the relay coil cannot be energized and the relay contacts remain in the initial state. At this time, the positive terminal of the battery input is connected to the positive terminal of the output interface through the normally closed contact of the relay contacts. The positive and negative terminals of the output interface correspond to the positive terminal of the battery input and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The equipment is in battery power supply mode.

7. The composite power management method for a power controller according to claim 2 is characterized in that, The microcontroller unit is connected to a human-machine interface. The microcontroller unit includes an analog-to-digital conversion pin, which is connected to a fourth resistor and a fifth resistor. The fourth resistor and the fifth resistor are connected in series, and the fifth resistor is connected to the positive input terminal of the battery.

8. The composite power management method for a power controller according to claim 2 is characterized in that, When the control general-purpose input / output interface changes from a high level to a low level or a high impedance, the base bias voltage of the third transistor disappears, and the third transistor is cut off. At this time, the base voltage of the second transistor is not clamped by the collector level of the third transistor, and it enters the following two operating states: In operating state three, if the voltage at the positive input terminal of the battery is normal, the high level at the positive input terminal will cause the second transistor to generate a base current and conduct, pulling its collector potential down to a low level. This low level will clamp the base potential of the first transistor, causing the first transistor to be cut off. The relay coil will not operate due to de-energization, and the relay contacts will remain in normal condition. The positive input terminal of the battery will be connected to the positive output terminal of the output interface through the normally closed contact of the relay contacts. The positive and negative output terminals of the output interface correspond to the positive input terminal of the battery and the common terminal connected after the external DC power supply and the battery share a common ground, respectively. The equipment is powered by the battery. In operating state four, if the voltage at the positive terminal of the battery input is abnormal, the base bias voltage of the second transistor disappears, and the second transistor is cut off. At this time, the base voltage of the first transistor is not clamped by the collector level of the second transistor. The high level at the positive terminal of the external DC power supply input continuously provides the base bias voltage to the first transistor through the first resistor, causing the first transistor to generate a base current and conduct. The relay coil remains energized, and its relay contacts engage, specifically manifested as the normally open contacts closing and the normally closed contacts opening. The positive and negative terminals of the output interface are connected to the positive terminal of the external DC power supply input and the common terminal connected after the external DC power supply and the battery share a common ground, respectively, and the equipment remains powered by the external DC power supply.