WO2024098741A1 - 正余弦信号的相位差校正方法、正余弦编码器及存储介质 - Google Patents

正余弦信号的相位差校正方法、正余弦编码器及存储介质 Download PDF

Info

Publication number
WO2024098741A1
WO2024098741A1 PCT/CN2023/099504 CN2023099504W WO2024098741A1 WO 2024098741 A1 WO2024098741 A1 WO 2024098741A1 CN 2023099504 W CN2023099504 W CN 2023099504W WO 2024098741 A1 WO2024098741 A1 WO 2024098741A1
Authority
WO
WIPO (PCT)
Prior art keywords
sine
cosine
phase difference
signal
encoder
Prior art date
Application number
PCT/CN2023/099504
Other languages
English (en)
French (fr)
Inventor
孙立强
Original Assignee
长春汇通光电技术有限公司
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 长春汇通光电技术有限公司 filed Critical 长春汇通光电技术有限公司
Publication of WO2024098741A1 publication Critical patent/WO2024098741A1/zh

Links

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D18/00Testing or calibrating apparatus or arrangements provided for in groups G01D1/00 - G01D15/00
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01DMEASURING NOT SPECIALLY ADAPTED FOR A SPECIFIC VARIABLE; ARRANGEMENTS FOR MEASURING TWO OR MORE VARIABLES NOT COVERED IN A SINGLE OTHER SUBCLASS; TARIFF METERING APPARATUS; MEASURING OR TESTING NOT OTHERWISE PROVIDED FOR
    • G01D5/00Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable
    • G01D5/26Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light
    • G01D5/32Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light
    • G01D5/34Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light the beams of light being detected by photocells
    • G01D5/347Mechanical means for transferring the output of a sensing member; Means for converting the output of a sensing member to another variable where the form or nature of the sensing member does not constrain the means for converting; Transducers not specially adapted for a specific variable characterised by optical transfer means, i.e. using infrared, visible, or ultraviolet light with attenuation or whole or partial obturation of beams of light the beams of light being detected by photocells using displacement encoding scales

