Mode control method and system, and electronic device, and storage medium
Abstract
Provided is a mode control method that includes obtaining a PWM signal; obtaining a duty cycle of the PWM signal; obtaining a target rotational speed of an electric pump based on the duty cycle of the PWM signal; in response to determining that the target rotational speed of the electric pump is equal to 0 and the target rotational speed of the electric pump remains equal to 0 for the set duration, entering the sleep mode by the microcontroller; and in response to determining that the target rotational speed of the electric pump is not equal to 0 or the target rotational speed of the electric pump does not remain equal to 0 for the set duration, entering the working mode by the microcontroller. Further provided are a mode control system, an electronic device and a storage medium.
Claims
exact text as granted — not AI-modifiedWhat is claimed is:
1. A mode control method, applied to a microcontroller configured to control an electric pump, the mode control method comprising:
obtaining a pulse-width modulation (PWM) signal;
obtaining a duty cycle of the PWM signal;
obtaining a target rotational speed of the electric pump based on the duty cycle of the PWM signal;
determining whether the target rotational speed of the electric pump is equal to 0 and whether that the target rotational speed of the electric pump remains equal to 0 for a set duration;
in response to determining that the target rotational speed of the electric pump is equal to 0 and that the target rotational speed of the electric pump remains equal to 0 for the set duration, entering a sleep mode by the microcontroller; and
in response to determining that the target rotational speed of the electric pump is not equal to 0 or the target rotational speed of the electric pump does not remain equal to 0 for the set duration, entering a working mode by the microcontroller;
wherein after the microcontroller enters the sleep mode, the mode control method further comprises:
determining whether the duty cycle of the PWM signal is 0% after a predetermined interval of time;
in response to determining that the duty cycle of the PWM signal is 0%, remaining in the sleep mode by the microcontroller;
in response to determining that the duty cycle of the PWM signal is not 0%, determining whether the duty cycle of the PWM signal falls in a preset duty cycle interval; and
in response to determining that the duty cycle of the PWM signal does not fall in the preset duty cycle interval, entering the working mode by the microcontroller.
2. The mode control method of claim 1 , further comprising determining whether the duty cycle of the PWM signal obtained by the microcontroller is 0% prior to the microcontroller entering the sleep mode, and determining whether the duty cycle of the PWM signal falls in a duty cycle interval bounded by a first duty cycle and a second duty cycle if the duty cycle of the PWM signal obtained by the microcontroller is not 0%; and
if the duty cycle of the PWM signal falls in the duty cycle interval bounded by the first duty cycle and the second duty cycle, the mode control method further comprising the following operations subsequent to the microcontroller entering the sleep mode:
determining whether the duty cycle of the PWM signal falls in the duty cycle interval bounded by the first duty cycle and the second duty cycle at every set interval of time;
in response to determining that the duty cycle of the PWM signal falls in the duty cycle interval bounded by the first duty cycle and the second duty cycle, remaining in the sleep mode by the microcontroller; and
in response to determining that the duty cycle of the PWM signal does not fall in the duty cycle interval bounded by the first duty cycle and the second duty cycle, entering the working mode from the sleep mode by the microcontroller.
3. The mode control method of claim 1 , further comprising:
in a case where the target rotational speed of the electric pump is 0, controlling, by the microcontroller, the electric pump to enter a stop rotating state, and entering the working mode or the sleep mode by the microcontroller; and
obtaining, by the microcontroller, a duration variable denoting that the target rotational speed of the electric pump is 0 where the duration variable is greater than the set duration, entering the sleep mode by the microcontroller.
4. The mode control method of claim 1 , wherein the sleep mode comprises at least one of a first sleep mode or a second sleep mode;
in a case where the target rotational speed of the electric pump remains equal to 0 for the set duration and the duty cycle of the PWM signal is 0%, the microcontroller enters the first sleep mode; and
in a case where the target rotational speed of the electric pump remains equal to 0 for the set duration, the duty cycle of the PWM signal is not 0%, and the duty cycle of the PWM signal falls in a preset duty cycle interval, the microcontroller enters the second sleep mode.
5. The mode control method of claim 4 , further comprising the following operations after the microcontroller enters the second sleep mode:
determining whether the duty cycle of the PWM signal falls in the preset duty cycle interval at every set interval of time;
in response to determining that the duty cycle of the PWM signal falls in the preset duty cycle interval, remaining in the second sleep mode by the microcontroller; and
in response to determining that the duty cycle of the PWM signal does not fall in the preset duty cycle interval, entering the working mode from the second sleep mode by the microcontroller.
6. The mode control method of claim 4 , further comprising:
when the target rotational speed of the electric pump is 0, entering a stop rotating state by the electric pump, and being in the working mode, the first sleep mode, or the second sleep mode by the microcontroller; and obtaining, by the microcontroller, a duration variable that denotes the target rotational speed of the electric pump is 0 and that is greater than the set duration, entering the first sleep mode or the second sleep mode or remaining in a current sleep mode by the microcontroller.
7. The mode control method of claim 1 , further comprising the following operations after obtaining the rotational speed of the electric pump:
in response to determining that the target rotational speed is not equal to 0, entering the working mode by the microcontroller; and
in response to determining that the target rotational speed is equal to 0, entering the sleep mode or entering the sleep mode from the working mode by the microcontroller.
8. The mode control method of claim 1 , wherein the duty cycle comprises a first duty cycle, a second duty cycle, a third duty cycle, and a fourth duty cycle, wherein an interval greater than 0% and less than or equal to the first duty cycle is defined as a first segment, an interval greater than the first duty cycle and less than or equal to the second duty cycle is defined as a second segment, an interval greater than the second duty cycle and less than or equal to the third duty cycle is defined as a third segment, an interval greater than the third duty cycle and less than or equal to the fourth duty cycle is defined as a fourth segment, and an interval greater than the fourth duty cycle and less than or equal to 100% is defined as a fifth segment, wherein the target rotational speed is 0 when the duty cycle is 0%, the target rotational speed corresponding to the first segment is a maximum rotational speed, the second segment is a preset duty cycle interval, the target rotational speed corresponding to the second segment is 0, the target rotational speed corresponding to the third segment is a non-zero minimum rotational speed, the target rotational speed corresponding to the fourth segment linearly increases from the non-zero minimum rotational speed to the maximum rotational speed, and the target rotational speed corresponding to the fifth segment is the maximum rotational speed.
9. The mode control method of claim 1 , wherein the duty cycle comprises a first duty cycle, a second duty cycle, a third duty cycle, a fourth duty cycle and a fifth duty cycle, wherein an interval greater than 0% and less than or equal to the first duty cycle is defined as a first segment, an interval greater than the first duty cycle and less than or equal to the second duty cycle is defined as a second segment, an interval greater than the second duty cycle and less than or equal to the third duty cycle is defined as a third segment, an interval greater than the third duty cycle and less than or equal to the fourth duty cycle is defined as a fourth segment, an interval greater than the fourth duty cycle and less than or equal to the fifth duty cycle is defined as a fifth segment, and an interval greater than the fifth duty cycle and less than or equal to 100% is defined as a sixth segment, wherein the target rotational speed is 0 when the duty cycle is 0%, the target rotational speed corresponding to the first segment is a maximum rotational speed, the target rotational speed corresponding to the second segment linearly decreases from the maximum rotational speed to a non-zero minimum rotational speed, the target rotational speed corresponding to the third segment is the non-zero minimum rotational speed, the target rotational speed corresponding to the fourth segment is a preset duty cycle interval, the target rotational speed corresponding to the fourth segment is 0, the target rotational speed corresponding to the fifth segment linearly increases from the non-zero minimum rotational speed to the maximum rotational speed, and the target rotational speed corresponding to the sixth segment is the maximum rotational speed.
10. A mode control method, applied to a microcontroller configured to control an electric pump, the method comprising:
S1. determining whether a duty cycle of a pulse-width modulation (PWM) signal is 0; in response to determining that the duty cycle of the PWM signal is 0, performing S2; and in response to determining that the duty cycle of the PWM signal is not 0, performing S3;
S2. determining whether the duty cycle of the PWM signal remains 0 for a preset duration; in response to determining that the duty cycle of the PWM signal remains 0 for the preset duration, entering a first sleep mode and controlling the electric pump not to rotate or to stop rotating by the microcontroller; and in response to determining that the duty cycle of the PWM signal does not remain 0 for the preset duration, entering a working mode or remaining in the working mode and controlling the electric pump to rotate at a determined target rotational speed by the microcontroller; and
S3. determining whether the duty cycle of the PWM signal falls in a preset duty cycle interval; in response to determining that the duty cycle of the PWM signal falls in the preset duty cycle interval, entering a second sleep mode by the microcontroller; and in response to determining that the duty cycle of the PWM signal does not fall in the preset duty cycle interval, entering the working mode or remaining in the working mode and controlling the electric pump to rotate at the determined target rotational speed by the microcontroller.
11. The mode control method of claim 10 , further comprising:
determining, by the microcontroller, whether the duty cycle of the PWM signal is equal to 0% after entering the first sleep mode; in response to determining that the duty cycle of the PWM signal is equal to 0%, remaining in the first sleep mode by the microcontroller; and in response to determining that the duty cycle of the PWM signal is not equal to 0%, entering the working mode from the first sleep mode and controlling the electric pump to rotate at the determined target rotational speed by the microcontroller; and
determining, by the microcontroller, whether the duty cycle of the PWM signal falls in the preset duty cycle interval at every set interval of time after entering the second sleep mode; in response to determining that the duty cycle of the PWM signal falls in the preset duty cycle interval, controlling the microcontroller to remain in the second sleep mode; and in response to determining that the duty cycle of the PWM signal does not fall in the preset duty cycle interval, entering the working mode from the second sleep mode and controlling the electric pump to rotate at the determined target rotational speed by the microcontroller.
12. A mode control system, configured for controlling an electric pump and, the mode control system comprising:
a host computer, comprising a pulse-width modulation (PWM) controller configured to issue a PWM signal; and
a microcontroller, electrically connected to the host computer and configured to receive and parse the PWM signal to obtain a duty cycle of the PWM signal and obtain a target rotational speed of the electric pump based on the duty cycle of the PWM signal, wherein
the microcontroller is further configured to: determine whether the target rotational speed of the electric pump is equal to 0 and determine whether the target rotational speed of the electric pump remains equal to 0 for a set duration; enter a sleep mode in response to determining that the target rotational speed of the electric pump is equal to 0 and the target rotational speed of the electric pump remains equal to 0 for the set duration; and enter a working mode in response to determining that the target rotational speed of the electric pump is not equal to 0 or the target rotational speed of the electric pump does not remain equal to 0 for the set duration;
wherein after the microcontroller enters the sleep mode, the microcontroller is further configured to:
determine whether the duty cycle of the PWM signal is 0% after a predetermined interval of time;
remain in the sleep mode in response to determining that the duty cycle of the PWM signal is 0%;
determine whether the duty cycle of the PWM signal falls in a preset duty cycle interval; and
enter the working mode in response to determining that the duty cycle of the PWM signal does not fall in the preset duty cycle interval.
13. The mode control system of claim 12 , wherein the control system further comprises a first clock;
the microcontroller is further configured to obtain a first clock signal and initialize the first clock signal;
the first clock is configured to start timing and issue the first clock signal when the target rotational speed of the electric pump is 0, the first clock signal denoting a duration that the target rotational speed of the electric pump remains 0; and
the microcontroller is further configured to determine whether the first clock signal is greater than or equal to the set duration, and determine that the target rotational speed of the electric pump remains equal to 0 for the set duration if the first clock signal is greater than or equal to the set duration.
14. The mode control system of claim 13 , further comprising a second clock;
and wherein the microcontroller is further configured to obtain a second clock signal and initialize the second clock signal;
the second clock is configured to start timing and issue the second clock signal in a case wherein the microcontroller enters the sleep mode, the second clock signal denoting a duration that the microcontroller remains in the sleep mode; and
the microcontroller is further configured to determine whether the second clock signal is greater than or equal to the set duration and determine whether the duty cycle of the PWM signal falls in a preset duty cycle interval if the second clock signal is greater than or equal to the set duration.
15. The mode control system of claim 12 , wherein the sleep mode comprises at least one of a first sleep mode or a second sleep mode;
the microcontroller is configured to enter the first sleep mode in a case where the target rotational speed of the electric pump remains equal to 0 for the set duration and the duty cycle of the PWM signal is 0%; and
the microcontroller is configured to enter the second sleep mode in a case where the target rotational speed of the electric pump remains equal to 0 for the set duration, the duty cycle of the PWM signal is not 0%, and the duty cycle of the PWM signal falls in a duty cycle interval bounded by a first duty cycle and a second duty cycle.
16. The mode control system of claim 15 , wherein
after entering the first sleep mode, the microcontroller is further configured to enter the working mode from the first sleep mode if the duty cycle of the PWM signal is not equal to 0%; and
after entering the second sleep mode, the microcontroller is further configured to obtain the PWM signal at every set interval of time, and enter the working mode from the second sleep mode if the duty cycle of the PWM signal falls outside the preset duty cycle interval.
17. An electronic device, comprising:
one or more processors; and
a non-transitory storage device, configured to store one or more programs,
wherein the one or more programs when executed by the one or more processors cause the one or more processors to perform the method as recited in claim 1 .Join the waitlist — get patent alerts
Track US12120850B2 — get alerts on status changes and closely related new filings.
We store only your email — no account needed. See our privacy policy.