METHOD TO ESTIMATE PHASE AND AMPLITUDE FOR CONTROL OF A RESONANT MEMS MIRROR

20230234836 · 2023-07-27

Assignee

Inventors

Cpc classification

International classification

Abstract

Techniques to be described herein are based upon the combination of a digital lock-in amplifier approach with a numerical method to yield accurate estimations of the amplitude and phase of a sense signal obtained from a movement sensor associated with a resonant MEMS device such as a MEMS mirror. The techniques described herein are efficient from a computational point of view, in a manner which is suitable for applications in which the implementing hardware is to follow size and power consumption constraints.

Claims

1. A method of operating a micro-electro mechanical systems (MEMS) device, comprising: driving the MEMS device with a drive signal; sensing movement of the MEMS device caused by the drive signal, and generating a sense signal indicative of the movement; using a rotation-matrix approach to generate a reference cosine wave and a reference sine wave, the reference cosine wave and reference sine wave each having an amplitude of 1 and a same frequency as that of the sense signal; multiplying the sense signal by the reference sine wave to produce a first product; multiplying the sense signal by the reference cosine wave to produce a second product; low-pass filtering the first product to produce a first intermediate output; low-pass filtering the second product to produce a second intermediate output; performing a 4-quadrant CORDIC technique on the first and second intermediate outputs to thereby determine a phase shift between the sense signal and the drive signal as well as an amplitude of the sense signal; comparing the phase shift to a target phase shift to produce a phase error as a difference therebetween; comparing the amplitude of the sense signal to a target amplitude to thereby produce an amplitude error as a difference therebetween; and modifying the drive signal based upon the phase error and the amplitude error so that the phase error and amplitude error are eliminated.

2. The method of claim 1, further comprising digitizing the sense signal prior to multiplication by the reference sine and cosine waves; and wherein the reference sine and cosine waves are generated in digital form.

3. The method of claim 1, wherein the low-pass filtering of the first product serves to remove intermodulation components from the reference sine wave; and wherein the low-pass filtering of the second product serves to remove intermodulation components from the reference cosine wave.

4. The method of claim 1, wherein the low-pass filtering of the first product is performed using a first decimation SINC filter; and wherein the low-pass filtering of the second product is performed using a second decimation SINC filter.

5. The method of claim 1, wherein performing the 4-quadrant CORDIC technique comprises: a) defining an index i having integer values ranging from 0 to N-1, with N being the total amount of CORDIC iterations; b) precalculating N angles θ.sub.i such that for each of the N angles, tan (θ.sub.i) = 2.sup.-i; c) determining a starting coordinate set X.sub.0, Y.sub.0 from the two SINC outputs (i.e. Y and X); d) If X>=0, setting Δθ=0 as a starting point, else if X<0, then if Y>0 setting Δθ = +180, else setting Δθ = -180. Also, rotating the starting X,Y coordinates by 180° by setting X=-X and Y=-Y; e) for a first number i=0 in the index, setting a next coordinate set X.sub.1, Y.sub.1 to be such that X.sub.1=X.sub.0-(Y.sub.0 >> 0) and Y.sub.1=Y.sub.0+(X.sub.0 >> 0) and determine a phase Δθ = Δθ - θ.sub.i if Y.sub.0 ≤ 0, but setting the next coordinate set X.sub.1,Y.sub.1 to be such that X.sub.1=X.sub.0+(Y.sub.0 >>0) and Y.sub.1=Y.sub.0-(X.sub.0 >>0)and determine the phase Δθ = Δθ + θ.sub.i, if Y.sub.0 > 0; f) incrementing i by one; g) for an ith number i in the index, setting a next coordinate set Xi, Yi to be such that X.sub.i+1=X.sub.i-(Y.sub.i >> i) and Y.sub.i+1=Y.sub.i+(X.sub.i >> i) and determine a phase Δθ = Δθ - θ.sub.i if Y.sub.i ≤ 0, but setting the next coordinate set X.sub.i+1,Y.sub.i+1 to be such that X.sub.i+i=X.sub.i+(Y.sub.i >>i) and Y.sub.i+1=Y.sub.i-(X.sub.i >>i)and determine the phase Δθ = Δθ + θ.sub.i, if Y.sub.i > 0; h) if i<N-1, return to f); and i) if i=N-1: determine the phase shift as being equal to the phase Δθ and determine the amplitude of the sense signal as being equal to K.Math.X.sub.N-1, being K = 2 .Math. i = 0 N 1 cos θ i .

