Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen angezeigt.

Link zu dieser Vergleichsansicht

Beide Seiten der vorigen Revision Vorhergehende Überarbeitung
Nächste Überarbeitung
Vorhergehende Überarbeitung
electrical_engineering_and_electronics_1:block23 [2025/12/14 16:49] mexleadminelectrical_engineering_and_electronics_1:block23 [2025/12/15 00:12] (aktuell) mexleadmin
Zeile 3: Zeile 3:
 ===== Learning objectives ===== ===== Learning objectives =====
 <callout> <callout>
-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**, not linear amplification 
 +    - 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}\)
 </callout> </callout>
  
Zeile 17: Zeile 27:
  
 ===== 90-minute plan ===== ===== 90-minute plan =====
-  - Warm-up (min):  +  - Warm-up (5–10 min): 
-    - ....  +    - Recall: op-amp with negative feedback vsno feedback. 
-  - Core concepts & derivations (min): +    - Live demo or simulation: sweep \(u_{\rm p}\) across \(u_{\rm m}\) and observe comparator switching
-    - ... +  - Core concepts (45–50 min): 
-  - Practice (min): ... +    - Comparator basics: inputs, differential voltage \(u_{\rm d}=u_{\rm p}-u_{\rm m}\), saturation behavior. 
-  - Wrap-up (min): Summary box; common pitfalls checklist.+    - Output stages: open-collector vspush-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 (15–20 min): 
 +    - Bang-bang control 
 +    - De-noising / signal conditioning 
 +    - Comparator as basic ADC element 
 +  - Wrap-up (min): 
 +    - Key takeaways 
 +    - Typical mistakes and outlook to further applications
  
 ===== Conceptual overview ===== ===== Conceptual overview =====
 <callout icon="fa fa-lightbulb-o" color="blue"> <callout icon="fa fa-lightbulb-o" color="blue">
-  - ...+  - 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/R_2\)) → wider hysteresis → better noise immunity, but less sensitivity. 
 +  - Many practical “make a clean digital signal” tasks boil down to comparator ideas: thresholding (ADC intuition), de-noising/debouncing, and bang-bang control.
 </callout> </callout>
  
Zeile 44: Zeile 76:
 {{drawio>electrical_engineering_and_electronics_1:ComaratorV01.svg}} {{drawio>electrical_engineering_and_electronics_1:ComaratorV01.svg}}
  
