Load control system, control method, device and readable storage medium
The load control system stabilizes microcontroller operation by controlling power supply to loads and entering sleep mode during voltage fluctuations, addressing instability issues during large load startups.
Patent Information
- Application Number
- CN202211511101.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2042-11-29
AI Technical Summary
When a large load starts, the voltage output from the power supply drops instantly, causing fluctuations in the internal voltage regulator of the microcontroller, affecting the digital circuit, and may cause the microcontroller to crash or reset and restart, affecting the stable operation.
By controlling the microcontroller to enter the sleep state when the load circuit is connected to the power supply, and automatically wake up after the preset time. The second power supply of the switching circuit is used to avoid the impact of voltage fluctuations on the microcontroller, and actively control it in combination with the timer and the target power supply moment.
It improves the operating stability of the microcontroller, reduces the chance of crash or restart, and enhances the stability and reliability of the load control system.
Smart Images

Figure CN115755716B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of single-chip microcomputers, and in particular, to a load control system, a control method, a device and a readable storage medium thereof. Background Art
[0002] A power supply supplies power to a load so that the load can be powered on and work.
[0003] However, when a large load starts up, the voltage drop amplitude output by the power supply is relatively large instantaneously. If the voltage fluctuates rapidly beyond the voltage stabilization bandwidth of the voltage regulator inside the single-chip microcomputer, there will be a large fluctuation in the voltage regulator, which will directly affect the digital circuit inside the single-chip microcomputer, resulting in abnormal operation of the digital circuit. In extreme cases, it may instantaneously cause the single-chip microcomputer to crash or reset and restart, affecting the stable operation of the single-chip microcomputer. Summary of the Invention
[0004] The present invention aims to solve at least one of the technical problems existing in the prior art or related technologies.
[0005] To this end, in a first aspect of the present invention, a control method for a load control system is provided.
[0006] In a second aspect of the present invention, a control device for a load control system is provided.
[0007] In a third aspect of the present invention, another control device for a load control system is provided.
[0008] In a fourth aspect of the present invention, a readable storage medium is provided.
[0009] In a fifth aspect of the present invention, a load control system is provided.
[0010] In a sixth aspect of the present invention, another load control system is provided.
[0011] In view of this, in a first aspect of the present invention, a control method for a load control system is provided. The load control system includes: a single-chip microcomputer, the power supply of the single-chip microcomputer is a first power supply; a load circuit; a switching circuit, connected to the load circuit and the single-chip microcomputer, the switching circuit switches between a conducting state and a cutoff state under the control of the single-chip microcomputer, the power supply of the switching circuit is a second power supply, the first power supply and the second power supply are the same power supply or the first power supply and the second power supply are related. The control method of the load control system includes: when receiving the power supply demand of the load circuit, controlling the switching circuit to switch from the cutoff state to the conducting state, and controlling the single-chip microcomputer to enter the sleep state; when the continuous duration of the single-chip microcomputer in the sleep state is greater than a preset duration, controlling the single-chip microcomputer to exit the sleep state.
[0012] In this technical solution, a control method for a load control system is proposed. By running this control method of the load control system, it is possible to avoid the rapid reduction of the power supply voltage caused by the load circuit at the moment of startup, thereby affecting the power supply of the digital circuit and causing the single-chip microcomputer to freeze or reset and restart, thus improving the stability of the operation of the single-chip microcomputer.
[0013] The technical solution of this application is realized through the following principle. Specifically, when the single-chip microcomputer is in the sleep state, the requirements of the single-chip microcomputer for the first power supply that powers it are reduced. For example, the digital circuit in the single-chip microcomputer may not be powered on, or the voltage supplied by the first power supply to it does not need to be very high, or the limit on the output power of the first power supply in the single-chip microcomputer is reduced. Therefore, even when the load circuit is connected to the power supply instantaneously, the voltage fluctuation reflected on the first power supply will not affect the operation of the single-chip microcomputer.
[0014] Based on this, during the process of connecting the load circuit to the power supply, the single-chip microcomputer can be controlled to enter the sleep state to avoid the impact of the voltage fluctuation reflected on the first power supply when the load circuit is connected to the power supply instantaneously. Thus, in the related technical solutions, when a large load starts up, the amplitude of the instantaneous voltage drop of the power supply output is relatively large. If the voltage fluctuates rapidly beyond the voltage regulation bandwidth of the voltage regulator inside the single-chip microcomputer, the voltage regulator will have a large fluctuation, which will directly affect the digital circuit inside the single-chip microcomputer, resulting in abnormal operation of the digital circuit. In extreme cases, it may instantaneously cause the single-chip microcomputer to freeze or reset and restart, affecting the stable operation of the single-chip microcomputer.
[0015] Specifically, when the power supply demand of the load circuit is detected, the state of the switch circuit is switched to the conducting state, so as to supply power to the load circuit using the second power supply that powers the switch circuit. At the same time, by controlling the single-chip microcomputer to enter the sleep state, the single-chip microcomputer can avoid the voltage fluctuation reflected on the first power supply.
[0016] Through a preset duration set in advance, the recorded continuous duration of the single-chip microcomputer entering the sleep state is compared with it, and then the automatic wake-up of the single-chip microcomputer is realized. During this process, without affecting the normal use of the single-chip microcomputer, the impact of the startup of the load circuit on the single-chip microcomputer is eliminated, thereby improving the stability of the load control system.
[0017] In one of the technical solutions, the preset duration is pre-calibrated. Specifically, the preset duration is the duration it takes for the voltage value output by the first power supply to drop from the initial value to the minimum value after the load circuit is switched to the conducting state by the switch circuit; or it is the duration it takes for the voltage value output by the first power supply to rise to a preset value after dropping from the initial value to the minimum value after the load circuit is switched to the conducting state by the switch circuit, where the preset value is greater than the minimum value and less than or equal to the initial value.
[0018] Among them, the initial value is the rated output voltage value of the first power supply.
[0019] In the above technical solution, the duration can be understood as the cumulative duration since the single-chip microcomputer enters the sleep mode.
[0020] In the above technical solution, the first power supply and the second power supply are related. It can be understood that the first power supply is the power supply obtained after the voltage of the second power supply changes.
[0021] In addition, the control method of the load control system proposed in this application also has the following additional technical features.
[0022] In the above technical solution, the single-chip microcomputer includes a timer. When the duration of the single-chip microcomputer in the sleep state is greater than the preset duration, the single-chip microcomputer is controlled to exit the sleep state. Specifically, it includes: when the switch circuit switches from the cut-off state to the conducting state, the timer is controlled to start timing; when the timing duration is greater than or equal to the preset duration, the single-chip microcomputer is controlled to exit the sleep state.
[0023] In this technical solution, it is specifically limited that the single-chip microcomputer has a timer. Among them, the timer can start running after the switch circuit acts. By selecting the condition that the switch circuit switches from the cut-off state to the conducting state as the start condition of timing, it is ensured that when the load circuit is connected and the voltage output by the first power supply fluctuates, the single-chip microcomputer is in the sleep state, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0024] In addition, the above start condition of timing can ensure that when the single-chip microcomputer exits the sleep mode, the voltage fluctuation brought by the connection of the load circuit to the power supply has passed, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0025] In any of the above technical solutions, the power supply demand includes the target power supply time, controlling the switch circuit to switch from the cut-off state to the conducting state, and controlling the single-chip microcomputer to enter the sleep state. Specifically, it includes: when the current time reaches the target power supply time, controlling the switch circuit to switch from the cut-off state to the conducting state, and controlling the single-chip microcomputer to enter the sleep state.
[0026] In this technical solution, the judgment factors for controlling the action of the switch circuit and the single-chip microcomputer to enter the sleep mode are specifically limited. By limiting that the power supply demand includes the target power supply time, the technical solution of this application can realize the active control of the single-chip microcomputer to sleep, reducing the probability of the situation where the single-chip microcomputer enters the sleep mode only after the load circuit is connected to the power supply, thereby improving the reliability of the load control system.
[0027] Specifically, if the detection of the load circuit being connected to the power supply is used as the trigger condition for the control single-chip microcomputer to enter the sleep mode, there will be a situation where after the load circuit is connected to the power supply, the single-chip microcomputer still does not enter the sleep mode, resulting in an instantaneous drop in the power supply to the single-chip microcomputer by the first power supply. By knowing the target power supply time, the switch circuit can act simultaneously while controlling the single-chip microcomputer to enter the sleep mode at the target power supply time, thus avoiding the above situation and improving the stability of the load control system.
[0028] In any of the above technical solutions, it further includes: obtaining the working parameters of the load circuit; determining a preset duration according to the working parameters.
[0029] In this technical solution, considering that different load circuits connected to the power supply bring different voltage fluctuations to the first power supply, if the preset duration remains fixed, there will be a situation where when the single-chip microcomputer exits the sleep mode, the voltage fluctuation of the first power supply output is still relatively large. There will also be a situation where after the load circuit is connected to the power supply, the voltage fluctuation of the first power supply output has been eliminated or approaches disappearance, but the single-chip microcomputer still does not exit the sleep mode, affecting the normal operation of the load control system.
[0030] To reduce the occurrence of the above situation, the technical solution of this application stipulates that the preset duration changes according to the working parameters of the load circuit, so as to dynamically adjust the preset duration according to different load circuits, ensure the rationality of the preset duration value, and reduce the occurrence of the above situation.
[0031] In any of the above technical solutions, the working parameters include: operating power and / or operating current.
[0032] In this technical solution, the greater the operating power, the greater the impact on the voltage fluctuation on the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact on the first power supply by the second power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating power, the shorter the value of the preset duration, so as to ensure the rationality of the preset duration value.
[0033] In the above technical solution, the greater the operating current, the greater the impact on the voltage fluctuation on the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact on the first power supply by the second power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating current, the shorter the value of the preset duration, so as to ensure the rationality of the preset duration value.
[0034] The second aspect of the present invention provides a control device for a load control system. The load control system includes: a single-chip microcomputer, and the power supply for the single-chip microcomputer is a first power supply; a load circuit; a switching circuit, which is connected to the load circuit and the single-chip microcomputer. The switching circuit switches between a conducting state and a cutoff state under the control of the single-chip microcomputer. The power supply for the switching circuit is a second power supply. The first power supply and the second power supply are the same power supply or the first power supply and the second power supply are related. The control device for the load control system includes: a first control unit, which is used to control the switching circuit to switch from the cutoff state to the conducting state and control the single-chip microcomputer to enter the sleep state when receiving the power supply demand of the load circuit; a second control unit, which is used to control the single-chip microcomputer to exit the sleep state when the continuous duration of the single-chip microcomputer in the sleep state is greater than a preset duration.
[0035] In this technical solution, a control device for a load control system is proposed, which can avoid the problem that the power supply voltage drops rapidly when the load circuit starts up, thereby affecting the power supply of the digital circuit and causing the single-chip microcomputer to crash or reset and restart, thus improving the stability of the single-chip microcomputer operation.
[0036] The technical solution of this application is realized through the following principle. Specifically, when the single-chip microcomputer is in the sleep state, the requirements of the single-chip microcomputer for the first power supply that powers it are reduced. For example, the digital circuit in the single-chip microcomputer can be powered off, or the voltage supplied by the first power supply to it does not need to be very high, or the limit on the output power of the first power supply in the single-chip microcomputer is reduced. Therefore, even when the load circuit is connected to the power supply instantaneously, the voltage fluctuation reflected on the first power supply will not affect the operation of the single-chip microcomputer.
[0037] Based on this, during the process of connecting the load circuit to the power supply, the single-chip microcomputer can be controlled to enter the sleep state to avoid the influence of the voltage fluctuation reflected on the first power supply when the load circuit is connected to the power supply instantaneously. Thus, in the related technical solutions, when a large load starts up, the voltage drop amplitude of the power supply output instantaneously is relatively large. If the voltage fluctuates rapidly beyond the voltage regulation bandwidth of the voltage regulator inside the single-chip microcomputer, the voltage regulator will have a large fluctuation, which will directly affect the digital circuit inside the single-chip microcomputer, resulting in abnormal operation of the digital circuit. In extreme cases, it may instantaneously cause the single-chip microcomputer to crash or reset and restart, affecting the operation stability of the single-chip microcomputer.
[0038] Specifically, when detecting the power supply demand of the load circuit, the state of the switching circuit is switched to the conducting state to supply power to the load circuit by using the second power supply that powers the switching circuit. At the same time, by controlling the single-chip microcomputer to enter the sleep state, the single-chip microcomputer can avoid the voltage fluctuation reflected on the first power supply.
[0039] By means of a preset duration, the duration during which the recorded microcontroller enters the sleep state is compared with it, so as to realize the automatic wake-up of the microcontroller. During this process, without affecting the normal use of the microcontroller, the influence of the startup of the load circuit on the microcontroller is eliminated, thereby improving the stability of the load control system.
[0040] In one of the technical solutions, the preset duration is pre-calibrated. Specifically, the preset duration is the duration it takes for the voltage value output by the first power supply to drop from the initial value to the minimum value after the switch circuit switches to the conducting state for the load circuit; or it is the duration it takes for the voltage value output by the first power supply to rise to the preset value after dropping from the initial value to the minimum value after the switch circuit switches to the conducting state for the load circuit, where the preset value is greater than the minimum value and less than or equal to the initial value.
[0041] Among them, the initial value is the rated output voltage value of the first power supply.
[0042] In the above technical solution, the duration can be understood as the cumulative duration since the microcontroller enters the sleep mode.
[0043] In the above technical solution, the first power supply and the second power supply are related. It can be understood that the first power supply is the power supply obtained after the voltage change of the second power supply.
[0044] In addition, the control device of the load control system proposed in this application also has the following additional technical features.
[0045] In the above technical solution, the microcontroller includes a timer and a second control unit, which are specifically used for: controlling the timer to start timing when the switch circuit switches from the cut-off state to the conducting state; and controlling the microcontroller to exit the sleep state when the timing duration is greater than or equal to the preset duration.
[0046] In this technical solution, it is specifically defined that the microcontroller has a timer. Among them, the timer can start running after the switch circuit operates. By selecting the condition that the switch circuit switches from the cut-off state to the conducting state as the start condition of timing, it is ensured that when the load circuit is connected and the voltage output by the first power supply fluctuates, the microcontroller is in the sleep state, thereby ensuring the stability of the microcontroller and reducing the probability of the microcontroller crashing or restarting.
[0047] In addition, the above start condition of timing can ensure that when the microcontroller exits the sleep mode, the voltage fluctuation caused by the connection of the load circuit to the power supply has passed, thereby ensuring the stability of the microcontroller and reducing the probability of the microcontroller crashing or restarting.
[0048] In any of the above technical solutions, the power supply demand includes a target power supply time. The first control unit is specifically configured to: when the current time reaches the target power supply time, control the switching circuit to switch from the cut-off state to the on state, and control the single-chip microcomputer to enter the sleep state.
[0049] In this technical solution, the judgment factors for controlling the operation of the switching circuit and the single-chip microcomputer to enter the sleep mode are specifically defined. By defining that the power supply demand includes the target power supply time, the technical solution of the present application can achieve the active control of the single-chip microcomputer to enter the sleep state, reducing the probability of the situation where the single-chip microcomputer enters the sleep mode only after the load circuit is connected to the power supply, thereby improving the reliability of the load control system.
[0050] Specifically, if the detection of the load circuit being connected to the power supply is used as the trigger condition for controlling the single-chip microcomputer to enter the sleep mode, then after the load circuit is connected to the power supply, the single-chip microcomputer may not enter the sleep mode, resulting in an instantaneous drop in the power supply to the single-chip microcomputer from the first power supply. By knowing the target power supply time, the switching circuit can act simultaneously while controlling the single-chip microcomputer to enter the sleep mode at the target power supply time, thus avoiding the above situation and improving the stability of the load control system.
[0051] In any of the above technical solutions, the first control unit is further configured to: obtain the operating parameters of the load circuit; determine a preset duration according to the operating parameters.
[0052] In this technical solution, considering that different load circuits connected to the power supply cause different voltage fluctuations to the first power supply, if the preset duration remains fixed, when the single-chip microcomputer exits the sleep mode, the voltage fluctuation of the first power supply output may still be relatively large. Also, after the load circuit is connected to the power supply, the voltage fluctuation of the first power supply output may have been eliminated or is approaching disappearance, but the single-chip microcomputer has not exited the sleep mode, affecting the normal operation of the load control system.
[0053] To reduce the occurrence of the above situation, the technical solution of the present application defines that the preset duration varies according to the operating parameters of the load circuit, so as to dynamically adjust the preset duration according to different load circuits, ensuring the rationality of the preset duration value and reducing the occurrence of the above situation.
[0054] In any of the above technical solutions, the operating parameters include: operating power and / or operating current.
[0055] In this technical solution, the greater the operating power, the greater the impact of the instantaneous connection of the load circuit to the power supply on the voltage fluctuation of the second power supply. At this time, the impact of the second power supply on the first power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating power, the shorter the value of the preset duration, so as to ensure the rationality of the preset duration value.
[0056] In the above technical solution, the greater the operating current, the greater the impact on the voltage fluctuation of the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact of the second power supply on the first power supply is also greater, and the value of the preset duration is longer. On the contrary, the smaller the operating current, the shorter the value of the preset duration, so as to ensure the rationality of the value of the preset duration.
[0057] The third aspect of the present invention provides a control device for a load control system, including: a processor and a memory, where the memory stores a program or instruction that can run on the processor, and when the program or instruction is executed by the processor, the steps of the method according to any one of the above are implemented.
[0058] The fourth aspect of the present invention provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by the processor, the steps of the method according to any one of the above are implemented.
[0059] The fifth aspect of the present invention provides a load control system, including: a control device for a load control system according to any one of the above; and / or the above-readable storage medium.
[0060] The sixth aspect of the present invention provides a load control system, including: a single-chip microcomputer, the power supply of the single-chip microcomputer is the first power supply; a load circuit; a switching circuit, connected to the load circuit and the single-chip microcomputer, the switching circuit switches between a conducting state and a cutoff state under the control of the single-chip microcomputer, the power supply of the switching circuit is the second power supply, and the first power supply and the second power supply are the same power supply or the first power supply and the second power supply are related.
[0061] In the above technical solution, it further includes: a first resistor located between the second power supply and the control end of the switching circuit or between the control end of the switching circuit and the ground; and / or a second resistor located between the single-chip microcomputer and the control end of the switching circuit.
[0062] In the above technical solution, by setting the first resistor, a pull-up resistor or a pull-down resistor is formed by using the first resistor, so that the switching circuit can be default in the cutoff state, thereby ensuring the stability of the load control system.
[0063] In the above technical solution, by setting the second resistor, the magnitude of the current flowing through the single-chip microcomputer is limited, thereby reducing the probability of damage to the single-chip microcomputer due to overcurrent, and thus improving the stability of the load control system.
[0064] In the above technical solution, the values of the first resistor and the second resistor can be taken according to actual use needs, and will not be elaborated here.
[0065] Additional aspects and advantages of the present invention will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the present invention. Brief Description of the Drawings
[0066] The above and / or additional aspects and advantages of the present invention will become apparent and be readily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0067] Figure 1 One of the schematic flowcharts of the control method of the load control system in an embodiment of the present invention is shown;
[0068] Figure 2 The schematic connection diagram of the load control system in an embodiment of the present invention is shown;
[0069] Figure 3 The schematic flowchart of the control process of the timer in an embodiment of the present invention is shown;
[0070] Figure 4 Another schematic flowchart of the control method of the load control system in an embodiment of the present invention is shown;
[0071] Figure 5 The schematic block diagram of the control device of the load control system in an embodiment of the present invention is shown.
[0072] Wherein, Figure 2 The corresponding relationship between the reference numerals in the drawings and the component names is as follows:
[0073] MCU 202, first power supply 204, load circuit 206, second power supply 208, Q switch circuit, first resistor R1, second resistor R2. Detailed Embodiments
[0074] In order to more clearly understand the above aspects, features and advantages of the present invention, the present invention will be further described in detail below in conjunction with the drawings and specific embodiments. It should be noted that, without conflict, the embodiments of the present application and the features in the embodiments can be combined with each other.
[0075] In the following description, many specific details are set forth in order to fully understand the present invention. However, the present invention may be implemented in other ways different from those described herein. Therefore, the protection scope of the present invention is not limited by the specific embodiments disclosed below.
[0076] In one of the embodiments, as Figure 1 and Figure 2As shown, a control method for a load control system is proposed. The load control system includes: a single-chip microcomputer 202, and the power supply for the single-chip microcomputer 202 is the first power supply 204; a load circuit 206; a switch circuit Q, which is connected to the load circuit 206 and the single-chip microcomputer 202. The switch circuit Q switches between a conducting state and a cut-off state under the control of the single-chip microcomputer 202. The power supply for the switch circuit Q is the second power supply 208. The first power supply 204 and the second power supply 208 are the same power supply or the first power supply 204 and the second power supply 208 are related. The control method for the load control system includes:
[0077] Step 102, when receiving the power supply demand of the load circuit, control the switch circuit to switch from the cut-off state to the conducting state, and control the single-chip microcomputer to enter the sleep state;
[0078] Step 104, when the continuous duration of the single-chip microcomputer in the sleep state is greater than the preset duration, control the single-chip microcomputer to exit the sleep state.
[0079] In this embodiment, a control method for a load control system is proposed. By running the control method of the load control system, it is possible to avoid the problem that the power supply voltage rapidly decreases instantaneously when the load circuit starts, which in turn affects the power supply of the digital circuit, resulting in the single-chip microcomputer crashing or resetting and restarting. Thus, the stability of the single-chip microcomputer operation is improved.
[0080] The embodiment of this application is realized through the following principle. Specifically, when the single-chip microcomputer is in the sleep state, the requirements of the single-chip microcomputer for the first power supply that powers it are reduced. For example, the digital circuit in the single-chip microcomputer may not be powered on, or the voltage supplied by the first power supply to it does not need to be very high, or the limit on the output power of the first power supply in the single-chip microcomputer is reduced. Therefore, even when the load circuit is connected to the power supply instantaneously, the voltage fluctuation feedback on the first power supply will not affect the operation of the single-chip microcomputer.
[0081] Based on this, during the process of the load circuit being connected to the power supply, the single-chip microcomputer can be controlled to enter the sleep state to avoid the influence of the voltage fluctuation feedback on the first power supply on the single-chip microcomputer when the load circuit is connected to the power supply instantaneously. Thus, it overcomes the problem in the related embodiments that when a large load starts, the voltage drop amplitude of the power supply output instantaneously is relatively large. If the voltage fluctuates rapidly beyond the voltage regulation bandwidth of the voltage regulator inside the single-chip microcomputer, the voltage regulator will have a large fluctuation, which will directly affect the digital circuit inside the single-chip microcomputer, resulting in abnormal operation of the digital circuit. In extreme cases, it may instantaneously cause the single-chip microcomputer to crash or reset and restart, affecting the operation stability of the single-chip microcomputer.
[0082] Specifically, when the power supply demand of the load circuit is detected, the state of the switching circuit is switched to the conducting state, so as to supply power to the load circuit by using the second power supply that powers the switching circuit. At the same time, the single-chip microcomputer is controlled to enter the sleep state, so that the single-chip microcomputer can avoid the voltage fluctuation feedback on the first power supply.
[0083] Through a preset duration, so as to compare the recorded continuous duration of the single-chip microcomputer entering the sleep state with it, and then realize the automatic wake-up of the single-chip microcomputer. In this process, without affecting the normal use of the single-chip microcomputer, the influence of the startup of the load circuit on the single-chip microcomputer is eliminated, thereby improving the stability of the load control system.
[0084] In one of the embodiments, the preset duration is pre-calibrated. Specifically, the preset duration is the duration spent when the voltage value output by the first power supply drops from the initial value to the minimum value after the switching circuit is switched to the conducting state for the load circuit; or it is the duration spent when the voltage value output by the first power supply rises to the preset value after dropping from the initial value to the minimum value after the switching circuit is switched to the conducting state for the load circuit, where the preset value is greater than the minimum value and less than or equal to the initial value.
[0085] Among them, the initial value is the rated output voltage value of the first power supply.
[0086] In the above embodiment, the continuous duration can be understood as the cumulative duration since the single-chip microcomputer maintains the sleep mode.
[0087] In the above embodiment, the first power supply and the second power supply are related. It can be understood that the first power supply is the power supply obtained after the voltage change of the second power supply.
[0088] Specifically, for example, the first power supply is a +5v power supply, and the second power supply is a +18v power supply. Among them, the +18v power supply is converted into a +5v power supply through a set buck circuit.
[0089] In one of the embodiments, the load circuit, that is, the load, can be selected according to the actual use scenario, such as selecting a motor, a compressor, a lighting device, a transformer, etc.
[0090] In the above embodiment, the state of the switching circuit changing from the cut-off state to the conducting state and the single-chip microcomputer entering the sleep mode can be carried out synchronously or successively.
[0091] Specifically, when the state of the switching circuit changing from the cut-off state to the conducting state and the single-chip microcomputer entering the sleep mode are carried out successively, the state of the switching circuit changing from the cut-off state to the conducting state precedes the single-chip microcomputer entering the sleep mode, so as to reduce the single-chip microcomputer entering the sleep and further affect the operation of the switching circuit.
[0092] In the above embodiments, the single-chip microcomputer includes a timer. When the duration of the single-chip microcomputer in the sleep state is greater than a preset duration, the single-chip microcomputer is controlled to exit the sleep state, which specifically includes: when the switch circuit switches from the cut-off state to the on state, controlling the timer to start timing; when the timing duration is greater than or equal to the preset duration, controlling the single-chip microcomputer to exit the sleep state.
[0093] In this embodiment, it is specifically defined that the single-chip microcomputer has a timer. Among them, the timer can start running after the switch circuit acts. By selecting the condition that the switch circuit switches from the cut-off state to the on state as the start condition of timing, it is ensured that the load circuit is connected. When the voltage output by the first power supply fluctuates, the single-chip microcomputer is in the sleep state, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0094] In addition, the above start condition of timing can ensure that when the single-chip microcomputer exits the sleep mode, the voltage fluctuation of the first power supply caused by the connection of the load circuit to the power supply has passed, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0095] In one of the embodiments, as Figure 3 shown, the control logic of the timer is as follows:
[0096] Step 302, call the timer interrupt function;
[0097] Step 304, clear the interrupt flag and clear the count;
[0098] Step 306, turn off the timer;
[0099] Step 308, exit the timer interrupt function.
[0100] In any of the above embodiments, the power supply demand includes a target power supply time, controlling the switch circuit to switch from the cut-off state to the on state, and controlling the single-chip microcomputer to enter the sleep state, which specifically includes: when the current time reaches the target power supply time, controlling the switch circuit to switch from the cut-off state to the on state, and controlling the single-chip microcomputer to enter the sleep state.
[0101] In this embodiment, it is specifically defined the judgment factors for controlling the action of the switch circuit and the single-chip microcomputer to enter the sleep mode. By defining that the power supply demand includes the target power supply time, the embodiments of the present application can achieve active control of the sleep of the single-chip microcomputer, reducing the probability of the situation where the single-chip microcomputer is controlled to enter the sleep mode after the load circuit is connected to the power supply, thereby improving the reliability of the load control system.
[0102] Specifically, if detecting that the load circuit is connected to the power supply is used as the trigger condition for the control microcontroller to enter the sleep mode, then after the load circuit is connected to the power supply, the microcontroller may still not enter the sleep mode, resulting in an instantaneous drop in the power supply from the first power supply to the microcontroller. By knowing the target power supply time, the switch circuit can act simultaneously while controlling the microcontroller to enter the sleep mode at the target power supply time, thereby avoiding the above situation and improving the stability of the load control system.
[0103] In one embodiment, the target power supply time can be represented in the form of 12:28:15 on October 11, 2222.
[0104] In one embodiment, the target power supply time can exist in the form of a countdown, such as 300 seconds later.
[0105] In any of the above embodiments, it further includes: obtaining the working parameters of the load circuit; determining a preset duration according to the working parameters.
[0106] In this embodiment, considering that different load circuits connected to the power supply bring different voltage fluctuations to the first power supply, if the preset duration remains fixed, when the microcontroller exits the sleep mode, the voltage fluctuation of the output of the first power supply may still be relatively large. Also, after the load circuit is connected to the power supply, the voltage fluctuation of the output of the first power supply has been eliminated or is approaching disappearance, but the microcontroller still has not exited the sleep mode, affecting the normal operation of the load control system.
[0107] To reduce the occurrence of the above situation, the embodiment of the present application limits that the preset duration changes according to the working parameters of the load circuit, so as to dynamically adjust the preset duration according to different load circuits, so as to ensure the rationality of the value of the preset duration and reduce the occurrence of the above situation.
[0108] In any of the above embodiments, the working parameters include: operating power and / or operating current.
[0109] In this embodiment, the greater the operating power, the greater the impact on the voltage fluctuation on the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact on the first power supply by the second power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating power, the shorter the value of the preset duration, so as to ensure the rationality of the value of the preset duration.
[0110] In the above embodiment, the greater the operating current, the greater the impact on the voltage fluctuation on the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact on the first power supply by the second power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating current, the shorter the value of the preset duration, so as to ensure the rationality of the value of the preset duration.
[0111] In one embodiment, the microcontroller 202 has an MCU. Among them, the first power supply 204 is connected to the VDD pin of the MCU, and the GND in the MCU is grounded to supply power to the MCU. Among them, the IO port in the MCU is connected to the switch circuit Q to drive the switch circuit Q to work.
[0112] In one embodiment, the switch circuit Q is a Metal-Oxide-Semiconductor Field-Effect Transistor (MOSFET).
[0113] As Figure 4 shown, the control method of the load control system includes:
[0114] Step 402, initialize the IO port and the timer function.
[0115] Among them, during the initialization process, an interruption period is set, and the interruption period is also the preset duration in this application.
[0116] Step 404, at the moment when the load circuit requests power supply, control the level of the IO port, turn on the switch circuit, and control the timer to start timing;
[0117] Step 406, the microcontroller enters the sleep state;
[0118] Step 408, after waiting for the interruption period, the microcontroller wakes up.
[0119] In one embodiment, as Figure 5 shown, a control device for a load control system is provided. The load control system includes: a microcontroller, and the power supply for the microcontroller is the first power supply; a load circuit; a switch circuit, connected to the load circuit and the microcontroller, and the switch circuit switches between a conducting state and a cutoff state under the control of the microcontroller. The power supply for the switch circuit is the second power supply. The first power supply and the second power supply are the same power supply or the first power supply and the second power supply are related. The control device 500 of the load control system includes: a first control unit 502, configured to control the switch circuit to switch from the cutoff state to the conducting state and control the microcontroller to enter the sleep state when receiving the power supply demand of the load circuit; a second control unit 504, configured to control the microcontroller to exit the sleep state when the continuous duration of the microcontroller in the sleep state is greater than the preset duration.
[0120] In this embodiment, a control device 500 for a load control system is proposed, which can avoid the problem that the power supply voltage drops rapidly when the load circuit starts up, thereby affecting the power supply of the digital circuit and causing the microcontroller to crash or reset and restart, thus improving the stability of the microcontroller operation.
[0121] The embodiments of the present application are implemented through the following principles. Specifically, when the single-chip microcomputer is in the sleep state, the requirements of the single-chip microcomputer for the first power supply that powers it are reduced. For example, the digital circuit in the single-chip microcomputer can be powered off, or the voltage supplied by the first power supply to it does not need to be very high, or the limit on the output power of the first power supply in the single-chip microcomputer is reduced. Therefore, even when the load circuit is connected to the power supply instantaneously, the voltage fluctuation reflected on the first power supply will not affect the operation of the single-chip microcomputer.
[0122] Based on this, during the process of connecting the load circuit to the power supply, the single-chip microcomputer can be controlled to enter the sleep state, so as to avoid the influence of the voltage fluctuation reflected on the first power supply on the single-chip microcomputer when the load circuit is connected to the power supply instantaneously. Thus, in the related embodiments, when a large load starts, the voltage output by the power supply drops instantaneously by a large amplitude. If the voltage fluctuates rapidly beyond the voltage regulation bandwidth of the voltage regulator inside the single-chip microcomputer, the voltage regulator will have a large fluctuation, which will directly affect the digital circuit inside the single-chip microcomputer, resulting in abnormal operation of the digital circuit. In extreme cases, it may instantaneously cause the single-chip microcomputer to crash or reset and restart, affecting the stable operation of the single-chip microcomputer.
[0123] Specifically, when the power supply demand of the load circuit is detected, the state of the switching circuit is switched to the conducting state, so as to supply power to the load circuit using the second power supply that powers the switching circuit. At the same time, by controlling the single-chip microcomputer to enter the sleep state, the single-chip microcomputer can avoid the voltage fluctuation reflected on the first power supply.
[0124] Through a preset duration set in advance, the recorded continuous duration of the single-chip microcomputer entering the sleep state is compared with it, so as to realize the automatic wake-up of the single-chip microcomputer. During this process, without affecting the normal use of the single-chip microcomputer, the influence of the startup of the load circuit on the single-chip microcomputer is eliminated, thereby improving the stability of the load control system.
[0125] In one of the embodiments, the preset duration is pre-calibrated. Specifically, the preset duration is the duration it takes for the voltage value output by the first power supply to drop from the initial value to the minimum value after the load circuit is switched to the conducting state by the switching circuit; or it is the duration it takes for the voltage value output by the first power supply to drop from the initial value to the minimum value and then rise to the preset value after the load circuit is switched to the conducting state by the switching circuit, where the preset value is greater than the minimum value and less than or equal to the initial value.
[0126] Among them, the initial value is the rated output voltage value of the first power supply.
[0127] In the above embodiments, the continuous duration can be understood as the cumulative duration since the single-chip microcomputer maintains the sleep mode.
[0128] In the above embodiments, the first power supply and the second power supply are related. It can be understood that the first power supply is obtained by changing the voltage of the second power supply.
[0129] Specifically, for example, the first power supply is a +5V power supply, and the second power supply is a +18V power supply. Among them, the +18V power supply is converted into a +5V power supply through a set buck circuit.
[0130] In one of the embodiments, the load circuit, that is, the load, can be selected according to the actual usage scenario, such as a motor, a compressor, a lighting device, a transformer, etc.
[0131] In the above embodiments, the state transition of the switch circuit from the cut-off state to the conduction state and the single-chip microcomputer entering the sleep mode can be synchronized or sequential.
[0132] Specifically, when the state transition of the switch circuit from the cut-off state to the conduction state and the single-chip microcomputer entering the sleep mode are sequential, the state transition of the switch circuit from the cut-off state to the conduction state precedes the single-chip microcomputer entering the sleep mode, so as to reduce the single-chip microcomputer entering the sleep and further affect the operation of the switch circuit.
[0133] In the above embodiments, the single-chip microcomputer includes a timer and a second control unit 504, which is specifically used for: when the switch circuit switches from the cut-off state to the conduction state, controlling the timer to start timing; when the timing duration is greater than or equal to the preset duration, controlling the single-chip microcomputer to exit the sleep state.
[0134] In this embodiment, it is specifically defined that the single-chip microcomputer has a timer. Among them, the timer can start running after the switch circuit operates. By selecting the switch circuit switching from the cut-off state to the conduction state as the condition for starting timing, it is ensured that when the load circuit is connected and there is a voltage fluctuation in the voltage output by the first power supply, the single-chip microcomputer is in the sleep state, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0135] In addition, the above condition for starting timing can ensure that when the single-chip microcomputer exits the sleep mode, the voltage fluctuation caused by the load circuit being connected to the power supply has passed, thereby ensuring the stability of the single-chip microcomputer and reducing the probability of the single-chip microcomputer crashing or restarting.
[0136] In any of the above embodiments, the power supply demand includes a target power supply time. The first control unit 502 is specifically used for: when the current time reaches the target power supply time, controlling the switch circuit to switch from the cut-off state to the conduction state and controlling the single-chip microcomputer to enter the sleep state.
[0137] In this embodiment, the judgment factors for controlling the operation of the switch circuit and the single-chip microcomputer to enter the sleep mode are specifically defined. By defining that the power supply requirement includes the target power supply time, the embodiments of the present application can achieve the active control of the single-chip microcomputer to enter the sleep mode, reducing the probability of the situation where the single-chip microcomputer enters the sleep mode only after the load circuit is connected to the power supply, thereby improving the reliability of the load control system.
[0138] Specifically, if detecting that the load circuit is connected to the power supply is used as the trigger condition for controlling the single-chip microcomputer to enter the sleep mode, then there will be a situation where after the load circuit is connected to the power supply, the single-chip microcomputer still does not enter the sleep mode, resulting in an instantaneous drop in the power supply from the first power supply to the single-chip microcomputer. By knowing the target power supply time, the switch circuit can act simultaneously while controlling the single-chip microcomputer to enter the sleep mode at the target power supply time, thereby avoiding the above situation and improving the stability of the load control system.
[0139] In one embodiment, the target power supply time can be represented in the form of 12:28:15 on October 11, 2222.
[0140] In one embodiment, the target power supply time can exist in the form of a countdown, such as 300 seconds later.
[0141] In any of the above embodiments, the first control unit 502 is further configured to: obtain the operating parameters of the load circuit; determine a preset duration according to the operating parameters.
[0142] In this embodiment, considering that different load circuits are connected to the power supply, the voltage fluctuations brought to the first power supply are also different. If the preset duration remains fixed, there will be a situation where when the single-chip microcomputer exits the sleep mode, the voltage fluctuation of the output of the first power supply is still relatively large, and there will also be a situation where after the load circuit is connected to the power supply, the voltage fluctuation of the output of the first power supply has been eliminated or approaches disappearance, but the single-chip microcomputer still does not exit the sleep mode, affecting the normal operation of the load control system.
[0143] To reduce the occurrence of the above situation, the embodiments of the present application define that the preset duration changes according to the operating parameters of the load circuit, so as to dynamically adjust the preset duration according to different load circuits, ensure the rationality of the preset duration value, and reduce the occurrence of the above situation.
[0144] In any of the above embodiments, the operating parameters include: operating power and / or operating current.
[0145] In this embodiment, the greater the operating power, the greater the impact on the voltage fluctuation of the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact of the second power supply on the first power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating power, the shorter the value of the preset duration, so as to ensure the rationality of the value of the preset duration.
[0146] In the above embodiment, the greater the operating current, the greater the impact on the voltage fluctuation of the second power supply when the load circuit is connected to the power supply instantaneously. At this time, the impact of the second power supply on the first power supply is also greater, and the value of the preset duration is longer. Conversely, the smaller the operating current, the shorter the value of the preset duration, so as to ensure the rationality of the value of the preset duration.
[0147] In one of the embodiments, a control device for a load control system is provided, including: a processor and a memory. The memory stores a program or instructions that can run on the processor. When the program or instructions are executed by the processor, the steps of the method as described in any one of the above are implemented.
[0148] In one of the embodiments, a readable storage medium is provided. A program or instructions are stored on the readable storage medium. When the program or instructions are executed by the processor, the steps of the method as described in any one of the above are implemented.
[0149] In one of the embodiments, a load control system is provided, including: the control device of the load control system as described in any one of the above; and / or the readable storage medium as described above.
[0150] In one of the embodiments, a load control system is provided, including: a single-chip microcomputer, the power supply of the single-chip microcomputer is the first power supply; a load circuit; a switching circuit, connected to the load circuit and the single-chip microcomputer. The switching circuit switches between a conducting state and a cutoff state under the control of the single-chip microcomputer. The power supply of the switching circuit is the second power supply, and the first power supply and the second power supply are the same power supply or the first power supply and the second power supply are related.
[0151] In the above embodiment, as Figure 2 shown, it further includes: a first resistor R1, located between the second power supply 208 and the control terminal of the switching circuit Q or between the control terminal of the switching circuit Q and the ground; and / or a second resistor R2, located between the single-chip microcomputer 202 and the control terminal of the switching circuit Q.
[0152] In the above embodiment, by setting the first resistor, so as to use the first resistor to form a pull-up resistor or a pull-down resistor, and further make the switching circuit default to the cutoff state, so as to ensure the stability of the load control system.
[0153] In the above embodiment, by setting the second resistor, the magnitude of the current flowing through the single-chip microcomputer is limited, thereby reducing the probability of damage to the single-chip microcomputer due to overcurrent, and improving the stability of the load control system.
[0154] In the above embodiment, the values of the first resistor and the second resistor can be selected according to actual usage requirements, and will not be elaborated here.
[0155] The terms "first" and "second" in the description and claims of this application may explicitly or implicitly include one or more of such features. In the written description of the present invention, unless otherwise specified, the meaning of "a plurality" is two or more. In addition, "and / or" in the description and claims means at least one of the connected objects. The character " / " generally indicates an "or" relationship between the associated objects before and after.
[0156] In the written description of the present invention, it can be understood that the terms "center", "longitudinal", "lateral", "length", "width", "thickness", "upper", "lower", "front", "rear", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", "clockwise", "counterclockwise", "axial", "radial", "circumferential", etc. indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings. It is only for the convenience of describing the embodiments of the present invention and simplifying the description of the embodiments of the present invention, rather than indicating or implying that the structures, devices, and elements referred to must have a specific orientation, be constructed and operated in a specific orientation. Therefore, these descriptions should not be construed as limiting the present invention.
[0157] In the written description of the present invention, it can be understood that, except for clear regulations and limitations, the terms "installation", "connection", and "coupling" should be understood in a broad sense. For example, it can be fixedly connected, detachably connected, or integrally connected; it can be a mechanical structure connection or an electrical connection; it can be a direct connection between the two, or an indirect connection between the two through an intermediate medium, and it can be the communication inside the two components. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific situations.
[0158] In the claims, the specification and the drawings of the present invention, the term "a plurality of" means two or more, unless otherwise clearly defined. The orientation or positional relationship indicated by terms such as "upper", "lower", etc. is based on the orientation or positional relationship shown in the drawings, and is only for more convenient description of the present invention and to simplify the description process, rather than to indicate or imply that the device or element referred to must have the specific orientation, be constructed and operated in the specific orientation, so these descriptions should not be construed as limitations on the present invention; terms such as "connection", "installation", "fixation", etc. should all be understood in a broad sense. For example, "connection" can be a fixed connection between multiple objects, a detachable connection between multiple objects, or an integral connection; it can be a direct connection between multiple objects, or an indirect connection between multiple objects through an intermediate medium. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to the specific circumstances of the above data.
[0159] In the claims, the specification and the drawings of the present invention, the description of terms such as "one embodiment", "some embodiments", "specific embodiments", etc. means that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In the claims, the specification and the drawings of the present invention, the schematic representation of the above terms does not necessarily refer to the same embodiment or instance. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner.
[0160] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A control method for a load control system, characterized in that The load control system includes: a single-chip microcomputer, the power supply of the single-chip microcomputer being a first power supply; a load circuit; a switching circuit connected to the load circuit and the single-chip microcomputer, the switching circuit switching between a conducting state and a cutoff state under the control of the single-chip microcomputer, the power supply of the switching circuit being a second power supply, the first power supply and the second power supply being associated. The control method of the load control system includes: When receiving the power supply demand of the load circuit, controlling the switching circuit to switch from the cutoff state to the conducting state, supplying power to the load circuit by using the second power supply for supplying power to the switching circuit, and controlling the single-chip microcomputer to enter the sleep state; When the continuous duration of the single-chip microcomputer in the sleep state is greater than a preset duration, controlling the single-chip microcomputer to exit the sleep state; The single-chip microcomputer includes a timer. When the continuous duration of the single-chip microcomputer in the sleep state is greater than a preset duration, controlling the single-chip microcomputer to exit the sleep state specifically includes: When the switching circuit switches from the cutoff state to the conducting state, controlling the timer to start timing; When the timing duration is greater than or equal to the preset duration, controlling the single-chip microcomputer to exit the sleep state; Obtaining the working parameters of the load circuit; Determining the preset duration according to the working parameters; Wherein, when the single-chip microcomputer is in the sleep state, the digital circuit in the single-chip microcomputer is not powered on.
2. The control method of the load control system according to claim 1, characterized in that, The power supply demand includes a target power supply time. Controlling the switching circuit to switch from the cutoff state to the conducting state and controlling the single-chip microcomputer to enter the sleep state specifically includes: When the current time reaches the target power supply time, controlling the switching circuit to switch from the cutoff state to the conducting state and controlling the single-chip microcomputer to enter the sleep state.
3. The control method of the load control system according to claim 1, characterized in that, The working parameters include: Operating power and / or operating current.
4. A control device for a load control system, characterized in that, The load control system includes: a single-chip microcomputer, the power supply of the single-chip microcomputer being a first power supply; a load circuit; a switching circuit connected to the load circuit and the single-chip microcomputer, the switching circuit switching between a conducting state and a cutoff state under the control of the single-chip microcomputer, the power supply of the switching circuit being a second power supply, the first power supply and the second power supply being associated. The control device of the load control system includes: A first control unit, configured to, when receiving the power supply demand of the load circuit, control the switching circuit to switch from the cutoff state to the conducting state, supply power to the load circuit by using the second power supply for supplying power to the switching circuit, and control the single-chip microcomputer to enter the sleep state; A second control unit, configured to, when the continuous duration of the single-chip microcomputer in the sleep state is greater than a preset duration, control the single-chip microcomputer to exit the sleep state; The single-chip microcomputer includes a timer. The second control unit is specifically configured to: When the switching circuit switches from the cutoff state to the conducting state, control the timer to start timing; When the timing duration is greater than or equal to the preset duration, control the single-chip microcomputer to exit the sleep state; The first control unit is further configured to: Obtain the operating parameters of the load circuit; Determine the preset duration according to the operating parameters; Wherein, when the single-chip microcomputer is in the sleep state, the digital circuit in the single-chip microcomputer is not powered on.
5. The control device of the load control system according to claim 4, characterized in that, The power supply requirement includes a target power supply time, and the first control unit is specifically configured to: When the current time reaches the target power supply time, control the switch circuit to switch from the cut-off state to the conducting state, and control the single-chip microcomputer to enter the sleep state.
6. The control device of the load control system according to claim 4, characterized in that, The operating parameters include: Operating power and / or operating current.
7. A control device for a load control system, characterized in that Comprising: A processor and a memory, the memory stores programs or instructions that can be run on the processor, and when the programs or instructions are executed by the processor, the steps of the method according to any one of claims 1 to 3 are implemented.
8. A readable storage medium, characterized in that, Programs or instructions are stored on the readable storage medium, and when the programs or instructions are executed by the processor, the steps of the method according to any one of claims 1 to 3 are implemented.
9. A load control system, characterized in that, Comprising: The control device of the load control system according to any one of claims 4 to 7; And / or The readable storage medium according to claim 8.
Citation Information
Patent Citations
Memory system and memory chip
CN101517547A
System and method for preventing single-chip microcomputer in battery power supply equipment from resetting due to voltage reduction
CN113937856A