PWM delay output circuit and PWM control system
By designing the PWM delay output circuit, using components such as finite state machine and time converter, the decimal precision output of the PWM signal is realized, solving the problem that traditional PWM delay output can only be integer-level accuracy, and improving the output accuracy and Adaptability.
Patent Information
- Application Number
- CN202411220654.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-02
- Publication Date
- 2024-11-15
AI Technical Summary
Traditional PWM delay output can only output integer-level accuracy, and cannot achieve decimal-level accuracy output. Especially under high-frequency clocks, the output accuracy cannot be guaranteed due to factors such as temperature and voltage.
A PWM delay output circuit is designed, including a state control module and a PWM output module. Clock synchronization is achieved through a finite state machine, a reserved delay unit, a time converter, a coarse-tuning delay control code generator and a shift counter. and dynamic lock measurement series updates to ensure accurate delay output of PWM signals.
It realizes the decimal precision delay output of PWM signals, can flexibly respond to changes in temperature and voltage, improves adaptability and output accuracy, and meets the high-precision requirements under high-frequency clocks.
Smart Images

Figure CN118971851A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of electronic circuits, and in particular to a PWM delay output circuit and a PWM control system. Background Art
[0002] In the field of power management and motor control, the requirements for energy efficiency and system performance are increasing. Pulse Width Modulation (PWM) is a method of digitally encoding analog signal levels. High-precision PWM (HRPWM) technology came into being to optimize system performance by providing higher-precision modulation resolution. By increasing the resolution of the modulation signal, HRPWM technology can more accurately control the output voltage and current of the power supply, thereby achieving higher energy conversion efficiency and lower system heat loss. Traditional PWM delay output, for example, its comparison value can only be selected from 0 to 100, and the accuracy of the duty cycle is only 1%. In other words, only integer duty cycles such as 24% and 56% can be generated, and more accurate decimal duty cycles such as 26.5% cannot be generated.
[0003] Ordinary chips can only output PWM with an integral precision through the output port, and cannot achieve decimal precision output. In the implementation of decimal precision output, especially when working under a high-frequency clock (200m), the chip will be affected by temperature, voltage, etc., resulting in the inability to guarantee output precision.
[0004] It can be seen that how to solve the problem that traditional PWM delay output can only output integer-level accuracy is a technical problem that needs to be solved urgently by people in this field. Summary of the invention
[0005] The purpose of the present application is to provide a PWM delay output circuit and a PWM control system, which are used to solve the problem that the traditional PWM delay output can only output integer-level accuracy.
[0006] In order to solve the above technical problems, the present application provides a PWM delay output circuit, comprising: a state control module, a PWM output module;
[0007] The state control module includes: a finite state machine, a reserved delay unit, a time converter, a coarse adjustment delay control code generator, and a shift counter;
[0008] The finite state machine starts to generate a measurement pulse and sends it to the reserved delay unit;
[0009] The reserved delay unit receives the measurement pulse and outputs a delayed measurement pulse to the time converter;
[0010] When the finite state machine enters the coarse adjustment locking state, the time converter is controlled to perform coarse adjustment measurement within a reference clock cycle, and the coarse adjustment measurement result is output to the coarse adjustment delay control code generator;
[0011] The coarse adjustment delay control code generator is used to output a coarse adjustment control code according to the coarse adjustment measurement result;
[0012] When the finite state machine enters the fine-tuning locking state, the shift counter is controlled to generate a fine-tuning control code, and the locking measurement level is updated according to the system locking state;
[0013] The PWM output module is used to obtain a delay control word according to the input delay fractional control word and the locking measurement series, and output the delay control word after synchronization with the input PWM signal.
[0014] As an optional solution, the above PWM delay output circuit further includes: a phase detection and lock detection module;
[0015] The phase detection and lock detection module includes: a first phase detector, a second phase detector, a third phase detector, and an XOR gate;
[0016] The first phase detector is used to detect the phase relationship of the reference clock after the feedback clock delay lock error;
[0017] The second phase detector is used to detect the phase relationship of the feedback clock after the delay locking error with respect to the reference clock;
[0018] The third phase detector is used to output an UP signal when the reference clock is ahead of the feedback clock; and output a DOWN signal when the feedback clock is ahead of the reference clock;
[0019] The XOR gate is used to receive the output signals of the first phase detector and the second phase detector and output a LOCK signal;
[0020] The finite state machine is used to dynamically update the locking measurement level when the phase detection and locking detection module outputs the LOCK signal and the UP signal.
[0021] As an optional solution, the above PWM delay output circuit further includes: a measurement feedback module;
[0022] The measurement feedback module is used to select a corresponding delay according to an input lock control word, and output the feedback clock to the phase discrimination and lock detection module.
[0023] As an optional solution, in the above-mentioned PWM delay output circuit, the measurement feedback module includes 32 coarse adjustment delay units, 32 coarse adjustment delay unit selection interfaces, 1 coarse adjustment delay unit control interface, 1 fine adjustment delay unit and 1 fine adjustment delay unit control interface;
[0024] The time converter is composed of 32 coarse adjustment delay units.
[0025] As an optional solution, in the above PWM delay output circuit, the PWM output module includes 8 PWM delay output units, each PWM delay output unit includes a delay output circuit and a control module; each PWM delay output unit can be controlled separately;
[0026] When the control module detects that the LOCK signal is 1, the corresponding PWM output is enabled.
[0027] As an optional solution, in the above-mentioned PWM delay output circuit, the delay output circuit is composed of 32 coarse adjustment delay units, 1 fine adjustment delay unit, 1 channel enable interface, 1 coarse adjustment delay unit control interface, 1 fine adjustment delay unit control interface, 1 compensation interface and 32 coarse adjustment delay unit selection interfaces;
[0028] When the control module of the PWM delay output unit receives an enable signal, it calculates a delay control word for enabling the control of the coarse adjustment delay unit, the fine adjustment delay unit and the four control interfaces;
[0029] The delay output circuit outputs synchronously with the delay control word and the input PWM signal.
[0030] As an optional solution, in the above PWM delay output circuit, the coarse adjustment delay control code generator includes an encoder and a control unit;
[0031] The encoder is used to encode and output a coarse adjustment control code according to the coarse adjustment measurement result;
[0032] The control unit is used to stop measuring and output an overflow flag signal when the coarse adjustment control code overflows; and to trigger the finite state machine to enter a fine adjustment locking state when the coarse adjustment control code does not overflow.
[0033] As an optional solution, in the above-mentioned PWM delay output circuit, the finite state machine is also used to enter a fine-tuning lock state when it detects that the LOCK signal is 1, update the lock measurement level and output a lock signal, continuously monitor the LOCK signal, and when the LOCK signal becomes 0, the system is unlocked.
[0034] As an optional solution, in the above PWM delay output circuit, the phase discrimination and lock detection module includes: a first error unit and a second error unit;
[0035] The first error unit is configured as a 2-level basic delay unit; the second error unit is configured as a 2- to 15-level basic delay unit according to a preset error level;
[0036] The locking error is determined according to a difference between a fixed delay output by the first error unit and a variable delay output by the second error unit.
[0037] Finally, the present application also provides a PWM control system, including the above-mentioned PWM delay output circuit.
[0038] The PWM delay output circuit provided by the present application includes: a state control module, a PWM output module; the state control module includes: a finite state machine, a reserved delay unit, a time converter, a coarse adjustment delay control code generator, and a shift counter; the finite state machine starts to generate a measurement pulse and sends it to the reserved delay unit; the reserved delay unit receives the measurement pulse and outputs the delay measurement pulse to the time converter; when the finite state machine enters the coarse adjustment locking state, the time converter is controlled to perform coarse adjustment measurement within a reference clock cycle, and the coarse adjustment measurement result is output to the coarse adjustment delay control code generator; the coarse adjustment delay control code generator is used to output the coarse adjustment control code according to the coarse adjustment measurement result; when the finite state machine enters the fine adjustment locking state, the shift counter is controlled to generate the fine adjustment control code, and the locking measurement series is updated according to the system locking state; the PWM output module is used to obtain the delay control word according to the input delay decimal control word and the locking measurement series, and output it after synchronizing the delay control word with the input PWM signal. The present application realizes clock synchronization through the reserved delay unit and the time converter, which provides a basis for the precise delay of the PWM signal. The dynamic control capability of the finite state machine and the shift counter allows the circuit to adjust the lock measurement level according to the real-time lock state, thereby adapting to different working conditions. The coarse adjustment delay control code generator and the shift counter are responsible for the coarse adjustment and fine adjustment processes respectively, ensuring that the delay control of the PWM signal is both fast and accurate. When the system is locked, the delay control word is obtained by inputting the delay decimal control word to realize the PWM delay. The delay decimal control word makes the PWM delay output accuracy reach the decimal level, dynamically updates the lock measurement level, effectively responds to changes in temperature, voltage, etc., flexibly responds to different delay requirements, and improves adaptability.
[0039] In addition, the present application also provides a PWM control system, including the above-mentioned PWM delay output circuit, with the same effect as above. BRIEF DESCRIPTION OF THE DRAWINGS
[0040] In order to more clearly illustrate the embodiments of the present application, the following is a brief introduction to the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0041] Figure 1 A schematic diagram of a PWM delay output circuit is provided for an embodiment of the present application;
[0042] Figure 2 Schematic diagram of the phase detection and lock detection module provided in the embodiment of the present application
[0043] Figure 3 A schematic diagram of the structure of a coarse adjustment delay unit provided in an embodiment of the present application;
[0044] Figure 4 A schematic diagram of the structure of a fine-tuning delay unit provided in an embodiment of the present application;
[0045] Figure 5 A structural diagram of a measurement feedback circuit, a PWM delay output circuit and a time converter provided in an embodiment of the present application;
[0046] Figure 6 A schematic diagram of the structure of a basic delay unit provided in an embodiment of the present application. DETAILED DESCRIPTION
[0047] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0048] The core of this application is to provide a PWM delay output circuit and a PWM control system.
[0049] In order to enable those skilled in the art to better understand the present application, the present application is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0050] In the field of power management and motor control, the requirements for energy efficiency and system performance are increasing day by day. Although the traditional pulse width modulation (PWM) series has achieved certain results in power conversion and speed control, it still has some limitations, especially when dealing with high power density and high-precision control requirements. In order to further improve the power conversion efficiency and motor control accuracy, HRPWM technology came into being, aiming to optimize system performance by providing higher-precision modulation resolution. By increasing the resolution of the modulation signal, HRPWM technology can more accurately control the output voltage and current of the power supply, thereby achieving higher energy conversion efficiency and lower system heat loss. In addition, in motor control applications, HRPWM can provide a smoother startup and speed regulation process, reduce electromagnetic interference and noise during operation, and improve the life and reliability of the motor.
[0051] The existing technical solutions cannot output accurate PWM signals according to the delay control word under high-frequency clock (such as 200MHz). Changes in environmental factors such as temperature and voltage will affect the output delay, thereby reducing the delay output accuracy of PWM.
[0052] In order to solve the above problems, the embodiment of the present application provides a PWM delay output circuit. Figure 1 A schematic diagram of a PWM delay output circuit is provided for an embodiment of the present application, such as Figure 1 As shown, it includes: a state control module 11 and a PWM output module 12;
[0053] The state control module includes: a finite state machine 111, a reserved delay unit, a time converter 112, a coarse adjustment delay control code generator 113, and a shift counter 114;
[0054] The finite state machine 111 starts to generate a measurement pulse and sends it to the reserved delay unit;
[0055] The reserved delay unit receives the measurement pulse and outputs the delayed measurement pulse to the time converter 112;
[0056] When the finite state machine 111 enters the coarse adjustment locking state, the control time converter 112 performs coarse adjustment measurement within a reference clock cycle, and outputs the coarse adjustment measurement result to the coarse adjustment delay control code generator 113;
[0057] The coarse adjustment delay control code generator 113 is used to output a coarse adjustment control code according to the coarse adjustment measurement result;
[0058] When the finite state machine 111 enters the fine-tuning locking state, the shift counter 114 is controlled to generate a fine-tuning control code, and the locking measurement level is updated according to the system locking state;
[0059] The PWM output module 12 is used to obtain a delay control word according to the input delay fractional control word and the locked measurement series, and output the delay control word after synchronization with the input PWM signal.
[0060] The PWM delay output circuit is composed of a state control module 11 and a PWM output module 12, which together realize high-precision delay control of the PWM signal.
[0061] After the system receives the enable signal, the finite state machine 111 (FSM) starts and generates a measurement pulse; it is responsible for controlling the state flow of the entire circuit, from startup to coarse adjustment and fine adjustment locking state.
[0062] The reserved delay unit receives the measurement pulse generated by the FSM and outputs a stable delay measurement pulse to the time converter 112, and the FSM enters a coarse adjustment locking state.
[0063] Under the control of the FSM, the time converter 112 (TDC) completes the coarse adjustment measurement of the delay measurement pulse output by the reserved delay unit within one reference clock cycle.
[0064] The coarse delay control code generator 113 generates a coarse control code according to the measurement result of the TDC to provide preliminary delay control for the PWM signal.
[0065] When the finite state machine 111 enters the fine tuning lock state, the shift counter 114 generates a fine tuning control code, and further updates the lock measurement class (measure_class) according to the system lock state.
[0066] The PWM output module 12 calculates the delay control word according to the input delay fractional control word (HRES) and the updated locked measurement level (measure_class). The input PWM signal is synchronized according to the delay control word to achieve accurate delay output synchronized with the input PWM signal. Specifically, the delay fractional control word is a 5BIT delay control word.
[0067] The circuit design uses a mechanism to dynamically update the lock measurement level according to the system lock status to adapt to the impact of environmental changes (such as temperature and voltage fluctuations) on circuit performance and ensure high precision and stability of PWM output. In addition, through the coarse and fine adjustment of FSM control, precise control of PWM signal delay can be achieved to meet the high-precision requirements under high-frequency clocks.
[0068] The PWM delay output circuit provided by the embodiment of the present application includes: a state control module 11, a PWM output module 12; the state control module 11 includes: a finite state machine 111, a reserved delay unit, a time converter 112, a coarse adjustment delay control code generator 113, and a shift counter 114; the finite state machine 111 starts to generate a measurement pulse and sends it to the reserved delay unit; the reserved delay unit receives the measurement pulse and outputs the delayed measurement pulse to the time converter 112; when the finite state machine 111 enters the coarse adjustment locking state, the time converter 112 is controlled 12 performs coarse adjustment measurement within a reference clock cycle, and outputs the coarse adjustment measurement result to the coarse adjustment delay control code generator 113; the coarse adjustment delay control code generator 113 is used to output the coarse adjustment control code according to the coarse adjustment measurement result; when the finite state machine 111 enters the fine adjustment locking state, the shift counter 114 is controlled to generate the fine adjustment control code, and the locking measurement level is updated according to the system locking state; the PWM output module 12 is used to obtain the delay control word according to the input delay fractional control word and the locking measurement level, and output it after synchronizing the delay control word with the input PWM signal. By reserving the delay unit and the time converter 112, clock synchronization is achieved, which provides a basis for the precise delay of the PWM signal. The dynamic control capability of the finite state machine 111 and the shift counter 114 allows the circuit to adjust the locking measurement level according to the real-time locking state, so as to adapt to different working conditions. The coarse adjustment delay control code generator 113 and the shift counter 114 are responsible for the coarse adjustment and fine adjustment processes respectively, ensuring that the delay control of the PWM signal is both fast and accurate. By inputting a delay decimal control word, the circuit can flexibly respond to different delay requirements, thereby improving adaptability.
[0069] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, it also includes: a phase detection and lock detection module 13;
[0070] The phase detector and lock detection module 13 includes: a first phase detector, a second phase detector, a third phase detector, and an XOR gate;
[0071] The first phase detector is used to detect the phase relationship of the reference clock after the feedback clock delay lock error;
[0072] The second phase detector is used to detect the phase relationship of the feedback clock after the delay locking error with respect to the reference clock;
[0073] The third phase detector is used to output an UP signal when the reference clock is ahead of the feedback clock; and output a DOWN signal when the feedback clock is ahead of the reference clock;
[0074] The XOR gate is used to receive the output signals of the first phase detector and the second phase detector and output a LOCK signal;
[0075] The finite state machine 111 is used to dynamically update the locking measurement level according to the LOCK signal and UP signal output by the phase detection and locking detection module 13 .
[0076] Figure 2 A schematic diagram of the phase discrimination and lock detection module 13 provided in the embodiment of the present application is shown in FIG. Figure 2 As shown, the first phase detector and the second phase detector respectively detect the phase relationship between the reference clock (CLK_REF) and the feedback clock (CLK_FB). When one of the clocks is delayed relative to the other clock to a preset locking error, the phase detector can identify this phase deviation.
[0077] The third phase detector monitors the relative advance or lag between the two clocks. If the reference clock is ahead of the feedback clock, it outputs an UP signal; conversely, if the feedback clock is ahead, it outputs a DOWN signal. This helps determine the real-time relative position between the clocks.
[0078] The XOR gate receives the output signals of the first and second phase detectors. If the outputs of the two phase detectors are inconsistent (i.e., there is a phase deviation), the XOR gate will output a LOCK signal, indicating that the system needs further adjustment to achieve a locked state.
[0079] The finite state machine 111 dynamically updates the lock measurement class (measure_class) according to the LOCK signal and the UP / DOWN signal output by the third phase detector. This dynamic update mechanism enables the system to adapt to the real-time change of the clock frequency and ensure the accurate delayed output of the PWM signal.
[0080] The solution provided by the embodiment of the present application, through the coordinated work of three phase detectors, the system can more accurately detect the phase relationship between the clocks and improve the accuracy of the locking process. Dynamic adjustment is made according to the actual phase deviation of the clock to improve the adaptability to different working conditions. The XOR gate ensures that the system considers that the lock state is reached only when the two clock phases match, reducing the possibility of false locking. The dynamic update of the finite state machine 111 adjusts the lock measurement series according to the real-time LOCK and UP / DOWN signals to maintain the accuracy of the PWM output.
[0081] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, it also includes: a measurement feedback module 14;
[0082] The measurement feedback module 14 is used to select a corresponding delay according to the input lock control word, and output a feedback clock to the phase detection and lock detection module 13 .
[0083] The measurement feedback module 14 receives the input lock control word from the state control module 11. According to the input lock control word, the delayed CLK_FB (feedback clock) is output to the phase detection and lock detection module 13. The measurement feedback module 14 is adjusted according to different lock control words, which increases the flexibility of the system and its adaptability to different application scenarios.
[0084] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the measurement feedback module 14 includes 32 coarse adjustment delay units, 32 coarse adjustment delay unit selection interfaces, 1 coarse adjustment delay unit control interface, 1 fine adjustment delay unit and 1 fine adjustment delay unit control interface;
[0085] The time converter 112 is composed of 32 coarse delay units.
[0086] Figure 3 A schematic diagram of the structure of a coarse adjustment delay unit provided in an embodiment of the present application; Figure 4 A schematic diagram of the structure of a fine-tuning delay unit provided in an embodiment of the present application; Figure 5 A structural diagram of a measurement feedback circuit, a delay output circuit and a time converter 112 provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the measurement feedback circuit is composed of 32 c_dly (coarse delay units), 32 c_dly selection muxes, 1 c_dly control mux, 1 f_dly (fine delay unit) and 1 f_dly control mux. The time converter 112 is composed of 32 c_dlys.
[0087] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the PWM output module 12 includes 8 PWM delay output units, each of which includes a delay output circuit and a control module; each PWM delay output unit is enabled to be controlled separately;
[0088] When the control module detects that the LOCK signal is 1, it enables the corresponding PWM output.
[0089] like Figure 1 As shown, the PWM output module 12 includes multiple PWM delay output units. The PWM output module 12 is composed of 8 independent PWM delay output units, and each unit is responsible for the delay and output control of one PWM signal.
[0090] Each PWM delay output unit contains a delay output circuit, which is responsible for adjusting the delay of the PWM signal according to the instructions of the control module. Each PWM delay output unit is equipped with a control module for receiving the system status information and LOCK signal, and controlling the output of the PWM signal accordingly. Each PWM delay output unit can be enabled or disabled individually, providing flexibility, allowing the system to activate only specific PWM output channels as needed. When the control module detects that the LOCK signal is 1 (indicating that the system is locked and ready to output PWM signals), it enables the corresponding PWM output unit and starts the delayed output of the PWM signal.
[0091] The design of multiple PWM delay output units allows the system to selectively activate PWM channels according to specific needs, improving the flexibility of the system. Individual enable control means that the system can turn off certain PWM output units when not needed, thereby reducing overall power consumption. The control module detects the LOCK signal to control the PWM output, ensuring that all PWM signal outputs are performed after the system is locked and stable, ensuring the synchronization of the output. Once the LOCK signal is detected, the PWM output is enabled immediately, reducing the time required for the system to reach a stable state.
[0092] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the delay output circuit is composed of 32 coarse adjustment delay units, 1 fine adjustment delay unit, 1 channel enable interface, 1 coarse adjustment delay unit control interface, 1 fine adjustment delay unit control interface, 1 compensation interface and 32 coarse adjustment delay unit selection interfaces;
[0093] When the control module of the PWM delay output unit receives the enable signal, the delay control word for the control enable of the coarse adjustment delay unit, the fine adjustment delay unit and the four control interfaces is calculated;
[0094] The delay output circuit outputs synchronously with the delay control word and the input PWM signal.
[0095] The coarse delay unit contains 32 coarse delay units, each of which provides a configurable delay for adjusting the phase of the PWM signal to a greater extent. The fine delay unit contains 1 fine delay unit for fine-tuning the phase of the PWM signal to achieve more precise delay control. The channel enable interface receives the enable signal from the control module to determine whether the delay output circuit should be activated. The coarse delay unit control interface receives instructions from the control module to select and activate the appropriate coarse delay unit. The fine delay unit control interface is used to control the fine delay unit to achieve more precise delay adjustment. The compensation interface provides a compensation mechanism to adjust the output of the delay output circuit to compensate for possible system errors.
[0096] There are 32 selection interfaces for the coarse adjustment delay unit selection interface, each interface corresponds to a coarse adjustment delay unit, allowing the control module to select and activate a specific delay unit based on the calculation results.
[0097] When the output is not enabled, a channel enable mux control signal is generated, and the input of the delay output circuit is fixed to 0; the control module receives an enable signal from the system or external, triggering the calculation of the delay control word. The delay control word is calculated based on the input LOCK signal, HRES (5BIT delay control word) and measure_class (locked measurement level). The corresponding delay unit is activated through the coarse and fine control interfaces, and necessary adjustments may be made through the compensation interface. The delay output circuit adjusts the delay of the PWM signal according to the calculated delay control word, and outputs it in synchronization with the input PWM signal. Figure 5 As shown, the PWM delay output circuit has one more PWM channel enable mux and one more compensation mux compared to the measurement feedback circuit.
[0098] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the coarse adjustment delay control code generator 113 includes an encoder and a control unit;
[0099] The encoder is used to encode and output a coarse adjustment control code according to the coarse adjustment measurement result;
[0100] The control unit is used to stop the measurement and output an overflow flag signal when the coarse adjustment control code overflows; when the coarse adjustment control code does not overflow, trigger the finite state machine 111 to enter the fine adjustment locking state.
[0101] The encoder receives the coarse adjustment measurement result of the time converter 112 and converts the result into a corresponding coarse adjustment control code; the control unit works in coordination with the encoder, and when it detects that the coarse adjustment control code output by the encoder reaches a preset overflow condition, the control unit issues an instruction to stop the measurement and outputs an overflow flag signal to indicate an abnormal end of the measurement process; when the coarse adjustment control code does not reach the overflow condition, the control unit prompts the finite state machine 111 to continue the operation process, enter the fine adjustment locking state, and prepare to start the fine adjustment process.
[0102] Specifically, the PWM delay output circuit also includes a user feedback interface for providing a warning message or an error code to the user when an overflow occurs in the coarse control code generator, so that the user can understand the system status and take corresponding measures.
[0103] By detecting the overflow of the control unit, data errors or system instability caused by the coarse adjustment control code exceeding the system processing capacity can be avoided. The encoder converts the coarse adjustment measurement result into a control code, provides raw data for the delay adjustment of the PWM signal, and ensures the accuracy of the measurement. Stopping the measurement and issuing a warning in time when an overflow is detected helps prevent the system from entering an unstable state. When the coarse adjustment control code is within the normal range, the control unit triggers the finite state machine 111 to enter the fine adjustment locking state, ensuring a smooth transition from coarse adjustment to fine adjustment.
[0104] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the finite state machine 111 is also used to enter a fine-tuning lock state when the LOCK signal is detected to be 1, update the lock measurement level and output a lock signal, continuously monitor the LOCK signal, and when the LOCK signal becomes 0, the system is unlocked.
[0105] When the finite state machine 111 detects that the LOCK signal from the phase detection and lock detection module 13 is 1, the fine adjustment locking process is triggered, and the system then enters the locked state; in the locked state, the finite state machine 111 updates measure_class (lock measurement series) and outputs a lock signal, indicating that the system has been successfully locked and is ready for precise delay output of the PWM signal; the finite state machine 111 continuously monitors the LOCK signal in the locked state, and once it detects that the LOCK signal becomes 0, it indicates that the system has lost lock; after the system loses lock, the finite state machine 111 controls to return to the fine adjustment locking state and waits for the system to be relocked; before the system is relocked, the finite state machine 111 prepares for the next round of lock measurement series updates to ensure that once the system is locked again, it can quickly recover to the precise PWM delay output.
[0106] By fine-tuning the lock state of the finite state machine 111, the system can achieve higher precision clock synchronization. Continuous monitoring of the LOCK signal ensures the stability of the system in the lock state, and any slight changes can be captured and processed in time. When the system loses lock, the FSM can respond quickly, reducing the time required for the system to recover to the lock state. Dynamically updating the lock measurement series enables the system to adapt to environmental changes or internal parameter fluctuations.
[0107] According to the above embodiment, in a specific implementation scheme of the PWM delay output circuit, the phase discrimination and lock detection module 13 includes: a first error unit, a second error unit;
[0108] The first error unit is configured as a 2-level basic delay unit; the second error unit is configured as a 2- to 15-level basic delay unit according to a preset error level;
[0109] The locking error is determined according to the difference between the fixed delay output by the first error unit and the variable delay output by the second error unit.
[0110] Figure 6 A schematic diagram of the structure of a basic delay unit provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the number of levels can be configured according to actual needs.
[0111] The first error unit and the second error unit are used to generate fixed delay and variable delay for phase detection; the first error unit is fixedly configured as a 2-level basic delay unit to provide a reference delay to ensure the reference point of the phase detection operation; the second error unit is variably set to a 2-level to 15-level basic delay unit according to the preset error level configuration. This unit provides a variable delay amount to adapt to different locking error requirements. According to the setting of the preset error level, the delay is variably adjusted to adapt to different locking error requirements.
[0112] The lock error is determined by calculating the difference between the fixed delay output by the first error unit and the variable delay output by the second error unit to measure and adjust for the phase difference between the clocks.
[0113] The phase detector compares the phase of the reference clock (CLK_REF) and the feedback clock (CLK_FB). The outputs of the first and second error units are used to adjust the comparison result to determine the actual lock error. The lock error is calculated as the difference between the output delay of the second error unit and the output delay of the first error unit (Δt = D2 - D1), which reflects the phase deviation between the two clocks. Based on the size and direction of the lock error, the system determines whether the lock state has been achieved or further adjustment is required. If the system has not achieved the lock state, the configuration of the second error unit can be dynamically adjusted as needed to reduce the lock error and drive the system into the lock state.
[0114] By precisely controlling the delays of the first and second error units, the system can achieve higher precision clock lock. The variable configuration of the second error unit provides the system with wide adaptability to meet different lock error requirements. Accurate lock error measurement helps optimize the generation and adjustment of PWM signals and improve overall system performance. By dynamically adjusting the second error unit, the system can maintain the lock state more stably. Accurate lock error measurement and adjustment reduces unnecessary clock adjustments and helps reduce system power consumption.
[0115] Finally, this embodiment provides a PWM control system, including the above-mentioned PWM delay output circuit.
[0116] The above is a detailed introduction to the PWM delay output circuit and PWM control system provided by the present application. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present application, several improvements and modifications can be made to the present application, and these improvements and modifications also fall within the scope of protection of the claims of the present application.
[0117] It should also be noted that, in this specification, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "comprise", "include" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the statement "comprises a ..." does not exclude the presence of other identical elements in the process, method, article or device including the element.
Claims
1. A PWM delay output circuit, characterized in that: include: State control module, PWM output module; The state control module includes: a finite state machine, a reserved delay unit, a time converter, a coarse adjustment delay control code generator, and a shift counter; The finite state machine starts to generate a measurement pulse and sends it to the reserved delay unit; The reserved delay unit receives the measurement pulse and outputs a delayed measurement pulse to the time converter; When the finite state machine enters the coarse adjustment locking state, the time converter is controlled to perform coarse adjustment measurement within a reference clock cycle, and the coarse adjustment measurement result is output to the coarse adjustment delay control code generator; The coarse adjustment delay control code generator is used to output a coarse adjustment control code according to the coarse adjustment measurement result; When the finite state machine enters the fine-tuning locking state, the shift counter is controlled to generate a fine-tuning control code, and the locking measurement level is updated according to the system locking state; The PWM output module is used to obtain a delay control word according to the input delay fractional control word and the locking measurement series, and output the delay control word after synchronization with the input PWM signal.
2. The PWM delay output circuit according to claim 1, characterized in that: Also includes: Phase detection and lock detection module; The phase detection and lock detection module includes: a first phase detector, a second phase detector, a third phase detector, and an XOR gate; The first phase detector is used to detect the phase relationship of the reference clock after the feedback clock delay lock error; The second phase detector is used to detect the phase relationship of the feedback clock after the delay locking error with respect to the reference clock; The third phase detector is used to output an UP signal when the reference clock is ahead of the feedback clock; and output a DOWN signal when the feedback clock is ahead of the reference clock; The XOR gate is used to receive the output signals of the first phase detector and the second phase detector and output a LOCK signal; The finite state machine is used to dynamically update the locking measurement level when the phase detection and locking detection module outputs the LOCK signal and the UP signal.
3. The PWM delay output circuit according to claim 2, characterized in that: Also includes: Measurement feedback module; The measurement feedback module is used to select a corresponding delay according to an input lock control word, and output the feedback clock to the phase discrimination and lock detection module.
4. The PWM delay output circuit according to claim 3, characterized in that: The measurement feedback module comprises 32 coarse adjustment delay units, 32 coarse adjustment delay unit selection interfaces, 1 coarse adjustment delay unit control interface, 1 fine adjustment delay unit and 1 fine adjustment delay unit control interface; The time converter is composed of 32 coarse adjustment delay units.
5. The PWM delay output circuit according to claim 4, characterized in that: The PWM output module includes 8 PWM delay output units, each of which includes a delay output circuit and a control module; each PWM delay output unit can be controlled individually; When the control module detects that the LOCK signal is 1, the corresponding PWM output is enabled.
6. The PWM delay output circuit according to claim 5, characterized in that: The delay output circuit is composed of 32 coarse-adjustment delay units, 1 fine-adjustment delay unit, 1 channel enable interface, 1 coarse-adjustment delay unit control interface, 1 fine-adjustment delay unit control interface, 1 compensation interface and 32 coarse-adjustment delay unit selection interfaces; When the control module of the PWM delay output unit receives an enable signal, it calculates a delay control word for enabling the control of the coarse adjustment delay unit, the fine adjustment delay unit and the four control interfaces; The delay output circuit outputs synchronously with the delay control word and the input PWM signal.
7. The PWM delay output circuit according to claim 6, characterized in that: The coarse adjustment delay control code generator includes an encoder and a control unit; The encoder is used to encode and output a coarse adjustment control code according to the coarse adjustment measurement result; The control unit is used to stop measuring and output an overflow flag signal when the coarse adjustment control code overflows; and to trigger the finite state machine to enter a fine adjustment locking state when the coarse adjustment control code does not overflow.
8. The PWM delay output circuit according to claim 7, characterized in that: The finite state machine is also used to enter a fine-tuning lock state when detecting that the LOCK signal is 1, update the lock measurement level and output a lock signal, continuously monitor the LOCK signal, and when the LOCK signal becomes 0, the system loses lock.
9. The PWM delay output circuit according to claim 2, characterized in that: The phase discrimination and lock detection module comprises: a first error unit and a second error unit; The first error unit is configured as a 2-level basic delay unit; the second error unit is configured as a 2- to 15-level basic delay unit according to a preset error level; The locking error is determined according to a difference between a fixed delay output by the first error unit and a variable delay output by the second error unit.
10. A PWM control system, characterized in that: It comprises the PWM delay output circuit as described in any one of claims 1 to 9.