6. The method of claim 1, wherein the rotation-matrix approach is performed by: a) defining an index i having integer values ranging from 0 to N-1, with N being the number of samples per reference cycle; b) determining a rotation amount as being equal to 360°/N and precalculating the (x_rot; y_rot)=(cos(360/N); sin(360/N)) rotation coordinates; c) determining a starting coordinate set X.sub.0, Y.sub.0 where x.sub.0 = cos (φ.sub.ref), y.sub.0 = sin (φ.sub.ref), with φ.sub.re.sub.f being equal to the initial phase shift for the reference waves; d) rotating the start coordinate set X.sub.0, Y.sub.0 by the rotation amount to produce a next coordinate set X.sub.1, Y.sub.1as X.sub.1 = X.sub.0 ▪ x.sub.rot - Y.sub.0 ▪ y.sub.rot and Y.sub.1 = X.sub.0 ▪ y.sub.rot + Y.sub.0 ▪ x.sub.rot; e) incrementing i by 1; f) rotate the coordinate set X.sub.1, Y.sub.1 by the rotation amount to produce an ith coordinate set X.sub.i, Y.sub.i as X.sub.i+1 = X.sub.i ▪ x.sub.rot - Y.sub.i ▪ y.sub.rot and Y.sub.i+1 = X.sub.i ▪ y.sub.rot + Y.sub.i ▪ x.sub.rot; g) if i<N-1, return to e); and h) if i=N-1, reset the index to 0, and start over from c).

7. A system for driving micro-electro mechanical systems (MEMS) device, the system comprising: a driver generating a drive signal for the MEMS device; a sensor associated with the MEMS device and generating an output indicative of movement of the MEMS device; an analog to digital converter digitizing the output of the sensor to produce a sense signal indicative of movement of the MEMS device; a reference generator using a rotation-matrix approach to generate a reference cosine wave and a reference sine wave based upon a frequency drive signal, the reference cosine wave and reference sine wave each having an amplitude of 1 and a same frequency as that of the sense signal; a processing circuit configured to: multiply the sense signal by the reference sine wave to produce a first product; multiply the sense signal by the reference cosine wave to produce a second product; low-pass filter the first product to produce a first intermediate output; low-pass filter the second product to produce a second intermediate output; and perform a 4-quadrant CORDIC technique on the first and second intermediate outputs to thereby determine a phase shift between the sense signal and the drive signal as well as an amplitude of the sense signal; a first error amplifier comparing the amplitude of the sense signal to a target amplitude to thereby produce an amplitude error as a difference therebetween; a second error amplifier comparing the phase shift to a target phase shift to produce a phase error as a difference therebetween; and controller circuitry causing modifying of the drive signal based upon the phase error and the amplitude error so that the phase error and amplitude error are eliminated.

8. The system of claim 7, wherein the controller circuitry comprises: a phase controller generating a control signal based upon the phase error; a programmable oscillator, generating the frequency drive signal based upon the control signal, the driver modifying phase of the drive signal based upon the frequency drive signal such that the phase error is eliminated; and an amplitude controller generating a voltage drive signal to the driver based upon the amplitude error, the driver modifying amplitude of the drive signal based upon the voltage drive signal such that the amplitude error is eliminated.

9. The system of claim 8, wherein the programmable oscillator comprises a phase locked loop (PLL).

10. The system of claim 7, wherein the processing circuit is an application specific integrated circuit (ASIC).

11. The system of claim 7, wherein the low-pass filtering of the first product performed by the processing circuit serves to remove intermodulation components from the reference sine wave; and wherein the low-pass filtering of the second product performed by the processing circuit serves to remove intermodulation components from the reference cosine wave.

12. The system of claim 7, wherein the low-pass filtering of the first product is performed by the processing circuit using a first decimation SINC filter; and wherein the low-pass filtering of the second product is performed by the processing circuit using a second decimation SINC filter.

13. The system of claim 7, wherein the processing circuit performs the 4-quadrant CORDIC technique by: a) defining an index i having integer values ranging from 0 to N-1, with N being the total amount of CORDIC iterations; b) precalculating N angles θ.sub.i such that for each of the N angles, tan (θ.sub.i) = 2.sup.-i; c) determining a starting coordinate set X.sub.0, Y.sub.0 from the two SINC outputs (i.e. Y and X); d) If X>=0, setting Δθ=0 as a starting point, else if X<0, then if Y>0 setting Δθ = +180, else setting Δθ = -180. Also, rotating the starting X,Y coordinates by 180° by setting X=-X and Y=-Y; e) for a first number i=0 in the index, setting a next coordinate set X.sub.1, Y.sub.1 to be such that X.sub.1=X.sub.0-(Y.sub.0 >> 0) and Y.sub.1=Y.sub.0+(X.sub.0 >> 0) and determine a phase Δθ = Δθ - θ.sub.i if Y.sub.0 ≤ 0, but setting the next coordinate set X.sub.1,Y.sub.1 to be such that X.sub.1=X.sub.0+(Y.sub.0 >> 0) and Y.sub.1=Y.sub.0-(X.sub.0 >>0)and determine the phase Δθ = Δθ + θ.sub.i, if Y.sub.0 > 0; f) incrementing i by one; g) for an ith number i in the index, setting a next coordinate set Xi, Yi to be such that X.sub.i+1=X.sub.i-(Y.sub.i >> i) and Y.sub.i+1=Y.sub.i+(X.sub.i >> i) and determine a phase Δθ = Δθ - θ.sub.i if Y.sub.i ≤ 0, but setting the next coordinate set X.sub.i+1,Y.sub.i+1 to be such that X.sub.i+1=X.sub.i+(Y.sub.i >>i) and Y.sub.i+1=Y.sub.i-(X.sub.i >>i)and determine the phase Δθ = Δθ + θ.sub.i, if Y.sub.i > 0; h) if i<N-1, return to f); and i) if i=N-1: determine the phase shift as being equal to the phase Δθ and determine the amplitude of the sense signal as being equal to K.Math.X.sub.N-1, being K = 2 .Math. i = 0 N 1 cos θ i .

14. The system of claim 7, wherein the processing circuit performs the rotation-matrix by: a) defining an index i having integer values ranging from 0 to N-1, with N being the number of samples per reference cycle; b) determining a rotation amount as being equal to 360°/N and precalculating the (x_rot; y_rot)=(cos(360/N); sin(360/N)) rotation coordinates; c) determining a starting coordinate set X.sub.0, Y.sub.0, where x.sub.0 = cos (φ.sub.ref), y.sub.0 = sin (φ.sub.ref), with φ.sub.ref being equal to theinitial phase shift for the reference waves; d) rotating the start coordinate set X.sub.0, Y.sub.0 by the rotation amount to produce a next coordinate set X.sub.1, Y.sub.1as X.sub.1 = X.sub.0 ▪ x.sub.rot - Y.sub.0 ▪ y.sub.rot and Y.sub.1 = X.sub.0 ▪ y.sub.rot + Y.sub.0 ▪ x.sub.rot; e) incrementing i by 1; f) rotate the coordinate set X.sub.1, Y.sub.1 by the rotation amount to produce an ith coordinate set X.sub.i, Y.sub.i as X.sub.i+1 = X.sub.i ▪ x.sub.rot - Y.sub.i ▪ y.sub.rot and Y.sub.i+1 = X.sub.i ▪ y.sub.rot + Y.sub.i ▪ x.sub.rot; g) if i<N-1, return to e); and h) if i=N-1, reset the index to 0, and start over from c).

15. A method of operating a micro-electro mechanical systems (MEMS) device, comprising: generating a reference cosine wave and a reference sine wave, the reference cosine wave and reference sine wave each having an amplitude of 1 and a same frequency as that of a sense signal indicative of movement of the MEMS device; multiplying the sense signal by the reference sine wave to produce a first product; multiplying the sense signal by the reference cosine wave to produce a second product; filtering the first product to produce a first intermediate output; filtering the second product to produce a second intermediate output; and performing a technique on the first and second intermediate outputs to thereby determine a phase shift between the sense signal and the drive signal as well as an amplitude of the sense signal; comparing the phase shift to a target phase shift to produce a phase error as a difference therebetween; comparing the amplitude of the sense signal to a target amplitude to thereby produce an amplitude error as a difference therebetween; and modifying a drive signal for the MEMS device based upon the phase error and the amplitude error so that the phase error and amplitude error are eliminated.

16. The method of claim 15, further comprising digitizing the sense signal prior to multiplication by the reference sine and cosine waves; and wherein the reference sine and cosine waves are generated in digital form.

17. The method of claim 15, wherein the filtering of the first product serves to remove intermodulation components from the reference sine wave; and wherein the filtering of the second product serves to remove intermodulation components from the reference cosine wave.

18. The method of claim 15, wherein the filtering of the first product is performed using a first decimation filter; and wherein the filtering of the second product is performed using a second decimation filter.

Description

BRIEF DESCRIPTION OF THE DRAWINGS

[0085] FIG. 1A is a block diagram of a laser scanning projector utilizing prior art control loops.

[0086] FIG. 1B is a graph showing the drive signal and sense signal of FIG. 1A and the phase shift therebetween.

[0087] FIG. 1C is a graph used in explaining a first known technique for estimating the phase shift between the drive signal and the sense signal of FIG. 1A.

[0088] FIG. 1D is a graph used in explaining a second known technique for estimating the phase shift between the drive signal and the sense signal of FIG. 1A.

[0089] FIG. 1E is a graph used in explaining a first known technique for estimation of the amplitude of the sense signal of FIG. 1A.

[0090] FIG. 1F is a graph used in explaining a second known technique for estimation of the amplitude of the sense signal of FIG. 1A.

[0091] FIGS. 2A-2B are graphs used in explaining a digital lock-in amplifier approach disclosed herein for use in determining the phase shift between drive and sense signals in a resonant MEMS device.

[0092] FIG. 3 is a schematic block diagram of a laser scanning projector disclosed herein utilizing computationally less intensive control loops.

[0093] FIG. 4 is a trigonometric circle used in explaining the generation of the reference cosine and sine waves by the reference generator of FIG. 3.

[0094] FIG. 5 is a graph showing the generated reference sine and cosine waves as generated using the technique described with reference to FIG. 4.

[0095] FIG. 6 is a graph showing the spectra of the generated reference sine wave.

[0096] FIG. 7 contains graphs showing the output provided by the low-pass filter of FIG. 3 when the reference waves are generated by the reference generator as being sinusoidal, square, and triangular, for different sampling rates.

