Grid-connected converter PWM simulation method and system considering quartz crystal frequency deviation
By designing a grid-connected converter PWM simulation system to simulate the temperature-frequency characteristics of the quartz crystal oscillator, the problem that existing simulation software cannot effectively simulate this characteristic is solved, and the accuracy and actual closeness of the simulation results are improved.
Patent Information
- Application Number
- CN202310426346.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-17
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2043-04-17
AI Technical Summary
Existing simulation software cannot effectively simulate the characteristics of the quartz crystal oscillator frequency changing with temperature, resulting in a deviation from the actual situation, and it is impossible to reproduce the superposition of medium and high-frequency harmonics in grid-connected equipment.
A grid-connected converter PWM simulation system is designed, including a frequency deviation generation module, a frequency synchronization module and a triangular wave generator. The system generates a PWM triangle wave that simulates the temperature-frequency characteristics of the quartz crystal oscillator by receiving the ambient temperature, outputs the temperature-frequency deviation of the temperature and frequency, and synchronizes the deviation signal with the frequency of the triangular wave generator.
This system can effectively simulate the temperature-frequency characteristics of quartz crystal oscillator, improve the accuracy of simulation results, and make it closer to actual conditions. It is suitable for a variety of grid-connected converter application scenarios.
Smart Images

Figure CN116644696B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of PWM simulation, and in particular relates to a PWM simulation method and system for a grid-connected converter taking into account a quartz crystal oscillator frequency deviation. Background Art
[0002] The statements in this section merely provide background information related to the present invention and do not necessarily constitute prior art.
[0003] Quartz crystal oscillator, that is, quartz crystal resonator made of quartz material, is an indispensable component of grid-connected converter control system. The quartz crystal oscillator located on the microprocessor generates PWM triangular wave that controls the converter. It has the characteristics of high stability and has always occupied an important position in the field of electronic technology. However, the frequency of the crystal oscillator is not constant. It is temperature sensitive and easily affected by ambient temperature. The change of crystal oscillator frequency will affect the change of PWM triangular wave frequency, resulting in random fluctuations in the output frequency of the converter. Each grid-connected converter is controlled by a different microprocessor. Different processors have different crystal oscillator frequencies when working, resulting in the superposition of different converter deviations during grid-connected operation, generating random ripples. Quartz crystal oscillators have many different types of quartz cutting angles according to different application fields and working temperature requirements. The most commonly used cutting method is AT cutting, with room temperature 25℃ as the relative zero point. The biggest advantage of AT cutting is that the crystal oscillator frequency changes with temperature in a cubic curve.
[0004] In existing simulation software, the triangle wave generator is a commonly used PWM triangle wave generating device. PWM triangle wave generation is an indispensable part of simulation models such as new energy converters and grid-connected equipment. However, the triangle wave generator in the simulation software uses a computer clock and can only output a fixed frequency. The result is in an ideal state and seriously inconsistent with the actual situation, resulting in deviations between the simulation results and the measured results. For example, the high-frequency harmonics generated by multiple grid-connected equipment at work will randomly overlap, and this phenomenon cannot be reproduced in the simulation. Summary of the invention
[0005] To overcome the above-mentioned deficiencies of the prior art, the present invention provides a grid-connected converter PWM simulation method taking into account the frequency deviation of a quartz crystal oscillator, which is used to simulate the temperature-frequency characteristics of the quartz crystal oscillator in the simulation to generate a PWM triangle wave.
[0006] To achieve the above objectives, one or more embodiments of the present invention provide the following technical solutions:
[0007] In the first aspect, a grid-connected converter PWM simulation system taking into account a quartz crystal oscillator frequency deviation is disclosed, comprising: a frequency deviation generation module, a frequency synchronization module, and a triangle wave generator;
[0008] The frequency deviation generating module is configured to: receive the ambient temperature and output the frequency deviation caused by the temperature to the frequency;
[0009] The frequency synchronization module is configured to: sample the frequency deviation, and the sampling time needs to be synchronized with the simulation step length of the triangular wave generator, so that the deviation frequency signal obtained by sampling is synchronized with the frequency of the triangular wave generator;
[0010] The triangular wave generator is configured to: receive a sampled deviation frequency signal as input, generate a frequency deviation of a PWM triangular wave after receiving the input signal, and obtain an actual output triangular wave frequency based on the frequency deviation.
[0011] As a further technical solution, the frequency deviation generating module outputs a corresponding crystal oscillator frequency deviation value Δp according to an AT-cut quartz crystal oscillator temperature-frequency characteristic curve for the ambient temperature value.
[0012] As a further technical solution, the specific steps for generating the temperature-frequency characteristic curve of the AT-cut quartz crystal are as follows:
[0013] Set the deviation parameter Δθ of the quartz crystal oscillator AT cutting angle;
[0014] Fit the extreme value T on the temperature-frequency characteristic curve corresponding to different Δθ values m.left , T m.right ;
[0015] Based on the extreme value T m.left , T m.right Get the coordinates of the extreme points on the two quadratic curves on the left and right of the inflection point;
[0016] The coefficients of the two quadratic curves after the cubic curve is split are obtained based on the obtained coordinate data, and the two quadratic curves are combined to obtain the desired cubic characteristic curve.
[0017] In a second aspect, a grid-connected converter PWM simulation method taking into account a quartz crystal oscillator frequency deviation is disclosed, comprising:
[0018] Based on the ambient temperature, output the deviation of the frequency caused by the ambient temperature;
[0019] The deviation signal is synchronized with the frequency of the triangular wave generator, that is, the sampling time of the deviation signal is kept the same as the step length of the triangular wave generator;
[0020] The input of the triangle wave generator is the sampled deviation frequency signal. The initial triangle wave frequency is set. After receiving the signal, the frequency deviation of the PWM triangle wave is generated to obtain the actual output triangle wave frequency.
[0021] One or more of the above technical solutions have the following beneficial effects:
[0022] The invention simulates the temperature-frequency characteristic curve of the AT-cut quartz crystal oscillator and reproduces the change of its crystal oscillator frequency with temperature. After use, the simulated experimental results can be closer to reality. The output triangular wave frequency can be controlled through a simple process, which is suitable for a variety of different grid-connected converter applications.
[0023] Advantages of additional aspects of the present invention will be given in part in the following description, and in part will become obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The accompanying drawings in the specification, which constitute a part of the present invention, are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations on the present invention.
[0025] Figure 1 A schematic block diagram of a converter PWM design for simulating crystal oscillator temperature-frequency characteristics according to the present invention;
[0026] Figure 2 The temperature-frequency characteristic curve of the AT-cut quartz crystal oscillator referred to in the present invention;
[0027] Figure 3 This is the program flow chart of the triangle wave generator;
[0028] Figure 4 It is a schematic diagram of setting the carrier height H in the triangular wave generator of the present invention;
[0029] Figure 5 This is a PWM waveform diagram output by the triangle wave generator of the present invention under varying temperatures. DETAILED DESCRIPTION
[0030] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0031] It should be noted that the terms used herein are for describing specific embodiments only and are not intended to be limiting of exemplary embodiments according to the present invention.
[0032] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0033] Embodiment 1
[0034] The overall block diagram of the system is as follows: Figure 1As shown, this embodiment discloses a grid-connected converter PWM simulation system taking into account the frequency deviation of a quartz crystal oscillator, which mainly includes a frequency deviation generation module, a frequency synchronization module, and a triangle wave generator.
[0035] The frequency deviation generation module and the triangular wave generator are composed of a function program. The input of the frequency deviation generation module is the ambient temperature T, and the output is the deviation Δp caused by the temperature on the frequency, which is the frequency deviation magnified by 10 6 The ratio of the final frequency to the rated frequency.
[0036] The frequency synchronization module is connected to the frequency deviation generation module and the triangular wave generator respectively. The output Δp of the frequency deviation generation module is sampled to obtain the deviation signal U(t). The deviation signal U(t) is synchronized with the frequency of the triangular wave generator, that is, the sampling time of the deviation signal is kept the same as the step length of the triangular wave generator, which is T. s .
[0037] The input of the triangle wave generator is the sampled deviation frequency signal, and the initial triangle wave frequency is set to F tri , the frequency deviation of the PWM triangle wave generated after receiving the signal is Δf, then the actual output triangle wave frequency is F s .
[0038] The simulation design also sets a deviation parameter Δθ of the quartz crystal oscillator AT cut angle. Adjusting the value of Δθ can change the temperature-frequency characteristic curve of the quartz crystal oscillator.
[0039] Specifically, the frequency deviation generation module inputs the ambient temperature value of the quartz crystal oscillator and outputs the corresponding crystal oscillator frequency deviation value Δp according to the AT-cut quartz crystal oscillator temperature-frequency characteristic curve. The reference AT-cut quartz crystal oscillator temperature-frequency characteristic curve is as follows: Figure 2 It should be noted that the temperature-frequency characteristic curve of the quartz crystal oscillator has a horizontal axis of temperature and a vertical axis of frequency deviation multiplied by 10. 6 The above AT type quartz crystal temperature-frequency characteristic curve is obtained by the prior art.
[0040] There is more than one temperature-frequency characteristic curve, because sometimes the cutting angle Δθ is deliberately changed slightly to achieve the desired temperature characteristic change. The relationship between the extreme values on each curve corresponding to different Δθ values and the temperature is also a cubic curve. Based on this, the extreme values on the temperature-frequency characteristic curve corresponding to different Δθ values are first fitted in the frequency deviation generation module, and then all characteristic curves are fitted from other known coordinate points. Since it is more complicated to find a cubic curve with three points, if the center point and another point of a quadratic curve are known, a quadratic curve can be uniquely determined. Therefore, the two extreme points and the center point of the cubic curve are used to solve the two quadratic curves (y=ax 2+bx+c) is relatively simple, so this embodiment splits all cubic curves into two quadratic curves at their inflection points for fitting. The coordinates of the extreme points on the two quadratic curves on the left and right of the inflection point, that is, the coordinates of the extreme points of the cubic curve, are obtained by the following formula:
[0041] T m.left =0.3314·Δθ 2 -7.5534·Δθ+19.892 (1)
[0042] T m.right =-0.6626·Δθ 2 +10.314·Δθ+26.746 (2)
[0043] Δp m.left =-0.0002·T m.left 3 +0.0416·T m.left 2 -0.4381·T m.left +4.6 (3)
[0044] Δp m.right =-0.0003·T m.right 3 +0.0288·T m.right 2 -1.0718·T m.right +12.984 (4)
[0045] Where T (°C) is the ambient temperature, Δθ is the deviation parameter of the quartz crystal oscillator AT cut angle, and Δp (ppm) is the frequency deviation of the quartz crystal oscillator, which means the value by which the crystal frequency will deviate from the nominal frequency.
[0046] (T m.left ,Δp m.left ) is the extreme point on the left quadratic curve after the cubic curve is split, (T m.right ,Δp m.right ) is the extreme point on the right half quadratic curve after the cubic curve is split. Among them, T m.left is the temperature extreme value on the left semi-quadratic curve, Δp m.left is the frequency deviation extreme value on the left semi-quadratic curve; T m.right is the temperature extreme value on the right semi-quadratic curve, Δp m.right It is the extreme value of frequency deviation on the left semi-quadratic curve.
[0047] The inflection point of the temperature-frequency characteristic curve of the AT-cut quartz crystal is (25°C, 0ppm), which is common knowledge. Therefore, the coordinates of the inflection point of the cubic curve are also (25°C, 0ppm). Based on the given Δθ value, the two maximum points of the cubic curve can be obtained (Tm.left ,Δp m.left ) and (T m.right ,Δp m.right ), the formula for obtaining the quadratic curve from the center point and the extreme point in the present invention is simplified as follows:
[0048] Δp=a·T 2 +b·T+c (5)
[0049] a=2·Δp m / (-2·T m 2 +100·T m -1250) (6)
[0050] c=(-25·Δp m / T m -(625-25·T m )·a) / (1-25 / T m ) (7)
[0051] b=(-c-625·a) / 25 (8)
[0052] The two extreme points (T m.left ,Δp m.left ) and (T m.right ,Δp m.right ) is substituted into equations (5)-(8) to obtain the coefficients a, b, c of the two quadratic curves after the cubic curve is split. The two quadratic curves are combined to form the desired cubic characteristic curve. The fitting of the temperature-frequency characteristic curve of the AT-cut quartz crystal oscillator is now completed, and the frequency deviation generation module outputs the frequency deviation Δp.
[0053] Specifically, T m.left With T m.right Substitute T into equations (5)-(8) m , Δp m.left With Δp m.right Substitute Δp m . .left and .right They correspond to the extreme points of the left and right quadratic curves, as shown in the attached figure. Figure 2 As shown in the figure, the multiple cubic curves on the simulation diagram of the present invention are split into two quadratic curves on the left and right. Based on the AT-cut quartz crystal oscillator, AT represents the angle of the cut, and a slight change in this angle will change the temperature-frequency characteristic curve. Figure 2 This phenomenon is presented. Each curve is approximated by a cubic curve, and each cubic curve is solved by splitting it into two quadratic curves.
[0054] The frequency synchronization module samples the signal output by the frequency deviation generation module, and its sampling time is Ts It needs to be synchronized with the simulation step size of the triangle wave generator. For data transmission between different modules in the simulation system, due to different task scheduling times and execution cycles, the waveform will be distorted or the software will report an error when exchanging information in the middle connection due to different data processing rates between different modules. Each simulation software involving grid-connected converters has a module for sampling signals, which can be the frequency synchronization module in the present invention.
[0055] The input of the triangle wave generator is the frequency deviation signal sampled by the frequency synchronization module, and it outputs a triangle wave with a changed frequency. The specific program flow chart is as follows: Figure 3 The program uses a step-by-step increasing and decreasing step counting waveform to simulate a triangular wave, and the time for each simulation step is T s , the frequency of the triangular wave after changing is F s .
[0056] The frequency deviation Δp after input sampling and the triangular wave frequency deviation Δf after the signal and the actual frequency F after the change are obtained by the following formula s :
[0057]
[0058] F s =F tri +Δf (10)
[0059] Among them, the initial triangular wave frequency is F tri .
[0060] In the function program, two counting variables h1 and h2 and a half-range flag HalfFlag are used to determine the progress of the triangular wave. Like the triangular wave, h1 accumulates the count value of the simulation time, and is cleared to zero when the amplitude is reached, and then accumulated again. h2 is the modulus of the carrier height of the count value of h1, forming a waveform with an amplitude half of h1 and a frequency twice that of h1. The accumulated value of the count values h1 and h2 in the function program is 1 each time. According to the principle and equations (11)-(12), the count amplitude of h2 is 2H, and the count amplitude of h1 is H. The initial values of the count values h1, h2 and the half-range flag HalfFlag are all set to 0. When h1=h2, it is the rising stage of the triangular wave, and HalfFlag is set to 0 at this time; when h1≠h2, it is the falling stage of the triangular wave, and HalfFlag is set to 1. When the half-range flag HalfFlag, the amplitude of the sawtooth wave h1, and the amplitude of the sawtooth wave h2 are all 0, it means that the triangle wave has gone through a complete cycle. At this time, the triangle wave generator inputs and updates the frequency deviation value.
[0061] The setting principle diagram of H is as follows Figure 4 As shown, the value of H is obtained by the following formula:
[0062]
[0063] Among them, H is related to the two count values h1 and h2 and is not 1. However, the amplitude of the triangular wave output subsequently is 1.
[0064]
[0065] Finally, set a counting variable TriCnt with an initial value of 0, which represents the number of steps of gradual increase and decrease. When the half-range flag HalfFlag is 0, the up count is increased by 1, otherwise the down count is decreased by 1. The output amplitude is 1 and the frequency is F through the following formula: s The triangle wave:
[0066] H(TriCnt)=TriCnt·F S ·T S ·4-1 (13)
[0067] In formula (13), H(TriCnt) represents the current carrier height value output by the triangular wave generator. The final effect diagram of the triangular wave generator is as follows: Figure 5 shown.
[0068] Embodiment 2
[0069] The purpose of this embodiment is to provide a grid-connected converter PWM simulation method taking into account the frequency deviation of a quartz crystal oscillator, comprising:
[0070] Simulate the temperature-frequency characteristic curve of the crystal oscillator in the simulation;
[0071] When the ambient temperature of the crystal oscillator changes, the frequency of the crystal oscillator will change accordingly, and the simulation will produce the crystal oscillator frequency deviation corresponding to the temperature relative to the zero point;
[0072] It is synchronized to the triangle wave generator through the frequency synchronization module, and finally outputs the waveform with changed frequency.
[0073] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A grid-connected converter PWM simulation system taking into account the frequency deviation of a quartz crystal oscillator, characterized in that: include: Frequency deviation generation module, frequency synchronization module, triangle wave generator; The frequency deviation generating module is configured to: receive the ambient temperature and output the frequency deviation caused by the temperature to the frequency; The frequency deviation generation module outputs the corresponding crystal frequency deviation value according to the temperature-frequency characteristic curve of the AT-cut quartz crystal oscillator based on the ambient temperature value. Δp; Get the frequency deviation after input sampling Δp The triangular wave frequency deviation after the signal Δf , and the actual frequency after the change F s : Among them, the initial triangular wave frequency is F tri ; The frequency synchronization module is configured to: sample the frequency deviation, and the sampling time needs to be synchronized with the simulation step of the triangle wave generator so that the deviation signal is synchronized with the frequency of the triangle wave generator; The triangular wave generator is configured to: receive a sampled deviation frequency signal as input, generate a frequency deviation of a PWM triangular wave after receiving the input signal, and obtain an actual output triangular wave frequency based on the frequency deviation.
2. The grid-connected converter PWM simulation system taking into account the quartz crystal frequency deviation as claimed in claim 1, characterized in that: The frequency deviation generation module outputs the frequency deviation caused by temperature. Δp, It is frequency deviation amplification The ratio of the final frequency to the rated frequency.
3. The grid-connected converter PWM simulation system taking into account the quartz crystal oscillator frequency deviation as claimed in claim 1, characterized in that: The specific steps for generating the temperature-frequency characteristic curve of an AT-cut quartz crystal are as follows: Set the deviation parameters of the quartz crystal AT cut angle Δθ ; Fitting different Δθ The extreme value on the temperature-frequency characteristic curve corresponding to the value T m.left , T m.right ; Based on extreme value T m.left , T m.right Get the coordinates of the extreme points on the two quadratic curves on the left and right of the inflection point; The coefficients of the two quadratic curves after the cubic curve is split are obtained based on the obtained coordinate data, and the two quadratic curves are combined to obtain the desired cubic characteristic curve.
4. The grid-connected converter PWM simulation system taking into account the quartz crystal oscillator frequency deviation as claimed in claim 3, characterized in that: All cubic curves are split into two quadratic curves at their inflection points for fitting.
5. The grid-connected converter PWM simulation system taking into account the quartz crystal frequency deviation as claimed in claim 3, characterized in that: Adjusting the deviation parameters Δθ The value of can change the temperature-frequency characteristic curve of the quartz crystal.
6. A grid-connected converter PWM simulation method taking into account quartz crystal frequency deviation, characterized in that: include: Based on the ambient temperature, output the deviation of the frequency caused by the ambient temperature; The deviation signal is synchronized with the frequency of the triangular wave generator, that is, the sampling time of the deviation signal is kept the same as the step length of the triangular wave generator; The input of the triangle wave generator is the sampled deviation frequency signal. The initial triangle wave frequency is set. After receiving the signal, the frequency deviation of the PWM triangle wave is generated to obtain the actual output triangle wave frequency. The frequency deviation generation module outputs the corresponding crystal frequency deviation value according to the temperature-frequency characteristic curve of the AT-cut quartz crystal oscillator based on the ambient temperature value. Δp; Get the frequency deviation after input sampling Δp The triangular wave frequency deviation after the signal Δf , and the actual frequency after the change F s : Among them, the initial triangular wave frequency is F tri。 7. The grid-connected converter PWM simulation method taking into account the quartz crystal oscillator frequency deviation as claimed in claim 6, characterized in that: According to the ambient temperature value, the corresponding crystal frequency deviation value is output according to the AT-cut quartz crystal temperature-frequency characteristic curve Δ p .
8. The grid-connected converter PWM simulation method taking into account the quartz crystal oscillator frequency deviation as claimed in claim 6, characterized in that: Frequency deviation due to temperature Δp, It is frequency deviation amplification The ratio of the final frequency to the rated frequency.
Citation Information
Patent Citations
Load-based variable PWM controller
CN109756133A
Time-triggered Ethernet clock synchronization method based on crystal oscillator frequency digital compensation
CN110299957A