CN108206699A - Utilize the method for sin/cos encoder calculating resolution position - Google Patents

Utilize the method for sin/cos encoder calculating resolution position Download PDF

Info

Publication number
CN108206699A
CN108206699A CN201611174934.2A CN201611174934A CN108206699A CN 108206699 A CN108206699 A CN 108206699A CN 201611174934 A CN201611174934 A CN 201611174934A CN 108206699 A CN108206699 A CN 108206699A
Authority
CN
China
Prior art keywords
incr
resolution
sin
phase
incremental
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.)
Pending
Application number
CN201611174934.2A
Other languages
Chinese (zh)
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.)
Xuzhou Xinlong Electronic Technology Co Ltd
Original Assignee
Xuzhou Xinlong Electronic Technology 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 Xuzhou Xinlong Electronic Technology Co Ltd filed Critical Xuzhou Xinlong Electronic Technology Co Ltd
Priority to CN201611174934.2A priority Critical patent/CN108206699A/en
Publication of CN108206699A publication Critical patent/CN108206699A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M1/00Analogue/digital conversion; Digital/analogue conversion
    • H03M1/12Analogue/digital converters
    • H03M1/64Analogue/digital converters with intermediate conversion to phase of sinusoidal or similar periodical signals
    • H03M1/645Analogue/digital converters with intermediate conversion to phase of sinusoidal or similar periodical signals for position encoding, e.g. using resolvers or synchros

Abstract

The invention discloses a kind of method using sin/cos encoder calculating resolution position, the method includes the following steps:Step 1: coarse resolution angle calculation;Step 2: accurate resolution angle calculation;Step 3: interpolated resolution angle calculation.The present invention can calculate high-resolution position by using sin/cos encoder, and result of calculation is accurate, and interference is small, is easy to implement.

Description