[0097] FIG. 8 is a graph showing the frequency response of the signal x(t) generated by the first demodulator of FIG. 3.

[0098] FIG. 9 is a graph showing the frequency response of the signal x(t) generated by the second demodulator of FIG. 3.

[0099] FIG. 10 is a graph illustrating the frequency response of a decimating SINC filter such as may be used for the low-pass filters of FIG. 3.

[0100] FIG. 11A is a graph showing the signals x(t) and y(t) generated by the demodulators of FIG. 3.

[0101] FIG. 11B is a graph showing the outputs X and Y of the filters of FIG. 3.

[0102] FIGS. 12A-12D are trigonometric circles used to describe the CORDIC technique used to recover the phase shift and amplitude values from the outputs X and Y of the filters of FIG. 3.

DETAILED DESCRIPTION

[0103] The following disclosure enables a person skilled in the art to make and use the subject matter disclosed herein. The general principles described herein may be applied to embodiments and applications other than those detailed above without departing from the spirit and scope of this disclosure. This disclosure is not intended to be limited to the embodiments shown, but is to be accorded the widest scope consistent with the principles and features disclosed or suggested herein.

[0104] Techniques to be described herein are based upon the combination of a digital lock-in amplifier approach with a numerical method to yield accurate estimations of the amplitude and phase of a sense signal obtained from a movement sensor associated with a resonant MEMS device such as a MEMS mirror. The techniques described herein are efficient from a computational point of view, in a manner which is suitable for applications in which the implementing hardware is to follow size and power consumption constraints.

[0105] First, the mathematical underpinnings of the techniques described herein will be discussed, and then the practical application and realization of those techniques will be discussed together with the uses thereof in real world applications to provide for accurate control of resonant MEMS mirrors using these techniques.

[0106] Illustrated in FIGS. 2A-2B is the digital lock-in amplifier approach. Shown in FIG. 2A are a digitized version of the sense signal as well as a reference signal, both at the same frequency. If these two signals are multiplied, the result is a signal with a mean value that is proportional to their amplitudes as well as the phase shift between the signals. Thus, notice that the result of this multiplication is equal to the two estimations (amplitude and phase of a sense signal) that it is desired to accurately and quickly perform. In the example of FIG. 2A, there is no phase shift between the sense signal and reference signal, so the mean value of the resulting wave can be calculated as:

[00009]Mean=AsenseAref2

[0107] Turn now to the example of FIG. 2B, where the sense signal and reference signal are in phase quadrature (e.g., phase shifted by 90°). Notice that in this example, the mean value of the product of the sense signal and reference signal is zero.

[0108] The mathematics yielding this result are now explained. The sense signal can be mathematically represented as:

[00010]senset=Asensesinωsenset+φsense

[0109] Here, Asense is the amplitude of the sense signal, ω.sub.sense is the frequency of the sense signal, and φ.sub.sense is the phase of the sense signal.

[0110] The reference signal can be mathematically using the following two equations:

[00011]cosreft=Arefcosωreft+φref

[00012]sinreft=Arefsinωreft+φref

[0111] Here, Aref is the amplitude of the reference signal, ω.sub.ref is the frequency of the reference signal, and φ.sub.ref is the phase of the reference signal.

[0112] The results of multiplication of the sense signal by the reference signal yields x and y values, which can be mathematically represented as:

[00013]yt=sensetcosreft=ArefAsense2sinΔφ+sin2ωreft+φsense+φref

[00014]xt=sensetsinreft=ArefAsense2cosΔφ+cos2ωreft+φsense+φref

[0113] Here, Aref is the amplitude of the reference signal, Asense is the amplitude of the sense signal, ω.sub.ref is the frequency of the reference signal, φ.sub.sense is the phase of the sense signal, φ.sub.ref is the phase of the reference signal, and Δφ is the difference between φ.sub.sense and φ.sub.ref.

[0114] Therefore, as can be seen, the result includes expressions proportional to amplitude, as well as the phase shift, and an intermodulation product (ω.sub.ref .square-solid. t). The intermodulation product represents the oscillations seen in the product (demodulator output) shown in FIGS. 2A and 2B, and it is desired to remove these oscillations from the output.

[0115] Assuming that ω.sub.ref = ω.sub.sense and that Aref = 1, the average of y(t), denoted Y, as obtained using suitable low-pass filtering can be mathematically represented as:

[00015]Y=<yt>=Asense2sinΔφ

[0116] Likewise assuming that ω.sub.ref = ω.sub.sense and that Aref = 1, the average of x(t), denoted X, as obtained using suitable low-pass filtering can be mathematically represented as:

[00016]X=<xt>=Asense2cosΔφ

[0117] From this, using simple math, the amplitude of the sense signal can be recovered as:

[00017]Asense=2X2+Y2

[0118] Similarly, the phase shift between the sense signal and reference signal can be recovered as:

[00018]Δφ=tan1YX

[0119] Hardware for use in implementing the estimation of the phase and amplitude of the sense signal, and then using that estimation in operating a laser scanning projector 100, is now described with additional reference to FIG. 3.

[0120] The laser scanning projector 100 includes a laser source 99 operated and driven by a laser driver 98 to emit a modulated laser beam at a resonant MEMS mirror 11 (e.g., micromirror). The MEMS mirror 11 is driven at resonance by a drive signal Drv generated by drive circuitry 12. A sensor 13, such as a piezoresistive based sensor, is used to generate a sense signal Sns in response to the movements of the MEMS mirror 11. A reference generator 97 generates reference signals for use by feedback circuitry 101. The feedback circuitry 101 receives the reference signals from the reference generator 97 and the sense signal Sns as input, and from them estimates the amplitude Asense of the sense signal and the phase shift Δφ of the sense signal.

[0121] A first error amplifier 22 compares the phase shift Δφ to a target phase shift φtarget to determine a phase error φerror. A phase controller 23 generates a new frequency setpoint to be used for tuning the driving frequency which may be generated from a fractional phase locked loop 24, in which case such tuning is achieved by changing the fractional input (PLLfrac). It is understood anyway that even though PLL circuitry is referred to herein, the driving frequency could also be generated by any controllable oscillator (such as a Voltage-Controlled Oscillator VCO).

[0122] The reference generator 97 receives the frequency signal Fdrive from the PLL 24 so that the frequency of the reference signals generated by the reference generator 97 matches the frequency of the drive signal Drv.

[0123] A second error amplifier 32 compares the amplitude Asense to an amplitude target Atarget to determine an amplitude error Aerror. An amplitude controller 33 generates a voltage signal Vdrive instruction the drive circuitry 12 at what amplitude to generate the drive signal Drv.

[0124] An analog to digital converter (ADC) 96 digitizes the sense signal Sns. The feedback circuitry 101 includes a first multiplication circuit 102 (e.g., a modulator) that receives the digitized sense signal Sns, which is mathematically represented as

[00019]senset=Asensesinωsenset+φsense

[0125] Here, with sense(t) and below with the following equations and expressions, since the operations are performed in the digital domain, t = nT, with T being the sampling period and n being the index of the nth sample. The first multiplication circuit 102 also receives a digital reference sine wave from the reference generator 97, which is mathematically represented as:

[00020]yref=sinωreft+φref

[0126] The first multiplication circuit 12 multiplies these two signals to yield:

[00021]xt=sensetsinreft=1Asense2cosΔφcos2ωreft+φsense+φref

[0127] The expression x(t) is filtered by low-pass filter 103 within the feedback circuit 101 to produce X, mathematically represented as:

[00022]X=<xt>=Asense2cosΔφ

[0128] The feedback circuit 101 includes a second multiplication circuit 104 (e.g., a modulator) that receives the digitized sense signal sense(t), and also receives a digital reference cosine wave, the reference cosine wave being mathematically represented as:

[00023]xref=cosωreft+φref

[0129] The second multiplication circuit 104 multiplies these two signals to yield:

[00024]yt=sensetcosreft=1Asense2sinΔφ+sin2ωreft+φsense+φref

[0130] The expression y(t) is filtered by low-pass filter 105 within the feedback circuit 101 to produce Y, mathematically represented as:

[00025]Y=<yt>=Asense2sinΔφ

[0131] X and Y are passed to an amplitude and phase estimation block 106 within the feedback circuit 101. The amplitude and phase estimation block 106 calculates the amplitude Asense and phase Δφ of the sense signal sense(t) as:

[00026]Asense=2X2+Y2

[00027]Δφ=tan1YX

[0132] Generation of the reference signals x.sub.ref and y.sub.ref by the reference generator 97 is now described with initial reference to FIG. 4. Typically, when sinusoidal signals are generated, a summation approximation, such as the Taylor Series, may be used. However, these approximations are not precise enough for use in performing the techniques described herein. Furthermore, producing these approximations utilizes excessive processing power, which is particularly detrimental for applications where more limited processing capabilities are available. Indeed, using the Taylor series or polynomial approximations has too many drawbacks. As such, a new method for generating sinusoidal signals for use as reference signals has been developed. The new method relies upon trigonometric relationships to yield accurate results without the use of approximation, and precision being the function of fixed point implementations (e.g., no algorithmic error is introduced).

[0133] Referring to FIG. 4, a sine wave over time is depicted on a trigonometric circle. Starting from a generic point, here P.sub.0, there is an initial reference phase φ.sub.ref with respect to the x-axis, this initial phase being a use-defined entry such that this initial reference phase is chosen to suit the present application. Then, in the next iteration, there is point P.sub.1, then point P.sub.2, and so on, accomplished using a rotation of the vector. A rotation can be performed using trigonometric relationships, knowing the amount of rotation to be performed and the actual phase values at the current step. For example, assume there will be 16 samples of the sense signal Sns per mirror cycle, meaning that the output data rate (ODR) is 16, and that 16 data points for a reference sine wave are therefore to be generated so that the conditions of ω.sub.ref = ω.sub.sense and A.sub.ref = 1 are fulfilled, enabling the calculation of x(t) and y(t) as described above to be performed.

[0134] The amount of rotation to be performed at each step can be calculated as:

