PWM signal duty ratio acquisition method, electronic equipment and computer storage medium
By acquiring the number of edges of the PWM signal and determining the corresponding duty cycle calculation strategy, the problem of the inability of the prior art to measure the duty cycle of the non-center symmetric PWM signal is solved, and high-precision and real-time duty cycle measurement is achieved.
Patent Information
- Application Number
- CN202411997985.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-11
AI Technical Summary
The existing PWM signal duty cycle measurement technology cannot achieve duty cycle acquisition of non-center symmetric PWM signals, especially in motor control systems, especially when the PWM wave transmission method and over-modulation zone operation with dual sampling and dual updates.
By obtaining the number of edges of the PWM signal in the period to be tested, the duty cycle calculation strategy of the PWM signal in the period to be tested is determined based on the number of edges, and the duty cycle of the PWM signal is calculated using this strategy. This method is suitable for PWM signals with central symmetric and non-center symmetrical.
The duty cycle acquisition of a non-center symmetric PWM signal is realized, which improves the measurement accuracy of duty cycle and supports real-time measurement of the duty cycle of PWM signal.
Smart Images

Figure CN119805000A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of measurement technology, and in particular to a method for acquiring a duty cycle of a PWM signal, an electronic device, and a computer storage medium. Background Art
[0002] Pulse Width Modulation (PWM) technology is widely used in various fields such as control, communication, and power electronics. For example, in a motor control system, the inverter is controlled by calculating and generating a PWM signal, thereby achieving torque control and speed control of the motor. Duty cycle is a key parameter of the PWM signal. In the motor control scheme, accurate measurement of the actual output PWM signal duty cycle can be used to reconstruct the phase voltage of the motor, thereby achieving functions such as motor power and torque estimation.
[0003] The existing PWM signal duty cycle measurement technology can be implemented using the capture mode of the general timer module of the microcontroller. This method can cover the PWM signal duty cycle measurement in most scenarios. However, in the motor control system, when the double sampling and double updating PWM wave generation method is adopted, and when running in the overmodulation area, the PWM signal includes center-symmetric and non-center-symmetric PWM signals. The existing acquisition method cannot achieve the acquisition of the duty cycle of the non-center-symmetric PWM signal. Summary of the invention
[0004] The present application provides a method for acquiring a duty cycle of a PWM signal, an electronic device, and a computer storage medium, which can achieve acquisition of a duty cycle of a non-center-symmetrical PWM signal and improve the measurement accuracy of the duty cycle.
[0005] The present application provides a method for obtaining the duty cycle of a PWM signal, which includes obtaining the number of edges of the PWM signal in a period to be measured; determining a duty cycle calculation strategy of the PWM signal in the period to be measured based on the number of edges; and calculating the duty cycle of the PWM signal in the period to be measured using the duty cycle calculation strategy.
[0006] In one embodiment, a duty cycle calculation strategy of a PWM signal in a measured period is determined based on the number of edges, including, in response to the number of edges being 2, determining that the duty cycle calculation strategy of the PWM signal in the measured period is a first calculation strategy, and the first calculation strategy satisfies D=CNTS / P; wherein D is the duty cycle of the PWM signal, CNTS is the duration of a high-level signal of the PWM signal in the measured period, and P is the period of the PWM signal.
[0007] In one embodiment, a duty cycle calculation strategy for a PWM signal within a measured period is determined based on the number of edges, including determining position information of the edge of the PWM signal within the measured period in response to the number of edges being 1; and determining a duty cycle calculation strategy for the PWM signal within the measured period based on the position information and a duration of a high level of the PWM signal within the measured period.
[0008] In one embodiment, a duty cycle calculation strategy for the PWM signal within the measured period is determined based on position information and a duration of a high level of the PWM signal within the measured period, including determining that, in response to an edge being in the first half of the measured period and being a rising edge, the duty cycle calculation strategy for the PWM signal within the measured period is a second calculation strategy, and the second calculation strategy satisfies D=(CNT+P / 2) / P; wherein D is the duty cycle of the PWM signal, CNT is the duration of a high level signal within the first half of the measured period, and P is the period of the PWM signal.
[0009] In one embodiment, a duty cycle calculation strategy of the PWM signal in the measured period is determined based on the position information and the duration of the high level of the PWM signal in the measured period, including: in response to the edge being in the second half of the measured period and being a falling edge, the duty cycle calculation strategy of the PWM signal in the measured period is determined to be a third calculation strategy, and the third calculation strategy satisfies D=(CNTS-CNT+P / 2) / P; wherein D is the duty cycle of the PWM signal, CNT is the duration of the high level signal in the first half of the measured period, CNTS is the duration of the high level signal in the measured period and the previous period, and P is the period of the PWM signal.
[0010] In one embodiment, the duty cycle calculation strategy of the PWM signal in the test cycle is determined based on the number of edges, including determining the level information of the PWM signal in the test cycle in response to the number of edges being 0; and determining the duty cycle calculation strategy of the PWM signal in the test cycle based on the level information.
[0011] In one embodiment, a duty cycle calculation strategy of a PWM signal within a test period is determined based on level information, including, in response to the PWM signal being at a low level within the test period, determining that the duty cycle calculation strategy of the PWM signal within the test period is a fourth calculation strategy, and the fourth calculation strategy satisfies: D=0; wherein D is the duty cycle of the PWM signal.
[0012] In one embodiment, a duty cycle calculation strategy of a PWM signal within a test period is determined based on level information, including, in response to the PWM signal being at a high level within the test period, determining that the duty cycle calculation strategy of the PWM signal within the test period is a fifth calculation strategy, and the fifth calculation strategy satisfies D=1; wherein D is the duty cycle of the PWM signal.
[0013] The present application provides an electronic device, which includes a processor and a memory, the memory is used to store a computer-readable program, and the processor is used to execute the computer-readable program to implement the above-mentioned acquisition method.
[0014] The present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to implement the above-mentioned acquisition method.
[0015] The beneficial effects of the present application are as follows: the acquisition method of the present application includes acquiring the number of edges of the PWM signal in the period to be measured; determining the duty cycle calculation strategy of the PWM signal in the period to be measured based on the number of edges; and calculating the duty cycle of the PWM signal in the period to be measured using the duty cycle calculation strategy. That is, the acquisition method of the present application acquires the number of edges of the PWM signal in the period to be measured, so as to determine whether the PWM signal in the period to be measured is a centrally symmetrical PWM signal or a non-centrally symmetrical PWM signal by the number of edges, and then determines the duty cycle calculation strategy of the PWM signal by the specific type of the PWM signal, because the duty cycle calculation strategy is determined according to the number of edges of the PWM signal in the period to be measured, that is, it is applicable to centrally symmetrical PWM signals and non-centrally symmetrical PWM signals, thereby realizing the measurement of the duty cycle of centrally symmetrical PWM signals and non-centrally symmetrical PWM signals in the period to be measured, and realizing the real-time measurement of the duty cycle of the PWM signal. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For those of ordinary skill in the art, other drawings can be obtained based on these drawings without creative work, among which:
[0017] Figure 1 It is a flow chart of an embodiment of a method for obtaining a duty cycle of a PWM signal provided by the present application;
[0018] Figure 2 It is a schematic diagram of all PWM waveforms provided by the present application when a double sampling double updating PWM wave generation method and overmodulation technology are adopted;
[0019] Figure 3 yes Figure 1 Embodiment Step S200 is a flowchart of an embodiment. DETAILED DESCRIPTION
[0020] 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.
[0021] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.
[0022] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.
[0023] The present application provides a method for obtaining a duty cycle of a PWM signal. Figure 1 , Figure 1 1 is a flow chart of an embodiment of a method for obtaining a duty cycle of a PWM signal provided by the present application, and the method for obtaining the duty cycle comprises the following steps:
[0024] Step S100: obtaining the number of edges of the PWM signal in the period to be measured.
[0025] Get the number of edges of the PWM signal in the period to be measured. The edge includes the rising edge and the falling edge. The number of edges refers to the number of rising edges and falling edges of the PWM signal.
[0026] The number of edges of the PWM signal in the cycle to be tested can be obtained based on the capture mode of the timer module of the microcontroller. When a rising edge is detected, the register CNT will be triggered to start counting from zero, and when a falling edge comes, the count value in CNT will be latched into the register CNTS, and CNTS records the duration of the high level between adjacent rising and falling edges.
[0027] Step S200: determining a duty cycle calculation strategy of the PWM signal within the period to be measured based on the number of edges.
[0028] See also Figure 2 , Figure 2 It is a schematic diagram of all PWM waveforms provided by the present application when the double-sampling double-update PWM wave generation method and overmodulation technology are adopted. It can be seen that the PWM signal generated based on the triangle wave includes 5 types of PWM waveforms. In the test cycle, the number of edges of the PWM signal can be 2, 1, or 0. Among them, when the number of edges is 2 and 0, the PWM signal is a center-symmetrical PWM signal; when the number of edges is 1, the PWM signal is a non-center-symmetrical PWM signal. Among them, the number of edges of the PWM signal in the test cycle is equal to the total number of edges read by the top interrupt function TOP_ISR of the triangle wave minus the total number of edges read by the previous top interrupt function TOP_ISR.
[0029] The present application determines a calculation strategy for the duty cycle of a PWM signal within a period to be measured based on the number of edges of the PWM signal, so as to achieve acquisition of centrosymmetric and non-centrosymmetric PWM signal duty cycles.
[0030] Step S300: Calculate the duty cycle of the PWM signal in the period to be measured using a duty cycle calculation strategy.
[0031] Based on the number of edges of different PWM signals, a duty cycle calculation strategy corresponding to the number of edges is selected, that is, the duty cycle of the centrally symmetrical PWM signal or the non-centrally symmetrical PWM signal in the period to be measured is calculated according to the corresponding duty cycle calculation strategy.
[0032] The acquisition method of the present application includes acquiring the number of edges of the PWM signal in the period to be measured; determining the duty cycle calculation strategy of the PWM signal in the period to be measured based on the number of edges; and calculating the duty cycle of the PWM signal in the period to be measured using the duty cycle calculation strategy. That is, the acquisition method of the present application acquires the number of edges of the PWM signal in the period to be measured, so as to determine whether the PWM signal in the period to be measured is a centrally symmetrical PWM signal or a non-centrally symmetrical PWM signal by the number of edges, and then determines the duty cycle calculation strategy of the PWM signal by the specific type of the PWM signal, because the duty cycle calculation strategy is determined according to the number of edges of the PWM signal in the period to be measured, that is, it is applicable to centrally symmetrical PWM signals and non-centrally symmetrical PWM signals, thereby realizing the measurement of the duty cycle of centrally symmetrical PWM signals and non-centrally symmetrical PWM signals in the period to be measured, and realizing the real-time measurement of the duty cycle of the PWM signal.
[0033] In one embodiment, step S200 determines the duty cycle calculation strategy of the PWM signal in the period to be measured based on the number of edges, including the following steps:
[0034] Step S211: In response to the number of edges being 2, determining that the duty cycle calculation strategy of the PWM signal in the period to be measured is the first calculation strategy, and the first calculation strategy satisfies D=CNTS / P.
[0035] The number of edges of the PWM signal is determined. In response to the number of edges being 2, that is, the PWM signal in the period to be measured includes a rising edge and a falling edge, in which case the high level duration will be latched into the CNTS register. The duty cycle calculation strategy of the PWM signal in the period to be measured is determined to be the first calculation strategy, that is, the duty cycle D of the PWM signal satisfies the calculation formula D=CNTS / P. Among them, CNTS is the duration of the high level signal of the PWM signal in the period to be measured, and P is the period of the PWM signal.
[0036] In this embodiment, when the number of edges of the PWM signal is 2, that is, when the PWM signal is a centrally symmetrical PWM signal and the number of edges is 2, the duty cycle of the PWM signal is the ratio of the duration of the high level of the PWM signal in the period to be measured to the period of the PWM signal. The calculation process is simple and easy to implement.
[0037] In one embodiment, step S200 determines the duty cycle calculation strategy of the PWM signal in the period to be measured based on the number of edges, including the following steps:
[0038] Step S221: in response to the edge number being 1, determining the position information of the edge of the PWM signal within the period to be measured.
[0039] Determine the number of edges of the PWM signal. In response to the number of edges being 1, that is, the PWM signal is a non-center-symmetrical PWM signal, it is also necessary to determine the position information of the edge in the period to be measured. The position information can be in the first half period or the second half period of the period to be measured; if it happens to fall on a half period, it can be the first half period or the second half period, which is not limited here.
[0040] Step S222: determining a duty cycle calculation strategy of the PWM signal in the period to be measured based on the position information and the duration of the high level of the PWM signal in the period to be measured.
[0041] Determine the position information of the edge in the cycle to be measured. In response to the edge being in the first half of the cycle to be measured and being a rising edge, in this case, since there is no falling edge, the count value in CNT is not latched. It is necessary to interrupt the function BOT_ISR at the bottom of the triangle wave to read the CNT register value of the real-time count. This value is the duration of the high level in the first half of the cycle, and then determine that the duty cycle calculation strategy of the PWM signal in the cycle to be measured is the second calculation strategy. The second calculation strategy satisfies D=(CNT+P / 2) / P. Wherein, D is the duty cycle of the PWM signal, CNT is the duration of the high level signal in the first half of the cycle to be measured, and P is the period of the PWM signal.
[0042] Determine the position information of the edge in the cycle to be measured. In response to the edge being in the second half of the cycle to be measured and being a falling edge, in this case, since there is no rising edge, CNTS contains the duration of the high level in this cycle and the previous cycle, and cannot be used directly. Therefore, it is necessary to use the bottom interrupt function BOT_ISR to read the real-time counted CNT register value to find out the duration of the high level in the second half of the cycle. Then determine that the duty cycle calculation strategy of the PWM signal in the cycle to be measured is the third calculation strategy, and the third calculation strategy satisfies D = (CNTS-CNT+P / 2) / P. Among them, D is the duty cycle of the PWM signal, CNT is the duration of the high level signal in the first half of the cycle to be measured, CNTS is the duration of the high level signal in the cycle to be measured and the previous cycle, and P is the period of the PWM signal.
[0043] When determining that the number of edges of the PWM signal is 1, this embodiment further determines the position information of the edge in the period to be measured, and determines the corresponding duty cycle calculation strategy of the PWM signal according to the position information and the specific type of the edge, thereby realizing the calculation of the duty cycle of a non-center-symmetric PWM signal.
[0044] In one embodiment, see Figure 3 , Figure 3 1 is a flow chart of an embodiment of step S200 provided in the present application. Step S200 determines the duty cycle calculation strategy of the PWM signal in the period to be tested based on the number of edges, and includes the following steps:
[0045] Step S231: in response to the edge number being 0, determining the level information of the PWM signal in the period to be tested.
[0046] Determine the number of edges of the PWM signal, in response to the number of edges being 0, that is, the PWM signal is a centrally symmetrical PWM signal and no edge of the PWM signal is detected. Since the corresponding PWM signal when the number of edges is 0 can be a low level signal or a high level signal in the period to be tested, it is necessary to further determine the level information of the PWM signal in the period to be tested.
[0047] Step S232: determining a duty cycle calculation strategy of the PWM signal within the period to be tested based on the level information.
[0048] A duty cycle calculation strategy of the PWM signal within the period to be measured is determined based on the level information.
[0049] Specifically, in response to the PWM signal being at a low level in the period to be measured, the duty cycle calculation strategy of the PWM signal in the period to be measured is determined to be the fourth calculation strategy, and the fourth calculation strategy satisfies D=0, where D is the duty cycle of the PWM signal.
[0050] In response to the PWM signal being at a high level in the period to be measured, it is determined that the duty cycle calculation strategy of the PWM signal in the period to be measured is the fifth calculation strategy, and the fifth calculation strategy satisfies D=1, where D is the duty cycle of the PWM signal.
[0051] When determining that the number of edges of the PWM signal is 0, this embodiment further determines the level information of the PWM signal in the period to be tested, so as to determine the duty cycle calculation strategy of the corresponding PWM signal according to the corresponding level information, thereby obtaining the duty cycle of the edgeless symmetrical PWM signal.
[0052] In practical applications, the method for obtaining the PWM signal duty cycle of the present application can be implemented based on a generic timer module (GTM) of a single-chip microcomputer or a processor with information processing capabilities, such as a generic timer IP module of BOSCH, namely a GTM module.
[0053] Among them, the timer TIM and the timer output module ATOM are submodules of the GTM module. Among them, the timer TIM is used to measure the input microcontroller signal, that is, to obtain the number of edges of the PWM signal. In order to realize PWM measurement, its working mode is set to PWM measurement mode. In order to achieve high real-time performance, the timer TIM is configured to continuously sample, that is, the next measurement is started immediately after one measurement is completed. The working principle of the timer TIM is as follows: Assuming that the positive duty cycle is measured, the level validity of the timer TIM sampling is configured to be high. When the rising edge is detected, the CNT register in the timer TIM module will continue to accumulate according to the clock frequency. After the falling edge is detected, it will automatically trigger the CNT count value to be latched into the CNTS register, and keep CNT counting. When the next rising edge arrives, the CNT count value is latched into the GPR1 register, the CNTS counter value is latched into the GPR0 register, and the CNT and CNTS count values are cleared to restart the next measurement cycle. Specifically, the present application judges the PWM waves of different states based on the number of edges in the cycle to be measured, relying on the ECNT register in the timer TIM module. If an edge is detected in a measurement cycle, the ECNT count value is increased by one, and the number of edges is judged by the difference between the ECNT of the bottom interrupt function BOT_ISR and the top interrupt function TOP_ISR of the triangular wave.
[0054] The timer output module ATOM is used to generate PWM waves and trigger interrupts. The carrier wave of the generated PWM wave is a triangular wave. The bottom interrupt function BOT_ISR and the top interrupt function TOP_ISR are triggered at the top and bottom of the triangular wave respectively. The threshold update of the shadow register of the timer output module ATOM is completed within the interrupt, so that the PWM level is flipped after reaching the new threshold, and the duty cycle is double updated within a PWM control cycle. This method has an obvious feature, that is, the starting point and end point of the PWM must be at the top interrupt of the triangular wave, and the bottom interrupt of the triangular wave is the midpoint of the PWM. This is a breakthrough point to solve the problem that the starting point and end point of PWM in the prior art cannot be determined.
[0055] By integrating the PWM measurement function of the timer TIM, this application can identify all PWM waveforms that may appear in each cycle, including the double-sampling double-update PWM wave generation mode and the PWM continuous high level and continuous low level generated by the overmodulation technology, as well as the interrupt signal generated by the timer output module ATOM that is synchronized with the PWM, that is, the PWM signal duty cycle of this application is calculated at the top interrupt of the triangle wave of each PWM cycle, which can achieve accurate measurement of the PWM signal duty cycle of each cycle to be measured and enhance the real-time acquisition of the PWM signal duty cycle. In the application of motor control systems, it is possible to complete the accurate measurement of the non-center-symmetrical PWM signal duty cycle issued by the system in each cycle to be measured. According to the duty cycle, high-real-time torque estimation is further achieved, which is used to monitor the system status and effectively improve the safety of the motor system.
[0056] The present application provides an electronic device, which includes a processor and a memory, wherein the memory is used to store a computer-readable program, and the processor is used to execute the computer-readable program to implement a method for obtaining a PWM signal duty cycle. The electronic device may be a vehicle, a robot, etc. provided with a motor system, which is not limited here.
[0057] The processor may be an integrated circuit chip with signal processing capabilities. The processor may also be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0058] The present application provides a computer-readable storage medium, which stores a computer program. The computer program can be executed by a processor to implement a method for acquiring a duty cycle of a PWM signal.
[0059] The above are only implementation methods of the present application, and are not intended to limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.
Claims
1. A method for obtaining a duty cycle of a PWM signal, characterized in that: The acquisition method comprises: Get the number of edges of the PWM signal in the period to be measured; Determine a duty cycle calculation strategy of the PWM signal within the period to be measured based on the number of edges; The duty cycle calculation strategy is used to calculate the duty cycle of the PWM signal in the period to be measured.
2. The acquisition method according to claim 1, characterized in that: The strategy for calculating the duty cycle of the PWM signal in the period to be measured based on the number of edges includes: In response to the number of edges being 2, it is determined that the duty cycle calculation strategy of the PWM signal in the period to be measured is a first calculation strategy, and the first calculation strategy satisfies: D=CNTS / P; wherein D is the duty cycle of the PWM signal, CNTS is the duration of the high-level signal of the PWM signal in the period to be measured, and P is the period of the PWM signal.
3. The acquisition method according to claim 1, characterized in that: The strategy for calculating the duty cycle of the PWM signal in the period to be measured based on the number of edges includes: In response to the edge number being 1, determining position information of the edge of the PWM signal within the period to be measured; A duty cycle calculation strategy of the PWM signal in the period to be measured is determined based on the position information and the duration of the high level of the PWM signal in the period to be measured.
4. The acquisition method according to claim 3, characterized in that: The strategy for calculating the duty cycle of the PWM signal in the period to be measured is determined based on the position information and the duration of the high level of the PWM signal in the period to be measured, including: In response to the edge being in the first half of the period to be measured and being a rising edge, it is determined that the duty cycle calculation strategy of the PWM signal in the period to be measured is a second calculation strategy, and the second calculation strategy satisfies: D=(CNT+P / 2) / P; wherein D is the duty cycle of the PWM signal, CNT is the duration of the high-level signal in the first half of the period to be measured, and P is the period of the PWM signal.
5. The acquisition method according to claim 3, characterized in that: The strategy for calculating the duty cycle of the PWM signal in the period to be measured is determined based on the position information and the duration of the high level of the PWM signal in the period to be measured, including: In response to the edge being in the second half of the period to be measured and being a falling edge, it is determined that the duty cycle calculation strategy of the PWM signal in the period to be measured is a third calculation strategy, and the third calculation strategy satisfies: D=(CNTS-CNT+P / 2) / P; wherein D is the duty cycle of the PWM signal, CNT is the duration of the high-level signal in the first half of the period to be measured, CNTS is the duration of the high-level signal in the period to be measured and the previous period, and P is the period of the PWM signal.
6. The acquisition method according to claim 1, characterized in that: The strategy for calculating the duty cycle of the PWM signal in the period to be measured based on the number of edges includes: In response to the edge number being 0, determining level information of the PWM signal in the period to be measured; A duty cycle calculation strategy of the PWM signal in the period to be measured is determined based on the level information.
7. The acquisition method according to claim 6, characterized in that: The step of determining a duty cycle calculation strategy of the PWM signal within the period to be measured based on the level information includes: In response to the PWM signal being at a low level during the period to be measured, it is determined that the duty cycle calculation strategy of the PWM signal during the period to be measured is a fourth calculation strategy, and the fourth calculation strategy satisfies: D=0; wherein D is the duty cycle of the PWM signal.
8. The acquisition method according to claim 6, characterized in that: The step of determining a duty cycle calculation strategy of the PWM signal within the period to be measured based on the level information includes: In response to the PWM signal being at a high level during the period to be measured, it is determined that the duty cycle calculation strategy of the PWM signal during the period to be measured is a fifth calculation strategy, and the fifth calculation strategy satisfies: D=1; wherein D is the duty cycle of the PWM signal.
9. An electronic device, characterized in that: include: A processor and a memory, wherein the memory is used to store a computer-readable program, and the processor is used to execute the computer-readable program to implement the acquisition method according to any one of claims 1 to 8.
10. A computer-readable storage medium, characterized in that: A computer-readable program is stored, and the computer-readable program can be executed by a processor to implement the acquisition method described in any one of claims 1 to 8.
Citation Information
Cited By
Complementation method of three paths of PWM signals, computer equipment and readable storage medium
CN120603102A