Search

CN-122026910-A - Sampling control method, device, electronic equipment and medium

CN122026910ACN 122026910 ACN122026910 ACN 122026910ACN-122026910-A

Abstract

The embodiment of the invention provides a sampling control method, a device, electronic equipment and a medium, wherein the method comprises the steps of obtaining edge moments of a plurality of pulse width modulation signals and sampling moments of a plurality of sampling signals; sequencing edge time and sampling time to obtain sequencing result, judging whether each sampling time and adjacent modulation signal edge time meet avoidance condition according to sequencing result, if so, regulating modulation signal edge time or sampling time. The embodiment of the invention can uniformly manage the pulse width modulation signals and the sampling signals by summarizing the edge moments of the pulse width modulation signals and the sampling moments of the sampling signals, is convenient for determining the interference influence and accurately judging, and adopts effective measures, thereby ensuring the sampling effect and improving the stability of the system.

Inventors

  • LIU WENFENG

Assignees

  • 珠海格力电器股份有限公司
  • 珠海零边界集成电路有限公司

Dates

Publication Date
20260512
Application Date
20251217

Claims (10)

  1. 1. A method of controlling sampling, the method comprising: Acquiring edge moments of a plurality of pulse width modulation signals and sampling moments of a plurality of sampling signals; Sequencing the edge time and the sampling time to obtain a sequencing result; judging whether the sampling time and the adjacent edge time meet the avoidance condition or not according to the sequencing result; And if the avoidance condition is met, adjusting the edge time or the sampling time.
  2. 2. The method according to claim 1, wherein the determining whether the avoidance condition is satisfied between each of the sampling instants and the edge instants adjacent thereto according to the sorting result includes: determining the edge time adjacent to the sampling time according to the sequencing result; acquiring interference information corresponding to the edge time adjacent to the sampling time; and judging whether the avoidance condition is met between the sampling time and the edge time according to the interference information.
  3. 3. The method according to claim 2, wherein the determining whether the avoidance condition is satisfied between the sampling time and the edge time according to the interference information includes: Determining an interference time window corresponding to the pulse width modulation signal according to the edge time and the interference information; Judging whether the sampling moment is in the interference time window or not; And if the sampling time is in the interference time window, judging that the avoidance condition is met between the sampling time and the edge time.
  4. 4. A method of controlling sampling according to claim 3, wherein the interference information comprises an interference delay time and an interference duration; The determining an interference time window corresponding to the edge signal according to the edge time information and the edge interference information comprises the following steps: determining an interference starting time according to the edge time; Determining an interference ending time according to the interference delay time and the interference duration; And determining an interference time window according to the interference starting time and the interference ending time.
  5. 5. The method for controlling sampling according to claim 3, wherein adjusting the edge time corresponding to the edge signal or the sampling time corresponding to the sampling signal if the avoidance condition is satisfied comprises: Acquiring sampling avoidance information corresponding to the sampling moment; Determining whether the sampling time delay is allowed or not according to the sampling avoidance information; If the sampling time is allowed to be delayed, determining sampling delay time according to the interference time window and the sampling time; and adjusting the sampling time corresponding to the sampling signal according to the sampling delay time.
  6. 6. The method for controlling sampling according to claim 3, wherein adjusting the edge time corresponding to the edge signal or the sampling time corresponding to the sampling signal if the avoidance condition is satisfied comprises: acquiring edge avoidance information corresponding to the edge moment; Determining whether the edge moment delay is allowed or not according to the edge avoidance information; If the edge time is allowed to be delayed, determining edge delay time according to the sampling time; And adjusting the edge time corresponding to the edge signal according to the edge delay time.
  7. 7. The method for controlling sampling according to claim 1, further comprising: controlling the corresponding pulse width modulation pin level inversion according to the adjusted edge time; or, according to the adjusted sampling time, controlling the corresponding analog-digital converter module to sample.
  8. 8. A sampling control device, the device comprising: The time acquisition module is used for acquiring edge time of the pulse width modulation signals and sampling time of the sampling signals; the sequencing result determining module is used for sequencing the edge time and the sampling time to obtain a sequencing result; The avoidance condition judging module is used for judging whether the avoidance condition is met between each sampling time and the adjacent edge time according to the sequencing result; and the time adjustment module is used for adjusting the edge time or the sampling time if the avoidance condition is met.
  9. 9. An electronic device comprising a processor, a memory and a program or instruction stored on the memory and executable on the processor, which program or instruction when executed by the processor implements the steps of the method of controlling sampling as claimed in claims 1-7.
  10. 10. A readable storage medium, characterized in that it has stored thereon a program or instructions which, when executed by a processor, implement the steps of the method of controlling sampling according to claims 1-7.

