CN111130561B - Signal sampling method, signal sampling device, computer equipment and storage medium - Google Patents

Signal sampling method, signal sampling device, computer equipment and storage medium Download PDF

Info

Publication number
CN111130561B
CN111130561B CN201811289274.1A CN201811289274A CN111130561B CN 111130561 B CN111130561 B CN 111130561B CN 201811289274 A CN201811289274 A CN 201811289274A CN 111130561 B CN111130561 B CN 111130561B
Authority
CN
China
Prior art keywords
sum
sampling
squares
time interval
signal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811289274.1A
Other languages
Chinese (zh)
Other versions
CN111130561A (en
Inventor
夏铸亮
叶健豪
方南
万希
刘伟
赵小坤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Gac Aion New Energy Vehicle Co ltd
Original Assignee
Guangzhou Automobile Group Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Automobile Group Co Ltd filed Critical Guangzhou Automobile Group Co Ltd
Priority to CN201811289274.1A priority Critical patent/CN111130561B/en
Publication of CN111130561A publication Critical patent/CN111130561A/en
Application granted granted Critical
Publication of CN111130561B publication Critical patent/CN111130561B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M13/00Coding, decoding or code conversion, for error detection or error correction; Coding theory basic assumptions; Coding bounds; Error probability evaluation methods; Channel models; Simulation or testing of codes
    • H03M13/65Purpose and implementation aspects
    • H03M13/6569Implementation on processors, e.g. DSPs, or software implementations
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/21Pc I-O input output
    • G05B2219/21122Programmable signal discrimination, input can be used for several functions

Landscapes

  • Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Probability & Statistics with Applications (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)

Abstract

The application relates to a signal sampling method, a signal sampling device, computer equipment and a storage medium, wherein an ECU (electronic control unit) is used for acquiring a first square sum of output signals (sine signals and cosine signals) of a rotary transformer at the current sampling moment; and determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum of the output signal of the previous sampling moment, and then sampling the output signal of the rotary transformer according to the next sampling moment, so that the ECU determines the next sampling moment at the current sampling moment, and then continuously determining the next sampling moment after the next sampling moment at the next sampling moment, thereby realizing that the actual sampling point of each sampling moment dynamically tracks the ideal sampling point, namely dynamically adjusting the time interval between the adjacent sampling moments of the ECU, and leading the actual sampling point to be aligned with or closer to the ideal sampling point, thereby ensuring that the signal quality is sufficiently high, obtaining the ideal signal-to-noise ratio, improving the decoding precision of the rotary transformer, and ensuring the normal operation of the system.

Description

Signal sampling method, signal sampling device, computer equipment and storage medium
Technical Field
The present application relates to the field of signal sampling technologies, and in particular, to a signal sampling method and apparatus, a computer device, and a storage medium.
Background
A resolver (abbreviated as resolver) is an electromagnetic sensor and is an important angle and angular velocity sensor in motor control. In general, a resolver comprises an input excitation signal (Uref) and two output response signals (Usin, Ucos). The signals Uref, Usin and Ucos must be processed (decoded) to obtain the angle θ and the electrical angular velocity ω required for motor control. The processing can adopt a special hardware decoding chip, or can decode the relevant signals by software after carrying out analog-digital conversion.
When software decoding is adopted, synchronous sampling needs to be carried out on the Usin signal and the Ucos signal once in each calculation period, and then required angle and angular speed information is obtained through decoding. In order to improve the decoding accuracy, the sampling points of the Usin and Ucos signals are the peak points of the signals, so that the signal-to-noise ratio can be maximized. If a microcontroller (Electronic Control Uint, abbreviated as ECU) running software decoding is synchronous with a rotating excitation signal (for example, the same clock source is used, or the excitation signal is generated by the ECU), the sampling point can be basically aligned to the ideal sampling point of the Usin and Ucos signals only by calibrating the sampling time off-line or on-line, so as to obtain an ideal signal-to-noise ratio.
However, when the ECU running the decoding program and the excitation signal of the rotary transformer use two asynchronous clocks, the actual sampling point gradually deviates from the ideal sampling point, which results in lower and lower signal-to-noise ratio, lower decoding precision and larger noise, thereby causing the system to be unable to operate normally.
Disclosure of Invention
Based on this, it is necessary to provide a signal sampling method, a device, a computer device, and a storage medium for solving the technical problem that when the ECU running the decoding program and the excitation signal of the rotary transformer use two asynchronous clocks, the actual sampling point gradually deviates from the ideal sampling point, so that the signal-to-noise ratio is lower and lower, the decoding accuracy is reduced, and the noise is higher and higher, thereby causing the system to be unable to normally run.
In a first aspect, an embodiment of the present invention provides a signal sampling method, where the method includes:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining the next sampling moment according to the magnitude relation between the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and sampling the output signal of the rotary transformer according to the next sampling moment.
In one embodiment, before the determining the next sampling time according to the magnitude relation between the first sum of squares and the second sum of squares, the method further includes:
calculating a difference or ratio between the first sum of squares and the second sum of squares;
and determining the magnitude relation between the first square sum and the second square sum according to the difference or the ratio.
In one embodiment, the determining the next sampling time according to the magnitude relation between the first sum of squares and the second sum of squares includes:
determining a first time interval between the current sampling moment and the next sampling moment according to the magnitude relation of the first square sum and the second square sum;
and determining the next sampling moment according to the first time interval and the current sampling moment.
In one embodiment, the determining a first time interval between the current sampling time and the next sampling time according to a magnitude relation between the first sum of squares and the second sum of squares includes:
determining the first time interval according to the magnitude relation between the first square sum and the second square sum, a second time interval and compensation time; the second time interval is a time interval between the last sampling moment and the current sampling moment, and the compensation time represents a time interval error between two adjacent sampling moments.
In one embodiment, the determining the first time interval according to the magnitude relation between the first sum of squares and the second sum of squares, a second time interval and a compensation time comprises:
if the magnitude relation between the first square sum and the second square sum is that the first square sum is larger than the second square sum, the first time interval is that the compensation time is increased or decreased along the same direction of the increasing or decreasing trend of the compensation time at the previous moment on the basis of a second time interval.
In one embodiment, the determining the first time interval according to the magnitude relation between the first sum of squares and the second sum of squares, a second time interval and a compensation time further includes:
if the magnitude relation between the first square sum and the second square sum is that the first square sum is smaller than the second square sum, the first time interval is to increase or decrease the compensation time along the opposite direction of the increase or decrease trend of the compensation time at the previous moment on the basis of a second time interval.
In one embodiment, the method further comprises:
and decoding an output signal of the rotary transformer at the next sampling moment.
In a second aspect, an embodiment of the present invention provides a resolver signal sampling apparatus, where the apparatus includes:
the acquisition module is used for acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
the first determining module is used for determining the next sampling moment according to the magnitude relation between the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and the sampling module is used for sampling the output signal of the rotary transformer according to the next sampling moment.
In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, where the memory stores a computer program, and the processor implements the following steps when executing the computer program:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and sampling the output signal of the rotary transformer according to the next sampling moment.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which a computer program is stored, where the computer program, when executed by a processor, implements the following steps:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and sampling the output signal of the rotary transformer according to the next sampling moment.
According to the signal sampling method, the signal sampling device, the computer equipment and the storage medium, the first square sum of output signals (sine signals and cosine signals) of the rotary transformer at the current sampling moment is obtained through the ECU; and determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum of the output signal of the previous sampling moment, and then sampling the output signal of the rotary transformer according to the next sampling moment, so that the ECU determines the next sampling moment at the current sampling moment, and then continuously determining the next sampling moment after the next sampling moment at the next sampling moment, thereby realizing that the actual sampling point of each sampling moment dynamically tracks the ideal sampling point, namely dynamically adjusting the time interval between the adjacent sampling moments of the ECU, and leading the actual sampling point to be aligned with or closer to the ideal sampling point, thereby ensuring that the signal quality is sufficiently high, obtaining the ideal signal-to-noise ratio, improving the decoding precision of the rotary transformer, and ensuring the normal operation of the system.
Drawings
Fig. 1 is a diagram illustrating an application environment of a signal sampling method according to an embodiment;
FIG. 1.1 is a waveform diagram illustrating a sampling problem caused by an asynchronous clock according to an embodiment;
fig. 2 is a schematic flow chart of a signal sampling method according to an embodiment;
FIG. 3 is a flow chart illustrating a signal sampling method according to an embodiment;
FIG. 4 is a flowchart illustrating a signal sampling method according to an embodiment;
FIG. 4.1 is a flowchart of a calculation algorithm for the first interval of time according to an embodiment;
fig. 4.2 is an overall flowchart of a signal sampling method according to an embodiment;
fig. 5 is a block diagram of a signal sampling apparatus according to an embodiment;
fig. 6 is a block diagram of a signal sampling apparatus according to an embodiment;
fig. 7 is a block diagram of a signal sampling apparatus according to an embodiment;
fig. 8 is a block diagram of a signal sampling apparatus according to an embodiment;
FIG. 9 is a diagram illustrating an internal structure of a computer device according to an embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
The signal sampling method provided by the present application can be applied to a hardware circuit shown in fig. 1, and the circuit includes: the device comprises an excitation signal generator, a rotary transformer, an output signal conditioning circuit (an SIN signal conditioning circuit and a COS signal conditioning circuit) and a microcontroller (Electronic Control Uint, ECU for short). In practical applications, the clock source of the excitation signal from the excitation signal generator is not the same as the ECU running the decoding program, i.e. the excitation signal is not provided by the ECU running the decoding program, such as: the hardware circuit may have a dedicated hardware decoding chip for providing the excitation signal and performing hardware decoding, and using software decoding for backup and verification. As shown in FIG. 1, the excitation signal generator generates a differential excitation signal into the rotary transformerThe system comprises a rotary transformer, a signal processing circuit, an ECU and an ECU, wherein the rotary transformer outputs two paths of differential response signals SIN and COS signals, the SIN and COS signals are respectively conditioned into positive signals for being sampled by the ECU through the corresponding signal conditioning circuits and then input into the ECU, and then the ECU samples and decodes the SIN and COS signals according to the signal sampling method provided by the application. Wherein T is the ECU shown in FIG. 1s,nThe sampling time obtained according to the signal sampling method provided by the application.
In general, the conventional excitation signal is generated by the ECU itself, so that the excitation signal and the software-decoded clock are completely synchronized, and the decoding program samples the resolver signal at a fixed period (the same as the period of the excitation signal), in which case, as long as the relative delay of the sampling time with respect to the excitation signal is calibrated off-line or on-line, the actual sampling time can always be aligned to be close to the ideal sampling time. However, this solution is not suitable for the case where the ECU running the decoding program and the excitation signal of the resolver are two asynchronous clocks, and if the ECU running the decoding program and the excitation signal of the resolver use asynchronous clocks, and the decoding program samples the SIN signal and the COS signal output by the resolver at a fixed period according to its own clock, regardless of the timing error between the two clocks, even if the actual sampling point is just aligned to the ideal sampling point, the actual sampling point will gradually deviate from the ideal sampling point as the timing error between the two clocks gradually accumulates, as shown in fig. 1.1, which results in a lower signal-to-noise ratio and a higher noise until the system cannot normally run. The embodiment of the application provides a signal sampling method, a signal sampling device, computer equipment and a storage medium, and aims to solve the technical problem that when an ECU (electronic control Unit) running a decoding program and a rotary-transformer excitation signal use two asynchronous clocks, actual sampling points gradually deviate from ideal sampling points, so that the signal-to-noise ratio is lower and lower, the decoding precision is reduced, and the noise is higher and higher, so that the system cannot normally run. The following describes in detail the technical solutions of the present application and how the technical solutions of the present application solve the above technical problems by embodiments and with reference to the drawings. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments.
It should be noted that, in the signal sampling method provided by the present invention, an execution main body is an ECU, wherein the execution main body may also be a computer device, or a signal sampling apparatus, and the apparatus may be implemented as part or all of a data analysis terminal by software, hardware, or a combination of software and hardware.
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In one embodiment, fig. 2 provides a signal sampling method, and the embodiment relates to a specific process in which an ECU determines a next sampling time according to a first square sum of an output signal of a resolver at a current sampling time and a second square sum of an output signal at a previous sampling time, and samples the output signal of the resolver at the next sampling time. As shown in fig. 2, the method includes:
s101, acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal includes a sine signal and a cosine signal.
The resolver in this embodiment may be a sine-cosine resolver, where the output signals are sine signals and cosine signals output by the resolver, for example: a sine signal Usin and a cosine signal Ucos. Accordingly, the first sum of squares represents the sum of squares of the sine signal and the cosine signal at the current sampling instant. The current sampling time may represent a time when the output signal is currently acquired, or may be any time when the ECU acquires the output signal of the resolver, which is not limited in this embodiment. Illustratively, the ECU obtains the resolver voltageThe first square sum of Usin and Ucos output by the device at the current moment needs to acquire a sine signal Usin and a cosine signal Ucos at the current moment, and then according to a formula An, the sum is equal to Usin2+Ucos2(An denotes a first sum of squares) a first sum of squares of the sine signal Usin and the cosine signal Ucos at the current time instant is calculated. The process of acquiring the sine signal Usin and the cosine signal Ucos at the current time and calculating the first square sum by the ECU may be executed according to a built-in program, where the program may be written and input by a user in advance, or may be transmitted from other devices, which is not limited in this embodiment. It should be noted that the current time may be determined according to a previous sampling time, and the determination process is the same as that provided in this embodiment for determining the next sampling time according to the current time, which is not described in detail in this embodiment again.
S102, determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant.
Based on the first sum of squares of the output signals of the resolver at the current sampling time, which is obtained by the ECU in the above step S101, the ECU determines the next sampling time based on the magnitude relationship between the first sum of squares and a second sum of squares, which is the sum of squares of the output signals of the resolver at the previous sampling time, wherein the second sum of squares of the output signals of the resolver at the previous sampling time is calculated in the same manner as the ECU calculates the first sum of squares in the above step S101. The ECU determines the next sampling time according to the magnitude relationship between the first sum of squares and the second sum of squares, which is not limited in this embodiment, and is exemplified by: when the first sum of squares is greater than the second sum of squares, it is determined that the output signal quality of the first sum of squares is better, that is, the output signal quality acquired at the current sampling time is better, the ECU may determine an ideal sum of squares of the output signal at the next sampling time according to the first sum of squares with better quality, then derive sine and cosine signals output at the next time according to the ideal sum of squares, and then determine the next sampling time according to the sine and cosine signals output at the next time, respectively. When the first sum of squares is less than the second sum of squares, it is determined that the output signal quality of the second sum of squares is better, that is, the output signal quality acquired at the previous sampling time is better, then the ideal sum of squares of the output signal at the next sampling time is determined according to the second sum of squares with better quality, then the sine and cosine signals output at the next sampling time are deduced according to the ideal sum of squares, and then the next sampling time is determined according to the sine and cosine signals output at the next sampling time.
And S103, sampling the output signal of the rotary transformer according to the next sampling moment.
It is understood that in the present embodiment, the ECU samples the resolver output signal at a time value of the output signal, and in this step, based on the step S102, the next sampling timing has been determined, and the ECU samples the resolver output signal according to the determined next sampling timing, that is, according to the determined next sampling timing, the values of the resolver output signals (the sine signal Usin and the cosine signal Ucos) at the time are collected. It should be noted that the previous sampling time, the current sampling time, and the next sampling time in this embodiment do not mean that one time is determined, but generally refer to a certain time and a previous time and a subsequent time.
In the signal sampling method provided by this embodiment, an ECU is used to obtain a first square sum of output signals (a sine signal Usin and a cosine signal Ucos) of a resolver at a current sampling time; and determining the next sampling moment according to the magnitude relation of the first square sum and the second square sum of the output signal of the previous sampling moment, and then sampling the output signal of the rotary transformer according to the next sampling moment, so that the ECU determines the next sampling moment at the current sampling moment, and then continuously determining the next sampling moment after the next sampling moment at the next sampling moment, thereby realizing that the actual sampling point of each sampling moment dynamically tracks the ideal sampling point, namely dynamically adjusting the time interval between the adjacent sampling moments of the ECU, and leading the actual sampling point to be aligned with or closer to the ideal sampling point, thereby ensuring that the signal quality is sufficiently high, obtaining the ideal signal-to-noise ratio, improving the decoding precision of the rotary transformer, and ensuring the normal operation of the system.
In one embodiment, FIG. 3 provides a signal sampling method, which relates to a specific process of determining a magnitude relationship between a first sum of squares and a second sum of squares by an ECU. As shown in fig. 3, before the step S102, the method further includes:
s201, calculating a difference or a ratio between the first sum of squares and the second sum of squares.
In this embodiment, based on the above step S101, after the ECU obtains the first sum of squares of the resolver output signals, the ECU obtains the second sum of squares by the same method as the first sum of squares, and then the ECU calculates the difference or ratio between the first sum of squares and the second sum of squares, where the calculation method may be calculation using third-party software, or calculation using software built in the ECU, and the method for calculating the difference or ratio between the two is not limited in this embodiment.
S202, determining the magnitude relation between the first square sum and the second square sum according to the difference or the ratio.
It should be noted that the output signals described in the embodiments of the present application include a sine signal Usin and a cosine signal Ucos, the sum of their squares may represent the quality of the output signal at the time, and a larger sum of the squares indicates a better quality of the output signal at the time. Thus in this step the ECU determines the magnitude relationship of the first sum of squares to the second sum of squares based on calculating the difference or ratio between said first sum of squares and said second sum of squares, illustratively, if the difference is a positive value, the magnitude relationship is such that the first sum of squares is greater than the second sum of squares, and if the difference is negative, the first sum of squares is less than the second sum of squares, or, if the ratio of the two is greater than 1, the magnitude relationship is such that the first sum of squares is greater than the second sum of squares, and if the ratio is less than 1, the magnitude relationship is that the first sum of squares is smaller than the second sum of squares, it should be noted that, the magnitude relationship between the first sum of squares and the second sum of squares is determined by calculating a difference or a ratio of the first sum of squares and the second sum of squares, which is only an example, and the present embodiment does not limit the present invention if there are other ways to determine the magnitude relationship between the first sum of squares and the second sum of squares.
According to the signal sampling method provided by the embodiment, the difference or the ratio between the first square sum and the second square sum is calculated, and the magnitude relation between the first square sum and the second square sum is determined according to the difference or the ratio, so that the ECU can determine the next sampling moment according to the magnitude of the current signal square sum and the signal square sum of the last moment, thereby ensuring that the square sum of the output signal at the next sampling moment is larger, namely the quality of the output signal is better, so that an ideal signal-to-noise ratio is obtained, the decoding precision of a rotary transformer is improved, and the normal operation of a system is ensured.
In one embodiment, fig. 4 provides a signal sampling method, and the embodiment relates to a specific process in which the ECU determines a first time interval according to a magnitude relation between the first sum of squares and the second sum of squares, and determines a next sampling time according to the first time interval. As shown in fig. 4, S202 includes:
and S301, determining a first time interval between the current sampling moment and the next sampling moment according to the magnitude relation between the first square sum and the second square sum.
In the present embodiment, the ECU determines a first time interval between the current sampling timing and the next sampling timing, for example, according to the magnitude relationship between the first sum of squares and the second sum of squares determined in step S201: when the first square sum is greater than the second square sum, the output signal quality at the current sampling moment is better, and the ECU determines the first time interval according to the variation trend of the time interval from the current sampling moment to the last sampling moment; when the first square sum is smaller than the second square sum, the output signal quality at the last sampling moment is better, and the ECU can determine a first time interval according to the reverse variation trend of the time interval from the current sampling moment to the last sampling moment; of course, other methods are also possible, and the embodiment of the determination method is not limited.
Optionally, an implementation manner of the S301 step includes: determining the first time interval according to the magnitude relation of the first square sum and the second square sum, the second time interval and the compensation time; the second time interval is a time interval between the last sampling moment and the current sampling moment, and the compensation time represents a time interval error between two adjacent sampling moments. Wherein the ECU determines the first time interval according to the magnitude relationship of the first sum of squares and the second sum of squares, the second time interval, and the compensation time, optionally the implementation "determining the first time interval according to the magnitude relationship of the first sum of squares and the second sum of squares, the second time interval, and the compensation time" comprises: if the magnitude relation between the first square sum and the second square sum is that the first square sum is larger than the second square sum, the first time interval is that the compensation time is increased or decreased along the same direction of the increasing or decreasing trend of the compensation time at the previous moment on the basis of the second time interval. Optionally, if the magnitude relation between the first sum of squares and the second sum of squares is that the first sum of squares is smaller than the second sum of squares, the first time interval is to increase or decrease the compensation time in a direction opposite to the increasing or decreasing trend of the compensation time at the previous time on the basis of a second time interval.
Exemplarily, as shown in fig. 4.1, let the first time interval be Td,n+1With a compensation time of T0The S initial value is 1, the absolute value is constant to be 1, the positive and negative values of S at different moments are different, and the positive and negative values of S indicate whether the first time interval is increased or decreased relative to the second time interval; in fig. 4.1, the flow of the ECU calculating the first interval time is: first, the first square sum A is judgednAnd a second sum of squares An-1If it is AnIs less than An-1Then S isnValue of and Sn-1In contrast, it means that the first time interval and the second time interval have opposite trend, that is: t isd,n+1And Td,nThe trend of change of (a) is opposite, for example: if Sn-1If 1 is taken, SnTaking as-1, Td,n+1=Td,n-T0If S isn-1If taken as-1, then SnTaken to be 1, Td,n+1=Td,n+T0(ii) a Such asFruit AnGreater than An-1Then S isnValue of and Sn-1Similarly, the trend of the first time interval and the second time interval is the same, namely: t isd,n+1And Td,nThe same trend of change, for example: if Sn-1If 1 is taken, SnTaken also as 1, Td,n+1=Td,n+T0If S isn-1If taken as-1, then SnIs also taken to be-1, Td,n+1=Td,n-T0Therefore, when the sum of squares of the output signals is increased, the sampling delay time changes along the change trend of the previous period, and when the sum of squares of the signals is reduced, the sampling delay time changes reversely along the change trend of the previous period until the sum of squares of the signals is maximum, so that the quality of the output signals is ensured to be better, an ideal signal-to-noise ratio is obtained, the decoding precision of the rotary transformer is improved, and the normal operation of the system is ensured.
S302, determining the next sampling time according to the first time interval and the current sampling time.
Based on the first time interval determined by the ECU in step S301, the ECU determines the next sampling time according to the current sampling time, for example, the next sampling time is Ts,n+1The current sampling time is Ts,nThen: t iss,n+1=Ts,n+Td,n+1
Illustratively, as shown in fig. 4.2, in combination with the above-mentioned fig. 4.1, the overall implementation flow of this embodiment is as follows: assuming that the ECU performs the nth sampling at the time tn, the ECU calculates the sum of squares of the sampling signals at the current time tn, that is:
Figure BDA0001849725620000131
if A isn>An-1Then, it means that the signal quality of the current tn is better than the signal quality An-1 at the last moment; then, the ECU is at An>An-1Determining a first sampling interval time Td,n+1Continuing to change according to the change trend of the last sampling interval time, namely: t isd,n+1=Td,n+T0=Td,n+(Td,n-Td,n-1) Then, at this time, go downOne sampling instant is: t iss,n+1=Ts,n+Td,n+1
In this embodiment, since the excitation signal clock of the resolver cannot interfere with the time interval of ECU sampling, the sampling interval of the ECU needs to be dynamically adjusted so that the actual sampling point is aligned with or closer to the ideal sampling point, thereby ensuring sufficiently high signal quality while naturally enabling the ECU sampling period to dynamically track the period of the resolver excitation signal. As long as each adjusted sampling interval compensates for the time T0The timing error caused by the error between the ECU and the rotary-change excitation signal clock in a sampling interval is not less than the timing error caused by the error between the ECU and the rotary-change excitation signal clock, so that the actual sampling point can dynamically track the ideal sampling point, the influence of the error on sampling is avoided, and the synchronization of ECU sampling and the rotary-change excitation signal is realized.
Considering that the resolver signal must be decoded to obtain the angle θ and the electrical angular velocity ω required for motor control, optionally, the method further comprises: and decoding an output signal of the rotary transformer at the next sampling moment. In this step, after the ECU determines the next sampling time according to the method described in the above embodiment, and after the ECU samples the output signal of the resolver according to the next sampling time, the ECU decodes the sampled output signal to obtain the final result. It should be noted that the step of decoding the sampled output signal by the ECU may be after or before the method described in the above embodiment, and this embodiment is not limited thereto.
It should be understood that although the various steps in the flow charts of fig. 2-4 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-4 may include multiple sub-steps or multiple stages that are not necessarily performed at the same time, but may be performed at different times, and the order of performance of the sub-steps or stages is not necessarily sequential, but may be performed in turn or alternating with other steps or at least some of the sub-steps or stages of other steps.
In one embodiment, as shown in fig. 5, there is provided a signal sampling apparatus comprising: an obtaining module 11, a first determining module 12 and a sampling module 13, wherein:
the acquisition module 11 is configured to acquire a first square sum of output signals of the resolver at a current sampling time; the output signal comprises a sine signal and a cosine signal;
a first determining module 12, configured to determine a next sampling time according to a size relationship between the first sum of squares and the second sum of squares; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and the sampling module 13 is configured to sample the output signal of the resolver according to the next sampling time.
The signal sampling apparatus provided in the foregoing embodiment has the similar implementation principle and technical effect to those of the foregoing method embodiment, and is not described herein again.
In one embodiment, as shown in fig. 6, there is provided a signal sampling apparatus, further comprising: a calculation module 14 and a second determination module 15.
A calculation module 14 for calculating a difference or ratio between the first sum of squares and the second sum of squares;
and a second determining module 15, configured to determine a magnitude relation between the first sum of squares and the second sum of squares according to the difference or the ratio.
The signal sampling apparatus provided in the foregoing embodiment has the similar implementation principle and technical effect to those of the foregoing method embodiment, and is not described herein again.
In one embodiment, as shown in fig. 7, there is provided a signal sampling apparatus, wherein the first determining module 12 includes: a first determining unit 121 and a second determining unit 122.
A first determining unit 121, configured to determine a first time interval between the current sampling time and the next sampling time according to a magnitude relationship between the first sum of squares and the second sum of squares;
a second determining unit 122, configured to determine the next sampling time according to the first time interval and the current sampling time.
The signal sampling apparatus provided in the foregoing embodiment has the similar implementation principle and technical effect to those of the foregoing method embodiment, and is not described herein again.
In one embodiment, the first determining unit 121 is specifically configured to determine the first time interval according to a magnitude relationship between the first sum of squares and the second sum of squares, a second time interval, and a compensation time; the second time interval is a time interval between the last sampling moment and the current sampling moment, and the compensation time represents a time interval error between two adjacent sampling moments.
In one embodiment, the second determining unit 122 determines the first time interval according to a magnitude relation between the first sum of squares and the second sum of squares, a second time interval and a compensation time, and is specifically configured to increase or decrease the compensation time in the same direction as an increasing or decreasing trend of the compensation time at the previous time on the basis of the second time interval if the magnitude relation between the first sum of squares and the second sum of squares is that the first sum of squares is greater than the second sum of squares. If the magnitude relation between the first square sum and the second square sum is that the first square sum is smaller than the second square sum, the first time interval is to increase or decrease the compensation time along the opposite direction of the increase or decrease trend of the compensation time at the previous moment on the basis of a second time interval.
The signal sampling apparatus provided in the foregoing embodiment has the similar implementation principle and technical effect to those of the foregoing method embodiment, and is not described herein again.
In one embodiment, as shown in fig. 8, there is provided a signal sampling apparatus, further comprising: and a decoding module 16, configured to decode an output signal of the resolver at the next sampling time.
The signal sampling apparatus provided in the foregoing embodiment has the similar implementation principle and technical effect to those of the foregoing method embodiment, and is not described herein again.
For a specific definition of a signal sampling device, reference may be made to the above definition of a signal sampling method, which is not described herein again. The modules in the signal sampling device can be wholly or partially implemented by software, hardware and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, a display screen, and an input device connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a signal sampling method. The display screen of the computer equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the computer equipment, an external keyboard, a touch pad or a mouse and the like.
Those skilled in the art will appreciate that the architecture shown in fig. 9 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining a next sampling moment according to the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and sampling the output signal of the rotary transformer according to the next sampling moment.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining a next sampling moment according to the first square sum and the second square sum; wherein the second sum of squares is a sum of squares of output signals of the resolver at a last sampling instant;
and sampling the output signal of the rotary transformer according to the next sampling moment.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (10)

1. A method of sampling a signal, the method comprising:
acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
determining a first time interval according to the magnitude relation between the first square sum and the second square sum, the second time interval and the compensation time; the second time interval is the time interval between the last sampling moment and the current sampling moment, and the compensation time represents the time interval error between two adjacent sampling moments; the second sum of squares is a sum of squares of output signals of the resolver at the last sampling instant;
determining the next sampling moment according to the first time interval and the current sampling moment;
and sampling the output signal of the rotary transformer according to the next sampling moment.
2. The method of claim 1, wherein prior to said determining a next sampling instant based on a magnitude relationship of said first sum of squares to said second sum of squares, said method further comprises:
calculating a difference or ratio between the first sum of squares and the second sum of squares;
and determining the magnitude relation between the first square sum and the second square sum according to the difference or the ratio.
3. The method according to claim 1 or 2, wherein determining the first time interval according to the magnitude relation of the first sum of squares and the second sum of squares, the second time interval and the compensation time comprises:
if the magnitude relation between the first square sum and the second square sum is that the first square sum is larger than the second square sum, the first time interval is that the compensation time is increased or decreased along the same direction of the increasing or decreasing trend of the compensation time at the previous moment on the basis of the second time interval.
4. The method according to claim 1 or 2, wherein determining the first time interval according to the magnitude relation of the first sum of squares and the second sum of squares, the second time interval and the compensation time further comprises:
if the magnitude relation between the first square sum and the second square sum is that the first square sum is smaller than the second square sum, the first time interval is to increase or decrease the compensation time along the opposite direction of the increase or decrease trend of the compensation time at the previous moment on the basis of the second time interval.
5. The method of claim 1, further comprising:
and decoding an output signal of the rotary transformer at the next sampling moment.
6. A resolver signal sampling apparatus, the apparatus comprising:
the acquisition module is used for acquiring a first square sum of output signals of the rotary transformer at the current sampling moment; the output signal comprises a sine signal and a cosine signal;
the first determining module is used for determining a first time interval according to the magnitude relation between the first sum of squares and the second sum of squares, the second time interval and the compensation time; determining the next sampling moment according to the first time interval and the current sampling moment; the second time interval is the time interval between the last sampling moment and the current sampling moment, and the compensation time represents the time interval error between two adjacent sampling moments; the second sum of squares is a sum of squares of output signals of the resolver at the last sampling instant;
and the sampling module is used for sampling the output signal of the rotary transformer according to the next sampling moment.
7. The apparatus of claim 6, further comprising:
a calculation module for calculating a difference or ratio between the first sum of squares and the second sum of squares;
and the second determining module is used for determining the magnitude relation between the first square sum and the second square sum according to the difference value or the ratio.
8. The apparatus according to claim 7, wherein the first determining module comprises a first determining unit, and the first determining unit is configured to increase or decrease the compensation time in the same direction as the increase or decrease trend of the compensation time at the previous time on the basis of a second time interval if the magnitude relationship between the first sum of squares and the second sum of squares is that the first sum of squares is greater than the second sum of squares.
9. A computer device comprising a memory and a processor, the memory storing a computer program, wherein the processor implements the steps of the method of any one of claims 1 to 5 when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 5.
CN201811289274.1A 2018-10-31 2018-10-31 Signal sampling method, signal sampling device, computer equipment and storage medium Active CN111130561B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811289274.1A CN111130561B (en) 2018-10-31 2018-10-31 Signal sampling method, signal sampling device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811289274.1A CN111130561B (en) 2018-10-31 2018-10-31 Signal sampling method, signal sampling device, computer equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111130561A CN111130561A (en) 2020-05-08
CN111130561B true CN111130561B (en) 2021-03-23

Family

ID=70485663

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811289274.1A Active CN111130561B (en) 2018-10-31 2018-10-31 Signal sampling method, signal sampling device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111130561B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3937366B1 (en) 2020-05-28 2023-02-22 Huawei Digital Power Technologies Co., Ltd. Sampling triggering method, microprocessor, motor controller, and electric vehicle

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5447810B2 (en) * 2009-09-07 2014-03-19 東芝エレベータ株式会社 Motor drive device and torque ripple removal method
CN103256946B (en) * 2013-05-23 2015-04-22 合肥工业大学 Rotating transformer digital converter capable of on-line failure detection and fault-tolerant control
US20160202088A1 (en) * 2013-08-30 2016-07-14 Panasonic Intellectual Property Management Co., Ltd. Angular position detection device
US9525376B2 (en) * 2014-05-13 2016-12-20 Gbox, Llc Wound field synchronous machine with resonant field exciter
US9897469B2 (en) * 2016-01-26 2018-02-20 GM Global Technology Operations LLC Resolver phase compensation
CN108282124B (en) * 2017-12-20 2020-03-24 上海辛格林纳新时达电机有限公司 Rotor position angle compensation method for motor vector control

Also Published As

Publication number Publication date
CN111130561A (en) 2020-05-08

Similar Documents

Publication Publication Date Title
CN108255774B (en) Application processor, computing system including the same, and method of operating the same
CN111130561B (en) Signal sampling method, signal sampling device, computer equipment and storage medium
WO2019105133A1 (en) Phase deviation compensation method and device
CN104375946B (en) A kind of method and device of data processing
CN114579933B (en) Error measurement optimization method and device, electronic equipment and readable storage medium
CN112711039A (en) Time synchronization attack detection and correction method and device based on optimal estimation
US11231296B2 (en) Systems and methods for determining rotational position
CN101593151B (en) Method and simulator for real-time calculation of the state variables of a process model
Renczes et al. Numerical optimization problems of sine-wave fitting algorithms in the presence of roundoff errors
CN111181559B (en) Method, device, equipment and storage medium for rotary soft decoding
CN113987803B (en) Frequency control method, device, equipment and storage medium based on model correction
US8838421B2 (en) Method and circuit for calculating sensor modelling coefficients
CN115452399A (en) Method and device for evaluating quality of automobile acceleration sound, computer equipment and storage medium
CN114279395B (en) Deformation detection method and system for pipeline
US10902896B2 (en) Memory circuit and method thereof
US8468421B2 (en) Memory system for error checking fetch and store data
CN117991307B (en) Method and device for solving displacement of navigation receiver
US10866096B2 (en) Method and apparatus for reducing sensor power dissipation
CN113193929B (en) Online judgment method and device for noise interference level of advanced observer
CN117687042B (en) Multi-radar data fusion method, system and equipment
CN113514686B (en) Method, device, equipment and storage medium for detecting voltage fundamental wave amplitude
CN109743123B (en) Port number determination method and device, computer equipment and storage medium
CN115987160A (en) Online parameter identification method for asynchronous motor
CN113358926A (en) Signal frequency measurement method and device suitable for chip relay protection
CN114123918A (en) Motor phase current sampling method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220105

Address after: 511434 No. 36, Longying Road, Shilou Town, Panyu District, Guangzhou City, Guangdong Province

Patentee after: GAC AION New Energy Vehicle Co.,Ltd.

Address before: 510030 23 building, Cheng Yue mansion 448-458, Dongfeng Middle Road, Yuexiu District, Guangzhou, Guangdong.

Patentee before: GUANGZHOU AUTOMOBILE GROUP Co.,Ltd.