# US 2025/0147087 A1 · Method for Acquiring Pulse Width Modulation Signal, Computer Device, and Storage Medium

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2025/0147087 A1
- Document ID: US20250147087A1
- Status: Published application
- Kind: A1
- Application number: 18/691,120
- Filed: 2022-09-05
- Published: 2025-05-08
- Earliest claimed: 2021-09-13
- Assignees: Beijing CHJ Information Technology Co., LTD.
- Applicants: Beijing Chj Information Technology Co., Ltd.
- Inventors: Hongshan Shao
- Web page: https://patentgrep.com/patent/US20250147087A1

## CPC

- G01R 29/023: {Measuring pulse width}
- G01R 23/10: by converting frequency into a train of pulses, which are then counted {, i.e. converting the signal into a square wave}
- G01R 29/02: Measuring characteristics of individual pulses, e.g. deviation from pulse flatness, rise time or duration
- H03K 9/08: of duration- or width-mudulated pulses {or of duty-cycle modulated pulses}
- G01R: MEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES (indicating correct tuning of resonant circuits H03J3/12)
- H03K: PULSE TECHNIQUE (measuring pulse characteristics G01R; modulating sinusoidal oscillations with pulses H03C; transmission of digital information H04L; discriminator circuits detecting phase difference between two signals by counting or integrating cycles of oscillation H03D3/04; automatic control, starting, synchronisation or stabilisation of generators of electronic oscillations or pulses where the type of generator is irrelevant or unspecified H03L; coding, decoding or code conversion, in general H03M)

## Abstract

A method for acquiring a PWM signal includes: acquiring an initial count value during a pulse period of the PWM signal based on an initial frequency division coefficient; determining a predicted frequency of the PWM signal based on the initial count value; determining a corresponding target frequency division coefficient based on the predicted frequency; and acquiring a target count value during the pulse period of the PWM signal and a target count value during a pulse width time of the PWM signal based on the target frequency division coefficient, determining an actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determining an actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal.

## Claims

### Claim 1

A method for acquiring a pulse width modulation (PWM) signal, comprising:
acquiring an initial count value during a pulse period of the PWM signal based on an initial frequency division coefficient;
determining a predicted frequency of the PWM signal based on the initial count value during the pulse period of the PWM signal;
determining a corresponding target frequency division coefficient based on the predicted frequency of the PWM signal; and
acquiring a target count value during the pulse period of the PWM signal and a target count value during a pulse width time of the PWM signal based on the target frequency division coefficient, determining an actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determining an actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal.

### Claim 2 (depends on 1)

The method according to claim 1, wherein the initial frequency division coefficient is determined based on an intermediate frequency of an acquisition frequency band of the PWM signal and a frequency of a clock source.

### Claim 3 (depends on 1)

The method according to claim 1, wherein the initial frequency division coefficient is determined based on an equation:
Div0=f1/(f2*N);
where f1 is a frequency of a clock source, f2 is an intermediate frequency of an acquisition frequency band of the PWM signal, Div0 is an initial frequency division coefficient, and N is a maximum count value of a timer.

### Claim 4 (depends on 1)

The method according to claim 1, wherein before acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient, the method further comprises:
triggering to execute an operation of acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient in response to detecting an input of the PWM signal.

### Claim 5 (depends on 4)

The method according to claim 4, wherein after detecting the input of the PWM signal, the method further comprises:
triggering to execute the operation of acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient in response to determining that count does not overflow.

### Claim 6 (depends on 1)

The method according to claim 1, wherein determining the corresponding target frequency division coefficient based on the predicted frequency of the PWM signal comprises:
determining a frequency band to which the predicted frequency of the PWM signal belongs; and
determining a frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal.

### Claim 7 (depends on 6)

The method according to claim 6, wherein before determining the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal, the method comprises:
triggering an operation of determining the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal in response to determining that the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs is different from the initial frequency division coefficient.

### Claim 8 (depends on 1)

The method according to claim 1, wherein acquiring the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient, determining the actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determining the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal comprises:
acquiring the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient; and
discarding a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for a first time and a target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for a first time, determining the actual frequency of the PWM signal based on a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for a second time, and determining the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for the second time.

### Claim 9 (depends on 8)

