modelComparator
Comparator
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This is a comparator. Resistance R1 can be chosen, resistance R2 is defined by the desired reference voltage Vref (between Vn and Vp). The output switches between Vn for input voltage < Vref and Vp for input voltage > Vref.
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Voltage | Vps | +15 | Positive supply |
| SI.Voltage | Vns | -15 | Negative supply |
| SI.Voltage | Vin | 5 | Amplitude of input voltage |
| SI.Frequency | f | 10 | Frequency of input voltage |
| SI.Voltage | Vref | 0 | Reference voltage |
| Real | k | (Vref - Vns)/(Vps - Vns) | Calculated potentiometer ratio to reach Vref |
| SI.Resistance | R | 1000 | Resistance of potentiometer |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica.Electrical.Analog.Ideal.OpAmpLimited | opAmp | ||
| Modelica.Electrical.Analog.Basic.Ground | ground | ||
| Modelica.Electrical.Analog.Sources.TrapezoidVoltage | vIn | ||
| Modelica.Electrical.Analog.Sensors.VoltageSensor | vOut | ||
| Modelica.Electrical.Analog.Basic.Potentiometer | potentiometer | ||
| Modelica.Electrical.Analog.Sources.SupplyVoltage | supplyVoltage |