02 First Order Systems

43
Department of Mechanical Engineering, NTU National Taiwan University ENGINEERING Mechatronic and Robotic Systems Laboratory System Dynamics Yu-Hsiu Lee 2. First Order Systems

Transcript of 02 First Order Systems

Department of Mechanical Engineering, NTU

National Taiwan UniversityENGINEERINGMechatronic and Robotic Systems Laboratory

System Dynamics

Yu-Hsiu Lee

2. First Order Systems

9/30/2021 2Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Outline

• Examples of first-order systems

Circuits

Mechanical system

Fluid system

• Solution to first-order IVP

• Numerical simulation

• LTI system properties

Linearity and superposition

Time-invariance

Convolution representation

Transfer function representation

Frequency response function

• Summary

Examples of First-Order Systems

9/30/2021 4Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

First Order Systems

• General form

• Block diagram

Better visualization

Facilitate simulation

• Example: low-pass RC circuit

_

9/30/2021 5Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Low-Pass Filter

• Example: low-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Substitute in:

gives

Collecting terms

in matrix form:

9/30/2021 6Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Low-Pass Filter

• Example: low-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Solution

Amplitude v.s. frequency

Non-dimensional frequency

9/30/2021 7Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Low-Pass Filter

• Example: low-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Solution

Phase v.s. frequency

Non-dimensional frequency

9/30/2021 8Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Low-Pass Filter

• Example: low-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Solution

Block diagram

Try sinusoidal inputs with different frequencies

_ IC

9/30/2021 9Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

High-Pass Filter

• Example: high-pass RC circuit

Governing equations

Sinusoidal input

Assume steady-state output is sinusoidal

Similar analysis gives

9/30/2021 10Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

High-Pass Filter

• Example: high-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Solution

Amplitude v.s. frequency

Non-dimensional frequency

9/30/2021 11Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

High-Pass Filter

• Example: high-pass RC circuit (cont’d)

Sinusoidal input

Assume steady-state output is sinusoidal

Solution

Phase v.s. frequency

Non-dimensional frequency

9/30/2021 12Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

High-Pass Filter

• Example: high-pass RC circuit

Governing equation

Take integral of the equation

Block diagram

Try sinusoidal inputs with different frequencies

IC

9/30/2021 13Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Sliding Mass

• Example: sliding mass

Governing equation

Force and velocity are related by a 1st order ODE

Force to position should be a 2nd order system

Block diagram

_ IC

9/30/2021 14Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Water Tank

• Example: water tank

Governing equations

After substitution

Block diagram

o Can simulate nonlinear system

o Can obtain a linear 1st order approximation

_ IC

9/30/2021 15Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Water Tank

• Example: water tank

Operating point

After substitution

o Linear approximation

Linear ODE

9/30/2021 16Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Water Tank

• Example: water tank

Operating point

Block diagram

• Linearized model can be used for linear control design

• Developed linear control will be tested on the nonlinear model to ensure the effectiveness

_ IC

Solution to First-Order IVP

9/30/2021 18Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Initial Value Problem

• Problem

Homogenous solution

Stable if

Particular solution

Non-uniqueness

• Solve for particular solution

Variation of parameter, try

Solution

W.L.O.G.

Free response Forced response

9/30/2021 19Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Initial Value Problem

• Example: low-pass circuit with • Simulation results

Solution of IVP

Homogenous and particular solutions

9/30/2021 20Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Initial Value Problem

• MATLAB script • Simulation results

Solution of IVP

Homogenous and particular solutions

Numerical Simulation

9/30/2021 22Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Numerical Simulation

• General form

Special case: linear systems

• Example: RLC circuit

Governing equation

Standard form

9/30/2021 23Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Numerical Simulation

• General form

Special case: linear systems

• Example: damped pendulum

Governing equation

Standard form

9/30/2021 24Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Numerical Simulation

• Simulation of a dynamic system boils down to solving differential equations

What happens after you click “Run”?

What is ode45 or lsim doing?

• Problem

Given

Solve for

• Mathematically,

This is an integration problem

• Recursive implementation

Rewrite

Because

Recursive form

9/30/2021 25Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Numerical Simulation

• Computer simulation

Given

Different solvers/algorithms use different ways to approximate the integral

• Recursive implementation

Rewrite

Because

Recursive formis the area under

(integration)

9/30/2021 26Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Rectangular Integration

• Also called Euler’s method

• Illustration

• Algorithm

Rectangular (1-point):

9/30/2021 27Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Trapezoidal Integration

• Also called improved Euler’s method or Heun’s method

We don’t know

Use rectangular formula to approximate

• Illustration

• Algorithm

Trapezoidal (2-point):

Area of the trapezoid

9/30/2021 28Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Runge-Kutta Integration

• Different solvers: ode15, ode23, ode45, etc.

Different ways to integrate

Higher-order (more points) methods usually gives better accuracy with increased complexity

The most common one is the 4th order Runge-Kutta integration (ode45)

• Algorithm (without derivation)

R-K integration (4-point):

9/30/2021 29Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Comparison of Different Integration Methods

• Example

Analytical solution for comparison

(1) Rectangular integration: (2) Trapezoidal integration: (3) R-K integration:

LTI System Properties

9/30/2021 31Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Linearity and Superposition

• Illustration

• For 1st order systems

This result holds for general LTI systems

LTI System

LTI System

LTI System

Don’t forget IC’s!

9/30/2021 32Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Linearity and Superposition

• Example • Simulation result

9/30/2021 33Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Linearity and Superposition

• Example • Simulation result

9/30/2021 34Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Time Invariance

• Illustration

• For 1st order systems

This result holds for general LTI systems

LTI System

LTI System

9/30/2021 35Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Convolution Representation

• Solution to first-order ODE

• Definition of convolution

Impulse response of 1st-order system

Readily obtained by the sifting property

• To show the equivalence

Causal system: future input has no effect

Regard IC as an input effect from

Impulse response fully characterizes the behavior

LTI System

9/30/2021 36Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Convolution Representation

• Fact: impulse response can be constructed by weighted sum of homogenous solution of IVP

Can be viewed as the response from IC

This result holds for general LTI systems

• Visualization of convolution

LTI System

LTI System

=

9/30/2021 37Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Transfer Function Representation

• Laplace transform

Meaning of Laplace variable:

Convert ODE into an algebraic equation

• Typical functions and transforms

9/30/2021 38Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Transfer Function Representation

• Laplace transform

Important convolution property

Can solve ODE easily

• Example:

Transfer function

9/30/2021 39Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Transfer Function Representation

• Laplace transform

Important convolution property

Can solve ODE easily

• Equivalence

=Transfer function does

not address IC!

Transfer function

9/30/2021 40Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Frequency Response Function (FRF)

• A special case when input is sinusoidal

Study the behavior in steady state

• Fact: output will oscillate at the same frequency but with different amplitude and phase

Provide intuition in frequency domain

• Perspective of convolution

FRF does not addresstransient response!

9/30/2021 41Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Frequency Response Function (FRF)

• FRF is the Fourier transform of the impulse response

• First-order system:

• Verification

Inverse Laplace transform

Summary

9/30/2021 43Mechatronic and Robotic Systems Laboratory, Department of Mechanical Engineering, NTU

Summary

First-orderLTI systems

ODE

Convolution Transfer Function

FRF:Impulse response:Fourier transform

Does not addressinitial condition

Does not address transient response