Utilize the method for sin/cos encoder calculating resolution position
Technical field
The present invention relates to A/D converter technologies fields, and in particular to a kind of calculated using sin/cos encoder is differentiated The method of rate position.
Background technology
Using the method that sin/cos encoder calculates high-resolution position for the angle of hardware, usually it can be used Two methods, both methods mainly influence the requirement to A/D converters.In " oversampler method ", sinusoidal and two kinds of cosine The sample frequency of signal at least should be four times of maximum sinusoidal and cosine frequency.Incremental count and phase calculation are by host-processor On subsequent digital signal handle and complete.This method is not needed to using comparator, but to use the double sampled ADC of high speed.
Common " lack sampling " method calculates incremental count and interpolation incremental phase using independent hardware block.With first Kind of method is compared, the advantages of this method be ADC sample frequency and bandwidth it is lower because the method does not interfere with incremental count, And only influence interpolation phase.But lack sampling method needs to be each sinusoidal and cosine respectively using a comparator, to generate Digital quadrature encoded signal A and B, the two signals meeting driving direction are incremented by down counter, and also referred to as quadrature coding pulse counts Device.The analog bandwidth of double sampled ADC at least needs to be equal to maximum sinusoidal/cosine frequency.
Invention content
The present invention overcomes the deficiencies in the prior art, provide a kind of utilization sin/cos encoder calculating resolution position Method.
To solve the technical issues of above-mentioned, the present invention uses following technical scheme:
A kind of method using sin/cos encoder calculating resolution position, the method include the following steps:
Step 1: coarse resolution angle calculation
For incremental count since 0, maximal increment is counted as incrMAX, wherein N is line counting:
incrMAX= (4*N)-1 ;
Incremental counter ΦincrCalculation formula it is as follows:
Φincr[ deg ]= 0
Wherein, incr is practical incremental count, and N is that total line counts, Φ0For zero angle;
Step 2: accurate resolution angle calculation
The phase of sinusoidal signal A and sinusoidal signal BA,B For angle value to be inserted into two continuous lines countings or four Between a incremental step, phaseA,BIt is calculated using the following formula:
ϕA,B[ deg ]=
Step 3: interpolated resolution angle calculation
When according to incremental count incr and phaseA,BWhen being consistent, total interpolation angle, φTOTAL N can be counted by line to calculate, Formula is as follows:
ΦTOTAL[ deg ]=
Further technical solution is that sinusoidal signal A and sinusoidal signal B and incremental count incr are same in the step 2 Shi Suocun.
Further technical solution is as analog signal A and analog signal B and digital signal ATTLAnd digital signal BTTLBetween phase shift be less than ± 90 ° when, then be corrected.
Further technical solution is that the correction includes:
When incremental count incr%4=3,0≤phase<When 90, incr=incr+1, if incr>4 × N -1, then incr = 0。
Further technical solution is that the correction includes:When incremental count incr%4=3,270≤phase<When 360, Incr=incr -1, if incr<0, then incr=4 × N -1.
Further technical solution is to further include to carry out low-pass filtering and improve resolution ratio and immunity to interference step.
Further technical solution is that the computational methods of equivalent interpolation angular resolution are:ΦRESOLUTION [bit] = log2(2×N)+ ADCRESOLUTION[bit]。
Compared with prior art, the beneficial effects of the invention are as follows:The present invention can be by using sin/cos encoder meter High-resolution position is calculated, result of calculation is accurate, and interference is small, is easy to implement.
Specific embodiment
All features or disclosed all methods disclosed in this specification or in the process the step of, in addition to mutually exclusive Feature and/or step other than, can combine in any way.
This specification(Including any accessory claim, abstract)Disclosed in any feature, unless specifically stated, It is replaced by other equivalent or with similar purpose alternative features.That is, unless specifically stated, each feature is a series of An example in equivalent or similar characteristics.
The specific embodiment of the present invention is described in detail with reference to embodiment.
According to one embodiment of present invention, the present embodiment discloses a kind of utilization sin/cos encoder calculating resolution The method of position, total interpolation Angle Position are made of rough angle and accurate angle.Interpolation angle is counted by practical increment line and the increment line In the range of phase decision.Phase in the range of increment line derived from any particular point in time analog sine and cosine signal A and B.Practical incremental count and realistic simulation sinusoidal and cosine signal must all latch simultaneously, therefore the two should synchronize.Increment meter line Number provides rough angle, and sinusoidal and cosine phase then provides accurate angle in the range of the increment line.Total interpolation angle by rough angle and Accurate angle is formed.
Specifically, the present embodiment is included the following steps using the method for sin/cos encoder calculating resolution position:
Step 1: coarse resolution angle calculation, incremental count and its rough angle of determining increment can be determined by counter, work as mould When intending sinusoidal and cosine signal A as targeting sequencing, counter is incremental, and when analog sine and cosine signal B are targeting sequencing When, counter successively decreases.During digitized processing, analog sine and the equal counting of cosine A and the edge of analog sine and cosine B. Therefore, an incremental count is equivalent to signal A and signal B 90 ° of phase shifts of generation.
For incremental count since 0, maximal increment is counted as incrMAX, wherein N is line counting:incrMAX= (4*N)-1 ;Incremental counter ΦincrCalculation formula it is as follows:
Φincr[ deg ]= 0
Wherein, incr is practical incremental count, and N is that total line counts, Φ0For zero angle;, the value is true by reference marker R It is fixed(If it uses).
Step 2: accurate resolution angle calculation
The phase of sinusoidal signal A and sinusoidal signal BA,B For angle value to be inserted into two continuous lines countings or four Between a incremental step, phaseA,BIt is calculated using the following formula:
ϕA,B[ deg ]=
Since the Amplitude Ration of A and B is used only(The common mathematical function of encoder rotating speed and supply voltage), therefore result of calculation will not Influence final result.
Step 3: interpolated resolution angle calculation
When according to incremental count incr and phaseA,BWhen being consistent, total interpolation angle, φTOTAL N can be counted by line to calculate, Formula is as follows:
ΦTOTAL[ deg ]=
Preferably, sinusoidal signal A and sinusoidal signal B and incremental count incr are latched simultaneously.Incremental count and phase and phase Relationship such as following table between the quadrant of position:
Further, in practice, compared with analog signal, it is input to the digitized signal of orthogonal encoder pulse counter ATTL and BTTL usually have phase shift.Generate phase shift the main reason for be comparator lag and propagation delay and latch Synchronizing between incremental count and sampling simulation input A and B is undesirable.Lag influence to phase shift almost with signal frequency without It closes, but is almost inversely proportional with signal amplitude.It is undesirable same between propagation delay and sampled analogue signals and latch incremental count It is influenced caused by step almost unrelated with amplitude but proportional to frequency.Therefore, maximum phase shift appears in sin/cos coding Device frequency is maximum, the position of amplitude minimum.This means that when being transformed into next quadrant every time, due to delayed phase, increase Batching counter will not update immediately, and above-mentioned factor can not be ignored, it is therefore desirable to detect and correct these poles using a kind of method End situation.Since the low sum-bit analogue phase of increment line number has uncertainty, as long as phase shift remains less than ± 90 °, i.e., As analog signal A and analog signal B and digital signal ATTLWith digital signal BTTLBetween phase shift be less than ± 90 ° when, then It is corrected.
Specifically, the correction includes:
When incremental count incr%4=3,0≤phase<When 90, incr=incr+1, if incr>4 × N -1, then incr = 0。
When incremental count incr%4=3,270≤phase<When 360, incr=incr -1, if incr<0, then incr =4×N–1。
Quadrant is identified since phase information is used only, and only needs to consider two kinds of exceptions(I.e. from 4 turns of quadrant Change to quadrant 1 or from quadrant 1 be transformed into 4 quadrant when), depending on specific apparent rotation direction.
Specifically, ideal interpolation angular resolution is the line number of sin/cos encoder and the letter of two-way ADC resolution ratio Number.The computational methods of equivalent interpolation angular resolution are:ΦRESOLUTION [bit] = log2(2×N)+ ADCRESOLUTION [bit]。
If in no interpolation, use ideal 12 two-way ADC and 16 two-way ADC in the case of, it is available insert It is worth angular resolution(The function of line number).During using 16 two-way ADC, if using the full scale input range of ADC, line Number is equal to 28 for the desired resolution of 2048 sin/cos encoder.Position control is not usually required to so high point Resolution, but when carrying out extremely accurately speed control high-resolution is then needed particularly in the case where mechanical speed is relatively low Rate.Sampling rate for 1.6kHz, without low-pass filtering under the conditions of the ideal velocity resolution curve that obtains.It is assumed that The current closed-loop control of operating ratio of industrial drives system speed closed-loop control under the conditions of 16kHz and PWM are 10 times low.It is putting into practice In, low-pass filtering will be carried out and improve resolution ratio and immunity to interference, but will appear the distinctive propagation of wave filter(Group)Delay or delay.
Phase error shows two periods caused by the phase shift between input signal A and B.Signal processing can be passed through Algorithm detects and calibration constant phase shift.
" one embodiment " for being spoken of in the present specification, " another embodiment ", " embodiment " etc., refer to tying Specific features, structure or the feature for closing embodiment description are included at least one embodiment of the application generality description In.It is not centainly to refer to same embodiment that statement of the same race, which occur, in multiple places in the description.Appoint furthermore, it is understood that combining When one embodiment describes a specific features, structure or feature, what is advocated is to realize this with reference to other embodiment Kind feature, structure or feature are also fallen within the scope of the present invention.
Although reference be made herein to invention has been described for the multiple explanatory embodiments invented, however, it is to be understood that this Field technology personnel can be designed that a lot of other modifications and embodiment, these modifications and embodiment will be fallen in the application Within disclosed spirit and spirit.More specifically, it is disclosed in the scope of the claims in the application, it can be to theme group The building block and/or layout for closing layout carry out a variety of variations and modifications.In addition to the modification carried out to building block and/or layout Outer with improving, to those skilled in the art, other purposes also will be apparent.

Claims (7)

  1. A kind of 1. method using sin/cos encoder calculating resolution position, it is characterised in that:The method include with Lower step:
    Step 1: coarse resolution angle calculation
    For incremental count since 0, maximal increment is counted as incrMAX, wherein N is line counting:
    incrMAX= (4*N)-1 ;
    Incremental counter ΦincrCalculation formula it is as follows:
    Φincr[ deg ]= 0
    Wherein, incr is practical incremental count, and N is that total line counts, Φ0For zero angle;
    Step 2: accurate resolution angle calculation
    The phase of sinusoidal signal A and sinusoidal signal BA,B For angle value to be inserted into two continuous lines countings or four Between incremental step, phaseA,BIt is calculated using the following formula:
    ϕA,B[ deg ]=
    Step 3: interpolated resolution angle calculation
    When according to incremental count incr and phaseA,BWhen being consistent, total interpolation angle, φTOTAL N can be counted by line to calculate, Formula is as follows:
    ΦTOTAL[ deg ]=
  2. 2. the method according to claim 1 using sin/cos encoder calculating resolution position, it is characterised in that institute Sinusoidal signal A and sinusoidal signal B and incremental count incr are latched simultaneously in the step of stating two.
  3. 3. the method according to claim 1 using sin/cos encoder calculating resolution position, it is characterised in that when Analog signal A and analog signal B and digital signal ATTLWith digital signal BTTLBetween phase shift be less than ± 90 ° when, then into Row correction.
  4. 4. the method according to claim 3 using sin/cos encoder calculating resolution position, it is characterised in that institute The correction stated includes:
    When incremental count incr%4=3,0≤phase<When 90, incr=incr+1, if incr>4 × N -1, then incr = 0。
  5. 5. the method according to claim 3 using sin/cos encoder calculating resolution position, it is characterised in that institute The correction stated includes:
    When incremental count incr%4=3,270≤phase<When 360, incr=incr -1, if incr<0, then incr=4 ×N–1。
  6. 6. the method according to claim 1 using sin/cos encoder calculating resolution position, it is characterised in that also Including carrying out low-pass filtering and improving resolution ratio and immunity to interference step.
  7. 7. the method according to claim 1 using sin/cos encoder calculating resolution position, it is characterised in that etc. The computational methods of the interpolation angular resolution of effect are:ΦRESOLUTION [bit] = log2(2×N)+ ADCRESOLUTION[bit]。
CN201611174934.2A 2016-12-19 2016-12-19 Utilize the method for sin/cos encoder calculating resolution position Pending CN108206699A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611174934.2A CN108206699A (en) 2016-12-19 2016-12-19 Utilize the method for sin/cos encoder calculating resolution position

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611174934.2A CN108206699A (en) 2016-12-19 2016-12-19 Utilize the method for sin/cos encoder calculating resolution position

Publications (1)

Publication Number Publication Date
CN108206699A true CN108206699A (en) 2018-06-26

Family

ID=62602757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611174934.2A Pending CN108206699A (en) 2016-12-19 2016-12-19 Utilize the method for sin/cos encoder calculating resolution position

Country Status (1)

Country Link
CN (1) CN108206699A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102564462A (en) * 2011-12-27 2012-07-11 华中科技大学 Error compensation device for sin/cos encoder
CN103528612A (en) * 2013-10-26 2014-01-22 连云港杰瑞电子有限公司 Method for increasing resolution ratio of absolute rotary encoder

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102564462A (en) * 2011-12-27 2012-07-11 华中科技大学 Error compensation device for sin/cos encoder
CN103528612A (en) * 2013-10-26 2014-01-22 连云港杰瑞电子有限公司 Method for increasing resolution ratio of absolute rotary encoder

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
无署名: "采用高分辨率位置插值的正弦/余弦编码器的接口", 《TI官网》 *

Similar Documents

Publication Publication Date Title
CN107607037B (en) Magnetoelectric encoder calibration method based on arc tangent trans-interval tabulation method
JP6624446B2 (en) Interpolation method and interpolation device
US9182251B2 (en) Angle detector and motor drive controller
US8344723B2 (en) Phase difference resolver of estimated real-time output
WO2008020231A2 (en) Methods of processing encoder signals
CN104155517B (en) A kind of non-integer-period sampled error compensating method of digitalized electrical energy meter and system
CN102111158A (en) Device for subdividing sine signal and cosine signal of position sensor and coding data, and implementation method thereof
JPWO2009116241A1 (en) Rotation angle detector
JPS62162968A (en) Speed detecting device
CN108871181B (en) Dynamic multi-window interval prediction angle subdivision method for multi-pair-electrode magnetoelectric encoder
CN108180933A (en) It is a kind of based on magnetism encoder automatic correcting method of the permanent magnet synchronous motor without sensor speed control
CN108375391B (en) Sine and cosine signal processing method and system
CN112985325B (en) Position decoding method and device of sine and cosine encoder and computer readable medium
CN201858990U (en) Device for subdividing sine-cosine signals and encoding data of position sensor
CN104569581B (en) Multi-level set and single-cycle estimation method of power grid frequency measuring
CN108206699A (en) Utilize the method for sin/cos encoder calculating resolution position
CN112434254B (en) Method, system, device, processor and storage medium for implementing incremental pulse count value correction processing for sine and cosine encoder
US10989568B2 (en) Position detection device and position detection method
JP2003149003A (en) Phase difference-correcting apparatus of encoder, phase difference-correcting method, and phase difference- correcting program
US10797624B2 (en) Rotation angle correction device and motor control system
CN110212818B (en) Angle detection method for permanent magnet motor
JP2012132805A (en) Position/speed control device
Kim et al. Ultra precise position estimation of servomotor using analog quadrature encoders
JP2012073053A (en) Rotation angle detection device
TWI344759B (en)

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
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20180626

WD01 Invention patent application deemed withdrawn after publication