Figure 1: Schematic overview of the two modeled circuits. The two sine wave signals at the IDTs (c1 and c2) are routed to either one of two potential hardware circuits that preprocess the signals to process a single DC, analog signal correlating with the phase shift between c1 and c2. A: The mixer circuit consisting of the mixer and a subsequent low-pass filter. B: The XOR circuit with a comparator at each input of the XOR gate, followed by a low-pass filter.
Assumptions underlying the models
Analysis of the Mixer output:
c₁(t) * c₂(t)
<=>(A₁ * cos(f₁*2πt+φ₁))*(aA₂*cos(f₂*2πt+φ₂))
f₁ and f₂ are assumed to be identical, f₁ = f₂ = 1Hz
<=> A₁*A₂*cos(1Hz*2πt+φ₁)*cos(1Hz*2πt+φ₂)
The mixer output therefore result depends on the amplitudes (aA₁ and aA₂), the time (t) and the phase shift (φ₁ and φ₂) in addition to the frequency f. The term above contains the product of two cosinus terms, which gives a superimposed wave function with twice the frequency of the input functions, in case f₁ = f₂.
Analysis of the XOR gate output:
c₁ | c₂ | XOR = c₁ ⊻ c₂ |
---|---|---|
0 | 0 | 0 |
0 | 1 | 1 |
1 | 0 | 1 |
1 | 1 | 0 |
Table 1: Truth table of an XOR gate with two inputs.
f₁ and f₂ are constant, set f₁ = f₂ = 1Hz
sgn(c1(t))⊻sgn(c2(t))
<=>sgn(A₁ * cos(1Hz*2πt+φ₁)) ⊻ sgn(A₂*cos(1Hz*2πt+φ₂))
<=> sgn(A₁ )* sgn(cos(1Hz*2πt+φ₁)) ⊻ sgn(A₂)*sgn(cos(1Hz*2πt+φ₂))
a₁,a₂>0 => sgn(a₁) = sgn(a₂) = 1
<=> sgn(cos(2πt+φ₁)) ⊻ sgn(cos(f2πt+φ₂))
Therefore, the output of the XOR gate depends on the time (t) and the phase shift (φ₁ and φ₂).
Numeric analysis
Figure 1: graphical representation of the mixer method
the figure shows the change in voltage (V) as a function of time (s)
the given variables have the values:
f_1 = 1.00, phi_1 = 3.14, a_1 = 1.00,
f_2 = 1.00. phi_2 = 4.40, a_2 = 1.30
the blue graph is c₁, the orange one is c₂ and the green graph is c₁*c₂
Figure 2: graphical representation of the XOR gate
the figure shows the change in voltage (volts) as a function of time (s)
the given variables have the values:
f_1 = 1.00, phi_1 = 3.14, a_1 = 1.00,
f_2 = 1.00. phi_2 = 4.40, a_2 = 1.30
the blue graph is c₁, the orange one is c₂ and the green graph is c₁ xor c₂
Figure 3: Color gradient of the mixer method,showing the dependency of the measurement on amplitude and phase shift.
Figure 4: Color gradient of the XOR gate,showing the dependency of the measurement on amplitude and phase shift
Conclusion
Based on our modeling, we therefore decided to use a XOR based phase detection on the phase detection PCB that we designed in cooperation with the CiTeC at Bielefeld University. This was a critical decision in the design process that was to be taken, and this eleborated modeling helped us to a lot in this respect. To read more about how the PCB including the XOR gate turned out in the end, read our hardware page.