System modeling and
Simulation
If you have a smart project, you can say "I'm an engineer“
Lecture 7
Staff boarder
Dr. Mostafa Elsayed Abdelmonem
System modeling and Simulation
Lecture aims:
Facilitate combining and manipulating differential equations
Identify the equations of motion of systems
Understand the mathematical modeling of all systems and combination
Modeling Of Electronic Circuits
Structure of Mechatronic Systems
٤
Conditioning Circuits
Signal Amplifiers
Designed to amplify input signals to a right level to be
noticeable for further uses.
Typical input signals are:
thermocouple, RTD, pressure, strain, flow, etc.
Typical outputs include:
high level dc voltages (0 to 5 or 0 to 10 volts),
process current (0 to 20 mA or 4 to 20 mA)
There are commercial signal conditioners with computer
٦
interface ready.
Operational Amplifier (Op Amp)
An operational amplifier (Op Amp) is an
integrated circuit of a complete amplifier
circuit.
Vi1 - Vout
A
Op amps have an extremely high gain
Vi2
B
+ (A=105 typically).
Op amps also have a high input impedance
(R=4 MΩ , typically) and a low output
Vout Vi1 Vi 2 A
impedance (in order of 100 Ω , typically) .
٧
Characters of Operational Amplifiers
high open loop gain
high input impedance
Not used 8 7 6 5 Offset null
low output impedance
low input bias current
Offset null 1 2 3 4
wide bandwidth
large common mode
rejection ratio (CMRR)
٨
Input Impedance
WHY HIGH?
Input Circuit Output
For an instrument the ZIN should
be very high (ideally infinity) so it
does not divert any current from
Impedance between input the input to itself even if the input
terminals = input
impedance has very high resistance.
e.g. an op-amp taking input from a
microelectrode. ٩
Output Impedance
Impedance between output terminals =
output impedance
WHY LOW?
Input Circuit Output For an instrument the ZOUT should
be very low (ideally zero) so it can
supply output even to very low
resistive loads and not expend
most of it on itself. ١٠
Voltage Output from an Amplifier
The linear range of an amplifier
is finite, and limited by the
Vout
supply voltage and the
A Non-linear characteristics of the amplifier.
region
Linear Vin If an amplifier is driven beyond
region
the linear range (overdriven),
serious errors can result if the
gain is treated as a constant.
١١
Analysis of Op-Amp Circuits
The following rules can be applied to almost
all op-amp circuits with external feedback:
Vi1 - Vout
A
Vi2 No current can enter op amp input terminals,
B
+
because of infinite input impedance
Vout AOG V V The +ve and –ve (non-inverting and inverting)
inputs are forced to be at the same potential.
١٢
Voltage Follower
V+ = VIN.
By virtual ground, V- = V+
Thus Vout = V- = V+ = VIN !!!!
•Due to the infinite input impedance of an op amp, no
current at all can be drawn from the circuit before VIN.
Thus this part is effectively isolated.
•Very useful for interfacing to high impedance sensors
such as microelectrode, microphone…
١٣
Inverting Amplifier
Point B is grounded, so does
RF
point A (very small).
R1 Voltage across R1 is Vin, and
- across RF is Vout.
Vin A
Vout
B
+ The output node voltage
R3
R1 R F determined by Kirchhoff's
R1 R F Current Law (KCL).
Circuit voltage gain determined
V R
G out F by the ratio of R1 and RF.
V in R1
١٤
Analysis of Inverting Amplifier
RF
iF
R1 V-
-
Vin i- A
i1 i+
Vout i1 i i F i F
V+B +
R V IN V V V out
i1 and iF
R1 RF
Ideal transfer characteristics: i 0 V 0 V 0
i i 0 V IN V V out R
R1
out
RF or V in
F
R1
V V
١٥
Noninverting Amplifier
Point VA equals to Vin .
RF
Op-amp circuit is a voltage divider.
R1
- R1
A
V A V out
R1 R F
Vin B
+ Vout
Circuit voltage gain determined by the ratio of R1 and RF.
V out R
G 1 F
V in R1
١٦
Differential Amplifier
RF Point B is grounded, so does
point A (very small).
R1
V1 -
A Voltage across R1 is V1, and
R2
V2 + Vout across R2 is V2.
B
R3
Normally: R1 = R2, and RF = R3.
Commonly used as a single op-
amp instrumentation amplifier.
RF
V out (V 2 V 1 )
R1
١٧
Design an Instrumentation Amplifier
RF
Design a single op-amp instrumentation amplifier.
R1
R1 = R2, RF = R3
V1 -
A Determine the instrumentation gain.
R2
Vout
V2 + V1 V A V V OUT
B A iA
R3 R1 RF
V2 VB V
iB B
R2 R3
i A iB 0
VA VB V1 V A V V OUT V V VB
A B 2
RF R1 RF R3 R2
V out (V 2 V1 )
R1 V OUT V A V B V 2 V 1 V A V B
RF R 1 ١٨
Instrumentation Amplifier with isolators
In order to avoid high current driving to the circuit, V1 and V2 input lines
are connected straight to the inputs of two voltage-follower op-amps,
giving very high impedance. The two op-amps on the left now handle
the driving of current through the resistors instead of letting the input
voltage sources (whatever they may be) do it.
١٩
Example 1:
A Sensor outputs a voltage range of 20 to 250 mV. The sensor output has to
feed computer based controller that work at voltage range of 0 to 5 V.
Design the required conditioning circuit in order to get the demand
voltage range.
٢٠
Instrumentation Amplifier with Adjustable Gain
Gain in the multiple stages: i.e.
Inverting
High Gain – so, you can
amplifier
amplify small signals
Put
some
lowpass
and
high
pass
filters!
Differential
amplifier but
with very high
input
impedance
Differential amplifier -> Non-inverting
- So, you can amplifier
it rejects common-mode
connect to ٢١
interference -> so you
sensors
can reject noise
Instrumentation Amplifier: Stage 1
Recall virtual ground of op-amps
I1 = (V1 – V2)/R1
Recall no current can enter op-
I2 amps and Kirchoff’s current law
I1
I3
I2 = I 3 = I 1
Recall Kirchoff’s voltage law
VOUT = (R1 + 2R2)(V1 – V2)/R1
= (V1 – V2)(1+2R2/R1)
٢٢
Instrumentation Amplifier: Stage 2
Recall virtual ground of opamps
and voltage divider
V- = V+ = V2R4/(R3 + R4)
I2 Recall no current can enter
I1
I3 opamps
(V1 – V-)/R3 = (V- – VOUT)/R4
Solving,
VOUT = (V2 – V1)R4/R3
٢٣
Instrumentation Amplifier: Complete
VOUT = (V2 – V1)(1 + 2R2/R1)(R4/R3)
Gain from Stage I and Stage II ٢٤
Example 2:
Re-solve example 1 by using the adjustable instrumentation amplifier.
٢٥
Example 3:
A sensor outputs a voltage ranging -2.4 to -1.1 V. For interface to ADC,
this needs to be 0 to 2.5 V. Develop the required signal conditioning.
٢٦
Example 4:
Temperature is to be measured in the range of 250oC to
450oC. The sensor resistance that varies linearly from 280Ω
to 1060Ω for the temperature range. Power dissipated in
the sensor must be kept below 5mW. Develop analog signal
conditioning that provides a voltage varying linearly from -
5 to 5 V for the temperature range. The load is high
impedance recorder.
٢٧
Sources of Amplifier Errors
Temperature drift: a drift in the output signal per unity change in the temperature
(e.g., μv/ oC)
Offset current: present at the input leads due to bias currents that are needed to
operate the solid-state circuitry.
Offset voltage that might be present at the output even when the input leads are open.
Common mode output voltage
The inverting gain is not equal to the non-inverting gain.
Internal noise
Ground Loop Noise: which can enter the signal leads because of the possible potential
difference between the two ground points.
٢٨
Mathematical Modeling Of
Electronic Circuits
Obtain the relationship between the output eo and the inputs e1, e2, and e3
e' = 0. Hence, we have
Outlines of Filters
input output
Filter
Filtering:
Certain desirable features are retained
Other undesirable features are suppressed
٣٠
Classification of Filters
Signal Filter
Analog Filter Digital Filter
Element Type Frequency Band
Active Passive Low-Pass Band-Pass All-Pass
High-Pass Band-Reject
٣١
Classification of Filters
Filter classification according to frequency response
Low-pass filter
High-pass filter
Band-pass filter
Band-stop (Notch) filter
٣٢
State-variable filters
Also known as a Universal Active Filter
Consists of one amplifier and two integrators
High-pass, low-pass and band-pass in the same IC
Example below: Burr Brown UAF42
٣٣
Mathematical Modeling Of
Electronic Circuits
V 2( s ) 1 V 2( s )
RCs
V 1( s ) RCs V 1( s )
Mathematical Modeling Of
Electronic Circuits
V 2( s ) R 2 R 1 C s 1
V 2( s ) R 1 C 1 s 1 R 2 C 2 s 1
V 1( s ) R1
V 1( s ) R 1 C 2 s
Low Pass RC Filters
The critical frequency (fc): is the frequency for which the ratio of
the to the input voltage is approximately 0.707. in terms of the
resistor and capacitor, the critical frequency is given by:
1
fc
2RC
The output-input voltage ratio can be computed by:
Vout 1
Vin 1 ( f / fc )2 ٣٦
Example:
A measurement signal has a frequency < 1 kHz, but there is unwanted noise
at about 1 MHz. Design a low-pass filter that attenuates the noise to 1%.
What is the effect on the measurement signal at its maximum of 1 kHz?
٣٧
High Pass RC Filters
High pass filter passes high frequencies and blocks low
frequencies.
1
fc
2RC
The output-input voltage ratio can be computed by:
Vout
f / fc
Vin 1 ( f / fc )2 ٣٨
Example:
Pulses for stepping motor are being transmitted at 2000 Hz.
Design a filter to reduce 60-Hz noise but reduce the pulses
by no more than 3 dB
٣٩
Band Pass RC Filters
Band pass filter blocks frequencies below a low limit and above
a high limit while passing frequencies between the limits.
1 1
fH fL
2RL C L 2RH C H
The output-input voltage ratio can be computed by:
Vout fH f
Vin ( f 2 f H f L ) 2 [ f L (1 ( RH / RL )) f H ]2 f 2
٤٠
Example:
A signal-conditioning system uses a frequency variation from 6 kHz
to 60 kHz to carry measurement information. There is a
considerable noise at 120 Hz and 1 MHz. Design a band pass
filter to reduce the noise by 90%.
٤١