Unterschiede
Hier werden die Unterschiede zwischen zwei Versionen angezeigt.
| Beide Seiten der vorigen Revision Vorhergehende Überarbeitung Nächste Überarbeitung | Vorhergehende Überarbeitung | ||
| electrical_engineering_and_electronics_1:block23 [2025/12/14 18:14] – mexleadmin | electrical_engineering_and_electronics_1:block23 [2025/12/15 00:12] (aktuell) – mexleadmin | ||
|---|---|---|---|
| Zeile 3: | Zeile 3: | ||
| ===== Learning objectives ===== | ===== Learning objectives ===== | ||
| < | < | ||
| - | After this 90-minute block, you can | + | After this 90-minute block, you will be able to |
| - | * ... | + | * explain what a **comparator** is and how it differs from an operational amplifier used in closed-loop (linear) operation: |
| + | - intended for **switching**, | ||
| + | - designed to operate at the output limits (**saturation**) rather than keeping the differential input near zero | ||
| + | - commonly used with **positive feedback** when hysteresis is desired (Schmitt trigger) | ||
| + | * interpret the comparator’s inputs and differential voltage | ||
| + | * describe and distinguish **open-collector** vs. **push-pull** comparator outputs and state when a **pull-up resistor** is required. | ||
| + | * predict the output state of a comparator from the sign of \(u_{\rm d}\) and the available saturation levels \(U_{\rm sat,min}\), \(U_{\rm sat,max}\). | ||
| + | * explain why noise at the switching point can cause rapid toggling and how **hysteresis** prevents this. | ||
| + | * analyze a **non-inverting Schmitt trigger** and compute its switching thresholds | ||
| + | - upper threshold \(U_{\rm sh,u}\) | ||
| + | - lower threshold \(U_{\rm sh,l}\) | ||
| </ | </ | ||
| Zeile 17: | Zeile 27: | ||
| ===== 90-minute plan ===== | ===== 90-minute plan ===== | ||
| - | - Warm-up (x min): | + | - Warm-up (5–10 |
| - | - .... | + | - Recall: op-amp with negative feedback vs. no feedback. |
| - | - Core concepts | + | - Live demo or simulation: sweep \(u_{\rm p}\) across \(u_{\rm m}\) and observe comparator switching. |
| - | - ... | + | - Core concepts (45–50 |
| - | - Practice | + | - Comparator basics: inputs, differential voltage \(u_{\rm d}=u_{\rm p}-u_{\rm m}\), saturation behavior. |
| - | - Wrap-up (x min): Summary box; common pitfalls checklist. | + | - Output stages: open-collector vs. push-pull; role of pull-up resistor. |
| + | - Noise problem at the switching point. | ||
| + | - Non-inverting Schmitt trigger: | ||
| + | - positive feedback | ||
| + | - hysteresis | ||
| + | - derivation and interpretation of \(U_{\rm sh,u}\) and \(U_{\rm sh,l}\). | ||
| + | - Applications | ||
| + | - Bang-bang control | ||
| + | - De-noising / signal conditioning | ||
| + | - Comparator as basic ADC element | ||
| + | - Wrap-up (5 min): | ||
| + | - Key takeaways | ||
| + | - Typical mistakes and outlook to further applications | ||
| ===== Conceptual overview ===== | ===== Conceptual overview ===== | ||
| <callout icon=" | <callout icon=" | ||
| - | - ... | + | - A **comparator** is the “switching cousin” of the op-amp: it does not try to keep \(u_{\rm d}\approx 0\) with negative feedback. \\ Instead, it reports the **sign** of \(u_{\rm d}=u_{\rm p}-u_{\rm m}\) by saturating its output to one of two extreme levels. |
| + | - The output is therefore **binary-like** (low/high), set by the supply rails via \(U_{\rm sat,min}\) and \(U_{\rm sat,max}\). The exact “high” behavior depends on the output stage: | ||
| + | - **Push-pull** drives both levels. | ||
| + | - **Open-collector** can reliably pull low, but needs a **pull-up resistor** to produce a defined high level. | ||
| + | - The critical moment is around \(u_{\rm d}=0\). Real signals are noisy, so a plain comparator can **toggle rapidly** (“chatter”) when the input hovers near the threshold. | ||
| + | - A **Schmitt trigger** fixes this by adding **positive feedback**, creating two thresholds: | ||
| + | - one threshold for rising input (upper threshold) | ||
| + | - another for falling input (lower threshold) | ||
| + | This separation is **hysteresis**. | ||
| + | - In the non-inverting Schmitt trigger, the thresholds scale with the feedback ratio \(R_1/R_2\) and the current output saturation level. Bigger feedback (larger \(R_1/ | ||
| + | - Many practical “make a clean digital signal” tasks boil down to comparator ideas: thresholding (ADC intuition), de-noising/ | ||
| </ | </ | ||
| Zeile 44: | Zeile 76: | ||
| {{drawio> | {{drawio> | ||
| - | We again have two inputs: The non-inverting input $u_{\rm p}$ and the inverting input $u_{\rm | + | We again have two inputs: The non-inverting input $u_{\rm p}$ and the inverting input $u_{\rm |
| Zeile 60: | Zeile 92: | ||
| In the first simulation they are set unipolar to $U_{\rm sat, min}=0 ~\rm V$ and $U_{\rm sat, max}=5 ~\rm V$. | In the first simulation they are set unipolar to $U_{\rm sat, min}=0 ~\rm V$ and $U_{\rm sat, max}=5 ~\rm V$. | ||
| - | < | + | < |
| </ | </ | ||
| Zeile 72: | Zeile 104: | ||
| - | The **golden rules** ($R_{\rm I}=0$, $R_{\rm O}\rightarrow \infty$, $A_{\rm D}\rightarrow \infty$) also apply here. \\ \\ | + | The **golden rules** ($R_{\rm I}\rightarrow \infty$, $R_{\rm O}=0$, $A_{\rm D}\rightarrow \infty$) also apply here. \\ \\ |
| Therefore, the currents through the resistors $R_1$ and $R_2$ are the same: $i_1 = i_2$ (given, that $R_{\rm O}\rightarrow \infty$). | Therefore, the currents through the resistors $R_1$ and $R_2$ are the same: $i_1 = i_2$ (given, that $R_{\rm O}\rightarrow \infty$). | ||
| Zeile 107: | Zeile 139: | ||
| - | < | + | < |
| </ | </ | ||
| Zeile 115: | Zeile 147: | ||
| {{drawio> | {{drawio> | ||
| + | ==== Applications ==== | ||
| + | |||
| + | === Bang-Bang Control === | ||
| + | |||
| + | In the shown simulation, **{{wp> | ||
| + | |||
| + | The circuit can be interpreted as follows: | ||
| + | * The comparator with positive feedback (via $R_1$ and $R_2$) forms a **Schmitt trigger** with an upper threshold $U_{\rm sh,u}$ and a lower threshold $U_{\rm sh,l}$. | ||
| + | * The output of the comparator switches only between its two saturation values ($U_{\rm sat,max}$ and $U_{\rm sat,min}$), which is characteristic of bang-bang behavior. | ||
| + | * The resistor–capacitor combination ($R$, $C$) represents a **controlled system** (plant) with inertia: the capacitor voltage changes only gradually. | ||
| + | |||
| + | The operating principle is: | ||
| + | * If the output voltage $u_{\rm O}$ is high, the capacitor is charged through $R$, causing the feedback signal to increase. | ||
| + | * As soon as the capacitor voltage reaches the **upper threshold** $U_{m sh,u}$, the comparator switches abruptly to its lower saturation level. | ||
| + | * The capacitor now discharges (or charges in the opposite direction), until the voltage reaches the **lower threshold** $U_{\rm sh,l}$. | ||
| + | * At this point, the comparator switches back to the high saturation level. | ||
| + | |||
| + | As a result, the system continuously oscillates between the two thresholds. The comparator output is a two-level (on/off) signal, while the capacitor voltage varies smoothly between $U_{\rm sh,l}$ and $U_{\rm sh,u}$. | ||
| + | |||
| + | This example illustrates key properties of bang-bang control: | ||
| + | * the actuator (comparator output) has only two states, | ||
| + | * the controlled variable is kept within a **band** defined by the hysteresis, | ||
| + | * the switching frequency depends on the system dynamics (here the $RC$ time constant) and the hysteresis width. | ||
| + | |||
| + | Such control principles appear in thermostats, | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | \\ \\ | ||
| + | === De-Noise === | ||
| + | |||
| + | Real analog signals are often corrupted by noise.\\ | ||
| + | When such a signal is fed directly into a comparator, small noise amplitudes around the threshold can cause rapid switching of the output (chatter). | ||
| + | |||
| + | The Schmitt trigger solves this problem by its two distinct thresholds \(U_{\rm sh,u}\) and \(U_{\rm sh,l}\). \\ | ||
| + | As long as the input signal remains between these two values, the output state does not change. | ||
| + | |||
| + | This makes comparators with hysteresis ideal for: | ||
| + | * cleaning up slowly varying or noisy sensor signals, | ||
| + | * debouncing mechanical switches, | ||
| + | * converting noisy analog waveforms into clean digital signals. | ||
| + | |||
| + | < | ||
| + | </ | ||
| + | \\ \\ | ||
| + | === Analog-to-Digital Converter (ADC) === | ||
| + | At its core, every analog-to-digital converter contains at least one **comparator**. | ||
| + | |||
| + | A comparator performs a **binary decision**: \\ | ||
| + | Is the input voltage larger or smaller than a given reference? | ||
| + | |||
| + | In the simplest case (1-bit ADC): | ||
| + | * one comparator compares \(u_{\rm I}\) with a reference voltage \(U_{\rm ref}\), | ||
| + | * the output represents a single digital bit. | ||
| + | |||
| + | More complex ADCs like the flash ADC (shown in the simulation below) use multiple comparators or reuse one comparator repeatedly with different reference values. | ||
| + | |||
| + | Thus, understanding comparator behavior is fundamental for understanding how analog information is converted into digital form. | ||
| + | |||
| + | < | ||
| + | </ | ||
| ===== Common pitfalls ===== | ===== Common pitfalls ===== | ||
| - | * ... | + | * **Treating a comparator like a linear op-amp**: assuming the output follows a linear gain law \(u_{\rm O}=A_{\rm D}\,u_{\rm d}\). In reality, the output almost always saturates at \(U_{\rm sat,min}\) or \(U_{\rm sat,max}\). |
| + | * **Using negative-feedback intuition**: | ||
| + | * **Mixing up inputs**: confusing the non-inverting input \(u_{\rm p}\) and inverting input \(u_{\rm m}\), which leads to predicting the wrong output polarity. | ||
| + | * **Ignoring the output stage type**: | ||
| + | - forgetting that an **open-collector** comparator cannot actively drive a high level, | ||
| + | - omitting the required **pull-up resistor**, resulting in an undefined/ | ||
| + | * **Forgetting saturation limits**: assuming ideal logic levels, while real comparators are limited by their supply voltages \(U_{\rm sat,min}\), \(U_{\rm sat, | ||
| + | * **No hysteresis for noisy signals**: using a plain comparator where a Schmitt trigger is required, leading to output chatter when \(u_{\rm I}\) fluctuates near the threshold. | ||
| + | * **Sign errors in Schmitt-trigger thresholds**: | ||
| + | \[ | ||
| + | U_{\rm sh, | ||
| + | U_{\rm sh, | ||
| + | \] | ||
| ===== Exercises ===== | ===== Exercises ===== | ||
| - | ==== Worked examples ==== | ||
| - | ... | + | ==== Conceptual checks ==== |
| + | - Explain in one or two sentences why a comparator is normally operated without negative feedback. | ||
| + | - What information about the input signal does the comparator output represent when \(u_{\rm O}\) is in saturation? | ||
| + | - Why is \(u_{\rm d}=0\) a special point for a comparator, even though it is not a stable operating point? | ||
| + | |||
| + | ==== Exercises ==== | ||
| + | |||
| + | <panel type=" | ||
| + | |||
| + | A push-pull comparator is supplied with $0~{\rm V}$ and $5~{\rm V}$. | ||
| + | The input voltages are given as: | ||
| + | \[ | ||
| + | u_{\rm p}=3.0~{\rm V}, \qquad u_{\rm m}=2.0~{\rm V} | ||
| + | \] | ||
| + | |||
| + | - Determine the differential input voltage $u_{\rm d}$. | ||
| + | - State the resulting output voltage $u_{\rm O}$. | ||
| + | |||
| + | <button size=" | ||
| + | * Recall that $u_{\rm d}=u_{\rm p}-u_{\rm m}$. | ||
| + | * For a push-pull comparator, the output directly saturates depending on the sign of $u_{\rm d}$. | ||
| + | </ | ||
| + | |||
| + | <button size=" | ||
| + | * $u_{\rm d}=+1.0~{\rm V}$ | ||
| + | * $u_{\rm O}=U_{\rm sat, | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | <panel type=" | ||
| + | |||
| + | A non-inverting Schmitt trigger is built with the resistors | ||
| + | \[ | ||
| + | R_1=10~{\rm k\Omega}, \qquad R_2=100~{\rm k\Omega} | ||
| + | \] | ||
| + | The comparator saturates symmetrically at | ||
| + | \[ | ||
| + | U_{\rm sat, | ||
| + | \] | ||
| + | |||
| + | - Calculate the upper threshold $U_{\rm sh,u}$. | ||
| + | - Calculate the lower threshold $U_{\rm sh,l}$. | ||
| + | - Sketch qualitatively the hysteresis characteristic $u_{\rm O}(u_{\rm I})$. | ||
| + | |||
| + | <button size=" | ||
| + | * Use the relations | ||
| + | \[ | ||
| + | U_{\rm sh, | ||
| + | U_{\rm sh, | ||
| + | \] | ||
| + | </ | ||
| + | |||
| + | <button size=" | ||
| + | * $U_{\rm sh, | ||
| + | * $U_{\rm sh, | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | |||
| + | <panel type=" | ||
| + | |||
| + | A noisy sensor signal fluctuates around $2.5~{\rm V}$ with a noise amplitude of $\pm 50~{\rm mV}$. | ||
| + | A comparator without hysteresis is used to detect whether the signal is above or below $2.5~{\rm V}$. | ||
| + | |||
| + | - Explain why the output may switch rapidly. | ||
| + | - Explain qualitatively how a Schmitt trigger improves the situation. | ||
| + | |||
| + | <button size=" | ||
| + | * Consider the behavior of the comparator near $u_{\rm d}=0$. | ||
| + | </ | ||
| + | |||
| + | <button size=" | ||
| + | * Without hysteresis: output chatter due to noise crossings. | ||
| + | * With hysteresis: two thresholds prevent switching for small fluctuations. | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| + | <panel type=" | ||
| + | |||
| + | A Schmitt trigger uses resistors $R_1$ and $R_2$ for positive feedback. The output saturates at $\pm 8~{\rm V}$. | ||
| + | |||
| + | - Write expressions for $U_{\rm sh,u}$ and $U_{\rm sh,l}$. | ||
| + | - Explain how the ratio $R_1/R_2$ influences the control band of the bang-bang controller. | ||
| + | |||
| + | <button size=" | ||
| + | * Recall that the thresholds are proportional to the output saturation voltage. | ||
| + | </ | ||
| + | |||
| + | <button size=" | ||
| + | * $U_{\rm sh, | ||
| + | * A larger ratio $R_1/R_2$ widens the control band. | ||
| + | </ | ||
| + | |||
| + | </ | ||
| + | |||
| ===== Embedded resources ===== | ===== Embedded resources ===== | ||