Description

Sampling control method, device, electronic equipment and medium Technical Field The present invention relates to the field of circuit control technologies, and in particular, to a method and apparatus for controlling sampling, an electronic device, and a readable storage medium. Background The pulse width modulation (Pulse Width Modulation, PWM) technology is used as a core means in the fields of motor control and switching power supply, and the switching state of a power tube is controlled by outputting PWM waves with specific duty ratio, so that the accurate regulation of voltage or current is realized. And an Analog-to-Digital Converter (ADC) is responsible for sampling and digitizing the key Analog signals such as current and voltage in the system in real time, so as to provide necessary feedback information for the control algorithm. PWM output and ADC sampling together form the sensing and executing foundation of a closed-loop control system, and are widely applied to scenes such as industrial control, new energy automobiles, consumer electronics and the like. At the edge moment of the power tube switch driven by the PWM module, power supply interference and signal interference are introduced, if the power tube switch is sampled at the moment, an interference signal is superposed on a real signal, so that sampling errors occur, and further control algorithm errors or power supply output fluctuation are caused. In the related art, in order to avoid the PWM switch from interfering with the ADC sampling, the PWM phase and the corresponding ADC sampling phase are usually fixed and time-interleaved by a user, or the strength of the interfering signal is reduced by adopting a hardware filtering scheme. However, for a control algorithm with non-fixed sampling time, a fixed time interleaving scheme is difficult to implement, and hardware filtering can introduce signal delay and phase lag while suppressing noise, thereby affecting the sampling effect and the stability of the system. Disclosure of Invention In view of the foregoing, embodiments of the present invention are directed to providing a sampling control method, apparatus, electronic device, and readable storage medium that overcome or at least partially solve the foregoing problems. In a first aspect, an embodiment of the present invention provides a method for controlling sampling, where the method includes: Acquiring edge moments of a plurality of pulse width modulation signals and sampling moments of a plurality of sampling signals; Sequencing the edge time and the sampling time to obtain a sequencing result; judging whether the sampling time and the adjacent edge time meet the avoidance condition or not according to the sequencing result; And if the avoidance condition is met, adjusting the edge time or the sampling time. Optionally, the determining, according to the sorting result, whether the sampling time and the adjacent edge time meet the avoidance condition includes: determining the edge time adjacent to the sampling time according to the sequencing result; acquiring interference information corresponding to the edge time adjacent to the sampling time; and judging whether the avoidance condition is met between the sampling time and the edge time according to the interference information. Optionally, the determining, according to the interference information, whether the sampling time and the edge time meet an avoidance condition includes: Determining an interference time window corresponding to the pulse width modulation signal according to the edge time and the interference information; Judging whether the sampling moment is in the interference time window or not; And if the sampling time is in the interference time window, judging that the avoidance condition is met between the sampling time and the edge time. Optionally, the interference information includes an interference delay time and an interference duration; The determining an interference time window corresponding to the edge signal according to the edge time information and the edge interference information comprises the following steps: determining an interference starting time according to the edge time; Determining an interference ending time according to the interference delay time and the interference duration; And determining an interference time window according to the interference starting time and the interference ending time. Optionally, if the avoiding condition is met, adjusting an edge time corresponding to the edge signal or a sampling time corresponding to the sampling signal includes: Acquiring sampling avoidance information corresponding to the sampling moment; Determining whether the sampling time delay is allowed or not according to the sampling avoidance information; If the sampling time is allowed to be delayed, determining sampling delay time according to the interference time window and the sampling time; and adjusting the sampling time corresponding to the