Meen19111103 Lab 04

Download as pdf or txt
Download as pdf or txt
You are on page 1of 9

Lab # 04

Objective:

To practice generating and analysing the transfer functions and roots of some basic
MATLAB’s Control systems.
Introduction to Control Engineering for MATLAB
Control engineering is a discipline that focuses on the design and implementation of control
systems to regulate and manage the behavior of dynamic systems. MATLAB, a widely used
programming language and environment, provides powerful tools for control engineering
applications. In this introduction, we will explore the fundamental concepts and capabilities
of MATLAB for control engineering.
Control Engineering Overview:
Definition of control engineering and its role in managing dynamic systems.
Importance of control systems in various industries and applications.
System Modeling:
Mathematical modeling of dynamic systems using differential equations, transfer functions,
state-space equations, or block diagrams.
MATLAB's capabilities for system modeling and representation.
Control System Analysis:
Analysis of control system behavior, stability, transient response, steady-state response, and
frequency response.
Utilizing MATLAB functions for control system analysis and visualization of results.
Control System Design:
Designing controllers to achieve desired performance specifications.
Available control design techniques in MATLAB, such as PID controllers, state feedback,
and optimal control methods.
Simulation and Verification:
Simulating control system behavior using mathematical models.
MATLAB's simulation capabilities for validating designs and exploring system responses
under different conditions.
Implementation and Real-Time Control:
Deploying control algorithms on hardware platforms for real-time control.
MATLAB's support for implementing control systems on microcontrollers, PLCs, and other
hardware.
Benefits of MATLAB for Control Engineering:
Overview of MATLAB's extensive library of functions and toolboxes dedicated to control
system analysis and design.
Graphical user interface (GUI) tools in MATLAB for intuitive control system development.
In summary, control engineering involves the design, analysis, and implementation of control
systems, and MATLAB offers a range of powerful tools and functionalities to support these
tasks. By leveraging MATLAB's capabilities, control engineers can model, analyze, simulate,
and design control systems efficiently, leading to optimized system performance and
improved control over dynamic processes.
First order systems:
In control engineering, a first-order system refers to a system whose dynamics can be
described by a first-order transfer function. A transfer function is a mathematical
representation of a system's input-output relationship in the frequency domain.
A first-order transfer function is characterized by a single pole in its denominator and no
zeros. The general form of a first-order transfer function is:
G(s) = K / (sT + 1)
where:
• G(s) is the transfer function,
• s is the complex frequency variable (s = σ + jω),
• K is the system gain,
• T is the time constant of the system.
The transfer function represents the relationship between the Laplace transform of the
system's output and the Laplace transform of the system's input.
The response of a first-order system to different inputs can be analyzed using various
techniques. Some important characteristics of first-order systems include:
• Time Constant (T):
The time constant represents the time it takes for the system's output to reach approximately
63.2% of its final value in response to a step input. A larger time constant indicates slower
response and vice versa.
• System Gain (K):
The system gain determines the amplification of the input signal. It represents the ratio of the
steady-state output to the steady-state input when the frequency is zero.
• Rise Time and Settling Time:
The rise time is the time taken by the system's output to rise from 10% to 90% of its final
value in response to a step input. The settling time is the time it takes for the output to reach
and remain within a specified percentage (e.g., 2%) of the final value.
First-order systems are commonly encountered in control engineering when modeling simple
physical systems or processes that have a single energy storage element or dominant time
constant.
Understanding the behavior of first-order systems is crucial for designing control systems,
tuning controllers, and analyzing system response characteristics such as stability, overshoot,
and settling time.
In MATLAB, a first-order system refers to a system that can be described by a first-order
ordinary differential equation (ODE) or transfer function. First-order systems are commonly
used to model physical systems or dynamic processes with a single energy storage element.
The general form of a first-order ODE is:
dy/dt = ay + bu
where:
• dy/dt represents the derivative of the output variable y with respect to time t,
• a is the coefficient of the output variable y,
• b is the coefficient of the input variable u.
In control engineering, the rise time and settling time are important performance metrics used
to assess the transient response of a system.
Rise Time:
The rise time is the time it takes for the system's response to transition from a specified lower
threshold to a specified upper threshold for the first time. Typically, these thresholds are
chosen as a percentage of the final value, such as from 10% to 90% or 5% to 95% of the final
value. The rise time provides an indication of how quickly the system responds to changes in
the input.
Settling Time:
The settling time is the time it takes for the system's response to reach and remain within a
specified tolerance band around its final value. The tolerance band is usually defined as a
percentage of the final value, such as ±2% or ±5%. The settling time characterizes the speed
at which the system reaches a steady-state and stops oscillating.
In control engineering, the rise time and settling time are typically determined through
analysis or simulation of the system's step response. The step response is the output of the
system when subjected to a step input, which is a sudden change from one value to another.
To calculate the rise time and settling time in control engineering, we can perform the
following steps:
• Obtain the step response of the system either through simulation or experimental
measurements.
• Determine the upper and lower thresholds for the rise time calculation. For example, if we
choose 10% to 90% of the final value, we will define the upper threshold as 90% and the
lower threshold as 10% of the final value.
• Measure the time it takes for the response to cross the upper and lower thresholds. The
difference between these two times is the rise time.
• Define a tolerance band around the final value to calculate the settling time. The settling
time is the time it takes for the response to remain within this tolerance band.
• We have to keep in mind that these calculations may vary depending on the specific
requirements and conventions used in your control system analysis or design.

2nd Order Control Systems:


A second-order control system refers to a control system that can be described by a second-
order transfer function or differential equation. Second-order systems are commonly
encountered in control engineering and are used to model a wide range of physical systems.
The general form of a second-order transfer function is:
G(s) = K / (s^2 + 2ζω_ns + ω_n^2)
where:
• G(s) is the transfer function,
• K is the system gain,
• ζ is the damping ratio,
• ω_n is the natural frequency.
The damping ratio (ζ) determines the amount of damping in the system and affects the
response characteristics such as overshoot and settling time. The natural frequency (ω_n)
represents the undamped frequency of oscillation in the system.
Alternatively, a second-order system can be described by a second-order differential equation
in the time domain. The general form of a second-order differential equation is:
d^2y/dt^2 + 2ζω_ndy/dt + ω_n^2y = Ku(t)
where:
• y is the system output,
• t is time,
• u(t) is the system input,
• ζ and ω_n have the same meanings as in the transfer function representation,
• K is the system gain.
The response of a second-order control system can exhibit various characteristics, including
overshoot, settling time, and damping. The behavior of the system depends on the values of
the damping ratio and natural frequency.
In control engineering, analyzing and designing second-order control systems involves
techniques such as root locus, frequency response analysis, pole placement, and controller
design methods (e.g., PID controllers). These techniques allow engineers to understand and
manipulate the system's response to meet desired performance specifications.
Tasks

Task-01:

Use MATLAB and the Symbolic Math Toolbox to find the Laplace transform of the
following time functions:

a. f = 8*(t^2)*{cos(3t +45)}
b. f = 3t*exp(-2t)*{sin(4t +60)}

Figure 1: MATLAB code for Task1

Figure 2: Command windows answer for Task1 part a


Figure 3: Command Windows answer for Task 1 part b

Task-02:

Use MATLAB and the Symbolic Math Toolbox to find the inverse Laplace transform of the
following frequency functions:

Figure 4: Equations to be solved on MATLAB

Figure 5: MATLAB code for Task2


Figure 6: Workspace Answer for Task 2
Task-03:

Find out the roots of a transfer function and plot the poles and zeros

Given the transfer function:

T(s) = (s^3+3s^2+5) / {(s^2+5s+4)(s^2+2s+9)}

Figure 7:MATLAB code for Task3

Figure 8: Workspace answer for Task 3


Figure 9: Plot of Task 3

You might also like