-We again have two inputs: The non-inverting input $u_{\rm p}$ and the inverting input $u_{\rm n}$. They result in the differential voltage $u_{\rm d} = u_{\rm p} - u_{\rm n}$.+We again have two inputs: The non-inverting input $u_{\rm p}$ and the inverting input $u_{\rm m}$. They result in the differential voltage $u_{\rm d} = u_{\rm p} - u_{\rm m}$.
  
  
Zeile 53: Zeile 85:
   - **comparators with open-collector output**: \\ This type outputs the minimum value, when the non-inverted input is bigger than the inverted one. \\ Otherwise, the output is **high-ohmic** or **undefined**. \\ This is sometimes shown by a diamond shape __◇__ on the output.  \\ For these type, a **pull-up resistor** is needed to have a readable output in case of $u_{\rm d}>0$.  \\ $$u_{\rm O,OC}= \biggl\{     \begin{array}{l}         &&\text{undefined}  &&\text{for} &&u_{\rm d}>0 \\         &&U_{\rm sat, min} &&\text{for} &&u_{\rm d}<    \end{array}$$   - **comparators with open-collector output**: \\ This type outputs the minimum value, when the non-inverted input is bigger than the inverted one. \\ Otherwise, the output is **high-ohmic** or **undefined**. \\ This is sometimes shown by a diamond shape __◇__ on the output.  \\ For these type, a **pull-up resistor** is needed to have a readable output in case of $u_{\rm d}>0$.  \\ $$u_{\rm O,OC}= \biggl\{     \begin{array}{l}         &&\text{undefined}  &&\text{for} &&u_{\rm d}>0 \\         &&U_{\rm sat, min} &&\text{for} &&u_{\rm d}<    \end{array}$$
   - **comparators with push-pull output**:  \\ This type outputs the minimum value, when the non-inverted input is bigger than the inverted one. \\ Otherwise, it outputs the maximum value. \\ $$u_{\rm O, PP}= \biggl\{     \begin{array}{l}         &&U_{\rm sat, max} &&\text{for} &&u_{\rm d}>0\\         &&U_{\rm sat, min} &&\text{for} &&u_{\rm d}<    \end{array}$$   - **comparators with push-pull output**:  \\ This type outputs the minimum value, when the non-inverted input is bigger than the inverted one. \\ Otherwise, it outputs the maximum value. \\ $$u_{\rm O, PP}= \biggl\{     \begin{array}{l}         &&U_{\rm sat, max} &&\text{for} &&u_{\rm d}>0\\         &&U_{\rm sat, min} &&\text{for} &&u_{\rm d}<    \end{array}$$
 +
 +Similar to the operational amplifier, the situation $u_{\rm d}=0$ is important. \\
 +This time, $u_{\rm d}=0$ is not automatically reached, but it is the "turning point" for changing the output value.
  
 The values of the output voltages $U_{\rm sat, min}$ (and $U_{\rm sat, max}$, when defined) are given by the voltage supply of the comparator, \\ The values of the output voltages $U_{\rm sat, min}$ (and $U_{\rm sat, max}$, when defined) are given by the voltage supply of the comparator, \\
 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$.
  
-<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjAnOB0AM8MUsBTAtAdhLaAmXsGhYAHGAKwBsslRALJSOeeLE2+emGAFAFYk2uQeGEhhbOiACuAfQDyAGnkBhPoRBowlEuMpStJKbn0gpAVVkAHdQPEZc4RrgdmQlmwCVN23SYMEQqZsYKyITNjY0GAYdOQAzLgQuOSQEHSJECw45DwARpq4dH7aPmLxGrA8AB6FdFiZPtwg8YlupCAACgD2AM7QADq9AJIAdlbSAC5DAMoAlgDmowCGADY8AE4gIvhSO3RsIQg8B6F+IjsiWGCwQxRDWuR3SLe9aLjQ8fXx5Bhk8RBErgwK0hq8buFcEMCM8XghodAWGAwTxvDtSjt4JFJBxsVFcgd4uI2gRdMU2IlDuBZGBZLBZNVhDcwLhZOQ6dFZFpZKySDy6QL6ayqr1tkJimL7I4QiAAGZrXooHjLMySVymeqOZrZMLhNjvT7fX7-QH4EFEiFVfhOMymIq2qQWay2bZk1wgxiatyWJSdTo8ADurrM6sdriqQYODptDCkEdVZhEpXJ2BOsCJuDaB0kIlS0uptPpjLIsBZNPpOEQEAwlCoKS5tLosj5wppsniHMQdAgPd7ff7lAFIIFreHHcrCG7-envcHVVqaGo4BI1yTEEk4ik8isKFGaBU3VWqxQAGNJt0NkN5FMJpMapoEqrQiyybBHZuutJegALNCdaRHleN5TIGkq7GBpTxjsriXIcoH7Lo+xwQuRRYN8PiwFA9SesuIAAHIoAsgwjOMUyzIsKzrAU7wSvES5aGIcShFU3haDoqq6O8WIHLoVKWliVKHIiLpsa+nGkI6sBku4sijC65y6KUwjSZYcnWsm+yJhuqk8EAA noborder}}+<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjAnOB0AM8MUsBTAtAdhLaAmXsGhYAHGAKwBsslRALJSOeeLE2+emGAFAFYk2uQeGEhhbOiACuAfQDyAGnkBhPoRBowlEuMpStJKbn0gpcgA7qB4jLnCNcdszNlWASpu26TBgkNM2MFZEJmxsaDAMOnIAZlwIXHJICDp4iBYcch4AI01cOh9tLzFYjVgeAA98uix0r24QWPiXUhAABQB7AGdoAB1ugEkAOwtpABcBgGUASwBzYYBDABseACcQEXwpLbo2IIQePeCfES2RLDBYAYoBrXIbpGvutFxoWNrY8gwyWIh43BgZoDZ5XUK4AYER5PBCQ6AsMAgnieLbFLbwcKSDiYiLZPaxcQtAi6QpseL7cCyMCyWCySrCK7aWTkGmRWRaWS4WQkTk0vm0rm0uRKVQ8bqbISFCW2exBEAAMxW3RQPEWZkkzlMtXsjUyIVCbFe70+31+-3wQIJYIq-AcZlMBXtUnMbmsmxJziBjG1LmFina7R4AHd3WZNc7nBUQ3snXaGFIo+qzCJiqTsEdYATcC09pIRMlZZTqbT6WRYEyrqzEBAMJQqEl2dS6NzebTqbEqwg6BAe72+-3KHygXzBVSOx2cIhu-2Z73B0KFP7A9U0NRwCRLimIJJxFJ5BYUMM0CpOstligAMbjTprAbyCZjcZVTRxdXBMBiPbO3cdaTdAAWaDtNIZ53g+EzBtK2xQcUiZbM45z7JBuy6LsSErgUWCfF4sBQLU3rriAAByKBzP0QyjBM0zzEsqx5K8UqxGuWifsk6aeFoOjqrorwYnsugUtaGIUvs8JupxJKwDxpDOlJvqyAAtm6py6MUwgkq4Sm2qmuzJjuchKUAA noborder}}
 </WRAP> </WRAP>
  