Definitions

  • the present application relates to the technical field of sine-cosine encoders, and in particular to a phase difference correction method for sine-cosine signals, a sine-cosine encoder and a storage medium.
  • the original sine-cosine signal is generated by the relative position change between the photocell and the code disk.
  • the amplitude, offset and phase of the original sine-cosine signal are generally adjusted in the subsequent circuit.
  • the phase difference is generally adjusted by adjusting the relative position between the PCB (Printed Circuit Board) and the code disk and the light source.
  • the signal quality of each encoder will be uneven. If the phase difference of the sine-cosine signal is adjusted by adjusting the relative position between the PCB and the code disk and the light source, it is more dependent on human factors, which is not conducive to mass production and automated production of products, and the manufacturability is very poor. Therefore, how to accurately correct the phase difference of the sine-cosine signal generated by the sine-cosine encoder to make the sine-cosine signal more accurate has become an urgent problem to be solved.
  • the main purpose of the present application is to provide a phase difference correction method for sine and cosine signals, a sine and cosine encoder and a storage medium, aiming to solve the technical problem of how to accurately correct the phase difference of the sine and cosine signals generated by the sine and cosine encoder to make the sine and cosine signals more accurate.
  • the present application provides a phase difference correction method for sine and cosine signals, and the phase difference correction method for sine and cosine signals comprises the following steps:
  • the correction parameter set includes amplitude compensation parameters for phase difference correction at various angles corresponding to one rotation of the sine-cosine encoder, and the correction parameter set is obtained by pre-testing;
  • the target amplitude compensation parameter is used to perform phase difference correction on the sine and cosine signals.
  • the method before obtaining the correction parameter set, the method further includes:
  • the correction parameter set is stored at a preset position of the sine-cosine encoder.
  • determining the amplitude compensation parameters corresponding to the sine-cosine encoder at each angle according to the phase difference includes:
  • the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle are determined according to the initial sine-cosine signal and the phase difference; wherein the initial sine-cosine signal includes: an initial sine signal and an initial cosine signal.
  • determining the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle according to the initial sine-cosine signal and the phase difference includes:
  • the amplitude compensation parameter of the cosine signal generated by the sine-cosine encoder at each angle is determined according to the initial sine signal, the initial cosine signal and the phase difference by using a first preset formula, wherein the first preset formula is:
  • cos(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • determining the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle according to the initial sine-cosine signal and the phase difference includes:
  • the amplitude compensation parameter of the sine signal generated by the sine-cosine encoder at each angle is determined according to the initial sine signal, the initial cosine signal and the phase difference by using a second preset formula, wherein the second preset formula is:
  • sin(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • the sine-cosine encoder includes a hardware correction circuit
  • the use of the target amplitude compensation parameter to perform phase difference correction on the sine-cosine signal includes:
  • the amplitude of the sine and cosine signals is adjusted using the hardware correction circuit to obtain target sine and cosine signals; wherein the phase difference between the target sine signal and the target cosine signal in the target sine and cosine signals is 90 degrees.
  • the hardware correction circuit includes: an adder, a subtractor, a variable gain operational amplifier, or a preset voltage divider resistor chain.
  • the method further includes:
  • the sine and cosine encoder is determined to be qualified.
  • the present application also provides a sine-cosine encoder, including: a photocell chip, a memory, and a phase difference correction module, wherein:
  • the photocell chip is used to generate sine and cosine signals
  • the memory is used to store a calibration parameter set
  • the phase difference correction module is used to collect the sine and cosine signals generated by the photocell chip at the current moment; obtain a correction parameter set from the memory, the correction parameter set including amplitude compensation parameters for phase difference correction at each angle corresponding to one rotation of the sine and cosine encoder, and the correction parameter set is obtained in advance by testing; determine the target amplitude compensation parameters of the angle corresponding to the current moment according to the correction parameter set; and use the target amplitude compensation parameters to perform phase difference correction on the sine and cosine signals.
  • the present application also proposes a storage medium, on which a phase difference correction program for sine and cosine signals is stored.
  • a phase difference correction program for sine and cosine signals is executed by a processor, the steps of the phase difference correction method for sine and cosine signals as described above are implemented.
  • the present application can collect the sine-cosine signal generated by the sine-cosine encoder at the current moment, and then by obtaining the correction parameter set, the target amplitude compensation parameter of the angle corresponding to the current moment can be determined.
  • the correction parameter set may include amplitude compensation parameters for phase difference correction at various angles corresponding to one rotation of the sine-cosine encoder, and the correction parameter set is obtained by pre-testing. Therefore, the phase error can be converted into an amplitude error according to the correction parameter set, and further, the sine-cosine signal can be corrected for phase difference using the target amplitude compensation parameter.
  • the present application obtains a correction parameter set through pre-testing, which can realize real-time correction of phase difference without changing the hardware layout of the encoder, which is more convenient and has wider applicability.
  • the phase difference correction of the sine-cosine signal can be converted into the amplitude adjustment of the sine-cosine signal, so that the above-mentioned method of the present application can automatically realize the phase difference correction of the sine-cosine signal generated by the sine-cosine encoder, so that the accuracy of the sine-cosine signal is higher.
  • FIG1 is a schematic flow chart of a first embodiment of a method for correcting a phase difference between sine and cosine signals of the present application
  • FIG2 is a waveform diagram of sine and cosine signals generated by a sine and cosine encoder according to an embodiment of a method for correcting a phase difference of sine and cosine signals of the present application;
  • FIG3 is a flow chart of a second embodiment of a method for correcting the phase difference of sine and cosine signals of the present application
  • FIG4 is a flow chart of a third embodiment of a method for correcting the phase difference of sine and cosine signals of the present application.
  • FIG5 is a graph showing the relationship between the angle, the radian of the angle, and the tangent value of the angle according to an embodiment of the phase difference correction method for sine and cosine signals of the present application;
  • FIG6 is a structural block diagram of a first embodiment of a sine-cosine encoder for sine-cosine signals of the present application.
  • FIG. 1 is a flow chart of a first embodiment of a method for correcting a phase difference between sine and cosine signals of the present application.
  • the phase difference correction method of the sine and cosine signals includes the following steps:
  • Step S10 collecting the sine and cosine signals generated by the sine and cosine encoder at the current moment
  • the execution subject of this embodiment can be a computing service device with data processing, network communication and program running functions, such as a central processing unit (CPU), a personal computer, etc., or other computing processing units, such as FPGA, CPLD, MCU and other units with data acquisition and processing, or an electronic device capable of realizing the above functions or a phase difference correction device for sine and cosine signals.
  • the CPU is taken as an example to illustrate this embodiment and the following embodiments.
  • the sine-cosine encoder is an incremental encoder with analog output, and its output is a sine-cosine signal.
  • the sine-cosine encoder may include a photocell chip and a code disk inside, and the sine-cosine signal refers to the signal generated by the photocell chip.
  • the sine-cosine signal generated by the sine-cosine encoder at the current moment is collected after the sine-cosine encoder leaves the factory.
  • Figure 2 is a waveform diagram of the sine-cosine signal generated by the sine-cosine encoder of an embodiment of the phase difference correction method of the sine-cosine signal of the present application, as shown in Figure 3, the sine-cosine signal in this embodiment may include a group of sine signals and a group of cosine signals, the horizontal axis represents time, and the vertical axis represents the photosensitive area.
  • the theoretical phase difference between the two groups of signals is 90°, but due to the difference in materials and the inconsistency of assembly, this phase difference is often not 90°, and it needs to be adjusted and corrected in the actual product production process.
  • Step S20 obtaining a correction parameter set, wherein the correction parameter set includes amplitude compensation parameters for phase difference correction at various angles corresponding to one rotation of the sine-cosine encoder, and the correction parameter set is obtained by pre-testing;
  • the correction parameter set can be determined and stored before the sine-cosine encoder leaves the factory, or before the sine-cosine encoder is powered on for the first time after leaving the factory. Of course, it can also be determined and stored after the sine-cosine encoder is powered on. The specific selection can be based on actual needs, and this embodiment does not impose any specific restrictions on this.
  • the sine-cosine encoder After the sine-cosine encoder leaves the factory, it is necessary to integrate hardware devices such as an acquisition card, an analog-to-digital converter, and a processor into the sine-cosine encoder. In this way, the correction parameter set can be updated during the operation of the sine-cosine encoder to ensure the accuracy of the correction. However, it will also increase the hardware complexity and cost of the sine-cosine encoder.
  • a correction parameter set is determined and stored before the sine-cosine encoder leaves the factory.
  • a fixed phase difference correction can be performed according to the stored correction parameter set during the operation of the encoder.
  • the correction parameter set may be obtained in advance by testing.
  • the specific testing method may be determined by comparing the sine-cosine signal generated by one rotation of the sine-cosine encoder with the theoretical sine-cosine signal.
  • the correction parameter set may include amplitude compensation parameters corresponding to each angle corresponding to one rotation of the sine-cosine signal.
  • the amplitude compensation parameter refers to the amplitude that the sine-cosine signal needs to reach.
  • the phase difference of the sine-cosine signal can be corrected according to the amplitude compensation parameters corresponding to each angle.
  • Step S30 determining a target amplitude compensation parameter of the angle corresponding to the current moment according to the correction parameter set;
  • the correction parameter set may include amplitude compensation parameters corresponding to various angles corresponding to one rotation of the sine and cosine signals, so the target amplitude parameter of the angle corresponding to the current moment may be selected from the correction parameter set.
  • the above-mentioned correction parameter set may include amplitude compensation parameters corresponding to each angle.
  • the angles corresponding to the amplitude compensation parameters in the above-mentioned correction parameter set may also be discrete, for example: 0 degrees, 0.1 degrees, 0.2 degrees, etc., or 0 degrees, 0.01 degrees, 0.02 degrees, etc.
  • the specific angles can be confirmed according to actual needs, and the embodiments of this specification are not limited to this.
  • the above-mentioned amplitude compensation parameters can be used to characterize the corrected theoretical amplitude corresponding to the angle at the current moment, and can also be used to characterize the data that needs to be superimposed to the corresponding theoretical amplitude at the current moment (the amplitude compensation parameters can be positive, negative, or 0).
  • the above-mentioned amplitude compensation parameters can also be fitted formulas or curves, which can be determined according to actual conditions, and this description embodiment does not limit this.
  • Step S40 performing phase difference correction on the sine and cosine signals using the target amplitude compensation parameter.
  • the target amplitude compensation parameter can be used to perform phase difference correction on the sine and cosine signals.
  • the phase difference correction method can be to change the amplitude of the sine and cosine signals generated at the current moment into the target amplitude compensation parameter of the angle corresponding to the current moment, or it can be to superimpose the amplitude of the sine and cosine signals generated at the current moment with the target amplitude compensation parameter of the angle corresponding to the current moment.
  • the specific phase difference correction method can also be determined according to the specific form of the amplitude compensation parameter, which can be determined according to the actual situation, and the embodiments of this specification do not limit this.
  • This embodiment can collect the sine-cosine signal generated by the sine-cosine encoder at the current moment, and then by obtaining the correction parameter set, the target amplitude compensation parameter of the angle corresponding to the current moment can be determined.
  • the correction parameter set may include amplitude compensation parameters for phase difference correction at various angles corresponding to one rotation of the sine-cosine encoder, and the correction parameter set is obtained by pre-testing. Therefore, the phase error can be converted into an amplitude error according to the correction parameter set, and further, the sine-cosine signal can be corrected for phase difference using the target amplitude compensation parameter.
  • the correction parameter set obtained by pre-testing in this embodiment can realize real-time correction of the phase difference without changing the hardware layout of the encoder, which is more convenient and has wider applicability.
  • the phase difference correction of the sine-cosine signal can be converted into the amplitude adjustment of the sine-cosine signal, so that the above-mentioned method of this embodiment can automatically realize the phase difference correction of the sine-cosine signal generated by the sine-cosine encoder, so that the accuracy of the sine-cosine signal is higher.
  • FIG. 3 is a flow chart of a second embodiment of a method for correcting the phase difference of sine and cosine signals of the present application.
  • step S20 the following steps are further included:
  • Step S01 obtaining initial sine and cosine signals generated by the sine and cosine encoder rotating one circle;
  • the present embodiment can obtain a set of correction parameters before the sine-cosine encoder leaves the factory.
  • the initial sine-cosine signal generated by one rotation of the sine-cosine encoder can be collected through a data acquisition card.
  • the initial sine-cosine signal may include an initial sine signal and an initial cosine signal.
  • the data acquisition card refers to a computer expansion card that can realize the data acquisition function. It is a production device, not the structure of the sine-cosine encoder itself.
  • the present embodiment can be used to collect the initial sine-cosine signal generated by one rotation of the sine-cosine encoder, and can be connected to the computer through the bus.
  • the present embodiment does not need to integrate the data acquisition card in the sine-cosine encoder, and the sine-cosine encoder does not need to add additional hardware circuits, making the structure of the sine-cosine encoder simpler.
  • Step S02 Acquire characteristic sine and cosine signals, wherein the characteristic sine and cosine signals are used to characterize theoretical values of sine and cosine signals generated by one rotation of the sine and cosine encoder;
  • the characteristic sin-cosine signal may refer to the theoretical value of the sin-cosine signal generated by the sin-cosine encoder when it rotates one circle.
  • the characteristic sin-cosine signal may include a characteristic sine signal and a characteristic cosine signal.
  • the phase difference between the characteristic sine signal and the characteristic cosine signal is 90 degrees.
  • the phase of the corresponding characteristic cosine signal may be 120 degrees.
  • the above-mentioned characteristic sine and cosine signals can be obtained by calculating through a formula, or by simulating using simulation software, or by running a standard high-precision encoder for one cycle.
  • the specific details can be determined based on actual conditions, and the embodiments of this specification do not limit this.
  • Step S03 comparing the initial sine and cosine signals with the characteristic sine and cosine signals to determine the phase difference of the sine and cosine encoder at each angle;
  • the phase difference can be determined according to the initial sine-cosine signal and the characteristic sine-cosine signal corresponding to each angle of the sine-cosine encoder.
  • the phase difference between the initial cosine signal and the initial sine signal can be corrected to 90 degrees based on the initial cosine signal, and the initial sine signal and the characteristic sine signal can be compared. It can also be corrected to 90 degrees based on the initial sine signal and the initial sine signal, and the initial cosine signal and the characteristic cosine signal can be compared.
  • the angle corresponding to the initial sine signal in the sine-cosine encoder is 30 degrees, and the corresponding angle can be selected from the characteristic cosine signal as 120 degrees.
  • the phase difference of the initial cosine signal is 1 degree, and the initial cosine signal can be corrected accordingly, and the initial sine signal is kept unchanged.
  • the phase difference of the cosine signal generated by the sine-cosine encoder at each angle can also be determined based on the characteristic sine signal and the initial cosine signal, and this embodiment does not elaborate on this.
  • Step S04 determining the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle according to the phase difference;
  • the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle can be determined based on the phase difference.
  • the specific method can be to use the initial sine signal as a reference, determine the phase difference between the initial sine signal and the initial cosine signal at each angle, and then determine the amplitude compensation parameters of the initial cosine signal at each angle based on the phase difference; or it can be based on the initial cosine signal, determine the phase difference between the initial cosine signal and the initial sine signal at each angle, and then determine the amplitude compensation parameters of the initial sine signal at each angle based on the phase difference.
  • the angle corresponding to the initial sine signal when the angle corresponding to the initial sine signal is 30 degrees, the angle corresponding to the initial cosine signal should be 120 degrees, but at this time the angle corresponding to the initial cosine signal is 121 degrees, and the phase difference is 1 degree. It is necessary to obtain the amplitude compensation parameters of the initial cosine signal of 121 degrees.
  • Step S05 generating a correction parameter set based on the amplitude compensation parameters corresponding to each angle of the sine and cosine encoder;
  • the correction parameter set may include amplitude compensation parameters corresponding to the cosine signal at various angles based on the sine signal, or may include amplitude compensation parameters corresponding to the sine signal at various angles based on the cosine signal.
  • the specific parameters can be determined based on actual conditions, and the embodiments of this specification do not limit this.
  • Step S06 storing the correction parameter set at a preset position of the sine-cosine encoder.
  • the correction parameter set can be stored in a preset location of the memory in the sine-cosine encoder, such as EEPROM (electrically erasable programmable read-only memory), or it can be stored in other memories, such as flash ROM, CPU internal memory, NVRAN and other memories.
  • EEPROM electrically erasable programmable read-only memory
  • other memories such as flash ROM, CPU internal memory, NVRAN and other memories.
  • step S06 it may also include: obtaining a stored correction parameter set, and testing the sine-cosine encoder according to the stored correction parameter set to obtain a sine-cosine signal after the test; when the phase difference of the sine-cosine signal after the test meets a preset phase difference condition, determining that the sine-cosine encoder is qualified.
  • the preset phase difference condition refers to a pre-set phase difference condition, for example, the phase difference between the sine signal and the cosine signal after the test is greater than 88 degrees and less than 92 degrees.
  • the specific phase difference can be determined based on actual conditions, and the embodiments of this specification do not limit this.
  • the stored compensation parameters can also be used to test and verify the sine-cosine encoder to obtain the tested sine-cosine signal.
  • the sine-cosine encoder is confirmed to be qualified and can be shipped.
  • the step S40 includes: according to the target amplitude compensation parameter, using the hardware correction circuit to adjust the amplitude of the sine and cosine signals to obtain target sine and cosine signals; wherein the phase difference between the target sine signal and the target cosine signal in the target sine and cosine signals is 90 degrees.
  • the sine-cosine encoder may include a hardware correction circuit for adjusting the amplitude of the sine-cosine signals.
  • the phase difference between the target sine signal and the target cosine signal in the target sine and cosine signals may be about 90 degrees, which is within the allowable error range, for example, 88 degrees, 89.6 degrees, 90.12 degrees, etc.
  • the amplitude of the sine and cosine signals can be adjusted using a hardware correction circuit to obtain the target sine and cosine signals.
  • the target amplitude compensation parameter corresponding to the angle in the cosine signal can be selected from the target amplitude compensation parameter of the angle corresponding to the current moment, and then the amplitude of the cosine signal can be adjusted.
  • the amplitude compensation parameter represents the corrected theoretical amplitude corresponding to the angle at the current moment
  • the angle of the cosine signal corresponding to the current moment is 121 degrees
  • the corresponding target amplitude compensation parameter is -2.
  • the amplitude of the cosine signal corresponding to the current moment can be adjusted to -2.
  • the hardware correction circuit may include: an adder, a subtractor, a variable gain operational amplifier or a preset voltage divider resistor chain, etc. In some implementations, the hardware correction circuit may include at least one of the above, or any combination thereof.
  • the hardware correction circuit may include an adder, a subtractor, a variable gain operational amplifier or a preset voltage divider resistor chain.
  • variable gain operational amplifier other programmable devices may also be used, such as A/D, D/A, etc.
  • the use of the above-mentioned hardware correction circuit does not need to be implemented by integrating A/D and D/A+CPU in the encoder, thereby avoiding the large time delay caused by using the CPU.
  • This embodiment obtains an initial sin-cosine signal generated by a sin-cosine encoder rotating one circle, and then obtains a characteristic sin-cosine signal, wherein the characteristic sin-cosine signal is used to characterize the theoretical value of the sin-cosine signal generated by the sin-cosine encoder rotating one circle, and then compares the initial sin-cosine signal with the characteristic sin-cosine signal to determine the phase difference of the sin-cosine encoder at each angle, and then determines the amplitude compensation parameter corresponding to the sin-cosine encoder at each angle according to the phase difference, and then generates a correction parameter set based on the amplitude compensation parameter corresponding to the sin-cosine encoder at each angle, and stores the correction parameter set at a preset position of the sin-cosine encoder.
  • This embodiment compares the initial sin-cosine signal with the characteristic sin-cosine signal to determine the phase difference of the sin-cosine encoder at each angle, and then determines the correction parameter set according to the phase difference, and can convert the phase difference correction of the sin-cosine signal into the amplitude adjustment of the sin-cosine signal, and then performs phase difference correction on the sin-cosine signal generated at the current moment, so that the phase difference correction of the sin-cosine signal generated by the sin-cosine encoder can be automatically realized, so that the accuracy of the sin-cosine signal is higher.
  • FIG. 4 is a flow chart of a third embodiment of a method for correcting the phase difference of sine and cosine signals of the present application.
  • step S04 may include:
  • Step S041 determining the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle according to the initial sine-cosine signal and the phase difference; wherein the initial sine-cosine signal includes: an initial sine signal and an initial cosine signal.
  • the initial sine signal and the initial cosine signal may refer to the sine signal and the cosine signal generated by the sine-cosine encoder after one rotation before leaving the factory.
  • the phase difference refers to the phase difference between the initial sine signal and the initial cosine signal at each angle, and then the amplitude compensation parameters of the sine-cosine encoder at each angle can be determined according to the initial sine signal, the initial cosine signal and the phase difference.
  • the step S041 may include: using a first preset formula to determine the amplitude compensation parameter corresponding to each angle of the cosine signal generated by the sine-cosine encoder according to the initial sine signal, the initial cosine signal and the phase difference, wherein the first preset formula is:
  • cos(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • the sine signal can be used as a reference, and the amplitude compensation parameter of the cosine signal generated by the sine-cosine encoder at various angles can be obtained through the above first preset formula.
  • the angle corresponding to the sine signal when the angle corresponding to the sine signal is 30 degrees, the angle corresponding to the cosine signal should be 120 degrees, but at this time the angle corresponding to the cosine signal is 121 degrees. At this time, the phase difference is 1 degree, and ⁇ is also 1 degree.
  • Coswt represents the initial cosine value corresponding to the angle wt in the initial cosine signal
  • sinwt represents the initial sine value corresponding to the angle wt in the initial sine signal
  • sqrt is the square root operation.
  • the first preset formula may also be:
  • A can be the amplitude of the cosine signal, and A can be a value greater than 0, for example: 1, 1.5, 2, 3, 5, etc., which can be determined according to actual conditions and is not limited in the embodiments of this specification.
  • the above-mentioned first preset formula can also be other possible variations.
  • Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of the embodiments of this specification.
  • the functions and effects achieved are the same or similar to those of the embodiments of this specification, they should be covered within the protection scope of the embodiments of this specification.
  • FIG. 5 is a curve diagram showing the relationship between the angle, the radian at which the angle is located, and the tangent value of the angle in an embodiment of the phase difference correction method for the sine and cosine signals of the present application.
  • the horizontal axis represents the angle
  • the first curve marked as 1 represents the tangent value of the angle
  • the second curve marked as 2 represents the radian at which the angle is located. It can be calculated that when the angle is 10 degrees, the error between the radian and the tangent value is 0.1027918, and when the angle is 5 degrees, the error between the radian and the tangent value is 0.0127311.
  • the phase shift problem of the sine and cosine signals can be solved by adjusting the amplitude of the sine and cosine signals, that is, the phase difference correction of the sine and cosine signals can be achieved by adjusting the amplitude of the sine and cosine signals.
  • represents the tangent value of the phase difference.
  • the tangent value of the phase difference can be approximately equal to the phase difference, that is, ⁇ .
  • the angle corresponding to the cosine signal
  • is 1 degree
  • the angle corresponding to the cosine signal in the sine-cosine encoder is 121 degrees
  • the corresponding amplitude compensation parameter is (cos120°+sin120°)/sqrt(2).
  • the phase difference adjustment range of the sine-cosine encoder is not greater than 5°.
  • the step S022 may include: using a second preset formula to determine the amplitude compensation parameter corresponding to each angle of the sine signal generated by the sine-cosine encoder according to the initial sine signal, the initial cosine signal and the phase difference, wherein the second preset formula is:
  • sin(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • the cosine signal may be used as a reference, and the amplitude compensation parameter of the sine signal generated by the sine signal at various angles may be obtained through the above second preset formula.
  • the angle corresponding to the cosine signal when the angle corresponding to the cosine signal is 120 degrees, the angle corresponding to the sine signal should be 30 degrees, but at this time the angle corresponding to the sine signal is 31 degrees. At this time, the phase difference is 1 degree, and ⁇ is also 1 degree.
  • coswt represents the initial cosine value corresponding to the angle wt in the initial cosine signal
  • sinwt represents the initial sine value corresponding to the angle wt in the initial sine signal
  • sqrt is the square root operation.
  • represents the tangent value of the phase difference.
  • the tangent value of the phase difference can be approximately equal to the phase difference, that is, ⁇ .
  • the angle corresponding to the sine signal
  • is 1 degree
  • the angle corresponding to the sine signal in the sine-cosine encoder is 30 degrees
  • the corresponding amplitude compensation parameter is (sin30°+cos30°)/sqrt(2).
  • phase difference adjustment range of the sine-cosine encoder is not greater than 5°.
  • the second preset formula may also be:
  • B can be the amplitude of the cosine signal, and B can be a value greater than 0, for example: 1.7, 3, 4, 5, etc., which can be determined according to actual conditions and is not limited in the embodiments of this specification.
  • the above-mentioned second preset formula can also be other possible variations.
  • Technical personnel in the relevant field may make other changes under the inspiration of the technical essence of the embodiments of this specification.
  • the functions and effects achieved are the same or similar to those of the embodiments of this specification, they should be covered within the protection scope of the embodiments of this specification.
  • This embodiment determines the amplitude compensation parameters corresponding to each angle of the sine-cosine encoder according to the initial sine-cosine signal and the phase difference, wherein the initial sine-cosine signal includes: an initial sine signal and an initial cosine signal.
  • This embodiment determines the amplitude compensation parameters corresponding to each angle of the sine-cosine encoder according to the initial sine signal, the initial cosine signal and the phase difference, and can obtain accurate amplitude compensation parameters corresponding to each angle of the sine-cosine encoder, thereby obtaining an accurate correction parameter set.
  • the correction parameter set can be updated after the sine-cosine encoder has been running for a period of time outside the factory.
  • the sine-cosine encoder can be controlled to rotate at a low speed for one circle.
  • the specific method for determining the current correction parameter set can refer to the above-mentioned method for obtaining the correction parameter set, and this embodiment does not elaborate on this. Then update the correction parameter set according to the current correction parameter set, and store the current correction parameter set at the preset position of the sine-cosine encoder, and then replace the correction parameter set with the current correction parameter set.
  • the phase difference correction can be performed according to the current correction parameter set.
  • FIG. 6 is a structural block diagram of a first embodiment of a sine-cosine encoder for sine-cosine signals of the present application.
  • the sine-cosine encoder proposed in the embodiment of the present application may include: a photocell chip 10, a memory 20, and a phase difference correction module 30, wherein:
  • the photovoltaic cell chip 10 can be used to generate sine and cosine signals
  • the memory 20 may be used to store a calibration parameter set
  • the phase difference correction module 30 can be used to collect the sine and cosine signals generated by the photocell chip at the current moment; obtain a correction parameter set from the memory, the correction parameter set including amplitude compensation parameters for phase difference correction at each angle corresponding to one rotation of the sine and cosine encoder, and the correction parameter set is obtained in advance by testing; determine the target amplitude compensation parameters of the angle corresponding to the current moment according to the correction parameter set; and use the target amplitude compensation parameters to perform phase difference correction on the sine and cosine signals.
  • This embodiment can collect the sine-cosine signal generated by the sine-cosine encoder at the current moment, and then by obtaining the correction parameter set, the target amplitude compensation parameter of the angle corresponding to the current moment can be determined.
  • the correction parameter set may include amplitude compensation parameters for phase difference correction at various angles corresponding to one rotation of the sine-cosine encoder, and the correction parameter set is obtained by pre-testing. Therefore, the phase error can be converted into an amplitude error according to the correction parameter set, and further, the sine-cosine signal can be corrected for phase difference using the target amplitude compensation parameter.
  • the correction parameter set obtained by pre-testing in this embodiment can realize real-time correction of the phase difference without changing the hardware layout of the encoder, which is more convenient and has wider applicability.
  • the phase difference correction of the sine-cosine signal can be converted into the amplitude adjustment of the sine-cosine signal, so that the above-mentioned method of this embodiment can automatically realize the phase difference correction of the sine-cosine signal generated by the sine-cosine encoder, so that the accuracy of the sine-cosine signal is higher.
  • phase difference correction method for sine and cosine signals provided in any embodiment of the present application, which will not be repeated here.
  • the phase difference correction module 30 is also used to obtain an initial sin-cosine signal generated by the sin-cosine encoder when it rotates one circle; obtain a characteristic sin-cosine signal, wherein the characteristic sin-cosine signal is used to characterize a theoretical value of a sin-cosine signal generated by the sin-cosine encoder when it rotates one circle; compare the initial sin-cosine signal with the characteristic sin-cosine signal to determine the phase difference of the sin-cosine encoder at each angle; determine the amplitude compensation parameters corresponding to the sin-cosine encoder at each angle based on the phase difference; generate a correction parameter set based on the amplitude compensation parameters corresponding to the sin-cosine encoder at each angle; and store the correction parameter set at a preset position of the sin-cosine encoder.
  • phase difference correction module 30 is also used to determine the amplitude compensation parameters of the sine-cosine encoder corresponding to each angle according to the initial sine-cosine signal and the phase difference; wherein the initial sine-cosine signal includes: an initial sine signal and an initial cosine signal.
  • phase difference correction module 30 is further used to determine the amplitude compensation parameter of the cosine signal generated by the sine-cosine encoder at each angle according to the initial sine signal, the initial cosine signal and the phase difference using a first preset formula, wherein the first preset formula may be:
  • cos(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • phase difference correction module 30 is further used to determine the amplitude compensation parameter of the sine signal generated by the sine-cosine encoder at each angle according to the initial sine signal, the initial cosine signal and the phase difference using a second preset formula, wherein the second preset formula is:
  • sin(wt+ ⁇ ) represents the amplitude compensation parameter of the sine-cosine encoder corresponding to the angle wt
  • coswt represents the initial cosine signal
  • sinwt represents the initial sine signal
  • represents the phase difference
  • represents the tangent value of the phase difference
  • w represents the angular velocity
  • t represents time.
  • phase difference correction module 30 is also used to adjust the amplitude of the sine and cosine signals according to the target amplitude compensation parameters using the hardware correction circuit to obtain target sine and cosine signals; wherein the phase difference between the target sine signal and the target cosine signal in the target sine and cosine signals is 90 degrees; and the hardware correction circuit includes: an adder, a subtractor, a variable gain operational amplifier or a preset voltage divider resistor chain.
  • phase difference correction module 30 is also used to obtain a stored correction parameter set, and test the sine-cosine encoder according to the stored correction parameter set to obtain a tested sine-cosine signal; when the phase difference of the tested sine-cosine signal meets a preset phase difference condition, the sine-cosine encoder is judged to be qualified.
  • an embodiment of the present application further proposes a storage medium, on which a phase difference correction program for sine and cosine signals is stored.
  • a phase difference correction program for sine and cosine signals is executed by a processor, the steps of the phase difference correction method for sine and cosine signals as described above are implemented.
  • the technical solution of the present application can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory/random access memory, a disk, or an optical disk), and includes a number of instructions for a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
  • a storage medium such as a read-only memory/random access memory, a disk, or an optical disk
  • a terminal device which can be a mobile phone, a computer, a server, or a network device, etc.

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Transmission And Conversion Of Sensor Element Output (AREA)

Abstract

一种正余弦信号的相位差校正方法,包括:采集正余弦编码器当前时刻生成的正余弦信号(S10),获取校正参数集,校正参数集包含正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,校正参数集是预先测试得到的(S20),根据校正参数集确定当前时刻对应的角度的目标幅值补偿参数(S30),利用目标幅值补偿参数对正余弦信号进行相位差校正(S40)。还公开了一种正余弦编码器及一种存储介质。

Description

正余弦信号的相位差校正方法、正余弦编码器及存储介质
本申请要求于2022年11月09日申请的、申请号为202211401273.8的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及正余弦编码器技术领域,尤其涉及一种正余弦信号的相位差校正方法、正余弦编码器及存储介质。
背景技术
目前的正余弦编码器***当中,做法是通过光电池和码盘的相对位置变化产生原始的正余弦信号,这个原始的正余弦信号一般会在后续的电路当中对这个信号的幅值、偏移量、相位做些调整,其中调整相位差一般采用调整pcb(Printed Circuit Board,印制电路板)和码盘、光源之间的相对位置。但是由于编码器装配的误差和来料的不一致性,会造成每台编码器的信号质量参差不齐,如果通过调整pcb和码盘、光源之间的相对位置来实现调整正余弦信号的相位差,比较依赖于人的因素,不利于产品的批量生产和自动化生产,可制造型很差。因此,如何精确地对正余弦编码器产生的正余弦信号进行相位差校正,使正余弦信号的精度更高成为一个亟待解决的问题。
上述内容仅用于辅助理解本申请的技术方案,并不代表承认上述内容是现有技术。
技术问题
本申请的主要目的在于提供了一种正余弦信号的相位差校正方法、正余弦编码器及存储介质,旨在解决如何精确地对正余弦编码器产生的正余弦信号进行相位差校正,使正余弦信号的精度更高的技术问题。
技术解决方案
为实现上述目的,本申请提供了一种正余弦信号的相位差校正方法,所述正余弦信号的相位差校正方法包括以下步骤:
采集所述正余弦编码器当前时刻生成的正余弦信号;
获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;
根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;
利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
在一实施例中,所述获取校正参数集之前,还包括:
获取所述正余弦编码器旋转一周生成的初始正余弦信号;
获取特征正余弦信号,其中,所述特征正余弦信号用于表征所述正余弦编码器旋转一周生成的正余弦信号的理论值;
对比所述初始正余弦信号和所述特征正余弦信号,确定所述正余弦编码器在各个角度的相位差;
根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;
基于所述正余弦编码器在各个角度对应的幅值补偿参数生成校正参数集;
将所述校正参数集存储至所述正余弦编码器的预设位置处。
在一实施例中,所述根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;其中,所述初始正余弦信号包括:初始正弦信号和初始余弦信号。
在一实施例中,所述根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
利用第一预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的余弦信号在各个角度对应的幅值补偿参数,其中,所述第一预设公式为:
cos(wt+β)=(coswt+αsinwt)/sqrt(1+α^2)
其中,cos(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
在一实施例中,所述根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
利用第二预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的正弦信号在各个角度对应的幅值补偿参数,其中,所述第二预设公式为:
sin(wt+β)=(sinwt+αcoswt)/sqrt(1+α^2)
其中,sin(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
在一实施例中,所述正余弦编码器包括硬件校正电路,所述利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正,包括:
根据所述目标幅值补偿参数,利用所述硬件校正电路调整所述正余弦信号的幅值,得到目标正余弦信号;其中,所述目标正余弦信号中目标正弦信号与目标余弦信号之间的相位差为90度。
在一实施例中,所述硬件校正电路包括:加法器、减法器、可变增益运放或预设分压电阻链。
在一实施例中,所述将所述校正参数集存储至所述正余弦编码器的预设位置处之后,还包括:
获取存储的校正参数集,并根据所述存储的校正参数集对所述正余弦编码器进行测试,获得测试后的正余弦信号;
在所述测试后的正余弦信号的相位差满足预设相位差条件时,判定所述正余弦编码器合格。
此外,为实现上述目的,本申请还提供一种正余弦编码器,包括:光电池芯片、存储器、相位差校正模块,其中,
所述光电池芯片用于生成正余弦信号;
所述存储器用于存储校正参数集;
所述相位差校正模块用于采集所述光电池芯片当前时刻生成的正余弦信号;从所述存储器获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
此外,为实现上述目的,本申请还提出一种存储介质,所述存储介质上存储有正余弦信号的相位差校正程序,所述正余弦信号的相位差校正程序被处理器执行时实现如上文所述的正余弦信号的相位差校正方法的步骤。
有益效果
本申请可以采集正余弦编码器当前时刻生成的正余弦信号,然后通过获取校正参数集,可以确定当前时刻对应的角度的目标幅值补偿参数。校正参数集可以包含正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,校正参数集是预先测试得到的。从而根据校正参数集可以将相位误差转换为幅值误差,进一步的,可以利用目标幅值补偿参数对正余弦信号进行相位差校正。本申请通过预先测试得到的校正参数集,可以在不改变编码器的硬件布局的前提下实现相位差的实时校正,更加便捷,适用性更广。利用根据校正参数集确定的目标幅值补偿参数对正余弦信号进行相位差校正,能够将正余弦信号的相位差校正转换为正余弦信号的幅值调整,从而使得本申请上述方式能够自动实现正余弦编码器产生的正余弦信号的相位差校正,使正余弦信号的精度更高。
附图说明
图1为本申请正余弦信号的相位差校正方法第一实施例的流程示意图;
图2为本申请正余弦信号的相位差校正方法一实施例的正余弦编码器产生的正余弦信号的波形图;
图3为本申请正余弦信号的相位差校正方法第二实施例的流程示意图;
图4为本申请正余弦信号的相位差校正方法第三实施例的流程示意图;
图5为本申请正余弦信号的相位差校正方法一实施例的角度、角度所在的弧度、角度的正切值之间的关系曲线图;
图6为本申请正余弦信号的正余弦编码器第一实施例的结构框图。
本申请目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。
本发明的实施方式
应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。
参照图1,图1为本申请正余弦信号的相位差校正方法第一实施例的流程示意图。
本实施例中,所述正余弦信号的相位差校正方法包括以下步骤:
步骤S10:采集所述正余弦编码器当前时刻生成的正余弦信号;
需要说明的是,本实施例的执行主体可以是一种具有数据处理、网络通信以及程序运行功能的计算服务设备,例如中央处理器(central processing unit,CPU)、个人电脑等,也可以采用其他的一些运算处理单元,比如FPGA、CPLD、MCU等具备数据采集、处理的单元,或者是一种能够实现上述功能的电子设备或正余弦信号的相位差校正设备。以下以所述CPU为例,对本实施例及下述各实施例进行说明。
应理解的是,正余弦编码器是一种采用模拟输出的增量编码器,其输出为正余弦信号。正余弦编码器内部可包括光电池芯片和码盘,正余弦信号是指光电池芯片产生的信号。正余弦编码器当前时刻生成的正余弦信号是在正余弦编码器出厂后采集的。具体地,参考图2,图2为本申请正余弦信号的相位差校正方法一实施例的正余弦编码器产生的正余弦信号的波形图,如图3所示,本实施例中的正余弦信号可包括一组正弦信号和一组余弦信号,横坐标表示时间,纵坐标表示感光面积,这两组信号的理论相位差为90°,但由于物料的差异和装配的不一致性,这个相位差往往不是90°,在实际产品生产过程中是需要调整和校正的。
步骤S20:获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;
在本实施例中,校正参数集可以在正余弦编码器出厂前确定并存储的,也可在正余弦编码器出厂后首次上电前确定并存储的,当然也可以是在正余弦编码器上电后确定并存储的,具体的可以根据实际需求选择,本实施例对此不做具体限制。
在本实施例中,在正余弦编码器出厂后确定校正参数集需要在正余弦编码器中集成采集卡、模数转换器、处理器等硬件器件,采用该方式可以在正余弦编码器的运行过程中对校正参数集进行更新,以确保校正的精度。但同时也会增加正余弦编码器的硬件复杂度,以及成本。
在本实施例中,在正余弦编码器出厂前确定并存储校正参数集,可以在编码器运行的过程中根据存储的校正参数集进行固定相位差校正,同时不需要一直对校正参数集进行更新,降低正余弦编码器的成本。
在具体实现中,校正参数集可以是预先测试得到的,具体测试方法可以是根据正余弦编码器旋转一周生成的正余弦信号与理论正余弦信号对比确定,校正参数集中可以包括正余弦信号旋转一周对应的各个角度对应的幅值补偿参数,幅值补偿参数是指正余弦信号需要达到的幅值,从而根据各个角度对应的幅值补偿参数可对正余弦信号进行相位差校正。
步骤S30:根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;
在本实施方式中,校正参数集中可以包括正余弦信号旋转一周对应的各个角度对应的幅值补偿参数,因此可从校正参数集中选取当前时刻对应的角度的目标幅值参数。
在本实施方式中,上述校正参数集中可以包含每个角度对应的幅值补偿参数,当然可以理解的是上述校正参数集中幅值补偿参数对应的角度也可以是离散的,例如:0度、0.1度、0.2度等,或者0度、0.01度、0.02度等,具体的可以根据实际需求确认,本说明书实施例对此不作限定。
在本实施方式中,上述幅值补偿参数可以用于表征当前时刻的角度对应的校正后的理论幅值,也可以用于表征当前时刻校正到对应的理论幅值需要叠加的数据(幅值补偿参数可以为正数,也可以为负数,也可以为0),当然可以理解的是上述幅值补偿参数也可以为拟合到的公式或者曲线,具体的可以根据实际情况确定,本说明实施例对此不作限定。
步骤S40:利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
在本实施例中,在从校正参数集中选取当前时刻对应的角度的目标幅值参数后,可利用目标幅值补偿参数对正余弦信号进行相位差校正。
在一些实施例中,相位差校正方式可以是将当前时刻生成的正余弦信号的幅值更改为当前时刻对应的角度的目标幅值补偿参数,也可以是将当前时刻生成的正余弦信号的幅值叠加当前时刻对应的角度的目标幅值补偿参数,当然可以理解是,还可以根据幅值补偿参数的具体形式确定具体的相位差校正方式,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
本实施例可以采集正余弦编码器当前时刻生成的正余弦信号,然后通过获取校正参数集,可以确定当前时刻对应的角度的目标幅值补偿参数。校正参数集可以包含正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,校正参数集是预先测试得到的。从而根据校正参数集可以将相位误差转换为幅值误差,进一步的,可以利用目标幅值补偿参数对正余弦信号进行相位差校正。本实施例通过预先测试得到的校正参数集,可以在不改变编码器的硬件布局的前提下实现相位差的实时校正,更加便捷,适用性更广。利用根据校正参数集确定的目标幅值补偿参数对正余弦信号进行相位差校正,能够将正余弦信号的相位差校正转换为正余弦信号的幅值调整,从而使得本实施例上述方式能够自动实现正余弦编码器产生的正余弦信号的相位差校正,使正余弦信号的精度更高。
参考图3,图3为本申请正余弦信号的相位差校正方法第二实施例的流程示意图。
基于上述第一实施例,在本实施例中,所述步骤S20之前,还包括:
步骤S01:获取所述正余弦编码器旋转一周生成的初始正余弦信号;
可理解的是,本实施例可在正余弦编码器出厂前得到校正参数集,首先可以通过数据采集卡采集正余弦编码器旋转一周生成的初始正余弦信号,初始正余弦信号可包括初始正弦信号和初始余弦信号。数据采集卡是指可以实现数据采集功能的计算机扩展卡,是生产设备,而不是正余弦编码器本身的结构,本实施例可用于采集正余弦编码器旋转一周生成的初始正余弦信号,并可通过总线接入计算机。本实施例无需在正余弦编码器中集成数据采集卡,正余弦编码器无需添加额外的硬件电路,使得正余弦编码器的结构更加简单。
步骤S02:获取特征正余弦信号,其中,所述特征正余弦信号用于表征所述正余弦编码器旋转一周生成的正余弦信号的理论值;
在本实施例中,特征正余弦信号可以是指正余弦编码器旋转一周生成的正余弦信号的理论值,特征正余弦信号可包括特征正弦信号和特征余弦信号,特征正弦信号和特征余弦信号之间的相位差为90度,例如特征正弦信号的相位为30度时,对应的特征余弦信号的相位可以为120度。
在本实施例中,上述特征正余弦信号可以是通过公式计算得到的,也可以是利用模拟软件模拟得到的,或者也可以是采用标准高精度的编码器运行一周得到的,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
步骤S03:对比所述初始正余弦信号和所述特征正余弦信号,确定所述正余弦编码器在各个角度的相位差;
在本实施例中,相位差可根据正余弦编码器在各个角度对应的初始正余弦信号和特征正余弦信号确定。在一些实施例中,可以是以初始余弦信号为基准校正初始余弦信号与初始正弦信号之间的相位差为90度,可以对比初始正弦信号与特征正弦信号,还可以是以初始正弦信号为基准校正初始余弦信号与初始正弦信号之间的相位差为90度,可以对比初始余弦信号与特征余弦信号。例如,正余弦编码器中的初始正弦信号对应的角度为30度,可从特征余弦信号中选取对应的角度为120度,假设初始正余弦信号中的初始余弦信号为121度,则初始余弦信号的相位差为1度,对应的可以校正初始余弦信号,并保持初始正弦信号不变。还可根据特征正弦信号和初始余弦信号确定正余弦编码器生成的余弦信号在各个角度的相位差,本实施例对此不过多赘述。
步骤S04:根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;
在本实施例中,可根据相位差确定正余弦编码器在各个角度对应的幅值补偿参数,具体方式可以是以初始正弦信号为基准,确定初始正弦信号在各个角度对应的与初始余弦信号之间的相位差,再根据该相位差确定初始余弦信号在各个角度对应的幅值补偿参数;还可以是以初始余弦信号为基准,确定初始余弦信号在各个角度对应的与初始正弦信号之间的相位差,再根据该相位差确定初始正弦信号在各个角度对应的幅值补偿参数。例如:在初始正弦信号对应的角度为30度时,初始余弦信号对应的角度应为120度,但是此时初始余弦信号对应的角度为121度,此时相位差为1度,需要得到初始余弦信号为121度的幅值补偿参数。
步骤S05:基于所述正余弦编码器在各个角度对应的幅值补偿参数生成校正参数集;
在本实施例中,校正参数集中可包括以正弦信号为基准,余弦信号在各个角度对应的幅值补偿参数,或者可以包括以余弦信号为基准,正弦信号在各个角度对应的幅值补偿参数,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
步骤S06:将所述校正参数集存储至所述正余弦编码器的预设位置处。
本实施例可将校正参数集存储在正余弦编码器中存储器的预设位置处,例如EEPROM(带电可擦可编程只读存储器),也可以通过其他存储器进行存储,例如flash ROM、CPU内部的存储器、NVRAN等存储器。
进一步地,在本实施例中,所述步骤S06之后,还可以包括:获取存储的校正参数集,并根据所述存储的校正参数集对所述正余弦编码器进行测试,获得测试后的正余弦信号;在所述测试后的正余弦信号的相位差满足预设相位差条件时,判定所述正余弦编码器合格。
需要说明的是,预设相位差条件是指预先设置的相位差条件,例如,测试后的正弦信号与余弦信号之间的相位差大于88度且小于92度,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
具体地,在确定出幅值补偿参数后,还可以利用存储的该补偿参数对正余弦编码器进行测试验证,获得测试后的正余弦信号,在测试后的正余弦信号的相位差精度满足预设相位差条件时,确认该正余弦编码器合格,可以出厂。
进一步地,为了精确进行相位差校正,在本实施例中,所述步骤S40包括:根据所述目标幅值补偿参数,利用所述硬件校正电路调整所述正余弦信号的幅值,得到目标正余弦信号;其中,所述目标正余弦信号中目标正弦信号与目标余弦信号之间的相位差为90度。
在本实施例中,正余弦编码器可包括硬件校正电路,用于对正余弦信号的幅值进行调整。
在实际应用中,目标正余弦信号中目标正弦信号与目标余弦信号之间的相位差可以是在90度左右,在误差允许的范围以内即可,例如,88度、89.6度、90.12度等。
可理解的是,在得到目标幅值补偿参数后,可利用硬件校正电路对正余弦信号的幅值进行调整,得到目标正余弦信号。在需要对正余弦信号中的余弦信号进行相位差校正时,可从当前时刻对应的角度的目标幅值补偿参数中选取余弦信号中该角度对应的目标幅值补偿参数,然后对余弦信号的幅值进行调整。例如:在幅值补偿参数表征当前时刻的角度对应的校正后的理论幅值的情况下,当前时刻对应的余弦信号的角度为121度,对应的目标幅值补偿参数为-2,此时可以将当前时刻对应的余弦信号的幅值调整为-2。
进一步地,在本实施例中,所述硬件校正电路可以包括:加法器、减法器、可变增益运放或预设分压电阻链等。在一些实施方式中,硬件校正电路可以包括以上至少之一,或者任意的组合方式。
在本实施例中,硬件校正电路可包括加法器、减法器、可变增益运放或预设分压电阻链,除了可变增益运放外,还可以采用其他的可编程器件,比如A/D、D/A等,利用上述硬件校正电路无需通过利用在编码器中集成A/D和D/A+CPU的方式来实现,避免采用CPU的方式带来很大的时间延迟。
本实施例通过获取正余弦编码器旋转一周生成的初始正余弦信号,然后获取特征正余弦信号,其中,特征正余弦信号用于表征正余弦编码器旋转一周生成的正余弦信号的理论值,然后对比初始正余弦信号和特征正余弦信号,确定正余弦编码器在各个角度的相位差,然后根据相位差确定正余弦编码器在各个角度对应的幅值补偿参数,再基于正余弦编码器在各个角度对应的幅值补偿参数生成校正参数集,并将校正参数集存储至正余弦编码器的预设位置处。本实施例通过对比初始正余弦信号和特征正余弦信号,确定正余弦编码器在各个角度的相位差,然后根据相位差确定校正参数集,能够将正余弦信号的相位差校正转换为正余弦信号的幅值调整,然后对当前时刻生成的正余弦信号进行相位差校正,从而能够自动实现正余弦编码器产生的正余弦信号的相位差校正,使正余弦信号的精度更高。
参考图4,图4为本申请正余弦信号的相位差校正方法第三实施例的流程示意图。
基于上述各实施例,在本实施例中,所述步骤S04可以包括:
步骤S041:根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;其中,所述初始正余弦信号包括:初始正弦信号和初始余弦信号。
在本实施例中,初始正弦信号和初始余弦信号可以是指正余弦编码器在出厂前旋转一周生成的正弦信号和余弦信号。
在本实施例中,相位差是指初始正弦信号和初始余弦信号在各个角度下的相位差,然后可根据初始正弦信号、初始余弦信号以及相位差确定正余弦编码器在各个角度对应的幅值补偿参数。
进一步地,为了得到幅值补偿参数,在本实施例中,所述步骤S041可以包括:利用第一预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的余弦信号在各个角度对应的幅值补偿参数,其中,所述第一预设公式为:
cos(wt+β)=(coswt+αsinwt)/sqrt(1+α^2)
其中,cos(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
在本实施例中,可以正弦信号为基准,通过上述第一预设公式得到正余弦编码器生成的余弦信号在各个角度下的幅值补偿参数。
可理解的是,例如:在正弦信号对应的角度为30度时,余弦信号对应的角度应为120度,但是此时余弦信号对应的角度为121度,此时相位差为1度,β也为1度,coswt表示初始余弦信号中角度为wt对应的初始余弦值,sinwt表示初始正弦信号中角度为wt对应的初始正弦值,sqrt为开根号运算。
在一些实施例中,上述第一预设公式还可以为:
Acos(wt+β)=A(coswt+αsinwt)/sqrt(1+α^2)
其中,A可以为余弦信号的幅值,A可以为大于0的数值,例如:1、1.5、2、3、5等,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
在本实施例中,上述第一预设公式还可以为其它可能的变形,所属领域技术人员在本说明书实施例技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本说明书实施例相同或相似,均应涵盖于本说明书实施例保护范围内。
在本实施例中,参照图5,图5为本申请正余弦信号的相位差校正方法一实施例的角度、角度所在的弧度、角度的正切值之间的关系曲线图。如图5所示,横坐标表示角度,标记为1的第一条曲线表示角度的正切值,标记为2的第二条曲线表示角度所在的弧度,可以计算出,在角度为10度的情况下,弧度与正切值的误差为0.1027918,在角度为5度的情况下,弧度与正切值的误差为0.0127311。所以在相移不大(10度以内)的情况下,可以通过调整正余弦信号的幅值来实现正余弦信号的相移问题,也就是通过调整正余弦信号的幅值实现正余弦信号的相位差校正。
应理解的是,α表示相位差的正切值,由图5可知,相位差的正切值可约等于相位差,即α≈β。例如:在余弦信号对应的角度为121度时,β为1度,cos(wt+1)=(coswt+sinwt)/sqrt(1+1^2)=(cos120°+sin120°)/sqrt(2),正余弦编码器中的余弦信号对应的角度为121度对应的幅值补偿参数为(cos120°+sin120°)/sqrt(2)。
在具体实现中,在相移大于10度的情况下,可以依据上述第一预设公式计算出理论误差,具体的应用条件要考虑***期望的精度和我们理论可达的精度,一般的,在我们实际的工程实践当中,正余弦编码器的相位差调整范围不大于5°。
进一步地,为了得到幅值补偿参数,在本实施例中,所述步骤S022可以包括:利用第二预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的正弦信号在各个角度对应的幅值补偿参数,其中,所述第二预设公式为:
sin(wt+β)=(sinwt+αcoswt)/sqrt(1+α^2)
其中,sin(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
在本实施例中,可以余弦信号为基准,通过上述第二预设公式得到正弦信号生成的正弦信号在各个角度下的幅值补偿参数。
可理解的是,例如:在余弦信号对应的角度为120度时,正弦信号对应的角度应为30度,但是此时正弦信号对应的角度为31度,此时相位差为1度,β也为1度,coswt表示初始余弦信号中角度为wt对应的初始余弦值,sinwt表示初始正弦信号中角度为wt对应的初始正弦值,sqrt为开根号运算。
应理解的是,α表示相位差的正切值,由图5可知,相位差的正切值可约等于相位差,即α≈β。例如:在正弦信号对应的角度为30度时,β为1度,sin(wt+β)=(sinwt+αcoswt)/sqrt(1+α^2)=(sin30°+cos30°)/sqrt(2),正余弦编码器中的正弦信号对应的角度为30度对应的幅值补偿参数为(sin30°+cos30°)/sqrt(2)。
在具体实现中,在相移大于10度的情况下,可以依据上述第二预设公式计算出理论误差,具体的应用条件要考虑***期望的精度和我们理论可达的精度,一般的,在我们实际的工程实践当中,正余弦编码器的相位差调整范围不大于5°。
在一些实施例中,上述第二预设公式还可以为:
Bsin(wt+β)=B(sinwt+αcoswt)/sqrt(1+α^2)
其中,B可以为余弦信号的幅值,B可以为大于0的数值,例如:1.7、3、4、5等,具体的可以根据实际情况确定,本说明书实施例对此不作限定。
在本实施例中,上述第二预设公式还可以为其它可能的变形,所属领域技术人员在本说明书实施例技术精髓的启示下,还可能做出其它变更,但只要其实现的功能和效果与本说明书实施例相同或相似,均应涵盖于本说明书实施例保护范围内。
本实施例根据初始正余弦信号和相位差确定正余弦编码器在各个角度对应的幅值补偿参数,其中,初始正余弦信号包括:初始正弦信号和初始余弦信号。本实施例根据初始正弦信号、初始余弦信号以及相位差确定正余弦编码器在各个角度对应的幅值补偿参数,能够获得精确的正余弦编码器在各个角度对应的幅值补偿参数,从而能够得到精确的校正参数集。
在一个实施例中,由于随着正余弦编码器使用次数的增多,正余弦编码器的误差可能会变大,因此在正余弦编码器出厂运行一段时间之后,可以更新校正参数集。在对校正参数集进行更新时,可以控制正余弦编码器低速旋转一周,具体确定当前校正参数集的方式可以参照上述获取校正参数集的方法,本实施例对此不过多赘述。再根据当前校正参数集对校正参数集进行更新,并将当前校正参数集存储到正余弦编码器的预设位置处,然后将校正参数集替换为当前校正参数集,后续在正余弦编码器的使用过程中可根据当前校正参数集进行相位差校正。
参照图6,图6为本申请正余弦信号的正余弦编码器第一实施例的结构框图。
如图7所示,本申请实施例提出的正余弦编码器可以包括:光电池芯片10、存储器20、相位差校正模块30,其中,
所述光电池芯片10可以用于生成正余弦信号;
所述存储器20可以用于存储校正参数集;
所述相位差校正模块30可以用于采集所述光电池芯片当前时刻生成的正余弦信号;从所述存储器获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
本实施例可以采集正余弦编码器当前时刻生成的正余弦信号,然后通过获取校正参数集,可以确定当前时刻对应的角度的目标幅值补偿参数。校正参数集可以包含正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,校正参数集是预先测试得到的。从而根据校正参数集可以将相位误差转换为幅值误差,进一步的,可以利用目标幅值补偿参数对正余弦信号进行相位差校正。本实施例通过预先测试得到的校正参数集,可以在不改变编码器的硬件布局的前提下实现相位差的实时校正,更加便捷,适用性更广。利用根据校正参数集确定的目标幅值补偿参数对正余弦信号进行相位差校正,能够将正余弦信号的相位差校正转换为正余弦信号的幅值调整,从而使得本实施例上述方式能够自动实现正余弦编码器产生的正余弦信号的相位差校正,使正余弦信号的精度更高。
需要说明的是,以上所描述的工作流程仅仅是示意性的,并不对本申请的保护范围构成限定,在实际应用中,本领域的技术人员可以根据实际的需要选择其中的部分或者全部来实现本实施例方案的目的,此处不做限制。
另外,未在本实施例中详尽描述的技术细节,可参见本申请任意实施例所提供的正余弦信号的相位差校正方法,此处不再赘述。
基于本申请上述正余弦编码器第一实施例,提出本申请正余弦编码器的第二实施例。
在本实施例中,所述相位差校正模块30,还用于获取所述正余弦编码器旋转一周生成的初始正余弦信号;获取特征正余弦信号,其中,所述特征正余弦信号用于表征所述正余弦编码器旋转一周生成的正余弦信号的理论值;对比所述初始正余弦信号和所述特征正余弦信号,确定所述正余弦编码器在各个角度的相位差;根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;基于所述正余弦编码器在各个角度对应的幅值补偿参数生成校正参数集;将所述校正参数集存储至所述正余弦编码器的预设位置处。
进一步地,所述相位差校正模块30,还用于根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;其中,所述初始正余弦信号包括:初始正弦信号和初始余弦信号。
进一步地,所述相位差校正模块30,还用于利用第一预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的余弦信号在各个角度对应的幅值补偿参数,其中,所述第一预设公式可以为:
cos(wt+β)=(coswt+αsinwt)/sqrt(1+α^2)
其中,cos(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
进一步地,所述相位差校正模块30,还用于利用第二预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的正弦信号在各个角度对应的幅值补偿参数,其中,所述第二预设公式为:
sin(wt+β)=(sinwt+αcoswt)/sqrt(1+α^2)
其中,sin(wt+β)表示所述正余弦编码器在角度wt对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
进一步地,所述相位差校正模块30,还用于根据所述目标幅值补偿参数,利用所述硬件校正电路调整所述正余弦信号的幅值,得到目标正余弦信号;其中,所述目标正余弦信号中目标正弦信号与目标余弦信号之间的相位差为90度;所述硬件校正电路包括:加法器、减法器、可变增益运放或预设分压电阻链。
进一步地,所述相位差校正模块30,还用于获取存储的校正参数集,并根据所述存储的校正参数集对所述正余弦编码器进行测试,获得测试后的正余弦信号;在所述测试后的正余弦信号的相位差满足预设相位差条件时,判定所述正余弦编码器合格。
本申请正余弦信号编码器的其他实施例或具体实现方式可参照上述各方法实施例,此处不再赘述。
此外,本申请实施例还提出一种存储介质,所述存储介质上存储有正余弦信号的相位差校正程序,所述正余弦信号的相位差校正程序被处理器执行时实现如上文所述的正余弦信号的相位差校正方法的步骤。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者***不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者***所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者***中还存在另外的相同要素。
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如只读存储器/随机存取存储器、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本申请各个实施例所述的方法。
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。

Claims (10)

  1. 一种正余弦信号的相位差校正方法,应用于正余弦编码器,其中,所述正余弦信号的相位差校正方法包括:
    采集所述正余弦编码器当前时刻生成的正余弦信号;
    获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;
    根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;
    利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
  2. 如权利要求1所述的正余弦信号的相位差校正方法,其中,所述获取校正参数集之前,还包括:
    获取所述正余弦编码器旋转一周生成的初始正余弦信号;
    获取特征正余弦信号,其中,所述特征正余弦信号用于表征所述正余弦编码器旋转一周生成的正余弦信号的理论值;
    对比所述初始正余弦信号和所述特征正余弦信号,确定所述正余弦编码器在各个角度的相位差;
    根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;
    基于所述正余弦编码器在各个角度对应的幅值补偿参数生成校正参数集;
    将所述校正参数集存储至所述正余弦编码器的预设位置处。
  3. 如权利要求2所述的正余弦信号的相位差校正方法,其中,所述根据所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
    根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数;其中,所述初始正余弦信号包括:初始正弦信号和初始余弦信号。
  4. 如权利要求3所述的正余弦信号的相位差校正方法,其中,所述根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
    利用第一预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的余弦信号在各个角度对应的幅值补偿参数,其中,所述第一预设公式为:
    cos(wt+β)=(coswt+αsinwt)/sqrt(1+α^2)
    其中,cos(wt+β)表示所述正余弦编码器在角度wt处对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
  5. 如权利要求3所述的正余弦信号的相位差校正方法,其中,所述根据所述初始正余弦信号和所述相位差确定所述正余弦编码器在各个角度对应的幅值补偿参数,包括:
    利用第二预设公式,根据所述初始正弦信号、所述初始余弦信号以及所述相位差确定所述正余弦编码器生成的正弦信号在各个角度对应的幅值补偿参数,其中,所述第二预设公式为:
    sin(wt+β)=(sinwt+αcoswt)/sqrt(1+α^2)
    其中,sin(wt+β)表示所述正余弦编码器在角度wt处对应的幅值补偿参数,coswt表示初始余弦信号,sinwt表示初始正弦信号,β表示相位差,α表示相位差的正切值,w表示角速度,t表示时间。
  6. 如权利要求1~5中任一项所述的正余弦信号的相位差校正方法,其中,所述正余弦编码器包括硬件校正电路,所述利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正,包括:
    根据所述目标幅值补偿参数,利用所述硬件校正电路调整所述正余弦信号的幅值,得到目标正余弦信号;其中,所述目标正余弦信号中目标正弦信号与目标余弦信号之间的相位差为90度。
  7. 如权利要求6所述的正余弦信号的相位差校正方法,其中,所述硬件校正电路包括:加法器、减法器、可变增益运放或预设分压电阻链。
  8. 如权利要求2所述的正余弦信号的相位差校正方法,其中,所述将所述校正参数集存储至所述正余弦编码器的预设位置处之后,还包括:
    获取存储的校正参数集,并根据所述存储的校正参数集对所述正余弦编码器进行测试,获得测试后的正余弦信号;
    在所述测试后的正余弦信号的相位差满足预设相位差条件时,判定所述正余弦编码器合格。
  9. 一种正余弦编码器,其中,包括:光电池芯片、存储器、相位差校正模块,其中,
    所述光电池芯片用于生成正余弦信号;
    所述存储器用于存储校正参数集;
    所述相位差校正模块用于采集所述光电池芯片当前时刻生成的正余弦信号;从所述存储器获取校正参数集,所述校正参数集包含所述正余弦编码器旋转一周对应的各个角度处用于进行相位差校正的幅值补偿参数,所述校正参数集是预先测试得到的;根据所述校正参数集,确定所述当前时刻对应的角度的目标幅值补偿参数;利用所述目标幅值补偿参数对所述正余弦信号进行相位差校正。
  10. 一种存储介质,其中,所述存储介质上存储有正余弦信号的相位差校正程序,所述正余弦信号的相位差校正程序被处理器执行时实现如权利要求1至8中任一项所述的正余弦信号的相位差校正方法的步骤。
PCT/CN2023/099504 2022-11-09 2023-06-09 正余弦信号的相位差校正方法、正余弦编码器及存储介质 WO2024098741A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202211401273.8 2022-11-09
CN202211401273.8A CN115655333A (zh) 2022-11-09 2022-11-09 正余弦信号的相位差校正方法、正余弦编码器及存储介质

Publications (1)

Publication Number Publication Date
WO2024098741A1 true WO2024098741A1 (zh) 2024-05-16

Family

ID=85015234

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2023/099504 WO2024098741A1 (zh) 2022-11-09 2023-06-09 正余弦信号的相位差校正方法、正余弦编码器及存储介质

Country Status (2)

Country Link
CN (1) CN115655333A (zh)
WO (1) WO2024098741A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115655333A (zh) * 2022-11-09 2023-01-31 长春汇通光电技术有限公司 正余弦信号的相位差校正方法、正余弦编码器及存储介质
CN117782187B (zh) * 2024-02-23 2024-05-07 泉州昆泰芯微电子科技有限公司 一种编码器的非线性误差修正方法及编码器

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102324933A (zh) * 2011-06-21 2012-01-18 中国兵器工业第二○六研究所 一种正交低杂散直接数字频率合成器
CN102564462A (zh) * 2011-12-27 2012-07-11 华中科技大学 一种正余弦编码器的误差补偿装置
US20130271823A1 (en) * 2011-08-30 2013-10-17 Kiyotaka Ito Modulated signal detecting apparatus and modulated signal detecting method
CN109579880A (zh) * 2018-12-26 2019-04-05 上海英威腾工业技术有限公司 带有自适应补偿功能的磁编码器
CN113566856A (zh) * 2021-08-16 2021-10-29 中国科学院长春光学精密机械与物理研究所 精码相位调整的方法
CN113824517A (zh) * 2021-09-18 2021-12-21 上海航天电子通讯设备研究所 一种基于数字波束合成的无线在轨自适应幅相校正***
CN115655333A (zh) * 2022-11-09 2023-01-31 长春汇通光电技术有限公司 正余弦信号的相位差校正方法、正余弦编码器及存储介质

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102324933A (zh) * 2011-06-21 2012-01-18 中国兵器工业第二○六研究所 一种正交低杂散直接数字频率合成器
US20130271823A1 (en) * 2011-08-30 2013-10-17 Kiyotaka Ito Modulated signal detecting apparatus and modulated signal detecting method
CN102564462A (zh) * 2011-12-27 2012-07-11 华中科技大学 一种正余弦编码器的误差补偿装置
CN109579880A (zh) * 2018-12-26 2019-04-05 上海英威腾工业技术有限公司 带有自适应补偿功能的磁编码器
CN113566856A (zh) * 2021-08-16 2021-10-29 中国科学院长春光学精密机械与物理研究所 精码相位调整的方法
CN113824517A (zh) * 2021-09-18 2021-12-21 上海航天电子通讯设备研究所 一种基于数字波束合成的无线在轨自适应幅相校正***
CN115655333A (zh) * 2022-11-09 2023-01-31 长春汇通光电技术有限公司 正余弦信号的相位差校正方法、正余弦编码器及存储介质

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
LIU XINZHENG, QIU DE-FENG, LI YU-QUAN, LIANG DE-LIANG, GAO LIN, KUANG JUN-SHENG: "Analysis and Compensation on Segmenting Subdivision Error of SIN/COS Encoder", MICROMOTORS, vol. 43, no. 11, 31 December 2010 (2010-12-31), pages 42 - 47, XP093170113, ISSN: 1001-6848, DOI: 10.15934/j.cnki.micromotors.2010.11.026 *

Also Published As

Publication number Publication date
CN115655333A (zh) 2023-01-31

Similar Documents

Publication Publication Date Title
WO2024098741A1 (zh) 正余弦信号的相位差校正方法、正余弦编码器及存储介质
CN115388930A (zh) 正余弦信号的误差补偿方法及存储介质
CN109696197A (zh) 正余弦编码器相位偏差的补偿方法和装置
CN109596143A (zh) 陀螺仪的测试方法、***、设备及计算机可读存储介质
CN114928355B (zh) 基于晶体振荡器的电压补偿方法、装置、设备及存储介质
CN111311021A (zh) 一种风电场理论功率预测方法、装置、设备和存储介质
CN114003045B (zh) 一种光电跟踪仪的目标跟踪方法、终端、可读存储介质
CN106643469A (zh) 感应同步器误差校准的在轨综合补偿实现方法
CN111679261B (zh) 一种基于反光板的激光雷达定位方法及***
CN108508385A (zh) 一种低成本高精度自动校正方法
CN110262391B (zh) 工件的开孔轨迹的生成方法、装置、存储介质和处理器
CN112465917B (zh) 镜头模组的畸变标定方法、***、设备及存储介质
CN109781342A (zh) 气压计校准方法及装置
CN114500209B (zh) 频偏补偿方法、***、电子设备及计算机可读存储介质
CN104635193B (zh) 一种电表用的soc芯片实时时钟高精度补偿方法
CN114879126A (zh) 一种精准用电调控终端校准方法、装置和设备
JP2839341B2 (ja) 位置信号の校正装置
CN110716860A (zh) 一种基于云平台的自动化测试工具管理方法及***
CN112198494A (zh) 飞行时间模组标定方法、装置、***及终端设备
JPS63256814A (ja) 位置検出装置
CN205176056U (zh) 一种内置有校准线圈的加速度传感器自标定装置
WO2022041998A1 (zh) 频率补偿方法及电路、存储介质、电子装置
CN110865577B (zh) 一种用于交流电阻校准的数字采样方法及装置
CN114034279B (zh) 结合光电测角信息实现电子罗盘高精度定向的方法及装置
CN117890849A (zh) 一种电能表计量补偿方法、装置、存储介质以及电子设备

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 23887440

Country of ref document: EP

Kind code of ref document: A1