CN109799384B - Voltage zero-crossing detection method and device and cooking appliance - Google Patents

Voltage zero-crossing detection method and device and cooking appliance Download PDF

Info

Publication number
CN109799384B
CN109799384B CN201711139739.0A CN201711139739A CN109799384B CN 109799384 B CN109799384 B CN 109799384B CN 201711139739 A CN201711139739 A CN 201711139739A CN 109799384 B CN109799384 B CN 109799384B
Authority
CN
China
Prior art keywords
zero
interrupt signal
voltage
crossing
time
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711139739.0A
Other languages
Chinese (zh)
Other versions
CN109799384A (en
Inventor
曾露添
雷俊
王云峰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Original Assignee
Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd filed Critical Foshan Shunde Midea Electrical Heating Appliances Manufacturing Co Ltd
Priority to CN201711139739.0A priority Critical patent/CN109799384B/en
Publication of CN109799384A publication Critical patent/CN109799384A/en
Application granted granted Critical
Publication of CN109799384B publication Critical patent/CN109799384B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Measurement Of Current Or Voltage (AREA)

Abstract

The invention discloses a voltage zero-crossing detection method, a voltage zero-crossing detection device and a cooking appliance, wherein the detection method comprises the following steps: acquiring the timing duration of a timer, wherein the timing duration of the timer is in a corresponding relation with the time of a half period of the alternating voltage; receiving an interrupt signal generated when the alternating-current voltage passes through zero in the positive direction, and starting a timer when the interrupt signal generated when the alternating-current voltage passes through zero in the positive direction is received; when the timer finishes timing, generating an overflow interrupt signal; and judging the negative zero crossing of the alternating voltage according to the overflow interruption signal to obtain the negative zero crossing time of the alternating voltage, so that the time when the zero crossing of the alternating voltage is interrupted is synchronous with the zero crossing time of the actual alternating voltage, and the problem of inaccurate voltage zero crossing detection is effectively solved.

Description

Voltage zero-crossing detection method and device and cooking appliance
Technical Field
The invention relates to the technical field of voltage zero-crossing detection, in particular to a voltage zero-crossing detection method, a voltage zero-crossing detection device and a cooking appliance with the voltage zero-crossing detection device.
Background
As is well known, the voltage or current waveform of an alternating current starts at zero, gradually rises to a positive maximum, then falls from the positive maximum to zero, then to a negative maximum, and then returns to zero, …. A zero-crossing is the moment when the voltage or current of the alternating current goes to "zero", at which instant the voltage or current is zero.
In the electronic control technology, when the switching tube is controlled to be turned on or off, because the impact current generated when the switching tube is turned on or off at the zero-crossing point is small, the switching tube is usually controlled at the zero-crossing point, so that the zero-crossing point needs to be accurately detected, but when the zero-crossing point is detected by adopting the conventional detection method, the situation of hysteresis exists, so that the zero-crossing detection method needs to be improved.
Disclosure of Invention
The present invention is directed to solving, at least to some extent, one of the technical problems in the related art. Therefore, a first objective of the present invention is to provide a voltage zero-crossing detection method, which can synchronize the time when the ac voltage zero-crossing is interrupted with the zero-crossing time of the actual ac voltage, and effectively solve the problem of inaccurate voltage zero-crossing detection.
A second object of the invention is to propose a computer-readable storage medium.
A third object of the present invention is to provide a voltage zero crossing detection apparatus.
A fourth object of the present invention is to provide an electric cooking appliance.
In order to achieve the above object, an embodiment of a first aspect of the present invention provides a voltage zero-crossing detection method, including the following steps: acquiring the timing duration of a timer, wherein the timing duration of the timer is in a corresponding relation with the time of a half period of the alternating voltage; receiving an interrupt signal generated when the alternating-current voltage passes through zero in the positive direction, and starting the timer when receiving the interrupt signal generated when the alternating-current voltage passes through zero in the positive direction; when the timer finishes timing, generating an overflow interrupt signal; and judging the negative zero crossing of the alternating voltage according to the overflow interrupt signal so as to obtain the negative zero crossing time of the alternating voltage.
According to the voltage zero-crossing detection method, the timing duration of a timer is firstly obtained, the timing duration of the timer is in a corresponding relation with the half-period time of the alternating-current voltage, then an interrupt signal generated when the alternating-current voltage passes through zero in the forward direction is received, and the timer is started when the interrupt signal generated when the alternating-current voltage passes through zero in the forward direction is received. When the timer finishes timing, an overflow interrupt signal is generated, and the negative zero crossing of the alternating-current voltage is judged according to the overflow interrupt signal to obtain the negative zero crossing time of the alternating-current voltage, so that the time when the alternating-current voltage zero crossing is interrupted is synchronous with the zero crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero crossing detection is effectively solved.
According to one embodiment of the invention, when an interrupt signal generated when the alternating voltage positive zero crossing is received, the positive zero crossing of the alternating voltage is judged so as to obtain the positive zero crossing time of the alternating voltage.
According to an embodiment of the present invention, the obtaining the timing duration of the timer includes: acquiring count values of a base counter when the interrupt signal is received twice continuously, and recording the count values as a first count value and a second count value respectively; and calculating a difference value between the second count value and the first count value, and acquiring the timing duration of the timer according to the difference value.
According to an embodiment of the present invention, before starting the timer, the method further includes: acquiring a count value of a base counter when the interrupt signal is received, calculating a difference value between the count value of the base counter when the interrupt signal is received and the count value of the base counter when the overflow interrupt signal is generated last time, and judging whether the difference value is within a first preset range; if the difference value is not within the first preset range, judging the interrupt signal to be an invalid interrupt signal; and if the difference value is within the first preset range, judging the interrupt signal to be an effective interrupt signal, and starting the timer.
To achieve the above object, a second embodiment of the present invention provides a computer-readable storage medium having instructions stored therein, which when executed perform the above voltage zero-crossing detection method.
According to the computer-readable storage medium of the embodiment of the invention, by executing the voltage zero-crossing detection method, the time when the zero-crossing of the alternating-current voltage is interrupted can be synchronized with the zero-crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
In order to achieve the above object, a third aspect of the present invention provides a voltage zero-crossing detection apparatus, including: the acquisition module is used for acquiring the timing duration of a timer, wherein the timing duration of the timer is in a corresponding relation with the time of a half period of the alternating voltage; the receiving module is used for receiving an interrupt signal generated when the alternating voltage passes through zero in the positive direction; the control module is connected with the receiving module and used for starting the timer when the receiving module receives an interrupt signal generated when the alternating voltage passes through zero in the positive direction, generating an overflow interrupt signal when the timer finishes timing, and judging the negative zero crossing of the alternating voltage according to the overflow interrupt signal so as to obtain the negative zero crossing time of the alternating voltage.
According to the voltage zero-crossing detection device provided by the embodiment of the invention, the timing duration of the timer is obtained through the acquisition module, the receiving module is used for receiving the interrupt signal generated when the alternating voltage positively crosses zero, the control module is used for starting the timer when the receiving module receives the interrupt signal generated when the alternating voltage positively crosses zero, the timer is used for generating the overflow interrupt signal when the timer is timed to be finished, and the negative zero-crossing time of the alternating voltage is judged according to the overflow interrupt signal to obtain the negative zero-crossing time of the alternating voltage, so that the time when the alternating voltage zero-crossing generates interrupt is synchronous with the zero-crossing time of the actual alternating voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
According to an embodiment of the present invention, when the receiving module receives an interrupt signal generated when the ac voltage crosses zero in the forward direction, the control module determines that the ac voltage crosses zero in the forward direction to obtain a zero-crossing time of the ac voltage in the forward direction.
According to an embodiment of the present invention, when the obtaining module obtains the timing duration of the timer, the obtaining module obtains count values of a base counter when the receiving module receives the interrupt signal twice, and the count values are respectively recorded as a first count value and a second count value; the obtaining module calculates a difference value between the second count value and the first count value, and obtains the timing duration of the timer according to the difference value.
According to an embodiment of the present invention, before starting the timer, the control module is further configured to obtain a count value of a time-base counter when the receiving module receives the interrupt signal, calculate a difference value between the count value of the time-base counter when the receiving module receives the interrupt signal and a count value of the time-base counter when an overflow interrupt signal is generated last time, and determine whether the difference value is within a first preset range; if the difference value is not within the first preset range, judging the interrupt signal to be an invalid interrupt signal; and if the difference value is within the first preset range, judging the interrupt signal to be an effective interrupt signal, and starting the timer.
In addition, the embodiment of the invention also provides a cooking appliance, which comprises the voltage zero-crossing detection device.
According to the cooking appliance provided by the embodiment of the invention, through the voltage zero-crossing detection device, the time when the alternating-current voltage zero-crossing is interrupted can be synchronized with the zero-crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
Drawings
Fig. 1 is a circuit diagram of a voltage zero-crossing detection circuit in the related art;
FIG. 2 is a diagram illustrating the generation timings of zero-crossing flag bits of a voltage in the related art;
FIG. 3 is a flow chart of a voltage zero crossing detection method according to an embodiment of the present invention;
FIG. 4 is a schematic diagram of the voltage zero crossing flag generation time according to one embodiment of the present invention;
FIG. 5 is a flow diagram of a voltage zero crossing detection method according to one embodiment of the invention; and
fig. 6 is a block schematic diagram of a voltage zero-crossing detection apparatus according to an embodiment of the present invention.
Detailed Description
Reference will now be made in detail to embodiments of the present invention, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar function throughout. The embodiments described below with reference to the drawings are illustrative and intended to be illustrative of the invention and are not to be construed as limiting the invention.
A voltage zero-crossing detecting method, a computer-readable storage medium, a voltage zero-crossing detecting apparatus, and a cooking appliance having the same proposed according to embodiments of the present invention will be described below with reference to the accompanying drawings.
Before describing the voltage zero crossing detection method according to the embodiment of the present invention, how to implement the voltage zero crossing detection function by using one resistor in the related art will be described first.
As shown in fig. 1, the electric control part of the cooking appliance may include a rectifier bridge 100, a voltage reducing module 200, and a control module 300. The rectifier bridge 100 is composed of diodes D1-D4, a first input end and a second input end of the rectifier bridge 100 are correspondingly connected with a power supply line of an alternating current power supply, and the rectifier bridge 100 is used for converting the alternating current power supply into a first direct current; the first end of the voltage-reducing module 200 is connected to the first output end of the rectifier bridge 100, the second end of the voltage-reducing module 200 is connected to the second output end of the rectifier bridge 100 and the ground, the third end of the voltage-reducing module 200 is connected to the power supply end VCC of the control module 300, and the voltage-reducing module 200 is used for reducing the voltage of the first direct current to obtain the second direct current to supply power to the control module 300. A Zero-crossing signal detection pin Zero of a controller in the control module 300 is connected with a power supply line of an alternating current power supply through a resistor R1, and by using an external level change interrupt function of the Zero-crossing signal detection pin Zero, interrupt can be triggered for both the rising edge and the falling edge of the Zero-crossing signal detection pin Zero, so that voltage Zero-crossing detection can be realized by setting a Zero-crossing flag bit in an interrupt service program.
Specifically, as shown in fig. 2, when the alternating voltage positive Zero-crossing occurs, since the voltage change of the node a1 is relatively large, the voltage change of the Zero-crossing detection pin Zero is sensitive because the change of the node a1 is 0V to 310V in the time period z3-z4 in the a1-GND waveform, and the rising edge interruption times t1, t3 and t5 of the controller substantially coincide with the voltage Zero-crossing times z1, z3 and z5, so that the rising edge interruption time can truly reflect the positive Zero-crossing of the voltage; when the alternating-current voltage is in negative Zero crossing, the voltage change of the node A1 is small, and the change of the A1 is 0V to-0.7V in the time period of z4-z5 in the A1-GND waveform, so that the voltage change of the Zero-crossing detection pin Zero is insensitive, and a delay phenomenon exists in falling edge interruption, wherein the interruption time t2, t4 and t6 have a certain delay compared with the real voltage Zero-crossing time z2, z4 and z6, so that the voltage Zero-crossing time cannot be truly reflected at the falling edge interruption time.
From the above analysis, it can be seen that the above-mentioned voltage zero crossing detection is inaccurate. Therefore, the invention provides a voltage zero-crossing detection method, wherein the zero-crossing detection of the positive period of the voltage is still detected through a zero-crossing signal detection pin, a controller sets the rising edge of the zero-crossing signal detection pin to trigger the interruption and generates a zero-crossing flag bit in an interruption service program, and the zero-crossing flag bit of the negative period of the voltage is generated by a timer in the controller, so that the problem of time delay of the interruption time of the falling edge is effectively solved.
Fig. 3 is a flow chart of a voltage zero crossing detection method according to an embodiment of the present invention. As shown in fig. 3, the voltage zero crossing detection method of the embodiment of the present invention may include the following steps:
and S1, acquiring the timing duration of the timer, wherein the timing duration of the timer is in a corresponding relation with the time of the half cycle of the alternating voltage.
According to one embodiment of the present invention, acquiring the timing duration of the timer comprises: acquiring count values of a base counter when interrupt signals are received twice continuously, and recording the count values as a first count value and a second count value respectively; and calculating a difference value between the second count value and the first count value, and acquiring the timing duration of the timer according to the difference value.
Specifically, before the controller executes the voltage zero-crossing detection procedure, initialization is performed, including initializing the zero-crossing signal detection pin to be set in the input mode, setting the interrupt to be triggered by the change in the level rising edge, and calculating the half-cycle time Th of the ac voltage, which is the timing duration used to set the timer T1 for delaying the half-cycle time. The calculation method of Th is as follows: when the alternating voltage positive zero crossing, the rising edge of the zero crossing signal detection pin triggers the interrupt, in the interrupt service process, a first Count value Count1 is read from the time base counter, then, the rising edge of the zero crossing signal detection pin triggers the interrupt again when the alternating voltage positive zero crossing next time, in the interrupt service process, a second Count value Count2 is read from the time base counter, then, the difference Char between the Count value Count1 and the second Count value Count2 is Count2-Count1, the Char is the Count value of one period of the alternating voltage, then the half period time Th of the alternating voltage is (Count2-Count1)/2, namely the timing duration of the timer is (Count2-Count 1)/2.
For example, assuming that the time base counter is in microseconds, when the frequency of the ac voltage is 50Hz, one cycle of the ac voltage is 20ms, and the value of Count2-Count1 is 20000 (representing 20ms), then Th is a half cycle value, i.e. the value of Th is 10000; when the frequency of the ac voltage is 60Hz, the value of Th is 83333, as can be obtained.
And S2, receiving the interrupt signal generated when the alternating current voltage positive zero crossing is received, and starting a timer when the interrupt signal generated when the alternating current voltage positive zero crossing is received.
According to one embodiment of the invention, when an interrupt signal generated when the alternating voltage positive zero crossing is received, the positive zero crossing of the alternating voltage is judged so as to obtain the positive zero crossing time of the alternating voltage.
S3, when the timer timing is over, an overflow interrupt signal is generated.
And S4, judging the negative zero crossing of the alternating voltage according to the overflow interrupt signal to obtain the negative zero crossing time of the alternating voltage.
Specifically, the frequency of the ac voltage is 50Hz, and the period of the ac voltage is 20ms and the half period (the timing duration of the timer) is 10 ms. When the alternating voltage passes through the positive zero, the rising edge of the level of the zero-crossing signal detection pin jumps to trigger interruption, the zero-crossing signal detection pin enters a zero-crossing pin interruption service program, a zero-crossing flag bit is set (namely the positive zero-crossing time of the alternating voltage is obtained) in the interruption service program, meanwhile, the timer is delayed by 10ms, and the timer is started. After the time of 10ms arrives, the timer generates overflow interrupt, enters a timer interrupt service routine, closes the timer in the interrupt service routine, and sets a zero-crossing flag bit (that is, obtains the negative zero-crossing time of the ac voltage), as shown in fig. 4. As can be seen from fig. 4, both the positive zero-crossing flag (zero-crossing flags generated at times t1, t3, and t 5) and the negative zero-crossing flag (zero-crossing flags generated at times t2, t4, and t 6) can reflect the positive zero-crossing time and the negative zero-crossing time of the ac voltage.
Therefore, according to the voltage zero-crossing detection method provided by the embodiment of the invention, at the positive zero-crossing moment of the alternating-current voltage, the rising edge of the zero-crossing signal detection pin triggers interruption to generate the zero-crossing flag bit, the timer is started to delay, and at the negative zero-crossing moment of the alternating-current voltage, the timer is used for timing interruption to generate the zero-crossing flag bit, so that the zero-crossing flag bit generation moment is synchronous with the actual alternating-current voltage zero-crossing moment, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
Further, according to an embodiment of the present invention, before starting the timer, the method further includes: acquiring a count value of a base counter when an interrupt signal is received, calculating a difference value between the count value of the base counter when the interrupt signal is received and the count value of the base counter when an overflow interrupt signal is generated last time, and judging whether the difference value is within a first preset range; if the difference value is not within the first preset range, judging the interrupt signal to be an invalid interrupt signal; and if the difference value is within the first preset range, judging the interrupt signal to be an effective interrupt signal, and starting a timer.
The first preset range may be calibrated according to actual conditions, for example, the frequency of the ac voltage is 50Hz, and the first preset range may be 9000ms to 11000 ms.
Specifically, when the ac voltage crosses zero in the forward direction, the rising edge change of the zero-crossing signal detection pin triggers an interrupt, and enters a zero-crossing pin interrupt service routine, in the interrupt service routine, the Count value Count _ a2 is read from the time base counter, and the difference value between the Count value Count _ a1 read in the previous interrupt is calculated, and then the difference value is determined. Still taking the frequency of the alternating voltage as 50Hz as an example, if the difference value is not within the range of 9000 ms-11000 ms, the current interruption is indicated to be invalid interference interruption, and the interruption signal is ignored at the moment; if the difference value is within the range of 9000 ms-11000 ms, the current interruption is indicated to be effective interruption, the positive zero crossing of the alternating-current voltage is judged to obtain the positive zero crossing time of the alternating-current voltage, meanwhile, the timer is delayed for 10ms, and the timer is started. And after the time of 10ms arrives, the timer generates overflow interruption, the timer enters a timer interruption service program, the timer is closed in the interruption service program, and a zero-crossing flag bit is set to obtain the negative zero-crossing time of the alternating-current voltage.
To make the present invention more clear to those skilled in the art, fig. 5 is a flowchart of a zero-crossing detection method according to an embodiment of the present invention. As shown in fig. 5, the zero crossing detection method may include the steps of:
and S101, initializing.
S102, calculate the time Th of half cycle of the ac voltage (i.e. the timing duration of the timer).
And S103, judging whether the rising edge of the zero-crossing signal detection pin triggers interruption or not. If yes, go to step S106; if not, step S104 is executed.
And S104, judging whether the timer generates interruption or not. If yes, go to step S105; if not, return to step S103.
S105, the timer is turned off (the voltage negative zero crossing time is reached after the voltage positive zero crossing time is 10 ms), and the step S110 is executed.
S106, calculating the time Td used by the previous interruption and the current interruption.
S107, judging whether Td is within a first preset range. If yes, go to step S108; if not, return to step S103.
And S108, setting a zero-crossing flag bit (positive zero-crossing time of alternating current).
And S109, setting timer delay Th and starting the timer.
And S110, setting a zero-crossing flag bit (negative zero-crossing time of alternating current) after timing is finished.
In summary, according to the zero-crossing detection method of the embodiment of the invention, the timing duration of the timer is firstly obtained, the timing duration of the timer is in a corresponding relationship with the half-period time of the alternating-current voltage, then the interrupt signal generated when the alternating-current voltage positive zero crossing is received, and the timer is started when the interrupt signal generated when the alternating-current voltage positive zero crossing is received. When the timer finishes timing, an overflow interrupt signal is generated, and the negative zero crossing of the alternating-current voltage is judged according to the overflow interrupt signal to obtain the negative zero crossing time of the alternating-current voltage, so that the time when the alternating-current voltage zero crossing is interrupted is synchronous with the zero crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero crossing detection is effectively solved.
Fig. 6 is a block schematic diagram of a zero-crossing detection apparatus according to an embodiment of the present invention. As shown in fig. 6, the zero-crossing detecting apparatus according to the embodiment of the present invention may include: an acquisition module 10, a receiving module 20 and a control module 30.
The obtaining module 10 is configured to obtain a timing duration of a timer, where the timing duration of the timer corresponds to a half-cycle time of the alternating-current voltage. The receiving module 20 is configured to receive an interrupt signal generated when the ac voltage crosses zero in the forward direction. The control module 30 is connected to the receiving module 20, and the control module 30 is configured to start a timer when the receiving module 20 receives an interrupt signal generated when the ac voltage crosses zero in the positive direction, generate an overflow interrupt signal when the timer finishes timing, and determine a negative zero crossing of the ac voltage according to the overflow interrupt signal to obtain a negative zero crossing time of the ac voltage.
According to an embodiment of the present invention, when the receiving module 20 receives the interrupt signal generated when the ac voltage crosses zero in the positive direction, the control module 30 determines that the ac voltage crosses zero in the positive direction to obtain the positive zero-crossing time of the ac voltage.
According to an embodiment of the present invention, the obtaining module 10 obtains the timing length of the timer, wherein the obtaining module 10 obtains the count values of the base counter when the receiving module 20 receives the interrupt signal twice, and the count values are recorded as a first count value and a second count value respectively. The obtaining module 10 calculates a difference between the second count value and the first count value, and obtains a timing duration of the timer according to the difference.
According to an embodiment of the present invention, before starting the timer, the control module 30 is further configured to obtain a count value of the base counter when the receiving module 20 receives the interrupt signal, calculate a difference value between the count value of the base counter when the receiving module 20 receives the interrupt signal and a count value of the base counter when the overflow interrupt signal is generated last time, determine whether the difference value is within a first preset range, determine that the interrupt signal is an invalid interrupt signal if the difference value is not within the first preset range, determine that the interrupt signal is an valid interrupt signal if the difference value is within the first preset range, and start the timer.
It should be noted that details that are not disclosed in the voltage zero-crossing detection apparatus according to the embodiment of the present invention refer to details that are disclosed in the voltage zero-crossing detection method according to the embodiment of the present invention, and are not described herein again in detail.
According to the voltage zero-crossing detection device provided by the embodiment of the invention, the timing duration of the timer is obtained through the obtaining module, the receiving module is used for receiving the interrupt signal generated when the alternating voltage positively crosses zero, the control module is used for starting the timer when the receiving module receives the interrupt signal generated when the alternating voltage positively crosses zero, the overflow interrupt signal is generated when the timer is timed to be finished, and the negative zero crossing of the alternating voltage is judged according to the overflow interrupt signal to obtain the negative zero-crossing time of the alternating voltage, so that the time when the alternating voltage zero-crossing generates interrupt is synchronous with the zero-crossing time of the actual alternating voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
In addition, an embodiment of the present invention further provides a computer-readable storage medium having instructions stored therein, which when executed, perform the above-mentioned voltage zero-crossing detection method.
According to the computer-readable storage medium of the embodiment of the invention, by executing the voltage zero-crossing detection method, the time when the zero-crossing of the alternating-current voltage is interrupted can be synchronized with the zero-crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
In addition, the embodiment of the invention also provides a cooking appliance, which comprises the voltage zero-crossing detection device.
According to the cooking appliance provided by the embodiment of the invention, through the voltage zero-crossing detection device, the time when the alternating-current voltage zero-crossing is interrupted can be synchronized with the zero-crossing time of the actual alternating-current voltage, and the problem of inaccurate voltage zero-crossing detection is effectively solved.
It should be understood that portions of the present invention may be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, the various steps or methods may be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, any one or combination of the following techniques, which are known in the art, may be used: a discrete logic circuit having a logic gate circuit for implementing a logic function on a data signal, an application specific integrated circuit having an appropriate combinational logic gate circuit, a Programmable Gate Array (PGA), a Field Programmable Gate Array (FPGA), or the like.
In addition, in the description of the present invention, 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 orientations or positional relationships based on those shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element referred to must have a particular orientation, be constructed in a particular orientation, and be operated, and thus, should not be construed as limiting the present invention.
Furthermore, the terms "first", "second" and "first" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one such feature. In the description of the present invention, "a plurality" means at least two, e.g., two, three, etc., unless specifically limited otherwise.
In the present invention, unless otherwise expressly stated or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally formed; can be mechanically or electrically connected; they may be directly connected or indirectly connected through intervening media, or they may be connected internally or in any other suitable relationship, unless expressly stated otherwise. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, the first feature "on" or "under" the second feature may be directly contacting the first and second features or indirectly contacting the first and second features through an intermediate. Also, a first feature "on," "over," and "above" a second feature may be directly or diagonally above the second feature, or may simply indicate that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature may be directly under or obliquely under the first feature, or may simply mean that the first feature is at a lesser elevation than the second feature.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example," or "some examples," etc., mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above are not necessarily intended to refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples. Furthermore, various embodiments or examples and features of different embodiments or examples described in this specification can be combined and combined by one skilled in the art without contradiction.
Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention, and that variations, modifications, substitutions and alterations can be made to the above embodiments by those of ordinary skill in the art within the scope of the present invention.

Claims (10)

1. A voltage zero-crossing detection method is characterized by comprising the following steps:
acquiring the timing duration of a timer, wherein the timing duration of the timer is in a corresponding relation with the time of a half period of the alternating voltage;
receiving an interrupt signal generated when the alternating-current voltage passes through zero in the positive direction, and starting the timer when receiving the interrupt signal generated when the alternating-current voltage passes through zero in the positive direction;
when the timer finishes timing, generating an overflow interrupt signal; and
and judging the negative zero crossing of the alternating voltage according to the overflow interrupt signal so as to obtain the negative zero crossing time of the alternating voltage.
2. A voltage zero-crossing detection method as claimed in claim 1, wherein upon receiving an interrupt signal generated when the ac voltage is passing through zero in the forward direction, the ac voltage is judged to pass through zero in the forward direction to obtain a zero-crossing timing in the forward direction of the ac voltage.
3. A voltage zero crossing detection method as claimed in claim 1, wherein the obtaining the timing duration of the timer comprises:
acquiring count values of a base counter when interrupt signals generated when the alternating voltage positive zero crossing are received twice continuously, and recording the count values as a first count value and a second count value respectively;
and calculating a difference value between the second count value and the first count value, and acquiring the timing duration of the timer according to the difference value.
4. A voltage zero crossing detection method as claimed in any one of claims 1 to 3, further comprising, before starting the timer:
acquiring a count value of a time base counter when an interrupt signal generated when the alternating current voltage positive zero crossing is received, calculating a difference value between the count value of the time base counter when the interrupt signal generated when the alternating current voltage positive zero crossing is received and a count value of the time base counter when an overflow interrupt signal is generated last time, and judging whether the difference value between the count value of the time base counter when the interrupt signal generated when the alternating current voltage positive zero crossing is received and the count value of the time base counter when the overflow interrupt signal is generated last time is in a first preset range or not;
if the difference value between the count value of the time-base counter when the interrupt signal generated when the alternating current voltage positive zero crossing occurs and the count value of the time-base counter when the overflow interrupt signal is generated last time is not in the first preset range, judging the interrupt signal generated when the alternating current voltage positive zero crossing is an invalid interrupt signal;
and if the difference value between the count value of the time-base counter when the interrupt signal generated when the alternating current voltage positive zero crossing occurs and the count value of the time-base counter when the overflow interrupt signal is generated last time is in the first preset range, judging the interrupt signal generated when the alternating current voltage positive zero crossing is an effective interrupt signal, and starting the timer.
5. A computer-readable storage medium having instructions stored therein that, when executed, perform a voltage zero-crossing detection method as recited in any one of claims 1-4.
6. A voltage zero-crossing detection apparatus, comprising:
the acquisition module is used for acquiring the timing duration of a timer, wherein the timing duration of the timer is in a corresponding relation with the time of a half period of the alternating voltage;
the receiving module is used for receiving an interrupt signal generated when the alternating voltage passes through zero in the positive direction;
the control module is connected with the receiving module and used for starting the timer when the receiving module receives an interrupt signal generated when the alternating voltage passes through zero in the positive direction, generating an overflow interrupt signal when the timer finishes timing, and judging the negative zero crossing of the alternating voltage according to the overflow interrupt signal so as to obtain the negative zero crossing time of the alternating voltage.
7. The voltage zero-crossing detection apparatus of claim 6, wherein when the receiving module receives an interrupt signal generated when the alternating-current voltage crosses zero in the positive direction, the control module judges that the alternating-current voltage crosses zero in the positive direction to obtain a zero-crossing time in the positive direction of the alternating-current voltage.
8. A voltage zero crossing detection apparatus as claimed in claim 6, wherein the obtaining module obtains a timing duration of a timer, wherein,
the acquisition module acquires count values of a time base counter when the receiving module receives an interrupt signal generated when the alternating current voltage passes through zero in the forward direction twice continuously, and the count values are recorded as a first count value and a second count value respectively;
the obtaining module calculates a difference value between the second count value and the first count value, and obtains the timing duration of the timer according to the difference value.
9. A voltage zero-crossing detection apparatus as claimed in any one of claims 6 to 8, wherein the control module is further configured to, prior to starting the timer,
acquiring a count value of a time base counter when the receiving module receives an interrupt signal generated when the alternating current voltage positive zero crossing, calculating a difference value between the count value of the time base counter when the receiving module receives the interrupt signal generated when the alternating current voltage positive zero crossing and the count value of the time base counter when the overflow interrupt signal is generated last time, and judging whether the difference value between the count value of the time base counter when the interrupt signal generated when the alternating current voltage positive zero crossing and the count value of the time base counter when the overflow interrupt signal is generated last time is in a first preset range;
if the difference value between the count value of the time-base counter when the interrupt signal generated when the alternating current voltage positive zero crossing occurs and the count value of the time-base counter when the overflow interrupt signal is generated last time is not in the first preset range, judging the interrupt signal generated when the alternating current voltage positive zero crossing is an invalid interrupt signal;
and if the difference value between the count value of the time-base counter when the interrupt signal generated when the alternating current voltage positive zero crossing occurs and the count value of the time-base counter when the overflow interrupt signal is generated last time is in the first preset range, judging the interrupt signal generated when the alternating current voltage positive zero crossing is an effective interrupt signal, and starting the timer.
10. Cooking appliance, characterized in that it comprises a voltage zero-crossing detection device according to any one of claims 6 to 9.
CN201711139739.0A 2017-11-16 2017-11-16 Voltage zero-crossing detection method and device and cooking appliance Active CN109799384B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711139739.0A CN109799384B (en) 2017-11-16 2017-11-16 Voltage zero-crossing detection method and device and cooking appliance

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711139739.0A CN109799384B (en) 2017-11-16 2017-11-16 Voltage zero-crossing detection method and device and cooking appliance

Publications (2)

Publication Number Publication Date
CN109799384A CN109799384A (en) 2019-05-24
CN109799384B true CN109799384B (en) 2020-11-20

Family

ID=66555677

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711139739.0A Active CN109799384B (en) 2017-11-16 2017-11-16 Voltage zero-crossing detection method and device and cooking appliance

Country Status (1)

Country Link
CN (1) CN109799384B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP7374637B2 (en) * 2019-07-12 2023-11-07 キヤノン株式会社 Power control device and image forming device
CN110618308B (en) * 2019-10-18 2021-11-09 Tcl空调器(中山)有限公司 Single-phase alternating-current voltage zero point detection method and device
CN114371642A (en) * 2019-12-24 2022-04-19 追觅科技(上海)有限公司 Equipment control method, device and storage medium
CN111830816B (en) * 2020-06-28 2023-05-12 南京天朗防务科技有限公司 Self-adaptive timing method and device
CN111969871A (en) * 2020-07-27 2020-11-20 深圳市汇川技术股份有限公司 Rectification control method, system, equipment and computer readable storage medium

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5834930A (en) * 1997-03-12 1998-11-10 Industrial Technology Research Institute Device for sensing the period of a digitized signal including noise evaluation and averaging over a plurality of zero crossing
JP2005123977A (en) * 2003-10-17 2005-05-12 Sharp Corp Zero-cross point detection apparatus and heater controller using the same
CN101303376A (en) * 2008-05-26 2008-11-12 深圳和而泰智能控制股份有限公司 Method and apparatus for compensating voltage zero-cross detection
CN101720143A (en) * 2009-12-04 2010-06-02 合肥荣事达三洋电器股份有限公司 Zero crossing point control method of relaying protection device
CN102062810A (en) * 2010-12-14 2011-05-18 江苏大学 Detection circuit and method for zero crossing point of alternating current power supply
CN102522969A (en) * 2011-12-12 2012-06-27 佛山市顺德区美的电热电器制造有限公司 Anti-interference method of IGBT (Insulated Gate Bipolar Translator)
CN103217572A (en) * 2013-04-07 2013-07-24 深圳和而泰智能控制股份有限公司 Device and method for detecting voltage and zero crossing point of alternating current
CN103499732A (en) * 2013-09-29 2014-01-08 湘潭大学 Bidirectional zero-cross detection circuit and method thereof
CN104090151A (en) * 2014-04-14 2014-10-08 西安工程大学 Zero-crossing-point accurate detection method for AC power-grid voltage signals
CN104597314A (en) * 2013-10-31 2015-05-06 博西华电器(江苏)有限公司 Anti-interference method and device for zero-crossing point detection of household appliance and household appliance
CN106877844A (en) * 2017-01-03 2017-06-20 青岛海尔空调器有限总公司 A kind of zero cross signal filtering method and device

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5834930A (en) * 1997-03-12 1998-11-10 Industrial Technology Research Institute Device for sensing the period of a digitized signal including noise evaluation and averaging over a plurality of zero crossing
JP2005123977A (en) * 2003-10-17 2005-05-12 Sharp Corp Zero-cross point detection apparatus and heater controller using the same
CN101303376A (en) * 2008-05-26 2008-11-12 深圳和而泰智能控制股份有限公司 Method and apparatus for compensating voltage zero-cross detection
CN101720143A (en) * 2009-12-04 2010-06-02 合肥荣事达三洋电器股份有限公司 Zero crossing point control method of relaying protection device
CN102062810A (en) * 2010-12-14 2011-05-18 江苏大学 Detection circuit and method for zero crossing point of alternating current power supply
CN102522969A (en) * 2011-12-12 2012-06-27 佛山市顺德区美的电热电器制造有限公司 Anti-interference method of IGBT (Insulated Gate Bipolar Translator)
CN103217572A (en) * 2013-04-07 2013-07-24 深圳和而泰智能控制股份有限公司 Device and method for detecting voltage and zero crossing point of alternating current
CN103499732A (en) * 2013-09-29 2014-01-08 湘潭大学 Bidirectional zero-cross detection circuit and method thereof
CN104597314A (en) * 2013-10-31 2015-05-06 博西华电器(江苏)有限公司 Anti-interference method and device for zero-crossing point detection of household appliance and household appliance
CN104090151A (en) * 2014-04-14 2014-10-08 西安工程大学 Zero-crossing-point accurate detection method for AC power-grid voltage signals
CN106877844A (en) * 2017-01-03 2017-06-20 青岛海尔空调器有限总公司 A kind of zero cross signal filtering method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"一种电网电压过零点精确锁相方法的研究";陈增禄 等;《电力***保护与控制》;20140416;第42卷(第8期);65-70 *

Also Published As

Publication number Publication date
CN109799384A (en) 2019-05-24

Similar Documents

Publication Publication Date Title
CN109799384B (en) Voltage zero-crossing detection method and device and cooking appliance
US20110095624A1 (en) Single Wire Transmission Interface And Method For the Same
CN108303604B (en) Phase sequence detection device and phase sequence detection method
CN111289943A (en) Electric energy meter calibration method and system
CN206131084U (en) Electromagnetic oven
JP2013036998A (en) Electronic load device and method of providing variable reactance load function on electronic load device
JP2019095395A (en) Motor drive device and measurement method
CN108076547B (en) Electromagnetic heating system and zero-crossing detection device and method thereof
CN112098708B (en) Line voltage information detection circuit and detection method for secondary side PD controller
CN106308465A (en) Method for recognizing cooking type of electric cooker and electric cooker
TW200822514A (en) Circuit and method to detect the wave trough of switching device
JPH11248783A (en) Partial discharge detection apparatus
CN109976955A (en) A kind of clock rate testing circuit and measuring method
CN110049588B (en) Pot detection method and device of induction cooker and induction cooker
JP2005168163A (en) Zero crossing signal generation device
CN212030772U (en) Temperature measurement circuit and cooking device
CN110582135A (en) Method and device for judging type of cookware and electric cooking appliance
JP5838394B2 (en) Frequency determination device, voltage comparison circuit, and frequency measurement device
CN115031264A (en) Pot detection method of electromagnetic heating device, electromagnetic heating device and control device
JP2015210135A (en) Electric power measurement device
CN111148286B (en) Equipment control method, device and storage medium
KR20220104215A (en) Voltage detection and adaptation method, device control method, apparatus, and storage medium
KR20150072651A (en) Apparatus and method for detecting over voltage or low voltage
JPH02246769A (en) Power control circuit
CN111385930B (en) Control method and device of electromagnetic heating appliance and electromagnetic heating appliance

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant