0% found this document useful (0 votes)
4 views16 pages

Lecture-09-System Modelling

Uploaded by

shubhisachan843
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
4 views16 pages

Lecture-09-System Modelling

Uploaded by

shubhisachan843
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 16

System Modelling

Automation and Robotics


Transfer function

● The input to a system


termed as cause
operates through a Input, Output,
transfer operation R(s) System, C(s)
termed as transfer G(s)
function to produce an
effect resulting in output
or response termed as
controlled variable.
Transfer function

● Thus the cause and effect relationship between the


output and input is related to each other through a
transfer function.
● The transfer function of a linear time-invariant (LTI)
system is defined to be the ratio of of the Laplace
transform of the output variable to the Laplace
transform of the input variable under the
assumption that all initial conditions are zero.
Transfer function of a Mechanical
System
Find the transfer function
between the displacement x(t)
and the force applied F(t) of the
Mass Spring Dashpot System

Mass, m = 1000kg,

Damping coefficient, c = 25 kg/s, F(t)

Spring constant, k = 1.87kg/s^2


Transfer function of a Mechanical
System
Applying Newton's law of motion to the free-body
diagram:

m * x"(t) = F(t) - c * x'(t) - k * x(t)


or, F(t) = m * x"(t) + c * x'(t) + k * x(t)
Taking laplace transform on both sides:
F(s) = m * X(s) * s^2 + c * X(s) * s + k * X(s)
or, F(s) = (m * s^2 + c * s + k ) * X(s)
Transfer function of a Mechanical
System

Therefore, the transfer function,


G(s) = X(s)/F(s)
= 1 / (m * s^2 + c * s + k )
Time response of an LTI system

For feedback control system given below plot the time response

G(s) = K(s+0.1)/(s+0.5)

H(s) = 1 Forward
Transfer Function
Input, Error, Output
R(s) E(s) C(s)
K=1
G(s)

H(s)
Feedback Transfer Function
Installing Conda - Package manager

● Download and install Miniconda in your PC using


the following link:

https://docs.conda.io/en/latest/miniconda.html

● Conda is a open-source package management


system and environment management system for
Python
● Miniconda is minimal installer for conda
Installing Conda - Package manager

● To install new packages, type at command prompt:


○ conda install <package_name>
● To update packages
○ conda update <package_name>
● To add a channel for searching packages
○ conda config --add channels <channel_name>
Conda - Environments

● Different environments can be created for different


applications with different sets of packages
● To create an environment
○ conda create --name <environment_name>
● To activate an environment
○ activate <environment_name>
Installing Packages

● Install NumPy, Matplotlib, Jupyter Notebook


○ $ conda install numpy matplotlib jupyter

● Install Control Module


○ $ pip install control
Verifying Installation
$ ipython
Python 3.8.3 (default, May 19 2020, 18:47:26)
Type 'copyright', 'credits' or 'license' for more information
IPython 7.16.1 -- An enhanced Interactive Python. Type '?' for help.
In [1]: import sys
In [2]: print(sys.version)
3.8.3 (default, May 19 2020, 18:47:26)
[GCC 7.3.0]
In [3]: exit
Software Simulation in Python
import control.matlab as ctl # Matlab like functions
import matplotlib.pyplot as plt # Plot functions
import numpy as npy # Array function
K = 1
# (1) `G(s) = K(s+0.1)/(s+0.5)` and `H(s) = 1` (type 0 system)
num = K*[1,0.1] # Numerator
den = [1,1] # Denominator
Gs1 = ctl.tf(num,den) # Forward transfer function
Hs1 = ctl.tf(1,1) # Feedback transfer function
Ms = ctl.feedback(Gs1,Hs1)
yout, T = ctl.impulse(Ms)
plt.plot(T,yout)
Software Simulation in Python ...
# (2) `G(s) = K(s+1)(s+0.2)/(s+1.2)(s+0.7)` and `H(s) = 1` (type 0 system)
zeros = [-1,-0.2]
poles = [-1.2, -0.7]
gain = K
num, den = ctl.zpk2tf(zeros,poles,gain) # Create transfer function from
zero, pole and gain
Gs2 = ctl.tf(num,den)
Hs2 = ctl.tf(1,1) # Feedback transfer function
Ms2 = ctl.feedback(Gs2,Hs2)
yout, T = ctl.impulse(Ms2)
plt.plot(T,yout)
Software Simulation in Python ...
# Task (b): To plot step response of System
T = npy.arange(0,50,0.1)
l = len(T)
U = npy.ones(l)

print('Step response of the system 1:')


yout, T, xout = ctl.lsim(Ms1,U,T)
plt.plot(T,yout,T,U)

print('Step response of the system 2:')


yout, T, xout = ctl.lsim(Ms2,U,T)
plt.plot(T,yout,T,U)
Practice Problem
For feedback control system plot the time responses

(1) G(s) = K(s+0.1)/(s+0.5) and H(s) = 1

(2) G(s) = K(s+1)(s+0.2)/(s+1.2)(s+0.7) and H(s) = 1

(3) G(s) = K(s+0.1)/s(s+0.5) and H(s) = 1

(4) G(s) = K(s+1)(s+0.2)/s(s+1.2)(s+0.7) and H(s) = 1

(5) G(s) = K(s+0.1)/s^2(s+0.5) and H(s) = 1

(6) G(s) = K(s+1)(s+0.2)/s^2(s+1.2)(s+0.7) and H(s) = 1

Assume K = 1

You might also like