[00028]φrot=360°ODR=360°16=22.5°

[0135] Therefore, knowing the amount of rotation per step and the initial phase-point P.sub.0 calculated as:

[00029]P0x0;y0,

[00030]wherex0=cosφref,y0=sinφref

[0136] This allows the calculation of the phase shift at each rotation and its use to calculate the sine and cosine waves as:

[00031]φi+1=φi+Δφ.fwdarw.cosφi+1=cosφicosφrotsinφisinφrotsinφi+1=cosφisinφrot+sinφicosφrot,

[00032]withi=0,.Math.,ODR1.

[0137] It is to be understood that cos(φ.sub.rot) = x.sub.rot and sin(φ.sub.rot) = y.sub.rot, keeping in mind that φ.sub.rot is known as being φ.sub.rot = 360°/ODR, with ODR being 16 in this example. Therefore, using the known values of cos(φ.sub.rot) and sin(φ.sub.rot), and the known initial point P.sub.0(x.sub.0;y.sub.0), the data points used to form the sine and cosine waves shown in FIG. 5 can be determined. The advantage of this technique is that the generation of sine and cosine wave is performed without approximations and is performed simply (i.e. using only multiplicative terms which are already precalculated as xrot, yrot and the (x.sub.0;y.sub.0) = (cos(φ.sub.ref); sin(φ.sub.ref)). Therefore, the values of the reference cosine wave x.sub.ref and reference sine wave y.sub.ref, as used by the multiplication circuits 102 and 104 described above, have been determined through this technique, using simple and computationally un-intensive trigonometry, allowing the performance of the estimation techniques discussed above by fixed-point calculation hardware that does not consume much area. Stated another way, using this technique to calculate the values of the reference cosine wave and reference sine wave, the physical area of the circuitry required to generate the reference cosine and sine waves is reduced as compared to the prior art.

[0138] Additionally, the precision of this technique for calculating the values of the reference sine and cosine waves is high. Consider that if the output data rate ODR were to be infinite, there would be an infinite number of values produced for the reference cosine and sine waves, and therefore such waves would precisely mathematically match actual-continuous waves. On the other hand, if a prior art technique such as the Taylor series were to be used, such precision could never be achieved, as Taylor series always produces an approximation.

[0139] The spectrum of the generated reference sine wave may be observed in FIG. 6. Here, the frequency of the drive signal Drv (shown as Fref) is 20 kHz, and therefore the frequency of the reference sine wave is 20 kHz. However, harmonics occur due to the quantization of the reference sine wave, with the amplitude of the harmonics being dependent upon the number of bits available for the calculations The effect of these harmonics and how to handle them will be explained in detail later herein.

[0140] Shown in FIG. 7 is a comparison of the output of the low-pass filters 103 and 105 when using sinusoidal reference waves as compared to square or triangular reference waves for the case of ODR being 16, as well as for the case of ODR being 160. The theoretical scaling factor for the reference sine wave is Aref/2, for the square wave is 2.Math.Aref/π, and for the triangular wave is 2.Math.Aref/π.sup.2. As can be observed in FIG. 7, with a low sampling frequency (e.g., ODR=16), both the square wave and the triangular wave cannot be perfectly reproduced because they are not band-limited. As such, in the digital domain, all the infinite harmonics within the bandwidth cannot be included due to the Nyquist limit. Sine waves, on the other hand, are band-limited and so can be perfectly reproduced even when low sampling frequencies are available. The result of using either square or triangular wave as reference instead of sinusoids is that the scaling factor would be different than its theoretical value, with this effect being even more pronounced for the square wave since the harmonics decrease as 1/n for the square wave but 1/n.sup.2 for the triangular wave. This would ultimately lead to increased error in the estimation of the phase shift and amplitude of the sense signal Sns. Furthermore, if a square wave or triangular wave were used as the reference wave, harmonics carried by the sense signal Sns would also be demodulated, adding more information to the output that is not information about the fundamental components of the sense signal Sns. As such, the generation of reference sinusoidal waves is used herein.

[0141] Estimation of the phase Δφ by the feedback circuitry 101 is now described. As a reminder, the sense signal Sns can be mathematically represented as:

[00033]senset=Asensesinωsenset+φsense+OSsense

[0142] Here, OS.sub.sense is the offset that might appear as an additive term in the sense signal Sns.

[0143] As explained above, the generation of the reference cosine and sine reference signals undesirably includes harmonics due to both quantization and limited ODR. As a result, for example, the cosine reference signal can be mathematically represented as:

[00034]cosreft=cosωreft+φref+Arefcos2ωreft+φref+.Math.

[0144] Here, the A′ref .square-solid. cos(2ω.sub.ref .square-solid. t + φ′.sub.ref) term and those following represent the harmonics present due to quantization. The calculation of y(t) then yields:

[00035]yt=sensetcosreft

[00036]=Asense2sinΔφ+sin2ωreft+φsense+φref+ArefAsense2

[00037]sin3ωreft+φsense+φref+sin3ωreft+φsense+φref+.Math.

[00038]+OSsense2cosωreft+φref+.Math.

[0145] This yields the desired fundamental components of the sense signal Sns, namely the

[00039]Aref2

and sin(Δφ) terms, but also undesired intermodulation products (the other terms) that arise due to the difference between ω.sub.sense and ω.sub.ref, 2ω.sub.ref, etc.

[0146] Similarly, the sine reference signal can be mathematically represented as:

[00040]sinreft=sinωreft+φref+Arefsinωreft+φref+.Math.

[0147] The calculation of x(t) then yields:

[00041]xt=sensetsinreft

[00042]=Asense2cosΔφcos2ωreft+φsense+φref+ArefAsense2

[00043]cos3ωreft+φsense+φref+cosωreft+φsense+φref+.Math.

[00044]+OSsense2sinωreft+φref+.Math.

[0148] Here too, this yields the desired fundamental components of the sense signal Sns, namely the

[00045]Aref2

and cos(Δφ) terms, but also undesired intermodulation products (the other terms) that arise due to the difference between ω.sub.sense and ω.sub.ref, 2ω.sub.ref, etc.

[0149] The results of the multiplications may be seen for the sample of the cosine reference wave in FIG. 8, where the desired data (that is the DC component) can be observed together with the intermodulation products (starting shortly before a frequency of 10.sup.4 Hz), and for the sample of the sine reference wave in FIG. 9, wherein the desired data (again, the DC component) can be observed together with the intermodulation products (also starting shortly before a frequency of 10.sup.4 Hz).

[0150] It is desired to cancel out these resulting intermodulation components in x(t) and (y). To do this, the low-pass filters 103 and 105 should have zeroes at harmonics in the reference signals, as shown in FIG. 10, to thereby filter out the intermodulation components. Since the reference sine and cosine signals are internally generated, their spectrum is known, and therefore the proper placement of the zeroes can easily be determined. For example, the zeroes are placed at ω.sub.ref, 2ω.sub.ref, 3ω.sub.ref, etc., because those are the expected location of the harmonics given that ω.sub.ref is known. The filters 103 and 105 may therefore be suitable ODR-decimation SINC filters.

[0151] The inputs x(t) and y(t) to the filters 103 and 105 can be observed in FIG. 11A, and the outputs of X and Y can be observed in FIG. 11B. After filtering, X thus becomes:

[00046]X=<xt>=Asense2cosΔφ

[0152] After filtering, Y thus becomes:

[00047]Y=<yt>=Asense2sinΔφ

[0153] From X and Y, Asense and Δφ can be recovered. This could be performed mathematically in the digital domain as:

[00048]Asense=2X2+Y2; and

[00049]Δφ=tan1YX

[0154] This would be easily performable in the case where the amplitude and phase estimation block 106 are implemented in a microprocessor. However, consider the case where the amplitude and phase estimation block 106 is to be implemented in a small application specific integrated circuit (ASIC) with low-power consumption and small area constraints, with poor computational abilities. In such a case, the above calculations of Asense and Δφ cannot be easily performed without modifying the constraints of the ASIC.

[0155] The implementation of the functions of the amplitude and phase estimation block 106 utilizing techniques easily performable by a small ASIC with low-power consumption and small area constraints is now described.

[0156] Consider the COordinate Rotation DIgital Computer (CORDIC) technique, a simple and efficient technique that can be used to calculate trigonometric functions, hyperbolic functions, square roots, multiplications, divisions, exponentials, and logarithms, using only computationally un-intensive subtraction and shift operations of the implementing ASIC. The starting point for the application of CORDIC to amplitude and phase estimation is the rotation matrix M, which is mathematically equivalent to X and Y described above, and can be represented as:

[00050]M=cosΔφsinΔφsinΔφcosΔφ

[0157] Starting from the rotation matrix M, factorization by cos (Δφ) can be performed to yield:

[00051]M=cosΔφ1tanΔφtanΔφ1

[0158] The idea is to achieve Δφ through successive approximations obtained by a linear combination of N precalculated angles θ.sub.i, with the angles θ.sub.i being chosen such that their tangent values are powers of 2, such that tan (θ.sub.i) = 2.sup.-i. This reduces the matrix to a form where iterations can be calculated using shifts rather than multiplications.

[0159] Through this technique, Δφ is ultimately computed as:

[00052]Δφ.Math.i=0N1σiθi,

where σ.sub.i is +1 or -1 depending upon the sign of the y.sub.i-1 component of the rotation vector at the previous iteration.

[0160] This would work well if:

[00053]Δφπ2,π2

[0161] However, for a 4-quadrant application, modifications are to be made.

[0162] Refer now to the trigonometric circle shown in FIG. 12A, where a first point or vector P.sub.0 having the cosine, sine coordinates of (x.sub.0, y.sub.0) is shown, as is a second point or vector P.sub.1 having the cosine, sine coordinates of (x.sub.1, y.sub.1) is shown. These points are the output of the filters 103 and 105 at the beginning and after the first CORDIC iteration respectively - note that P.sub.0 is therefore calculated as

[00054]Asense2cosΔφ,Asense2sinΔφ.

The angular distance between the vector P.sub.0 and the x-axis is the Δφ that it is desired to recover.

[0163] This is performed by successive approximation using the rotation matrix M. For example, for iteration i=1, P.sub.0 can be rotated by θ.sub.1 to reach P.sub.1, as shown in FIG. 12A. For the next iteration, i=2, P.sub.1 can be rotated by θ.sub.2 to reach P.sub.2, having the cosine, sine coordinates of (x.sub.2, y.sub.2), as shown in FIG. 12B. For the next iteration, i=3, P.sub.2 can be rotated by θ.sub.3 to reach P.sub.3, having the cosine, sine coordinates of (x.sub.3, y.sub.3), as shown in FIG. 12C. For the Nth and last iteration, i=N, P.sub.N is on the x-axis and has coordinates of (xn, 0).

[0164] This has been a series of approximated rotations by ±θ.sub.i, ±θ.sub.i+1, ±θ.sub.i+2, ±θ.sub.i+3, etc (with the actual signs of each rotation depending on the starting point as well as being decided at each iteration), up until the last point which will have approximately a 0 phase with an accuracy that depends on the number of iterations N (algorithmic error) and the fixed-point implementation. If these rotations are summed, the result will be a composition of angles that yield Δφ.

[0165] Thus, the technique has started with a vector that is Δφ degrees away from the x-axis, and at each iteration (±θ.sub.i, ±θ.sub.i+1, ±θ.sub.i+2, ±θ.sub.i+3, etc), the resulting phase becomes closer to 0. Thus, Δφ is approximated by summation of σ.sub.iθ.sub.i from 0 to N-1, with σ.sub.i being +1 or -1 dependent upon the y.sub.i-1 component of the rotation vector at the previous iteration, and with θ.sub.i being the rotation angle at each iteration. So, θ.sub.i is the angle whose tangent is 2.sup.-i. Thus, Δφ is recomposed by as the series of smaller angles that when combined together with the appropriate sign, with the rotations being performed with the tangents of those angles, which are powers of 2 as explained. Therefore, this becomes multiplications by powers of 2, which are implemented as shifts, and shifts as explained above are efficient in terms of computational complexity and are capable of being performed by simple ASICS.

[0166] The successive approximation can be summed up as follows: [0167] 1. The starting point is the X, Y coordinates from the outputs of the filters 103 and 105, mathematically represented as as explained above [0168] 2. If X>=0, set Δθ=0 and go to the next step. Instead, If X<0, then if Y>0 set Δθ = +180, else set Δθ = -180. Also, rotate the starting X,Y coordinates by 180° by setting X=-X and Y=-Y. [0169] 3. Start from Δθ.sub.i from step 2., and repeat from i=0 to N-1:

[0170] The phase contributions of the partial angles Δθ are recorded in a lookup table. The lookup table is used together with the starting point X, Y and the described operations are performed at each iteration. After an infinite number of iterations, the phase will be exactly at 0. It has been found that 12 to 18 iterations provide sufficient accuracy for the laser scanning projector 100.

[0171] After the last iteration, Δφ and A.sub.sense are determined as:

[00058]ΔφΔθ,Asense=KX, where K depends on N and is known a priori as: 2.Math.i=0N1cosθi

[0172] Using the above techniques, because the phase and amplitude (which is indicative of the opening angle of the MEMS mirror) are known upon commencement of operation, proper settings for Fdrive and Vdrive are quickly determined, making calibration quick and easy. Thus, in addition to reducing the computational complexity utilized for proper control of the MEMS mirror 11, lock time is decreased due to the quick determination of proper settings for Fdrive and Vdrive. Moreover, the amplitude and phase estimation are run in parallel and so are both control loops. Additionally, since the phase estimation is not limited by the resolution of the PLL counts, the above techniques are usable even with mirrors having a high resonance frequency, and in fact, are usable with any resonance MEMS device and are not limited to MEMS mirrors. Still further, the stability of the output provided here is more stable than would be provided by any analog control because analog lock-in amplifiers, though still implemented, suffer from technological and physical limitations (e.g., temperature deviation from the transistors used for demodulation, non-linearities, etc) which digital implementations are insensitive to. In addition the reference signal generation is reliable as it is based on using the same clock source as other components within the device.

[0173] The described functions and blocks of the feedback circuit 101 may be performed by a field programmable gate array (FPGA) or application specific integrated circuit (ASIC), for example.

[0174] Note that the above scheme permits precise control of the MEMS mirror 11 through the described hardware performing the described functions, and that the above scheme reduces the computational resources utilized to obtain precise control of the MEMS mirror 11 (e.g., reduces computational intensity of the functions performed that are used to precisely control the MEMS mirror 11).

[0175] Finally, it is clear that modifications and variations may be made to what has been described and illustrated herein, without thereby departing from the scope of this disclosure, as defined in the annexed claims.

[0176] While the disclosure has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this disclosure, will appreciate that other embodiments can be envisioned that do not depart from the scope of the disclosure as disclosed herein. Accordingly, the scope of the disclosure shall be limited only by the attached claims.