Zeile 69: 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$).
  
-And similar to the operational amplifier the situation $u_{\rm d}=0$ is important. \\ +$
-This time, it is not automatically reached, but the turning point for changing the output value.+u_{\rm D}=0 \quad \rightarrow \quad u_{\rm O} \text{  changes its state} 
 +$$
  
 +At the "turning point" with $u_{\rm D}=0$, the input and output voltages are equal to the voltages over the resistances. \\
 +However, the signs have to be considered (when $u_{\rm O}$ is positive,  $u_{\rm i}$ has to be negative for  $u_{\rm D}=0$):
 $$ $$
-u_{\rm d}\neq0, u_{\rm O} +u_1 u_{\rm I} \\ 
-      \biggl\{      +u_2 = u_{\rm O}
-            \begin{array}{l}          +
-              &&U_{\rm sat, max} &&\text{for} &&u_{\rm d}>0\\ +
-              &&U_{\rm sat, min} &&\text{for} &&u_{\rm d}<     +
-            \end{array}+
 $$ $$
  
-<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjAnOCmC0Ac4B0AWAzBSYBsAGCArGChPBGiAQeLpbQXGGAFABMuA7CLDoq9im5h4g-oMEBXAPoBJZgCUh2PgO7taYkLQphcevZS1akYDigJpWEVkQgR0V6riQFmAIzUo+OIa0RpOLWYAD08uSygeAlYQNEsQQWEQGQA7AAcJABcAHQBnAGUASwBzFIBDABs2QIQNVVgOGM1JWWquRpA-WjB2TvhaFoB5ABoABVHmFFwKdj5WcQJsWLQl2lwpFCl14L9dHqldLaR9fA5sRZspHg2peClWLce0I5OSO3ePz+xHgkeH9d+z2cr0+oI+31wzAA7iAOl1YU14pCAE4IzrxBDomIafTQ7h8DEqQSQ4r4zoQJaYuKrIJlMnwuH9EBQaiwai6E5rTpIeA4DC4UysALRFCsLgc3Go2qdepEowSkLcbCIylEdFQRJLeSK2AkTpTbgoMD6iia8CKladHoJURgahm1iKoWdXD+W3Gs3a0UzXDUKxzDSkILezo2cl8A3+4PO+Z+oP8QOISEh-hxvhMqPJmPwNOxAyZybO4Xh2K9Ashyy5tCRoNZijVqt4Et12LnEtoDO1wv1nMlqaJ6Om319stdkOi3MoGtJ7s2ydN8sx4f8Jpl5WD0N+9fzOrY2exmVNBfrlupw99XcbvxbmIBS8t4sr0v32eV8-Vl8V8zv497ittp8O0-IteyfftzxbKYbwSNc-2dCdzynYDTW-MDf2DaZKGtVh5hAbB4mpIxNjAR5RQgAEjhI64Hl+SFQmVJpe2wbBjT8RAzQAPjyPJpEKRVFi4IUKAIM50SWM1AHIifiODmQQ8FEMUEnAJZpAAe2YDsQEQAAxY0cQMCVaB4EB5HuZggA noborder}}+Then, the currents $i_1$ and $i_2$ are given by  
 +$$ 
 +i_1 = - {{u_{\rm I}}\over{R_1}} \\ 
 +i_2 = {{u_{\rm O}}\over{R_2}}  
 +$$ 
 + 
 +And therefore, this "turning point" is given by  
 +$$ 
 +u_{\rm I} = - {{R_1}\over{R_2}} \cdot u_{\rm O} 
 +$$ 
 + 
 +These "turning points" are called **threshold**. \\  
 +The upper threshold $U_{\rm sh,u}$ and the lower threshhold $U_{\rm sh,l}$ are given by 
 +$$ 
 +\boxed{ 
 +U_{\rm sh,u} = + {{R_1}\over{R_2}} \cdot u_{\rm O} \\ 
 +U_{\rm sh,l} = - {{R_1}\over{R_2}} \cdot u_{\rm O}  
 +
 +$$ 
 + 
 + 
 +<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjCAMB0l5BOJyWoVaAmTkDsewAOMAVgDZIz8AWMkEk8Se5kgUwFowwAoHXEIWaZy4TIRAi61EAFcA+gHk+eEFwqTcmNWFx1MWkDIUBJFQI5kZmasw7UJN5sflmASjo0HtXBNu9QIADMRqyBMJQIxEG6cLgIuLgxEjAkPLYhHNgyQWQSXGDa1A6BYPLU8pDyAB7iYJBgZPL1ldBlXPKY8oSd0CSVzfJBrZAiA7IAOgDOZgBGatmSNjo4waRQPNULq0HUjFwiwSUyRCAmAHYADrIALtMAygCWAObnAIYANpvgJCG7jJgyNpdhIThJFLdrncpk9Xp8eAB3QIBdSabSQHjPTxo7FBSAyZgYpFCSSiEk4FI8ABOgmEkBSknpyPgGJpwlsaiskg5zHq8ERzIZTg2b2RZOEonQ+0YfJZgXs0EIxCs1BwhTICDgIVlcHSkEyJVyEhJxQZYGGFSqtWIDSaLQicHaZS6PS6VXNQxG8DGVUmUwAIuZBdiwH4jCAANK8VXa6ghVUQUigzAQDEx8BkeMp8C4ZOp9KYbWELOJqJGbNpwuMkuSU4Jjbp7A1wt5htVmzNkityshQHN3Pl-PpsBx4IIbVdschHsZv7jnMSILzmdEOfastL6cF3v6qe1xfL7dLNeSIIHreN0eb0nntu9zN7gy3tO7s-WLkUZwlXnNcQDa31AAJl09ptPIHQus0WD9FUsFQTB3z2BA-xGIwILhqc-qPAAZth0APC87xfFsJAIDkZAQJmfxcicdAAHzTNMCiPN8Dj6LgEDUAgAK4DItEgIA5ESsWWfb0MsgLSBmcjyAA9keb7BAw9AIHQQRKRiWziKpZGSAkY4CPxACq3yYEg+nBNmtjOGIIBTAAFgANLI3x4s4VbJOWkmFLZjnEZIhAGaspnJvGUnGSR1AQICrAkP4D5Gd8DDviEJB6JIZBedo9lOaxxTpfGQLpZlPkOX5cZRRoxRxaFjQgMZRA+BIKkgFyzWEn0CwdZgHXSkGHBNXQA3hqYeqxuRjiGKapTlP+4h4o0XoNItTqdN0q1wVUbryH6yhbFkAKnL4SycTZvB7Wetb7AY+4YXQbguSc8SoeAhBFFJ91bNQAgNfQRaMCc-g8Bd3kAGKpuAjLwDoIBuLwwMQGDpSQ3A0NuJgPBAA 1000,500 noborder}} 
 +</WRAP> 
 + 
 +The shown "switching effect" is called **hysteresis**. \\ 
 +The curve is called **hysteresis loop** and shows the switching at the upper and lower threshold. 
 + 
 +{{drawio>electrical_engineering_and_electronics_1:HysteresisV01.svg}} 
 + 
 +==== Applications ==== 
 + 
 +=== Bang-Bang Control === 
 + 
 +In the shown simulation, **{{wp>Bang–bang_control}}** is realized with a comparator including hysteresis. and a simple first-order plant (RC network). 
 + 
 +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, relaxation oscillators, power electronics, and simple closed-loop controllers where simplicity and robustness are more important than exact regulation. 
 + 
 +<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjCAMB0l5BOJyWoVaAmTkDsewAOMAVgDZIz8AWMkEk8Se5kgUwFowwAoHXENTjgwmQQGYx3MdRABXAPoA7AGIAhHgA96AzGUakxewoPAmAkkoAOcgC4AdAM4BlAJYBzJQEMANjwDuIDgmYNSywSAIdJA8AE5BkCZR4JhJ0QnwcSkhqSBksqImzDiZgYWRdOXlMV7Z4GEJIQ3ojBwG8PAg4tC4NOIk2MSQYIjo1NAk8OL5veSY1LjiTB18eHXJ0iCEzLIA0rzUmEsNki3op1A8h0v5XZjouOf3l9dbshdId+gxryPvz9wnt8rkcUv90GBxECXqDQuDwCRoT9YbcLmBHl8Ycd3pR6Odccibji6BjxASQUtCMTIvjohSmNTAV1yb95szKlD2Vj6ozEVzCeBUbj0bTLtpxNwgvpBDgpSYCiYAPJ2GwOFwebx+bREARkgRgBAmCU7QUgACqWgyXRGQWw1uOKRAjgAFgAaOSWnAQcQSoIGrriWQFMQu11asxG3IG86+gp0C1CY4mVIhXB0aZFKAKagKSAKTSpMlgMi52BwMCl+AVrgKCuEBSYXMKRSqDTxH2VUSCYSbZgjOA8ADG3b7XaEfbTphgHUgULIaAXXR6fQGqRGI0+jBi7hH4En4-ACDEzBi-DqxeYGwophb6ktxYgVD3YnwpmLIAASvfcLJX0RmIsb5GPes4MkwEJrMG4CWggfbDEwEB-G+dBfuKZCUucP6RDIpqoYI77FnQhz6vOyEgAAwjwH55MGISVLkJ7dlOUAYCQPAAEZBEe9CMLQdBHMeqy6IkPJBEIomyIoipCQGnZiGSBRjvICjSeKkBGGygYaQICogAAMgA9l4AAmVygQpQSEPKkhdGQmZCNmTYFkMxa1nmMDVhWjb1o2eYOeIlYkE2Uk8OI8ogCoEB9hkwhcJ+vBhV0EVReAMXMHFH6YKFyboJFLHTh0UVlvAC6legcWUUAA 1000,500 noborder}} 
 +</WRAP> 
 +\\ \\ 
 +=== 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. 
 + 
 +<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgjCAMB0l5BOJyWoVaAmTkDsewAOMAVgDZIz8AWMkEk8Se5kgUwFowwAoHXEIWaZy4TIRAi61EAFcA+gHk+eEFwqTcmNWFx1MWkDIUBJFQI5kZmasw7UJN5sflmASmuzXDHKZu3CRqxQGJQIxADMunC4CLi4URIwJDwARp6EjjY6OCBRjJA8AB7gZPoRzBERAphVRuASJgB2AA6yAC4AOgDOnQCGPYodbV3dAMoAlgDmTX0ANjwA7iEG2ur+UDxTOvo+YHQVMsyFy0KSomc4STwAToLCkEmSjyvwhXfCtmpWkl-MYG8lq8nk5Nn0VhdhKJ0IwOIwAW9jhhCFEqGBqOFaAkSNgmID+MCduAENoZABpXgAN082VWO2EhmY0mYuGgBRCyR4tgi4D0v0qkBkEVy-3k1HkkHkRUwAGMKvsJbA4GBFfAVVx5Jh5IR5CqIhKDZLJVrJbJBjwIhIASAAGIQf7PeA6EBuXiWkDoO0hCA4J1cF2YHhAA 1000,500 noborder}} 
 +</WRAP> 
 +\\ \\ 
 +=== 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. 
 + 
 +<WRAP>{{url>https://www.falstad.com/circuit/circuitjs.html?running=false&ctz=CQAgzCAMB0l5BOJyWoVaAmTkDseBGADgIFYA2Sc-AFnJFNJAMgddIFMBaAggKBy4QuTM3JEG9AuJA0QAVwD6ASQF5mCUWFE5W22QpV8ASiExzdILhMt7ZrTNCaOmMKghJgC+PAly4vCRhSPhpICGszEWZIOTBSUVZIRRpFZIAPTBJIaUUWNOgCRR5FTEUiUqc06rACyExSavkAHQBnVQAjKzB0IiFeCGx6SD50qxYzGiEiZ1JWOWIQZQA7AAd5ABc2gGUASwBzZYBDABs+I6itIjiCK4WCZiYeJhZ4OAxGT6-GckwwOnAhSyRBBoJBfluMTefAA7pdwLh6A16GBEVBYWYKAikViwGBhhjMNEejppOBNOiAE5mMkkmkohJQKFwPjUzC0xnslGQ1ivFlwolaTkcxKE3H4zFIhAEgXEiXI8ASkYXQXgGg3LTq5gPMjjF5vd4EQq8E2m250ClgIFgm0Q0R8lkq6KYcgasyu7WPPXM+BmLDYAOB8wIMDXQG3G1gu0+kaynRYhUK2OSlOJsnJ1WZsmqkZs7PO7P6XnQvPc0lI6LF+CE4mQrngHliqU4lvouNmaWpzvK+FgWINrT93he54x3nQciTqfT8T4UPh4GRojRh091UELVee1a4e60ervTQJeghDSWJxa3HlcGmv2+VYghKpvMe-0bu3x7lz9U+nf+u8RIfVZX8AN-SsgPbUD-0bAUsU7BUiw-eC4IJJ17X7LcYnuEddQPWRoHVQiiPVUgiHqBdj2XXBIVXc54WIN0GM9PdcINQ88Q4zi8VwMIhCtCMr2o9DoUgtEFW8GUUwkqSn0gil-wpXMQPkskyEAh1gPrP4vwIRSIPhbTf0MjME2zB80QzAtW3rNdnXMAczHs3cnlYg0-X8DzPNwEhvCJCjBJom9S1kfR6zpKsWX2X8aFCsl1SCNsNC0eMUVFUx6w9aSPSSewGCZJInEJMkrJAbKMUw0M4glSrEoqzdqq1ZNMJdKqkTKuEKow6r+yamj6qkRrysCuIdx6ob7TDPEpDDXqdHsqbHLkEYAEIQAAEw4AAzI55BODYmQADVwAAaA7yFO0hTpoU6wFOzBToIU7WAATVu577uex7ntYABjeRWg2AB7ABbNoTkB-Zdh+qA2MgZoAEc3maZZYYIBH4DRlGDV4dGcjhrGMZxxGckxt5TXR15kcJk0KZyKmSfJxHeHxhnGYZ5GzRp+G+WRtQJHie0snsCQIyZDbtt2-b2CZEJdKEeLmCFhIRaFkYyCEUg0VF8gH1V4R8oxTXW1dBwsWTagUtK50QUSi2zBto37aCQ20W0VhaHAHBEo9t3hH7JNys5eb5XsprGV0rQJQj2qo8mqPFPK+UPQWgOOs5cVWzDnQbZTm2mvlHPuqWwPkr0aqvfz1Ky5RQa06FTU4kZSvwEmzcZvKzdGX+OJ246qP+rEJJE6kShwHD0es8V-md1VjuFiF7usPRdKFglSJH2GAwyL9ZwnAwdxPG8OBcD8AJFmCPhtmEe0ZCcmQcu2k5Wg4JlMEJCx3ic3vJj-VeCSAA 1000,500 noborder}}
 </WRAP> </WRAP>
  
 ===== 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**: expecting the circuit to automatically enforce \(u_{\rm d}=0\)Without negative feedback, \(u_{\rm d}=0\) is only the *switching boundary*, not an operating point. 
 +  * **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/high-ohmic output. 
 +  * **Forgetting saturation limits**: assuming ideal logic levels, while real comparators are limited by their supply voltages \(U_{\rm sat,min}\), \(U_{\rm sat,max}\). 
 +  * **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**: losing track of the sign of \(u_{\rm O}\) when deriving or applying 
 +    \[ 
 +      U_{\rm sh,u}=+\frac{R_1}{R_2}u_{\rm O}, \qquad 
 +      U_{\rm sh,l}=-\frac{R_1}{R_2}u_{\rm O}. 
 +    \] 
  
 ===== 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="info" title="Task 23.1 Comparator Output States"> <WRAP group><WRAP column 2%>{{fa>pencil?32}}</WRAP><WRAP column 92%> 
 + 
 +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="xs" type="link" collapse="Loesung_23_1_Tipps">{{icon>eye}} Tips for the solution</button><collapse id="Loesung_23_1_Tipps" collapsed="true"> 
 +  * 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}$. 
 +</collapse> 
 + 
 +<button size="xs" type="link" collapse="Loesung_23_1_Result">{{icon>eye}} Result</button><collapse id="Loesung_23_1_Result" collapsed="true"> 
 +  * $u_{\rm d}=+1.0~{\rm V}$ 
 +  * $u_{\rm O}=U_{\rm sat,max}=5~{\rm V}$ 
 +</collapse> 
 + 
 +</WRAP></WRAP></panel> 
 + 
 + 
 +<panel type="info" title="Task 23.2 Schmitt Trigger Thresholds"> <WRAP group><WRAP column 2%>{{fa>pencil?32}}</WRAP><WRAP column 92%> 
 + 
 +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,max}=+12~{\rm V}, \qquad U_{\rm sat,min}=-12~{\rm V} 
 +\] 
 + 
 +  - 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="xs" type="link" collapse="Loesung_23_3_Tipps">{{icon>eye}} Tips for the solution</button><collapse id="Loesung_23_3_Tipps" collapsed="true"> 
 +  * Use the relations 
 +    \[ 
 +      U_{\rm sh,u}=+\frac{R_1}{R_2}u_{\rm O}, \qquad 
 +      U_{\rm sh,l}=-\frac{R_1}{R_2}u_{\rm O} 
 +    \] 
 +</collapse> 
 + 
 +<button size="xs" type="link" collapse="Loesung_23_3_Result">{{icon>eye}} Result</button><collapse id="Loesung_23_3_Result" collapsed="true"> 
 +  * $U_{\rm sh,u}=+1.2~{\rm V}$ 
 +  * $U_{\rm sh,l}=-1.2~{\rm V}$ 
 +</collapse> 
 + 
 +</WRAP></WRAP></panel> 
 + 
 + 
 +<panel type="info" title="Task 23.3 Application: De-Noising"> <WRAP group><WRAP column 2%>{{fa>pencil?32}}</WRAP><WRAP column 92%> 
 + 
 +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="xs" type="link" collapse="Loesung_23_4_Tipps">{{icon>eye}} Tips for the solution</button><collapse id="Loesung_23_4_Tipps" collapsed="true"> 
 +  * Consider the behavior of the comparator near $u_{\rm d}=0$. 
 +</collapse> 
 + 
 +<button size="xs" type="link" collapse="Loesung_23_4_Result">{{icon>eye}} Result</button><collapse id="Loesung_23_4_Result" collapsed="true"> 
 +  * Without hysteresis: output chatter due to noise crossings. 
 +  * With hysteresis: two thresholds prevent switching for small fluctuations. 
 +</collapse> 
 + 
 +</WRAP></WRAP></panel> 
 + 
 +<panel type="info" title="Task 23.4 Thresholds from Resistor Ratio"> <WRAP group><WRAP column 2%>{{fa>pencil?32}}</WRAP><WRAP column 92%> 
 + 
 +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="xs" type="link" collapse="Loesung_23_7_Tipps">{{icon>eye}} Tips for the solution</button><collapse id="Loesung_23_7_Tipps" collapsed="true"> 
 +  * Recall that the thresholds are proportional to the output saturation voltage. 
 +</collapse> 
 + 
 +<button size="xs" type="link" collapse="Loesung_23_7_Result">{{icon>eye}} Result</button><collapse id="Loesung_23_7_Result" collapsed="true"> 
 +  * $U_{\rm sh,u}=+\dfrac{R_1}{R_2}\,8~{\rm V}$, $U_{\rm sh,l}=-\dfrac{R_1}{R_2}\,8~{\rm V}$. 
 +  * A larger ratio $R_1/R_2$ widens the control band. 
 +</collapse> 
 + 
 +</WRAP></WRAP></panel> 
 + 
  
 ===== Embedded resources ===== ===== Embedded resources =====