The method according to claim 8, wherein acquiring the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient, determining the actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determining the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal comprises:
acquiring the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient;
acquiring the actual duty ratio of the PWM signal determined based on the target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for the first time; and
in response to a difference value between the actual frequency of the PWM signal and the predicted frequency of the PWM signal being greater than a preset threshold, determining the actual frequency of the PWM signal based on a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for the second time, and determining the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and a target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for the second time.

### Claim 10

(canceled)

### Claim 11

A computer device, comprising one or more processors and a storage device;
wherein the storage device is configured to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are configured to:
acquire an initial count value during a pulse period of the PWM signal based on an initial frequency division coefficient;
determine a predicted frequency of the PWM signal based on the initial count value during the pulse period of the PWM signal;
determine a corresponding target frequency division coefficient based on the predicted frequency of the PWM signal; and
acquire a target count value during the pulse period of the PWM signal and a target count value during a pulse width time of the PWM signal based on the target frequency division coefficient, determine an actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determine an actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal.

### Claim 12

A computer-readable storage medium with a computer program stored thereon, wherein the computer program is configured to implement a method for acquiring a PWM signal when executed by a processor, and the method comprises:
acquiring an initial count value during a pulse period of the PWM signal based on an initial frequency division coefficient;
determining a predicted frequency of the PWM signal based on the initial count value during the pulse period of the PWM signal;
determining a corresponding target frequency division coefficient based on the predicted frequency of the PWM signal; and
acquiring a target count value during the pulse period of the PWM signal and a target count value during a pulse width time of the PWM signal based on the target frequency division coefficient, determining an actual frequency of the PWM signal based on the target count value during the pulse period of the PWM signal, and determining an actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal.

### Claim 13

(canceled)

### Claim 14

(canceled)

### Claim 15 (depends on 11)

The method according to claim 11, wherein the initial frequency division coefficient is determined based on an intermediate frequency of an acquisition frequency band of the PWM signal and a frequency of a clock source.

### Claim 16 (depends on 11)

The method according to claim 11, wherein the initial frequency division coefficient is determined based on an equation:
Div0=f1/(f2*N);
where f1 is a frequency of a clock source, f2 is an intermediate frequency of an acquisition frequency band of the PWM signal, Div0 is an initial frequency division coefficient, and N is a maximum count value of a timer.

### Claim 17 (depends on 11)

The method according to claim 11, wherein the one or more processors are configured to:
before acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient, trigger to execute an operation of acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient in response to detecting an input of the PWM signal.

### Claim 18 (depends on 17)

The method according to claim 17, wherein the one or more processors are configured to:
after detecting the input of the PWM signal, trigger to execute the operation of acquiring the initial count value during the pulse period of the PWM signal based on the initial frequency division coefficient in response to determining that count does not overflow.

### Claim 19 (depends on 11)

The method according to claim 11, wherein the one or more processors are configured to:
determine a frequency band to which the predicted frequency of the PWM signal belongs; and
determine a frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal.

### Claim 20 (depends on 19)

The method according to claim 19, wherein the one or more processors are configured to:
before determining the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal, trigger an operation of determining the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs as the target frequency division coefficient of the PWM signal in response to determining that the frequency division coefficient corresponding to the frequency band to which the predicted frequency of the PWM signal belongs is different from the initial frequency division coefficient.

### Claim 21 (depends on 11)

The method according to claim 11, wherein the one or more processors are configured to
acquire the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient; and
discard a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for a first time and a target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for a first time, determine the actual frequency of the PWM signal based on a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for a second time, and determine the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for the second time.

### Claim 22 (depends on 21)

The method according to claim 21, wherein the one or more processors are configured to:
acquire the target count value during the pulse period of the PWM signal and the target count value during the pulse width time of the PWM signal based on the target frequency division coefficient;
acquire the actual duty ratio of the PWM signal determined based on the target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for the first time; and
in response to a difference value between the actual frequency of the PWM signal and the predicted frequency of the PWM signal being greater than a preset threshold, determine the actual frequency of the PWM signal based on a target count value during the pulse period of the PWM signal acquired based on the target frequency division coefficient for the second time, and determine the actual duty ratio of the PWM signal based on the target count value during the pulse period of the PWM signal and a target count value during the pulse width time of the PWM signal acquired based on the target frequency division coefficient for the second time.
