This disclosure is related to the field of resonant MEMS device control and, in particular, is related to techniques for estimating the phase and amplitude of a sense signal containing information about the movement of a resonant MEMS device, said techniques being performable using computationally simple operations.
A laser scanning projector is a small, portable electronic device. Laser scanning projectors are typically paired to, or incorporated within, user devices such as smart glasses, smartphones, tablets, laptops, depth sensing cameras, or LIDAR, and used to project virtual and augmented reality, documents, images, or video stored on those user devices onto a projection surface, such as a wall, holographic surface, or inner display surface of virtual or augmented reality glasses (for example a wave guide in a coupling window).
Laser scanning projectors are also incorporated within distance determination systems within vehicles to determine information about the vehicles relative to their surroundings, permitting the creation of advanced driver assistance systems.
Such laser scanning projectors typically include a projection subsystem and an optical module. The paired user device serves an image stream (e.g., a video stream, or a pattern projected into an area used for distance determination) to the projection subsystem. The projection subsystem properly drives the optical module to project the image stream onto the projection surface or environment for viewing.
In greater detail, typical optical modules are comprised of a laser source and one or more microelectromechanical (MEMS) mirrors that scan the laser beam produced by the laser source across the projection surface in a projection pattern. By modulating the laser beam (in the case of an image projection system) according to its position on the projection surface, while the laser beam is scanned in the projection pattern, the image stream is displayed.
The projection subsystem controls the driving of the laser source and the driving of the movement of the one or more MEMS mirrors. Typically, the driving of movement of one of the MEMS mirrors is at, or close to, the resonance frequency of that MEMS mirror.
Monitoring of the mirror movement of the one or more MEMS mirrors is performed by the projection subsystem to provide feedback about the operation of the mirror movement so that the driving of the movement of the one or more MEMS mirrors may be adjusted accordingly to maintain the movement as desired. For example, feedback may be used to maintain the one or more MEMS mirrors operating at a given opening angle.
A sample prior art laser scanning projector 10 is now described with reference to
Phase feedback circuitry 20 receives the drive signal Drv and sense signal Sns as input, and generates therefrom a frequency signal Fdrive instructing the drive circuitry 12 at what frequency and phase to generate the drive signal Drv.
Amplitude feedback circuitry 30 receives the sense signal Sns as input and from it generates a drive voltage signal Vdrive instructing the drive circuitry 12 at what voltage to generate the drive signal Drv.
Details of the phase feedback circuitry 20 and amplitude feedback circuitry 30 will be given below, but first a mathematical discussion of operation of MEMS mirrors at resonance is presented.
A resonant MEMS mirror can be considered to behave as a second-order filter, mathematically represented as:
Here, ω0 represents the natural frequency of the mirror, Q is the quality factor of the mirror and H0 is the DC gain.
The magnitude response of a resonant MEMS mirror represents its opening angle and can be mathematically represented as:
Here, ω represents the current frequency of the resonant MEMS mirror (as determined from a sense signal generated by a mirror sensor associated with the mirror).
The phase response φ of a resonant MEMS mirror represents the delay between the drive signal and the mirror, and can be mathematically represented as:
At resonance, a resonant MEMS mirror as indicated by the sense signal responds with a specific phase value with respect to the driving signal, and the drive signal and sense signal are in phase quadrature.
When a resonant MEMS mirror is operated at resonance, for a given voltage of the drive signal, the resonant MEMS mirror is opened to a wider opening angle and, for a specific opening angle, requires a lower voltage drive signal. During operation, the frequency of the drive signal is to therefore to be set to maintain the drive signal and the sense signal as being in phase quadrature to maintain resonance, and the voltage of the drive signal is to be set to maintain the drive signal at a specific voltage to maintain a desired opening angle of the resonant MEMS mirror.
Therefore, during operation of the laser scanning projector 10, the phase feedback circuitry 20 generates the frequency signal Fdrive based upon the feedback of the drive signal Drv and the sense signal Sns so as to maintain the drive signal Drv and sense signal Sns in phase quadrature, and the amplitude feedback circuitry 30 generates the drive voltage signal Vdrive so as to maintain the voltage of the drive signal at a desired voltage to achieve a desired opening angle of the MEMS mirror 11.
The phase feedback circuitry 20 includes a phase estimator 21 that receives the drive signal Drv and sense signal Sns, and generates therefrom a phase φ, indicative of a phase shift between Drv and Sns. An error amplifier 22 compares the phase φ to a target phase φtarget, and generates a phase error φerror as an indication of the difference between φ and φtarget. A phase controller 23 generates a tuning signal PLLfrac to adjust the output frequency generated by a fractional phase locked loop (PLL) 24 from which the frequency signal Fdrive is adjusted to bring φerror to zero. The frequency of the drive signal Drv as generated by the drive circuitry 12 is set to match the frequency of Fdrive. It is understood that even though we PLL circuitry 24 is referred to herein, the driving frequency could also be generated by any programmable oscillator, and that the use of a PLL is simply an example.
The amplitude feedback circuitry 30 includes an amplitude estimator 31 that receives the sense signal Sns as input and generates an amplitude A as being representative of the amplitude of the sense signal Sns. An error amplifier 32 compares the amplitude A to a target amplitude Atarget and generates an amplitude error signal Aerror as an indication of the difference between A and Atarget. An amplitude controller 33 generates a voltage signal Vdrive that drives Aerror to zero. The amplitude of the drive signal Drv as generated by the drive circuitry 12 is set to match the amplitude of Vdrive.
The estimation of the phase shift between the drive signal Drv and sense signal Sns is now described.
A sample drive signal and sense signal are shown in
The sense signal can be mathematically represented as:
Here, Asense is the amplitude of the sense signal, ωsense is the frequency of the sense signal, and φsense is the phase of the sense signal with respect to the driver.
A first known technique for estimating the phase shift Φ between the drive signal and the sense signal is described with reference to
A second known technique for estimating the phase shift between the drive signal and the sense signal is described with reference to
The limitations here are that an accurate estimation of the amplitude Asense of the sense signal is required for normalization, and that the samples themselves and the timing thereof must be accurate in order to yield an accurate estimation of the phase shift.
A first known technique for estimation of the amplitude of the sense signal is shown in
A second known technique for estimation of the amplitude of the sense signal is shown in
In the above examples of phase shift and amplitude estimation that rely upon samples, bandpass filtering is performed to clear noise, such bandpass filtering requiring a high amount of computational resources in order to provide the needed performance, adding a further challenge and drawback to the usage of such techniques. Also, some of the above examples require that the MEMS mirror be locked at resonance prior to opening angle determination, which involves obtaining additional samples placed at sense peaks, adding even more complexity.
Prior solutions have been found to yield poor results when estimations (and control loops are implemented directly on hardware like application specific integrated circuits (ASICs), where few computational resources are available, and both area and power consumption are challenging aspects (meaning high clock frequencies and sampling rates cannot be afforded).
As such, current techniques for phase shift and amplitude estimation (e.g., current implementations of the phase estimator 21 and amplitude estimator 31 described above with reference to
Disclosed herein is a method of operating a micro-electro mechanical systems (MEMS) device. The method includes: 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.
The method may include digitizing the sense signal prior to multiplication by the reference sine and cosine waves, and the reference sine and cosine waves may be generated in digital form.
The low-pass filtering of the first product may serves to remove intermodulation components from the reference sine wave, and the low-pass filtering of the second product may serve to remove intermodulation components from the reference cosine wave.
The low-pass filtering of the first product may be performed using a first decimation SINC filter, and the low-pass filtering of the second product may be performed using a second decimation SINC filter.
Performing the 4-quadrant CORDIC technique may be accomplished by:
The rotation-matrix approach may performed by:
Also disclosed herein is a system for driving micro-electro mechanical systems (MEMS) device. The system includes: 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; and a processing circuit. The processing circuit is 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. The system also includes: 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.
The controller circuitry may include: a phase controller generating a PLL control signal based upon the phase error; a phase locked loop (PLL) generating the frequency drive signal based upon the PLL 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.
The processing circuit may be an application specific integrated circuit (ASIC).
The low-pass filtering of the first product may be performed by the processing circuit serves to remove intermodulation components from the reference sine wave, and the low-pass filtering of the second product may be performed by the processing circuit serves to remove intermodulation components from the reference cosine wave.
The low-pass filtering of the first product may be performed by the processing circuit using a first decimation SINC filter, and the low-pass filtering of the second product may be performed by the processing circuit using a second decimation SINC filter.
The processing circuit may perform the 4-quadrant CORDIC technique by:
The processing circuit may perform the rotation-matrix by:
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.
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.
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.
Illustrated in
Turn now to the example of
The mathematics yielding this result are now explained. The sense signal can be mathematically represented as:
Here, Asense is the amplitude of the sense signal, ωsense is the frequency of the sense signal, and φsense is the phase of the sense signal.
The reference signal can be mathematically using the following two equations:
Here, Aref is the amplitude of the reference signal, ωref is the frequency of the reference signal, and φref is the phase of the reference signal.
The results of multiplication of the sense signal by the reference signal yields x and y values, which can be mathematically represented as:
Here, Aref is the amplitude of the reference signal, Asense is the amplitude of the sense signal, ωref is the frequency of the reference signal, φsense is the phase of the sense signal, φref is the phase of the reference signal, and Δφ is the difference between φsense and φref.
Therefore, as can be seen, the result includes expressions proportional to amplitude, as well as the phase shift, and an intermodulation product (ωref ▪ t). The intermodulation product represents the oscillations seen in the product (demodulator output) shown in
Assuming that ωref = ωsense and that Aref = 1, the average of y(t), denoted Y, as obtained using suitable low-pass filtering can be mathematically represented as:
Likewise assuming that ωref = ωsense and that Aref = 1, the average of x(t), denoted X, as obtained using suitable low-pass filtering can be mathematically represented as:
From this, using simple math, the amplitude of the sense signal can be recovered as:
Similarly, the phase shift between the sense signal and reference signal can be recovered as:
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
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.
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).
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.
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.
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
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:
The first multiplication circuit 12 multiplies these two signals to yield:
The expression x(t) is filtered by low-pass filter 103 within the feedback circuit 101 to produce X, mathematically represented as:
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:
The second multiplication circuit 104 multiplies these two signals to yield:
The expression y(t) is filtered by low-pass filter 105 within the feedback circuit 101 to produce Y, mathematically represented as:
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:
Generation of the reference signals xref and yref by the reference generator 97 is now described with initial reference to
Referring to
The amount of rotation to be performed at each step can be calculated as:
Therefore, knowing the amount of rotation per step and the initial phase-point P0 calculated as:
This allows the calculation of the phase shift at each rotation and its use to calculate the sine and cosine waves as:
It is to be understood that cos(φrot) = xrot and sin(φrot) = yrot, keeping in mind that φrot is known as being φrot = 360°/ODR, with ODR being 16 in this example. Therefore, using the known values of cos(φrot) and sin(φrot), and the known initial point P0(x0;y0), the data points used to form the sine and cosine waves shown in
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.
The spectrum of the generated reference sine wave may be observed in
Shown in
Estimation of the phase Δφ by the feedback circuitry 101 is now described. As a reminder, the sense signal Sns can be mathematically represented as:
Here, OSsense is the offset that might appear as an additive term in the sense signal Sns.
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:
Here, the A′ref ▪ cos(2ωref ▪ t + φ′ref) term and those following represent the harmonics present due to quantization. The calculation of y(t) then yields:
This yields the desired fundamental components of the sense signal Sns, namely the
and sin(Δφ) terms, but also undesired intermodulation products (the other terms) that arise due to the difference between ωsense and ωref, 2ωref, etc.
Similarly, the sine reference signal can be mathematically represented as:
The calculation of x(t) then yields:
Here too, this yields the desired fundamental components of the sense signal Sns, namely the
and cos(Δφ) terms, but also undesired intermodulation products (the other terms) that arise due to the difference between ωsense and ωref, 2ωref, etc.
The results of the multiplications may be seen for the sample of the cosine reference wave in
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
The inputs x(t) and y(t) to the filters 103 and 105 can be observed in
After filtering, Y thus becomes:
From X and Y, Asense and Δφ can be recovered. This could be performed mathematically in the digital domain as:
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.
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.
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:
Starting from the rotation matrix M, factorization by cos (Δφ) can be performed to yield:
The idea is to achieve Δφ through successive approximations obtained by a linear combination of N precalculated angles θi, with the angles θi being chosen such that their tangent values are powers of 2, such that tan (θi) = 2-i. This reduces the matrix to a form where iterations can be calculated using shifts rather than multiplications.
Through this technique, Δφ is ultimately computed as:
where σi is +1 or -1 depending upon the sign of the yi-1 component of the rotation vector at the previous iteration.
This would work well if:
However, for a 4-quadrant application, modifications are to be made.
Refer now to the trigonometric circle shown in
The angular distance between the vector P0 and the x-axis is the Δφ that it is desired to recover.
This is performed by successive approximation using the rotation matrix M. For example, for iteration i=1, P0 can be rotated by θ1 to reach P1, as shown in
This has been a series of approximated rotations by ±θi, ±θi+1, ±θi+2, ±θ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 Δφ.
Thus, the technique has started with a vector that is Δφ degrees away from the x-axis, and at each iteration (±θi, ±θi+1, ±θi+2, ±θi+3, etc), the resulting phase becomes closer to 0. Thus, Δφ is approximated by summation of σiθi from 0 to N-1, with σi being +1 or -1 dependent upon the yi-1 component of the rotation vector at the previous iteration, and with θi being the rotation angle at each iteration. So, θi is the angle whose tangent is 2-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.
The successive approximation can be summed up as follows:
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.
After the last iteration, Δφ and Asense are determined as:
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.
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.
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).
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.
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.