Atomizing Device and Its PWM Lighting Effect Control Method, System and Storage Medium
By setting independent lighting effect control parameters in the PWM channel of the electronic atomizer, and using software control to achieve a variety of lighting effect effects, the problem of single lighting effect caused by limited PWM channel in the prior art is solved, and the cost and size are reduced.
Patent Information
- Application Number
- CN202210625903.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-06-02
- Publication Date
- 2025-07-01
- Estimated Expiration
- 2042-06-02
AI Technical Summary
Due to the limited PWM channel of the MCU control module, existing electronic atomizers cannot achieve more PWM lighting effect control, resulting in single lighting effect.
Through software control, three lighting control parameters, PWM single-period high-level duration, PWM single-period and duty cycle update cycle are set in each PWM channel through software control, so as to realize arbitrary adjustment of the duty cycle of the PWM channel.
More breathing lamp effects are achieved, the single lighting effect problem caused by limited number of PWM channels is avoided, and the production cost and equipment size are reduced.
Smart Images

Figure CN115022998B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of lamp effect control of atomizing devices, and particularly to an atomizing device, a PWM lamp effect control method, system and storage medium thereof. Background Art
[0002] With the increasing use of electronic atomizers by users, while pursuing the internal use experience and taste, users are also gradually pursuing the appearance use experience of electronic atomizers. This has prompted various electronic atomizer manufacturers to continuously improve the requirements for the appearance and lamp effect design of electronic atomizers, resulting in higher and higher hardware requirements for controlling lamp effect flashing.
[0003] Currently, most electronic atomizers use hardware to control the LEDs on the electronic atomizer to achieve the breathing effect of the electronic atomizer in the use state or charging state. However, in most hardware designs, due to cost and the size of the entire electronic atomizer, the PWM channels of its MCU control module are limited, such as 3 / 4. In this case, more PWM breathing lamp effects cannot be achieved only by hardware. Summary of the Invention
[0004] In view of this, the purpose of the present invention is to provide an atomizing device, a PWM lamp effect control method, system and storage medium thereof, which solve the problem that more PWM lamp effect controls cannot be achieved by hardware in the prior art through software control.
[0005] To achieve the above purpose, the first aspect of the present invention provides a PWM lamp effect control method for an atomizing device, including the following steps:
[0006] Continuously monitor the operating state of the atomizing device, and generate a first interrupt signal when the operating state changes;
[0007] In response to the first interrupt signal, obtain the lamp effect control parameters of each PWM channel after the operating state of the atomizing device changes, initialize each PWM channel and start a timer, and then generate the control signal;
[0008] In response to the control signal, and determine whether the timer reaches the interrupt time, and generate a second interrupt signal when the interrupt time arrives;
[0009] In response to the second interrupt signal, traverse and poll each PWM channel, and when the PWM channel is turned on, execute the lamp effect control of the corresponding PWM channel according to the corresponding lamp effect control parameters.
[0010] Further, before the step of continuously monitoring the operating state of the atomizing device and generating a first interrupt signal when the operating state changes, the following steps are further included:
[0011] Configure the basic time base of the atomization device and the lamp effect control parameters of each PWM channel in each operating state; wherein, the basic time base is the basic period for the timer to traverse and poll the PWM channels, and the lamp effect control parameters are integer multiples of the basic time base and are counted based on the basic time base.
[0012] Further, in the step of monitoring the operating state of the atomization device in real time and generating a first interrupt signal when the operating state changes, the atomization device has a corresponding status flag bit in each operating state, and the change of the operating state includes active change and / or passive change. The active change is triggered internally by the atomization device, and the passive change is triggered externally by the atomization device. The specific method is as follows:
[0013] Monitor the external trigger action and / or internal trigger action acting on the atomization device in real time. When an external trigger action is recognized, obtain the status flag bit of the atomization device before and after the change of the operating state and the lamp effect control parameters of each PWM channel before the change of the operating state, and respectively judge whether the lamp effect control parameters of each PWM channel in the current operating state are zero. If so, set the status flag bit to 0. Otherwise, set the status flag bit to 0 and then clear the lamp effect control parameters of each PWM channel. When an internal trigger action is recognized, obtain the status flag bit of the atomization device before and after the change of the operating state and set the status flag bit to 0.
[0014] Further, the lamp effect control parameters at least include the high-level duration of a single PWM cycle, the single PWM cycle, and the duty cycle update period. The values of the high-level duration of a single PWM cycle, the single PWM cycle, and the duty cycle update period increase in sequence, and the duty cycle update period is an integer multiple of the single PWM cycle.
[0015] Further, in the step of responding to the second interrupt signal, traversing and polling each PWM channel, and when the PWM channel is turned on, performing the lamp effect control of the corresponding PWM channel according to the corresponding lamp effect control parameters, the following sub-steps are included:
[0016] Respond to the second interrupt signal and loop through polling each PWM channel;
[0017] Judge whether the PWM channel is turned on. If it is turned on, generate a first parameter judgment signal, a second parameter judgment signal, and a third parameter judgment signal. Otherwise, end the lamp effect control of the corresponding PWM channel;
[0018] Respond to the first parameter judgment signal, judge whether the high-level duration of a single PWM cycle is zero. If so, control the control module of the atomization device to output a low level. Otherwise, control the control module of the atomization device to output a high level and generate a self-decrement signal;
[0019] In response to the second parameter judgment signal, determine whether the PWM single cycle is zero. If it is not zero, generate the decrement signal;
[0020] In response to the third parameter judgment signal, determine whether the duty cycle update period is zero. If it is not zero, generate the decrement signal;
[0021] In response to the decrement signal, decrement the values corresponding to the PWM single cycle high level duration, the PWM single cycle, and the duty cycle update period by 1 respectively to generate the control signal.
[0022] Further, after the step of determining whether the PWM single cycle is 0 in response to the second parameter judgment signal, the following steps are further included:
[0023] If it is zero, generate a first parameter loading signal;
[0024] In response to the first parameter loading signal, reload the PWM single cycle high level duration and the PWM single cycle according to the lamp effect control parameters in the current operating state to generate the control signal.
[0025] Further, after the step of determining whether the duty cycle update period is zero in response to the third parameter judgment signal, the following steps are further included:
[0026] If it is zero, generate a second parameter loading signal;
[0027] In response to the second parameter loading signal, reload the PWM single cycle high level duration, the PWM single cycle, and the duty cycle update period according to the lamp effect control parameters in the current operating state to generate the control signal.
[0028] The second aspect of the present invention provides a PWM lamp effect control system for an atomization device, including:
[0029] A parameter configuration module for configuring the basic time base of the atomization device in each operating state and the lamp effect control parameters of each PWM channel;
[0030] An operating state monitoring module for monitoring the operating state of the atomization device in real time and generating a first interrupt signal when the operating state changes;
[0031] A parameter acquisition and initialization module for acquiring the lamp effect control parameters of the atomization device after the operating state changes according to the first interrupt signal, initializing the PWM channel with the lamp effect control parameters and starting a timer to generate a control signal;
[0032] An interruption time determination module, configured to determine whether the timer reaches the interruption time according to the control signal, and generate a second interruption signal when the interruption time arrives; and
[0033] A lighting effect control module, configured to traverse and poll each PWM channel according to the second interruption signal, and when the PWM channel is turned on, perform the lighting effect control of the corresponding PWM channel according to the corresponding lighting effect control parameter.
[0034] The third aspect of the present invention provides an atomization device based on PWM lighting effect control, including:
[0035] An atomization device, configured to identify a triggering action acting thereon and respond to the triggering action to convert the corresponding operating state;
[0036] A PWM lighting effect control system disposed in the atomization device, configured to generate a corresponding control signal according to the operating state of the atomization device, and determine whether the timer reaches the interruption time according to the control signal and control the corresponding PWM channel to perform lighting effect control when the interruption time arrives; and
[0037] A lighting effect display module disposed on the atomization device, configured to perform corresponding lighting effect display according to the PWM lighting effect control system.
[0038] The fourth aspect of the present invention provides a computer storage medium, on which an executable computer program is stored, and when the computer program is executed by a processor, the PWM lighting effect control method of the atomization device as described above is implemented.
[0039] In the present invention, three lighting effect control parameters, namely, the PWM single-cycle high-level duration, the PWM single cycle, and the duty cycle update period, which are independent of each other, are respectively set in each PWM channel based on the basic time base of the timer. By adjusting the three lighting effect control parameters, the duty cycle of each PWM channel can be arbitrarily adjusted, thereby realizing the lighting effect control of the corresponding PWM channel, enabling the atomization device to have more breathing lamp effects. The control process is not limited by the number of PWM channels, and there is no need to additionally replace the MCU control module with multiple PWM channels, which can not only save the production cost of the atomization device, but also effectively reduce the size of the atomization device. Description of the Drawings
[0040] Figure 1 It is a flowchart of the PWM lighting effect control method of the atomization device according to Embodiment 1 of the present invention.
[0041] Figure 2 is Figure 1 The timing logic diagram of the basic time base, the PWM single-cycle high-level duration, the PWM single cycle, and the duty cycle update period in step S1 in.
[0042] Figure 3For Figure 1 Another flowchart of the PWM lamp effect control method for the atomizing device.
[0043] Figure 4 It is the control block diagram of the PWM lamp effect control system for the atomizing device according to Embodiment 2 of the present invention.
[0044] Figure 5 It is the structural block diagram of the atomizing device based on PWM lamp effect control according to Embodiment 3 of the present invention. Detailed implementation manners
[0045] The following is a further detailed description through specific implementation manners:
[0046] Embodiment 1
[0047] As Figure 1 and Figure 2 shown, it is the flowchart of the PWM lamp effect control method for the atomizing device of this embodiment. The lamp effect pointed out in the PWM lamp effect control method for the atomizing device of this embodiment is the breathing effect of the lamp effect display module (which can be an LED lamp group in this embodiment) provided on the atomizing device. By adjusting the duty cycle of the PWM channel, the on and off of different LED lamps and the on and off time of the same LED lamp can be controlled to achieve different breathing effects, so as to indicate the current operating state of the atomizing device. Specifically, this embodiment includes the following steps:
[0048] S1: Configure the basic time base and lamp effect control parameters of the atomizing device in each operating state.
[0049] First, based on a hardware timer and combined with the breathing effect required to be achieved by the atomizing device, set the pulse period of the timer, and configure the pulse period as the basic time base T0 for the atomizing device to achieve the breathing effect. The basic time base T0 is the interruption time of the timer, that is, the basic period for traversing and polling the PWM channel in the subsequent implementation process. In this embodiment, considering the operating efficiency and control accuracy of the MCU control module comprehensively, the basic time base T0 is 0.25 ms. Of course, in some other embodiments, the pulse period can be selected as 0.5 ms or 1 ms, etc., and set as the basic time base T0.
[0050] Then, based on the basic time base T0, the light effect control parameters of the atomizing device in each operating state are configured respectively. The light effect control parameters are counted based on the basic time base T0, and the light effect control parameters are integral multiples of the basic time base. In this embodiment, the operating states of the atomizing device include a normal state, an abnormal state, a charging state, etc.; among them, the normal state can further include a power usage state (specifically, the power consumption of the battery during use, which can be reflected as a percentage of the power), a suction state, and an atomizing oil usage state (specifically, the consumption of the atomizing oil, which can also be reflected as a remaining percentage, and can be obtained by monitoring the liquid level or hydraulic pressure of the atomizing oil in the atomizing cartridge during specific implementation), etc.; the abnormal state can further include a battery abnormality, an atomizing oil abnormality, an atomizing device abnormality, etc.; and the charging state can further include a power increase state (specifically, the power increase during the battery charging process, which can also be reflected as a percentage of the power). Correspondingly, the corresponding light effect control parameters are configured for the atomizing device in each state, so as to control the light effect to display different breathing effects for the atomizing device in different operating states.
[0051] Specifically, the light effect control parameters are pre-configured in the atomizing device when it leaves the factory and do not require secondary configuration. Of course, in some other embodiments, the light effect control parameters can also be custom-modified through later software or hardware, so that users can customize the light effect according to their needs to achieve more breathing effects; for example, the light effect control parameters of the atomizing device can be remotely modified in the form of an application software, or the light effect control parameters can be modified by connecting a peripheral device through a data interface on the atomizing device, or the custom setting of the light effect control parameters can be achieved by setting buttons on the atomizing device, etc.
[0052] In this embodiment, to achieve the control of various lighting effects of the atomization device, the lighting effect control parameters include the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3. The high-level duration T1 of a single PWM cycle is the duration of the output high level within a PWM cycle, that is, the time when the light is on within a PWM cycle (when the high level is triggered, if the low level is triggered, it corresponds to the time when the light is off). The single PWM cycle T2 is the duration of a PWM cycle, and the single PWM cycle T2 includes the high-level duration T1 of a single PWM cycle and the low-level duration of a single PWM cycle. The duty cycle update period T3 is the time of continuous operation at a certain set duty cycle (in this embodiment, it is reflected as the ratio of the high-level duration T1 of a single PWM cycle in the single PWM cycle T2). When the duration is exceeded, the corresponding duty cycle will change. For example, when the current operating state has a duty cycle of 70%, when the duty cycle update period T3 is reached, the next duty cycle may be 75% or the value corresponding to other operating states; the duty cycle update period T3 includes several single PWM cycles T2.
[0053] As Figure 2 shown, the timing logic diagram of the basic time base T0, the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3. The high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 are all counted based on the basic time base T0, and the values of the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 are all integer multiples of the basic time base T0 (that is, 0.25 ms in this embodiment), that is, T1 = NT0, T2 = MT0, T3 = QT0, where: N, M, and Q are all positive integers and N ≤ M ≤ Q; at the same time, the duty cycle update period T3 is an integer multiple of the single PWM cycle T2, that is, T3 = PT2, where: P is a positive integer, and P = M * Q.
[0054] In this embodiment, the step S1 is the configuration step of the lighting effect control parameters when the lighting effect control is executed. Usually, it is the step executed when the atomization device leaves the factory, is used for the first time, or when other custom configurations of the lighting effect control parameters are required. If it is not one of the foregoing situations, when the lighting effect control is executed in this embodiment, the step S1 can be omitted and directly start from step S2.
[0055] S2: Monitor the operating state of the atomization device and generate a first interrupt signal when the operating state changes.
[0056] Monitor the operating state of the atomizing device in real time, and determine whether the operating state of the atomizing device has changed. If it has changed, generate a first interrupt signal when the operating state changes, so that the atomizing device temporarily executes the corresponding breathing effect (or lighting effect) before the change of the operating state. If it has not changed, continue to monitor the operating state of the atomizing device until the first interrupt signal is generated after the operating state changes. In this embodiment, the atomizing device has corresponding status flag bits in each operating state, such as a charging status flag bit, a working status flag bit, and so on. Correspondingly, when the atomizing device is in the charging state, its corresponding charging status flag bit is set to 1. When switching from the charging state to the working state, the corresponding charging status flag bit is set to 0, and at the same time, the working status flag bit is set to 1; and so on. When the atomizing device is in other operating states, the assignment method of its corresponding status flag bits is the same and will not be elaborated here.
[0057] The change in the operating state of the atomizing device includes active change and / or passive change. The active change is mainly the change in the operating state of the atomizing device caused by an internal trigger action when the program runs to a certain moment or a certain state. The internal trigger action is such as the battery level or the atomizing oil reaching an integer (50%, 80%, etc.), or the atomizing device has been running in a certain state for a certain period of time (10 minutes, 20 minutes, etc.), which causes the corresponding change in the operating state of the atomizing device; the passive change is mainly the change in the operating state of the atomizing device caused by an external trigger action. The external trigger action is such as connecting the atomizing device to charging, data transmission, or button triggering, etc., which causes the corresponding change in the operating state of the atomizing device.
[0058] In the specific implementation of this embodiment, the internal program running on the atomizing device is monitored in real time by the operating state monitoring module inside the atomizing device to a certain moment or a certain state corresponding internal trigger action and / or external trigger action acting on the external structure (such as interfaces, buttons).
[0059] When it is recognized as an external trigger action, the change in the operating state of the atomizing device caused by the external trigger action may cause the atomizing device not to reach the corresponding duty cycle update period before the change in the operating state. At this time, the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 are all non-zero. To avoid program operation errors, it is necessary to obtain the status flag bits of the atomizing device before and after the change in the operating state and the lamp effect control parameters of each PWM channel before the change in the operating state at the same time, and judge whether the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 of the atomizing device before the change in the operating state are zero. If they are all zero, set the status flag bit of the operating state before the change to 0 and the status flag of the operating state after the change to 1. If they are not all zero, set the status flag bit of the operating state before the change to 0, clear the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3, and then set the status flag of the operating state after the change to 1.
[0060] When it is recognized as an internal trigger action, most of the changes in the operating state of the atomizing device caused by the internal trigger action are due to reaching the internally set duty cycle update period T3. At this time, the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 are all zero. Then directly obtain the status flag bits of the atomizing device before and after the change in the operating state and set the status flag bit of the operating state before the change to 0 and the status flag of the operating state after the change to 1.
[0061] S3: Obtain the lamp effect control parameters according to the first interrupt signal and initialize the PWM channels and the timer.
[0062] Specifically, in response to the first interrupt signal, combined with the corresponding changed operating state of the atomizing device, obtain the lamp effect control parameters (the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3) of each PWM channel in the changed operating state, and initialize each PWM channel with the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 and their multiple values (i.e., N, M, Q) of the corresponding basic time base T0, and start the timer to run. At the same time, generate a control signal to control the subsequent program operation.
[0063] S4: Generate a second interrupt signal when the interrupt time of the set timer arrives.
[0064] Specifically, in response to the control signal, monitor the running situation of the timer, judge whether the timer reaches the interrupt time, that is, whether the timer runs through a basic time base T0. When the timer interrupt time arrives, generate a second interrupt signal to trigger the subsequent judgment step.
[0065] S5: Poll the PWM channels according to the second interrupt signal, and execute the corresponding lighting effect control when the PWM channel is enabled.
[0066] Based on the second interrupt signal, traverse and poll each PWM channel and determine whether the PWM channel is enabled. When the PWM channel is enabled, execute the lighting effect control of the corresponding PWM channel according to the corresponding lighting effect control parameters; otherwise, end the lighting effect control of the PWM channel.
[0067] As Figure 3 shown, the step S5 includes the following sub-steps:
[0068] S501: In response to the second interrupt signal, loop through and poll each PWM channel.
[0069] S502: Determine whether each PWM channel is enabled. If the PWM channel is enabled, generate a first parameter judgment signal, a second parameter judgment signal, and a third parameter judgment signal to judge the PWM single-cycle high-level duration T1, the PWM single-cycle T2, and the duty cycle update period T3 of each enabled PWM channel respectively; if the PWM channel is not enabled, end the lighting effect control corresponding to the closed PWM channel.
[0070] Specifically, in this embodiment, when determining whether the PWM channel is enabled, it is judged based on the value of an enable flag bit, that is, obtain the value of the enable flag bit of the corresponding channel. If the value is 1, it means that the PWM channel is enabled; if the value is 0, it means that the PWM channel is closed.
[0071] S503: In response to the first parameter judgment signal, judge whether the PWM single-cycle high-level duration T1 is zero, that is, judge whether N is zero. If N is not zero, it means that the PWM single-cycle high-level duration T1 has not ended. At this time, control the corresponding IO pin on the control module of the atomization device to output a high level to trigger the LED light of the corresponding PWM channel in the lighting effect display module of the atomization device to turn on, and at the same time generate a decrement signal and then jump to execute step S506; if N is zero, control the corresponding IO pin on the control module of the atomization device to output a low level and then return to execute step S4 to turn off the LED light of the corresponding PWM channel on the lighting effect display module of the atomization device to realize the control of the LED light turning on and off.
[0072] S504: In response to the second parameter judgment signal, determine whether the PWM single cycle T2 is zero, that is, determine whether M is zero. If M is not zero, it indicates that the LED light has not completed a cycle of turning on and off, that is, a PWM single cycle T2 has not ended. At this time, after generating the decrement signal, jump to execute step S506; if M is zero, it indicates that a PWM single cycle T2 has ended. At this time, generate a first parameter loading signal and then jump to execute step S507.
[0073] S505: In response to the third parameter judgment signal, determine whether the duty cycle update period T3 is zero, that is, determine whether Q is zero. If Q is not zero, it indicates that the period during which the lamp effect control is executed according to the current duty cycle in the current operating state has not ended. At this time, after generating the decrement signal, jump to execute step S506; if Q is zero, it indicates that the lamp effect control executed according to the current duty cycle has ended, and the lamp effect control needs to be continued according to the set next duty cycle. At this time, generate a second parameter loading signal and then jump to execute step S508.
[0074] In the specific implementation of this embodiment, when steps S503 to S505 respectively judge the three parameters of the PWM single cycle high-level duration T1, the PWM single cycle T2, and the duty cycle update period T3, they can be performed sequentially or simultaneously. When performed sequentially, the judgment order is not limited by the above order and can be executed in any order.
[0075] S506: In response to the decrement signal, subtract 1 from the value N of the PWM single cycle high-level duration T1, the value M of the PWM single cycle T2, and the value Q of the duty cycle update period T3 respectively, then generate the control signal and return to execute step S4.
[0076] S507: In response to the first parameter loading signal, reload the PWM single cycle high-level duration T1 and the PWM single cycle T2 according to the lamp effect control parameters in the current operating state, then generate the control signal and return to execute step S4. At this time, the values of the lamp effect control parameters of each PWM channel, namely the PWM single cycle high-level duration T1, the PWM single cycle T2, and the duty cycle update period T3, can be expressed as N, M, and Q - X * M (where: X represents the number of times the PWM single cycle T2 runs, that is, the number of times to execute a cycle of turning on and off the LED light).
[0077] S508: In response to the second parameter loading signal, reload the PWM single cycle high-level duration T1, the PWM single cycle T2, and the duty cycle update period T3 according to the lamp effect control parameters in the current operating state, then generate the control signal and return to execute step S4, so that the atomization device performs lamp effect control according to the duty cycle of the next operating state, thereby achieving more breathing effects.
[0078] The PWM lighting effect control method of the atomization device in this embodiment sets three independent lighting effect control parameters, namely, the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3, in the PWM channel based on the basic time base of the timer. By separately adjusting these three lighting effect control parameters, arbitrary adjustment of the duty cycle of each PWM channel can be achieved, so that more lighting effects can be realized through various combinations of duty cycles to meet different usage requirements of users. The adjustment process is not limited by the number of hardware PWM channels, which can effectively solve the problem of single lighting effect caused by limited number of PWM channels. It is convenient to use and has low requirements for hardware, which can effectively save the production cost of the atomization device.
[0079] Embodiment 2
[0080] As Figure 4 shown, it is the control block diagram of the PWM lighting effect control system of the atomization device in this embodiment. The PWM lighting effect control system of the atomization device in this embodiment is used to implement the PWM lighting effect control method of the atomization device with the same or similar processes and functions as those in Embodiment 1. The PWM lighting effect control system of the atomization device in this embodiment includes a parameter configuration module 201, an operating state monitoring module 202, a parameter acquisition and initialization module 203, an interruption time judgment module 204, and a lighting effect control module 205. Among them:
[0081] The parameter configuration module 201 can configure the basic time base T0 of the atomization device in each operating state and the lighting effect control parameters of each PWM channel, and store the configured basic time base T0 and the lighting effect control parameters of each PWM channel corresponding to the operating state of the atomization device in a storage module. Specifically, first, based on a timer, set the basic period for it to traverse and poll the PWM channels, and use this basic period as the basic time base T0 for the atomization device to achieve the breathing effect. Then, based on this basic time base T0 and combined with the operating state of the atomization device, configure the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 of each PWM channel respectively.
[0082] In this embodiment, when the parameter configuration module 201 configures the basic time base T0, the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3, it can be configured at the factory or can be customized later based on the user's configuration instructions after leaving the factory. For the specific configuration process and rules, refer to the relevant description of step S1 in Embodiment 1, which will not be elaborated here.
[0083] The operation status monitoring module 202 can monitor the operation status of the atomization device in real time, and generate a first interrupt signal when the operation status changes. The first interrupt signal is used to control the atomization device to temporarily execute the corresponding breathing effect (or lighting effect) before the operation status change. Specifically, the operation status monitoring module 202 monitors in real time the internal trigger actions corresponding to a certain moment or state when the internal program acting on the atomization device runs, and / or the external trigger actions acting on external structures (such as interfaces, buttons). When the internal trigger action and / or external trigger action are recognized, the status flag bits of the atomization device before and after the operation status change and / or the lighting effect control parameters of each PWM channel before the operation status change are obtained. Then, the status flag bit of the operation status before the change is set to 0, the status flag bit of the operation status after the change is set to 1, and the lighting effect control parameters of each PWM channel before the operation status change are cleared.
[0084] In this embodiment, the operation status change of the atomization device includes active change and / or passive change. The active change is mainly the change of the operation status of the atomization device caused by internal trigger actions when the program runs to a certain moment or state. The passive change is mainly the change of the operation status of the atomization device caused by external trigger actions. For the specific process of the operation status monitoring module 202 for real-time monitoring of the operation status of the atomization device, refer to the relevant description of step S2 in Embodiment 1, which will not be elaborated here.
[0085] The parameter acquisition and initialization module 203 receives the first interrupt signal generated by the operation status monitoring module 202, and obtains the lighting effect control parameters corresponding to the atomization device after the operation status change in the storage module. The corresponding PWM channels are initialized with the lighting effect control parameters (PWM single-cycle high-level duration T1, PWM single-cycle T2, and duty cycle update period T3), then the timer is started, and a control signal is generated at the same time.
[0086] The interrupt time judgment module 204 receives the control signal generated by the parameter acquisition and initialization module 203 and judges whether the timer reaches the interrupt time according to the control signal. When the interrupt time arrives, a second interrupt signal is generated.
[0087] The lamp effect control module 205 receives the second interrupt signal generated by the interrupt time judgment module 204, traverses and polls each PWM channel according to the second interrupt signal, determines whether each PWM channel is enabled, and when the PWM channel is enabled, judges the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, the duty cycle update period T3, and the multiple values N, M, and Q of their corresponding basic time bases T0, so as to realize the lamp effect control of the corresponding PWM channel. For the control process of the lamp effect control module 205, refer to the relevant description of step S5 in Embodiment 1, which will not be elaborated here.
[0088] In the PWM lamp effect control system of the atomizing device in this embodiment, by setting the parameter configuration module 201 to configure the high-level duration T1 of a single PWM cycle, the single PWM cycle T2, and the duty cycle update period T3 for each PWM channel of the atomizing device in each operating state, and by identifying the operating state of the atomizing device, the corresponding lamp effect control parameters can be obtained when the operating state changes, so as to change the breathing effect of the LED lamp of the atomizing device, thereby meeting the requirement of the atomizing device to achieve more breathing lamp effects.
[0089] Embodiment 3
[0090] As Figure 5 shown, it is a structural block diagram of an atomizing device based on PWM lamp effect control in this embodiment. The atomizing device 301 based on PWM lamp effect control in this embodiment realizes more breathing lamp effects based on the PWM lamp effect control system of the atomizing device in Embodiment 2 (that is, the PWM lamp effect control system 302 in this embodiment). Specifically, this embodiment includes an atomizing device 301, a PWM lamp effect control system 302, and a lamp effect display module 303. Among them:
[0091] The atomizing device 301 can recognize the triggering action acting on it and respond to the triggering action to convert the corresponding operating state. Specifically, the atomizing device 301 can recognize the internal triggering action and external triggering action acting on it based on its built-in operating program or peripheral structure (interface, button, etc.), and form a monitoring signal and transmit it to the PWM lamp effect control system 302.
[0092] The PWM light effect control system 302 is configured within the atomizing device 301. It can pre-configure or customize the basic time base T0 and light effect control parameters (T1 to T3) for implementing different light effect controls, and monitor the operating state of the atomizing device 301 in real time according to the monitoring signal formed by the atomizing device 301. When the operating state of the atomizing device 301 changes, it generates corresponding control signals, and determines whether the timer reaches the interrupt time according to the control signals and controls the corresponding PWM channel to execute light effect control when the interrupt time arrives. The monitoring process of the operating state of the atomizing device 301 and the light effect control process by the PWM light effect control system 302 based on the monitoring signal are referred to the relevant descriptions in Embodiment 2, which will not be elaborated in this embodiment.
[0093] The light effect display module 303 is configured on the atomizing device 301, and it can perform corresponding light effect display according to the PWM light effect control system 302. Specifically, the light effect display module 303 can be multiple LED lights arranged on the outer shell of the atomizing device 301 and electrically connected to the PWM light effect control system 302. It controls the lighting and extinguishing of different LED lights according to the high and low levels output by the PWM light effect control system 302, thereby realizing the display of the breathing effect of the LED lights.
[0094] In the atomizing device based on PWM light effect control of this embodiment, by arranging the PWM light effect control system 302 and the light effect display module 303 on the atomizing device 301, different breathing effects can be displayed through the LED lights according to needs or the operating state of the atomizing device 301, so that users can understand the operating state of the atomizing device 301 at any time.
[0095] As another embodiment of the present invention, a computer storage medium is also provided. The computer storage medium stores computer-executable instructions. When the computer-executable instructions are called and executed by a processor, the computer-executable instructions cause the processor to implement the PWM light effect control method of the atomizing device as described in Embodiment 1.
Claims
1. PWM lighting effect control method for an atomization device, characterized in that, It includes the following steps: Monitor the operating state of the atomizing device in real time, and generate a first interrupt signal when the operating state changes; In response to the first interrupt signal, obtain the lighting effect control parameters of each PWM channel after the change of the operating state of the atomizing device, initialize each PWM channel and start a timer, and then generate a control signal. The lighting effect control parameters at least include the high-level duration of a single PWM cycle, the single PWM cycle, and the duty cycle update period; In response to the control signal, judge whether the timer reaches the interrupt time, and generate a second interrupt signal when the interrupt time arrives; In response to the second interrupt signal, traverse and poll each PWM channel, and when the PWM channel is turned on, execute the lighting effect control of the corresponding PWM channel according to the corresponding lighting effect control parameters; wherein, this step includes: In response to the second interrupt signal, loop through and poll each PWM channel; Judge whether the PWM channel is turned on. If it is turned on, generate a first parameter judgment signal, a second parameter judgment signal, and a third parameter judgment signal. Otherwise, end the lighting effect control of the corresponding PWM channel; In response to the first parameter judgment signal, judge whether the high-level duration of a single PWM cycle is zero. If it is, control the control module of the atomizing device to output a low level. Otherwise, control the control module of the atomizing device to output a high level and generate a decrement signal; In response to the second parameter judgment signal, judge whether the single PWM cycle is zero. If it is not zero, generate the decrement signal; In response to the third parameter judgment signal, judge whether the duty cycle update period is zero. If it is not zero, generate the decrement signal; In response to the decrement signal, decrement the values corresponding to the high-level duration of a single PWM cycle, the single PWM cycle, and the duty cycle update period by 1 respectively, and then generate the control signal.
2. The PWM lamp effect control method of the atomization device according to claim 1, characterized in that, Before the step of monitoring the operating state of the atomizing device in real time and generating a first interrupt signal when the operating state changes, the following steps are further included: Configure the basic time base of the atomizing device and the lighting effect control parameters of each PWM channel in each operating state; wherein, the basic time base is the basic period for the timer to traverse and poll the PWM channels, and the lighting effect control parameters are integer multiples of the basic time base and are counted based on the basic time base.
3. The PWM lamp effect control method of the atomization device according to claim 1, characterized in that, In the step of monitoring the operating state of the atomizing device in real time and generating a first interrupt signal when the operating state changes, the atomizing device has a corresponding status flag bit in each operating state, and the change of the operating state includes active change and / or passive change. The active change is triggered internally by the atomizing device, and the passive change is triggered externally by the atomizing device. The specific method is: Monitor the external trigger action and / or internal trigger action acting on the atomization device in real time. When an external trigger action is recognized, obtain the status flag bits of the atomization device before and after the change in the operating state and the light effect control parameters of each PWM channel before the change in the operating state, and respectively determine whether the light effect control parameters of each PWM channel in the current operating state are zero. If they are zero, set the status flag bit to 0; otherwise, set the status flag bit to 0 and then clear the light effect control parameters of each PWM channel. When an internal trigger action is recognized, obtain the status flag bits of the atomization device before and after the change in the operating state and set the status flag bit to 0.
4. The PWM lamp effect control method of the atomization device according to claim 1, characterized in that The values of the PWM single-cycle high-level duration, the PWM single cycle, and the duty cycle update period increase in sequence, and the duty cycle update period is an integer multiple of the PWM single cycle.
5. The PWM lamp effect control method of the atomization device according to claim 1, characterized in that After the step of determining whether the PWM single cycle is 0 in response to the second parameter judgment signal, the following steps are further included: If it is zero, generate a first parameter loading signal; In response to the first parameter loading signal, reload the PWM single-cycle high-level duration and the PWM single cycle according to the light effect control parameters in the current operating state and then generate the control signal.
6. The PWM lamp effect control method of the atomization device according to claim 1, wherein After the step of determining whether the duty cycle update period is 0 in response to the third parameter judgment signal, the following steps are further included: If it is zero, generate a second parameter loading signal; In response to the second parameter loading signal, reload the PWM single-cycle high-level duration, the PWM single cycle, and the duty cycle update period according to the light effect control parameters in the current operating state and then generate the control signal.
7. The PWM lamp effect control system of the atomization device, characterized in that, Comprising: A parameter configuration module for configuring the basic time base of the atomization device in each operating state and the light effect control parameters of each PWM channel. The light effect control parameters at least include the PWM single-cycle high-level duration, the PWM single cycle, and the duty cycle update period; An operating state monitoring module for monitoring the operating state of the atomization device in real time and generating a first interrupt signal when the operating state changes; A parameter acquisition and initialization module for obtaining the light effect control parameters of the atomization device after the change in the operating state according to the first interrupt signal, initializing the PWM channel with the light effect control parameters, starting the timer, and then generating a control signal; An interrupt time judgment module for judging whether the timer reaches the interrupt time according to the control signal, and generating a second interrupt signal when the interrupt time arrives; And The lamp effect control module is used to traverse and poll each PWM channel according to the second interrupt signal. When the PWM channel is turned on, the lamp effect control of the corresponding PWM channel is executed according to the corresponding lamp effect control parameters. Specifically, the lamp effect control module is used to respond to the second interrupt signal and circularly traverse and poll each PWM channel; determine whether the PWM channel is turned on. If it is turned on, a first parameter judgment signal, a second parameter judgment signal, and a third parameter judgment signal are generated. Otherwise, the lamp effect control of the corresponding PWM channel is ended; in response to the first parameter judgment signal, determine whether the high-level duration of the PWM single cycle is zero. If so, control the control module of the atomizing device to output a low level. Otherwise, control the control module of the atomizing device to output a high level and generate a self-decrement signal; in response to the second parameter judgment signal, determine whether the PWM single cycle is zero. If it is not zero, generate the self-decrement signal; in response to the third parameter judgment signal, determine whether the duty cycle update period is zero. If it is not zero, generate the self-decrement signal; in response to the self-decrement signal, subtract 1 from the values corresponding to the high-level duration of the PWM single cycle, the PWM single cycle, and the duty cycle update period respectively to generate the control signal.
8. The atomizing device based on PWM light effect control is characterized in that Comprising: An atomizing device for identifying a triggering action acting thereon and responding to the triggering action to convert a corresponding operating state; A PWM lamp effect control system configured in the atomizing device for generating a corresponding control signal according to the operating state of the atomizing device, and determining whether the timer reaches the interrupt time according to the control signal and controlling the corresponding PWM channel to execute the lamp effect control when the interrupt time arrives; And A lamp effect display module configured on the atomizing device for performing corresponding lamp effect display according to the PWM lamp effect control system.
9. A computer storage medium, on which an executable computer program is stored, characterized in that, When the computer program is executed by a processor, it implements the PWM lamp effect control method of the atomizing device according to any one of claims 1-6.
Citation Information
Patent Citations
Electrostatic spray device, inspection method, inspection program, and computer readable information recording medium
CN107073493A
Automatic temperature control method of electronic atomizer and electronic atomizer applying method
CN112189907A