The document discusses frequency response analysis and control system design. It introduces frequency response, defines it as the steady-state response of a system to a sinusoidal input in terms of gain and phase lag. Bode diagrams are presented as a tool to graphically analyze the frequency response from a transfer function or experimentally. MATLAB functions like tf() and bode() are used to define transfer functions and plot Bode diagrams from the frequency response. Discrete-time PID and PI controller implementations and state-space models are also covered.
Modeling, simulation and control of a robotic armcesarportilla8
This document presents the modeling, simulation, and control of a robotic arm system using a DC motor. It describes the mathematical modeling of the DC motor and robotic arm dynamics. An open-loop simulation is performed to analyze stability and response. A closed-loop system is then designed using a PID controller. Different controller parameters are tested to meet design specifications of less than 5% overshoot, settling time less than 2 seconds, and zero steady-state error. Both P and PID controllers are able to achieve the specifications, with the PID controller providing faster response.
Chapter 3-Dynamic Behavior of First and Second Order Processes-1.pptxaduladube0992
This document discusses the dynamic behavior of first, second, and higher order processes. It begins by defining dynamic behavior as the deviation of the output variable from its desired value, which can occur during startup/shutdown or due to disturbances. It then examines the dynamic behavior of first order processes, describing their standard inputs (step, ramp, sinusoidal, etc.), parameters (time constant and gain), and step response characteristics. Next, it discusses second order processes and their standard transfer function. It analyzes the step responses of second order systems and how they are affected by the damping coefficient.
time domain analysis, Rise Time, Delay time, Damping Ratio, Overshoot, Settli...Waqas Afzal
Time Response- Transient, Steady State
Standard Test Signals- U(t), S(t), R(t)
Analysis of First order system - for Step input
Analysis of second order system -for Step input
Time Response Specifications- Rise Time, Delay time, Damping Ratio, Overshoot, Settling Time
Calculations
This presentation gives complete idea about definitions of stability, BIBO, Absolute and relative stability, Routh-Hurwitz Criterion, Special Cases and numerical examples.
Giving description about time response, what are the inputs supplied to system, steady state response, effect of input on steady state error, Effect of Open Loop Transfer Function on Steady State Error, type 0,1 & 2 system subjected to step, ramp & parabolic input, transient response, analysis of first and second order system and transient response specifications
This Presentation explains about the introduction of Frequency Response Analysis. This video clearly shows advantages and disadvantages of Frequency Response Analysis and also explains frequency domain specifications and derivations of Resonant Peak, Resonant Frequency and Bandwidth.
Modeling, simulation and control of a robotic armcesarportilla8
This document presents the modeling, simulation, and control of a robotic arm system using a DC motor. It describes the mathematical modeling of the DC motor and robotic arm dynamics. An open-loop simulation is performed to analyze stability and response. A closed-loop system is then designed using a PID controller. Different controller parameters are tested to meet design specifications of less than 5% overshoot, settling time less than 2 seconds, and zero steady-state error. Both P and PID controllers are able to achieve the specifications, with the PID controller providing faster response.
Chapter 3-Dynamic Behavior of First and Second Order Processes-1.pptxaduladube0992
This document discusses the dynamic behavior of first, second, and higher order processes. It begins by defining dynamic behavior as the deviation of the output variable from its desired value, which can occur during startup/shutdown or due to disturbances. It then examines the dynamic behavior of first order processes, describing their standard inputs (step, ramp, sinusoidal, etc.), parameters (time constant and gain), and step response characteristics. Next, it discusses second order processes and their standard transfer function. It analyzes the step responses of second order systems and how they are affected by the damping coefficient.
time domain analysis, Rise Time, Delay time, Damping Ratio, Overshoot, Settli...Waqas Afzal
Time Response- Transient, Steady State
Standard Test Signals- U(t), S(t), R(t)
Analysis of First order system - for Step input
Analysis of second order system -for Step input
Time Response Specifications- Rise Time, Delay time, Damping Ratio, Overshoot, Settling Time
Calculations
This presentation gives complete idea about definitions of stability, BIBO, Absolute and relative stability, Routh-Hurwitz Criterion, Special Cases and numerical examples.
Giving description about time response, what are the inputs supplied to system, steady state response, effect of input on steady state error, Effect of Open Loop Transfer Function on Steady State Error, type 0,1 & 2 system subjected to step, ramp & parabolic input, transient response, analysis of first and second order system and transient response specifications
This Presentation explains about the introduction of Frequency Response Analysis. This video clearly shows advantages and disadvantages of Frequency Response Analysis and also explains frequency domain specifications and derivations of Resonant Peak, Resonant Frequency and Bandwidth.
The document discusses the Nyquist stability criterion for analyzing the stability of sampled-data control systems. It begins by defining the Nyquist criterion and contour, and how they can be used to determine the number of closed-loop poles outside the unit circle (Z). It then provides an example showing how to apply the Nyquist criterion by plotting the loop gain and counting encirclements of the critical point. The document also discusses modifications to the Nyquist contour when open-loop poles are on the unit circle and defines the Nyquist criterion theorem.
This document discusses mathematical modeling of mechanical systems involving translational and rotational motion. It explains how to form differential equations of motion using Newton's laws and analogies to electrical systems. Models with multiple degrees of freedom are addressed by considering the independent motion of individual points/components and summing the relevant forces for each. Examples of 2 and 3 degree of freedom systems are presented for both translation and rotation.
This document discusses steady-state errors in control systems. It defines steady-state error as the difference between the input and output of a system as time approaches infinity. For a unity feedback system, the steady-state error can be calculated from the closed-loop transfer function T(s) or open-loop transfer function G(s). The steady-state error depends on the type of input signal (step, ramp, or parabola) and number of integrations in the system. Systems are classified as Type 0, 1, or 2 based on this number of integrations. The document provides examples of calculating steady-state error for different system types and input signals.
Time Response Analysis of system
Standard Test Signals
What is time response ?
Types of Responses
Analysis of First order system
Analysis of Second order system
Time response of discrete systems 4th lecturekhalaf Gaeid
1. The document discusses the time response of discrete-time systems, including their transient and steady-state response. It describes parameters for characterizing transient response such as rise time, delay time, peak time, and settling time.
2. Steady-state errors are also examined for different system types (Type-0, 1, 2 systems) and inputs (step, ramp, parabolic). Examples are provided to calculate steady-state errors.
3. The response of discrete-time systems is derived using impulse response sequences and convolution sums. The time response is broken into zero-input and zero-state responses.
25. complex frequency, network function ,poles and zerosshwetabhardwaj48
This document discusses complex frequency, transfer functions, and poles and zeros representations. It defines transient behavior as the response of a system to a change from equilibrium or steady state. Examples of transient behavior include the capacitor voltage during charge and discharge and the inductor voltage initially leading. The document also defines network functions as the ratio of voltage and current transforms. It provides examples of immittance functions for simple and more complex networks and defines driving point functions. Finally, it discusses representing the poles and zeros of a network function on the s-plane.
This document provides an overview of time domain analysis techniques for control systems. It discusses common test inputs like impulse, step, and ramp functions used to characterize system performance. It describes how to determine a system's poles and zeros from its transfer function and use a pole-zero plot to understand system dynamics. Standard forms are presented for first and second order systems. Transient performance metrics like rise time, peak time, settling time, and overshoot are defined for characterizing step responses. The effects of poles and zeros on the system response are explained.
Mathematics (from Greek μάθημα máthēma, “knowledge, study, learning”) is the study of topics such as quantity (numbers), structure, space, and change. There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics
Mathematical Modelling of Control SystemsDivyanshu Rai
Different types of mathematical modeling in control systems [which include Mathematical Modeling of Mechanical and Electrical System (which further includes, Force-Voltage and Force-Current Analogies)]
This document describes a second order transfer function model and classifies different types of second order systems based on their damping ratio (ζ). It defines an undamped system as one where ζ=0, an underdamped system as 0<ζ<1, a critically damped system as ζ=1, and an overdamped system as ζ>1. For each case, it provides the characteristic equation, location of poles in the s-plane, and form of the homogeneous solution. It also discusses transient response properties like rise time, peak time, settling time, and maximum percent overshoot for an underdamped system.
Fourier series and its applications by md nazmul islamMd Nazmul Islam
The document provides an introduction to Fourier series and their applications. It begins with defining a Fourier series as an expansion of a periodic function in terms of an infinite sum of sines and cosines. It then gives the general formula for a Fourier series representing a function f(x) within the interval [-L, L]. Several examples are shown, including finding the Fourier series for the function f(x)=x from 0 to 2π. Applications of Fourier series discussed include expanding periodic functions outside their intervals, noise cancellation, analyzing oscillating functions, simplifying waves, mapping heat distribution, and signal processing. Electrical circuits are described as equivalent to Fourier series representations of voltage sources. Fourier series are also used in signal processing to represent non
Types of electrotherapeutic current (unit 6)
1. Types of electrotherapeutic current :- There are three types of current used in electrotherapeutic purpose:-
Direct current.
Alternating current.
Pulsed current/ pulsatile current.
2. Characteristic features of electrotherapeutic current:- Wave Form:-
The shape of the single pulse or cycle phases as they appear on the graph of current (voltage) versus time is called wave form.
Mainly two types of characteristics are used to describe pulsed and alternating current wave forms:-
Descriptive (qualitative) characteristics.
Quantitative Characteristics.
3. Current modulations:- Changes in current characteristics may be sequential, intermittent or variable in nature and are referred to as modulations.
Amplitude modulation:- Variations in peak amplitude of a series of pulses.
4. Burst Current:- A finite series of pulses, a finite interval of alternation current delivered at a specific frequency over a specific time interval.
Burst duration (with interruption).
Inter burst interval (without interruption).
Continuous mode (without interruption).
The document discusses the response of first and second order systems. It defines poles and zeros as values that make the transfer function infinite or zero. For first order systems, it describes the transient response as gradual change from initial to final output. The time constant determines how quickly the system responds. For second order systems, the natural frequency and damping ratio characterize the response. Underdamped systems oscillate with declining amplitude, with specifications like rise time and settling time defined.
1. The document discusses time response analysis of systems using poles and zeros. It describes different types of system responses including first-order, second-order, and higher-order systems.
2. Key aspects covered include the relationship between poles/zeros and forced/natural responses, effects of varying damping ratios, and specifications for step responses including rise time and settling time.
3. Various figures and examples illustrate pole-zero placement and resulting step responses for different system orders and damping scenarios.
CONTROL SYSTEMS PPT ON A UNIT STEP RESPONSE OF A SERIES RLC CIRCUIT sanjay kumar pediredla
THIS PPT IS SO USEFUL TO KNOW ABOUT THE SERIES RLC CIRCUIT AND IN THIS WE CAN ALSO HOW THE RESPONSE WILL BE THERE FOR A UNIT STEP RESPONSE AND I ALSO KEPT A MATLAB CODING AND GRAPHS FOR THE SERIES RLC CIRCUIT
Active movement refers to voluntary movement performed with one's own strength or energy. Assisted exercise involves applying an external force to help compensate for muscle deficiencies and ensure maximum effort from the weakened muscles. The principles of assisted exercise include applying assistance in the direction of muscle action, starting from a position of minimal tension in antagonistic muscles, and decreasing assistance as muscle power increases. The goal is for the patient to achieve controlled active movement without assistance over time through strengthening and retraining coordination.
This presentation gives complete idea about time domain analysis of first and second order system, type number, time domain specifications, steady state error and error constants and numerical examples.
The document discusses a training on the design and simulation of fuzzy logic controllers using MATLAB. It begins with an introduction to fuzzy logic and fuzzy logic controllers. It then discusses the basic concepts of fuzzy logic including fuzzy sets, membership functions, and fuzzy rules. The document outlines the steps to build a fuzzy logic system and describes various applications of fuzzy logic controllers in areas like temperature control, motor speed control, washing machines, and air conditioners. It also discusses when fuzzy logic is applicable and provides examples of fuzzy logic applications in different domains.
This document provides a table of commonly used Laplace transform pairs. There are 37 entries in the table that list various functions of t and their corresponding Laplace transforms F(s). Each entry is of the form f(t) = L-1{F(s)}, which relates a function of time f(t) to its Laplace transform F(s). Notes are provided to explain concepts like hyperbolic functions and the Gamma function used in some of the entries.
This chapter introduces analog computing techniques. It discusses the components of an analog computer including operational amplifiers, resistors, capacitors and inductors. It describes how operational amplifiers can be used to simulate linear systems using inverting amplifiers, non-inverting amplifiers, summer amplifiers, integrators and differentiators. The chapter also covers how to apply magnitude and time scaling to model systems within the voltage range of an analog computer. An example shows how to derive the scaled dynamic model of a system and realize it using operational amplifiers.
In this presentation we introduce a family of gossiping algorithms whose members share the same structure though they vary their performance in function of a combinatorial parameter. We show that such parameter may be considered as a “knob” controlling the amount of communication parallelism characterizing the algorithms. After this we introduce procedures to operate the knob and choose parameters matching the amount of communication channels currently provided by the available communication system(s). In so doing we provide a robust mechanism to tune the production of requests for communication after the current operational conditions of the consumers of such requests. This can be used to achieve high performance and programmatic avoidance of undesirable events such as message collisions.
Paper available at https://dl.dropboxusercontent.com/u/67040428/Articles/pdp12.pdf
The document discusses the Nyquist stability criterion for analyzing the stability of sampled-data control systems. It begins by defining the Nyquist criterion and contour, and how they can be used to determine the number of closed-loop poles outside the unit circle (Z). It then provides an example showing how to apply the Nyquist criterion by plotting the loop gain and counting encirclements of the critical point. The document also discusses modifications to the Nyquist contour when open-loop poles are on the unit circle and defines the Nyquist criterion theorem.
This document discusses mathematical modeling of mechanical systems involving translational and rotational motion. It explains how to form differential equations of motion using Newton's laws and analogies to electrical systems. Models with multiple degrees of freedom are addressed by considering the independent motion of individual points/components and summing the relevant forces for each. Examples of 2 and 3 degree of freedom systems are presented for both translation and rotation.
This document discusses steady-state errors in control systems. It defines steady-state error as the difference between the input and output of a system as time approaches infinity. For a unity feedback system, the steady-state error can be calculated from the closed-loop transfer function T(s) or open-loop transfer function G(s). The steady-state error depends on the type of input signal (step, ramp, or parabola) and number of integrations in the system. Systems are classified as Type 0, 1, or 2 based on this number of integrations. The document provides examples of calculating steady-state error for different system types and input signals.
Time Response Analysis of system
Standard Test Signals
What is time response ?
Types of Responses
Analysis of First order system
Analysis of Second order system
Time response of discrete systems 4th lecturekhalaf Gaeid
1. The document discusses the time response of discrete-time systems, including their transient and steady-state response. It describes parameters for characterizing transient response such as rise time, delay time, peak time, and settling time.
2. Steady-state errors are also examined for different system types (Type-0, 1, 2 systems) and inputs (step, ramp, parabolic). Examples are provided to calculate steady-state errors.
3. The response of discrete-time systems is derived using impulse response sequences and convolution sums. The time response is broken into zero-input and zero-state responses.
25. complex frequency, network function ,poles and zerosshwetabhardwaj48
This document discusses complex frequency, transfer functions, and poles and zeros representations. It defines transient behavior as the response of a system to a change from equilibrium or steady state. Examples of transient behavior include the capacitor voltage during charge and discharge and the inductor voltage initially leading. The document also defines network functions as the ratio of voltage and current transforms. It provides examples of immittance functions for simple and more complex networks and defines driving point functions. Finally, it discusses representing the poles and zeros of a network function on the s-plane.
This document provides an overview of time domain analysis techniques for control systems. It discusses common test inputs like impulse, step, and ramp functions used to characterize system performance. It describes how to determine a system's poles and zeros from its transfer function and use a pole-zero plot to understand system dynamics. Standard forms are presented for first and second order systems. Transient performance metrics like rise time, peak time, settling time, and overshoot are defined for characterizing step responses. The effects of poles and zeros on the system response are explained.
Mathematics (from Greek μάθημα máthēma, “knowledge, study, learning”) is the study of topics such as quantity (numbers), structure, space, and change. There is a range of views among mathematicians and philosophers as to the exact scope and definition of mathematics
Mathematical Modelling of Control SystemsDivyanshu Rai
Different types of mathematical modeling in control systems [which include Mathematical Modeling of Mechanical and Electrical System (which further includes, Force-Voltage and Force-Current Analogies)]
This document describes a second order transfer function model and classifies different types of second order systems based on their damping ratio (ζ). It defines an undamped system as one where ζ=0, an underdamped system as 0<ζ<1, a critically damped system as ζ=1, and an overdamped system as ζ>1. For each case, it provides the characteristic equation, location of poles in the s-plane, and form of the homogeneous solution. It also discusses transient response properties like rise time, peak time, settling time, and maximum percent overshoot for an underdamped system.
Fourier series and its applications by md nazmul islamMd Nazmul Islam
The document provides an introduction to Fourier series and their applications. It begins with defining a Fourier series as an expansion of a periodic function in terms of an infinite sum of sines and cosines. It then gives the general formula for a Fourier series representing a function f(x) within the interval [-L, L]. Several examples are shown, including finding the Fourier series for the function f(x)=x from 0 to 2π. Applications of Fourier series discussed include expanding periodic functions outside their intervals, noise cancellation, analyzing oscillating functions, simplifying waves, mapping heat distribution, and signal processing. Electrical circuits are described as equivalent to Fourier series representations of voltage sources. Fourier series are also used in signal processing to represent non
Types of electrotherapeutic current (unit 6)
1. Types of electrotherapeutic current :- There are three types of current used in electrotherapeutic purpose:-
Direct current.
Alternating current.
Pulsed current/ pulsatile current.
2. Characteristic features of electrotherapeutic current:- Wave Form:-
The shape of the single pulse or cycle phases as they appear on the graph of current (voltage) versus time is called wave form.
Mainly two types of characteristics are used to describe pulsed and alternating current wave forms:-
Descriptive (qualitative) characteristics.
Quantitative Characteristics.
3. Current modulations:- Changes in current characteristics may be sequential, intermittent or variable in nature and are referred to as modulations.
Amplitude modulation:- Variations in peak amplitude of a series of pulses.
4. Burst Current:- A finite series of pulses, a finite interval of alternation current delivered at a specific frequency over a specific time interval.
Burst duration (with interruption).
Inter burst interval (without interruption).
Continuous mode (without interruption).
The document discusses the response of first and second order systems. It defines poles and zeros as values that make the transfer function infinite or zero. For first order systems, it describes the transient response as gradual change from initial to final output. The time constant determines how quickly the system responds. For second order systems, the natural frequency and damping ratio characterize the response. Underdamped systems oscillate with declining amplitude, with specifications like rise time and settling time defined.
1. The document discusses time response analysis of systems using poles and zeros. It describes different types of system responses including first-order, second-order, and higher-order systems.
2. Key aspects covered include the relationship between poles/zeros and forced/natural responses, effects of varying damping ratios, and specifications for step responses including rise time and settling time.
3. Various figures and examples illustrate pole-zero placement and resulting step responses for different system orders and damping scenarios.
CONTROL SYSTEMS PPT ON A UNIT STEP RESPONSE OF A SERIES RLC CIRCUIT sanjay kumar pediredla
THIS PPT IS SO USEFUL TO KNOW ABOUT THE SERIES RLC CIRCUIT AND IN THIS WE CAN ALSO HOW THE RESPONSE WILL BE THERE FOR A UNIT STEP RESPONSE AND I ALSO KEPT A MATLAB CODING AND GRAPHS FOR THE SERIES RLC CIRCUIT
Active movement refers to voluntary movement performed with one's own strength or energy. Assisted exercise involves applying an external force to help compensate for muscle deficiencies and ensure maximum effort from the weakened muscles. The principles of assisted exercise include applying assistance in the direction of muscle action, starting from a position of minimal tension in antagonistic muscles, and decreasing assistance as muscle power increases. The goal is for the patient to achieve controlled active movement without assistance over time through strengthening and retraining coordination.
This presentation gives complete idea about time domain analysis of first and second order system, type number, time domain specifications, steady state error and error constants and numerical examples.
The document discusses a training on the design and simulation of fuzzy logic controllers using MATLAB. It begins with an introduction to fuzzy logic and fuzzy logic controllers. It then discusses the basic concepts of fuzzy logic including fuzzy sets, membership functions, and fuzzy rules. The document outlines the steps to build a fuzzy logic system and describes various applications of fuzzy logic controllers in areas like temperature control, motor speed control, washing machines, and air conditioners. It also discusses when fuzzy logic is applicable and provides examples of fuzzy logic applications in different domains.
This document provides a table of commonly used Laplace transform pairs. There are 37 entries in the table that list various functions of t and their corresponding Laplace transforms F(s). Each entry is of the form f(t) = L-1{F(s)}, which relates a function of time f(t) to its Laplace transform F(s). Notes are provided to explain concepts like hyperbolic functions and the Gamma function used in some of the entries.
This chapter introduces analog computing techniques. It discusses the components of an analog computer including operational amplifiers, resistors, capacitors and inductors. It describes how operational amplifiers can be used to simulate linear systems using inverting amplifiers, non-inverting amplifiers, summer amplifiers, integrators and differentiators. The chapter also covers how to apply magnitude and time scaling to model systems within the voltage range of an analog computer. An example shows how to derive the scaled dynamic model of a system and realize it using operational amplifiers.
In this presentation we introduce a family of gossiping algorithms whose members share the same structure though they vary their performance in function of a combinatorial parameter. We show that such parameter may be considered as a “knob” controlling the amount of communication parallelism characterizing the algorithms. After this we introduce procedures to operate the knob and choose parameters matching the amount of communication channels currently provided by the available communication system(s). In so doing we provide a robust mechanism to tune the production of requests for communication after the current operational conditions of the consumers of such requests. This can be used to achieve high performance and programmatic avoidance of undesirable events such as message collisions.
Paper available at https://dl.dropboxusercontent.com/u/67040428/Articles/pdp12.pdf
1. The document describes the components of a closed loop control system including the process, measuring element, comparator, controller, and control valve. Block diagrams and transfer functions are developed for each component.
2. Transfer functions relating the output Co(s) to the input Ci(s) and setpoint Csp(s) are derived for the example of a mixing process.
3. For a step change in input Ci of 2 units, the final output Co is calculated to be 1.515 units.
ME-314 Introduction to Control Engineering is a course taught to Mechanical Engineering senior undergrads. The course is taught by Dr. Bilal Siddiqui at DHA Suffa University. This lecture is about frequency domain solutions of differential equations and transfer functions.
Dcs lec03 - z-analysis of discrete time control systemsAmr E. Mohamed
The document discusses discrete time control systems and their mathematical representation using z-transforms. It covers topics such as impulse sampling, the convolution integral method for obtaining the z-transform, properties of the z-transform, inverse z-transforms using long division and partial fractions, and mapping between the s-plane and z-plane. Examples are provided to illustrate various concepts around discrete time systems and their analysis using z-transforms.
This document provides instructions for a lab session on frequency response analysis and controller design. Students will analyze the frequency response of systems using Bode plots to determine gain margin, phase margin, and bandwidth frequency. They will then design proportional-integral (PI) controllers to meet specifications for steady-state error, settling time, and phase margin. An example system is given and students must select controller parameters to improve closed-loop performance based on Bode plot and step response analysis.
control system Lab 01-introduction to transfer functionsnalan karunanayake
The document provides information about transfer functions and their characteristics including time response, frequency response, stability, and system order. It discusses different types of systems including first order and second order systems. It also demonstrates how to analyze transfer functions and obtain step and impulse responses using MATLAB. Key points include:
- Transfer functions relate the input and output of a system in the Laplace domain
- Time and frequency responses provide information about a system's behavior over time and at different frequencies
- Stability depends on the locations of the poles - systems are stable if all poles have negative real parts
- First and second order systems have distinguishing characteristics like rise time, settling time, overshoot
- MATLAB commands like step, impulse, pole can
1. The document discusses open loop and closed loop control systems. An open loop system's output is not controlled, while a closed loop system uses feedback to maintain its output constant despite disturbances.
2. A closed loop system consists of a process, measuring element, comparator, controller and final control element. The controller acts to minimize the error between the measured and desired output.
3. Transfer functions can be derived to model the response of open and closed loop systems. The closed loop transfer function depends on the process, controller, and other elements.
Exercise 1a transfer functions - solutionswondimu wolde
This document provides information about the course EE4107 - Cybernetics Advanced, including:
- An overview of transfer functions and how they are represented mathematically using numerators and denominators related to zeros and poles.
- How transfer functions can be derived from differential equations using Laplace transforms.
- Functions in MathScript that can be used to define transfer functions and analyze system responses.
- Examples of converting differential equations into transfer functions by taking the Laplace transform.
- The document details a state space solver approach for analog mixed-signal simulations using SystemC. It models analog circuits as sets of linear differential equations and solves them using the Runge-Kutta method of numerical integration.
- Two examples are provided: a digital voltage regulator simulation and a digital phase locked loop simulation. Both analog circuits are modeled in state space and simulated alongside a digital design to verify mixed-signal behavior.
- The state space approach allows modeling analog circuits without transistor-level details, improving simulation speed over traditional mixed-mode simulations while still capturing system-level behavior.
Ece 415 control systems, fall 2021 computer project 1 ronak56
This document provides instructions for a control systems computer project. It includes two parts:
Part I has students implement proportional control of a DC motor model in MATLAB. This includes designing open-loop and closed-loop controllers and analyzing step and disturbance responses.
Part II involves further controller design problems, including designing a controller to increase the system type and minimize settling time, analyzing response to a ramp input, and discussing performance limitations.
The document discusses automatic control systems. It defines automatic control as a methodology for analyzing and designing systems that can self-regulate operating conditions with minimal human intervention. It describes the basic functions, elements, components, and types of feedback in automatic control systems. It provides examples of a first order and second order control system's time response to a unit step input function. It also discusses transfer functions and types 0, 1, and 2 control systems. Finally, it demonstrates modeling automatic control systems using MATLAB/Simulink.
Control system basics, block diagram and signal flow graphSHARMA NAVEEN
This document discusses control systems and provides definitions and classifications of control systems. It defines a control system as an arrangement of physical elements connected to regulate, direct or command itself. Control systems are classified as natural or man-made, manual or automatic, open-loop or closed-loop, linear or non-linear. The key difference between open-loop and closed-loop systems is that closed-loop systems have feedback which makes them more accurate, reliable and less sensitive to parameter changes compared to open-loop systems. Examples of both open-loop and closed-loop systems are provided. The document also discusses transfer functions, Laplace transforms, block diagram reduction rules, and signal flow graphs.
This document analyzes and models a rotational mechanical system to determine its time domain characteristics. The system is modeled using a second-order differential equation and Laplace transform. MATLAB is used to verify results and simulate the system. Key findings include:
1) The system has poles at -8 ± j20, a damping ratio of 0.3714, and 28.46% overshoot.
2) The impulse and step responses are determined and match simulations in MATLAB.
3) A state space model is developed using A, B, C, and D matrices to reduce the system to first-order equations.
Linear Control Hard-Disk Read/Write Controller AssignmentIsham Rashik
Classic Hard-Disk Read/Write Head Controller Assignment completed using MATLAB and SIMULINK. To see the diagrams in detail, please download first and zoom it.
The document provides an introduction to control systems. It defines key terms like systems, control systems, open loop and closed loop systems. It explains that a system is a combination of components that work together, while a control system includes feedback to achieve a desired output. Open loop systems operate independently of feedback, while closed loop systems use feedback to adjust. Common examples of open and closed loop systems are also provided like electric hand driers and automatic washing machines. The basic elements of control systems like resistors, inductors, and capacitors are also introduced in the context of electrical systems.
Here are the steps to solve this problem:
1) The open-loop transfer function is given as:
G(s) = Kv/s
2) To reduce overshoot, we need to add a compensator to increase the damping. A lag compensator is suitable here.
3) A lag compensator has the transfer function:
Gc(s) = (s+z)/(s+p)
4) To reduce overshoot to less than 20%, we choose z=0.1 and p=0.05
5) The closed-loop transfer function is:
T(s) = Kv(s+0.1)/(s(s+0.05))
The document discusses frequency response and Bode plots. It begins by defining the sinusoidal transfer function and frequency response. The frequency response consists of the magnitude and phase functions of the transfer function. Bode plots graphically display the magnitude and phase functions versus frequency on logarithmic scales. The document then provides procedures for constructing Bode plots, including determining individual component responses, combining them, and reading off gain and phase margins. Examples are given to demonstrate the procedures.
Control tutorials for matlab and simulink introduction pid controller desig...ssuser27c61e
This document introduces PID (proportional-integral-derivative) controllers and how they can be used to improve closed-loop system performance. It describes how each of the P, I, and D terms affect rise time, overshoot, settling time, and steady-state error. An example using a mass-spring-damper system demonstrates how to design PID controllers manually and use MATLAB's automatic tuning tools to design controllers. The document provides guidelines for designing PID controllers and introduces PID controller objects and functions in MATLAB.
Similar to Frequency Response with MATLAB Examples.pdf (20)
Use PyCharm for remote debugging of WSL on a Windo cf5c162d672e4e58b4dde5d797...shadow0702a
This document serves as a comprehensive step-by-step guide on how to effectively use PyCharm for remote debugging of the Windows Subsystem for Linux (WSL) on a local Windows machine. It meticulously outlines several critical steps in the process, starting with the crucial task of enabling permissions, followed by the installation and configuration of WSL.
The guide then proceeds to explain how to set up the SSH service within the WSL environment, an integral part of the process. Alongside this, it also provides detailed instructions on how to modify the inbound rules of the Windows firewall to facilitate the process, ensuring that there are no connectivity issues that could potentially hinder the debugging process.
The document further emphasizes on the importance of checking the connection between the Windows and WSL environments, providing instructions on how to ensure that the connection is optimal and ready for remote debugging.
It also offers an in-depth guide on how to configure the WSL interpreter and files within the PyCharm environment. This is essential for ensuring that the debugging process is set up correctly and that the program can be run effectively within the WSL terminal.
Additionally, the document provides guidance on how to set up breakpoints for debugging, a fundamental aspect of the debugging process which allows the developer to stop the execution of their code at certain points and inspect their program at those stages.
Finally, the document concludes by providing a link to a reference blog. This blog offers additional information and guidance on configuring the remote Python interpreter in PyCharm, providing the reader with a well-rounded understanding of the process.
Software Engineering and Project Management - Introduction, Modeling Concepts...Prakhyath Rai
Introduction, Modeling Concepts and Class Modeling: What is Object orientation? What is OO development? OO Themes; Evidence for usefulness of OO development; OO modeling history. Modeling
as Design technique: Modeling, abstraction, The Three models. Class Modeling: Object and Class Concept, Link and associations concepts, Generalization and Inheritance, A sample class model, Navigation of class models, and UML diagrams
Building the Analysis Models: Requirement Analysis, Analysis Model Approaches, Data modeling Concepts, Object Oriented Analysis, Scenario-Based Modeling, Flow-Oriented Modeling, class Based Modeling, Creating a Behavioral Model.
Redefining brain tumor segmentation: a cutting-edge convolutional neural netw...IJECEIAES
Medical image analysis has witnessed significant advancements with deep learning techniques. In the domain of brain tumor segmentation, the ability to
precisely delineate tumor boundaries from magnetic resonance imaging (MRI)
scans holds profound implications for diagnosis. This study presents an ensemble convolutional neural network (CNN) with transfer learning, integrating
the state-of-the-art Deeplabv3+ architecture with the ResNet18 backbone. The
model is rigorously trained and evaluated, exhibiting remarkable performance
metrics, including an impressive global accuracy of 99.286%, a high-class accuracy of 82.191%, a mean intersection over union (IoU) of 79.900%, a weighted
IoU of 98.620%, and a Boundary F1 (BF) score of 83.303%. Notably, a detailed comparative analysis with existing methods showcases the superiority of
our proposed model. These findings underscore the model’s competence in precise brain tumor localization, underscoring its potential to revolutionize medical
image analysis and enhance healthcare outcomes. This research paves the way
for future exploration and optimization of advanced CNN models in medical
imaging, emphasizing addressing false positives and resource efficiency.
Discover the latest insights on Data Driven Maintenance with our comprehensive webinar presentation. Learn about traditional maintenance challenges, the right approach to utilizing data, and the benefits of adopting a Data Driven Maintenance strategy. Explore real-world examples, industry best practices, and innovative solutions like FMECA and the D3M model. This presentation, led by expert Jules Oudmans, is essential for asset owners looking to optimize their maintenance processes and leverage digital technologies for improved efficiency and performance. Download now to stay ahead in the evolving maintenance landscape.
Comparative analysis between traditional aquaponics and reconstructed aquapon...bijceesjournal
The aquaponic system of planting is a method that does not require soil usage. It is a method that only needs water, fish, lava rocks (a substitute for soil), and plants. Aquaponic systems are sustainable and environmentally friendly. Its use not only helps to plant in small spaces but also helps reduce artificial chemical use and minimizes excess water use, as aquaponics consumes 90% less water than soil-based gardening. The study applied a descriptive and experimental design to assess and compare conventional and reconstructed aquaponic methods for reproducing tomatoes. The researchers created an observation checklist to determine the significant factors of the study. The study aims to determine the significant difference between traditional aquaponics and reconstructed aquaponics systems propagating tomatoes in terms of height, weight, girth, and number of fruits. The reconstructed aquaponics system’s higher growth yield results in a much more nourished crop than the traditional aquaponics system. It is superior in its number of fruits, height, weight, and girth measurement. Moreover, the reconstructed aquaponics system is proven to eliminate all the hindrances present in the traditional aquaponics system, which are overcrowding of fish, algae growth, pest problems, contaminated water, and dead fish.
Batteries -Introduction – Types of Batteries – discharging and charging of battery - characteristics of battery –battery rating- various tests on battery- – Primary battery: silver button cell- Secondary battery :Ni-Cd battery-modern battery: lithium ion battery-maintenance of batteries-choices of batteries for electric vehicle applications.
Fuel Cells: Introduction- importance and classification of fuel cells - description, principle, components, applications of fuel cells: H2-O2 fuel cell, alkaline fuel cell, molten carbonate fuel cell and direct methanol fuel cells.
Advanced control scheme of doubly fed induction generator for wind turbine us...IJECEIAES
This paper describes a speed control device for generating electrical energy on an electricity network based on the doubly fed induction generator (DFIG) used for wind power conversion systems. At first, a double-fed induction generator model was constructed. A control law is formulated to govern the flow of energy between the stator of a DFIG and the energy network using three types of controllers: proportional integral (PI), sliding mode controller (SMC) and second order sliding mode controller (SOSMC). Their different results in terms of power reference tracking, reaction to unexpected speed fluctuations, sensitivity to perturbations, and resilience against machine parameter alterations are compared. MATLAB/Simulink was used to conduct the simulations for the preceding study. Multiple simulations have shown very satisfying results, and the investigations demonstrate the efficacy and power-enhancing capabilities of the suggested control system.
Optimizing Gradle Builds - Gradle DPE Tour Berlin 2024Sinan KOZAK
Sinan from the Delivery Hero mobile infrastructure engineering team shares a deep dive into performance acceleration with Gradle build cache optimizations. Sinan shares their journey into solving complex build-cache problems that affect Gradle builds. By understanding the challenges and solutions found in our journey, we aim to demonstrate the possibilities for faster builds. The case study reveals how overlapping outputs and cache misconfigurations led to significant increases in build times, especially as the project scaled up with numerous modules using Paparazzi tests. The journey from diagnosing to defeating cache issues offers invaluable lessons on maintaining cache integrity without sacrificing functionality.
Null Bangalore | Pentesters Approach to AWS IAMDivyanshu
#Abstract:
- Learn more about the real-world methods for auditing AWS IAM (Identity and Access Management) as a pentester. So let us proceed with a brief discussion of IAM as well as some typical misconfigurations and their potential exploits in order to reinforce the understanding of IAM security best practices.
- Gain actionable insights into AWS IAM policies and roles, using hands on approach.
#Prerequisites:
- Basic understanding of AWS services and architecture
- Familiarity with cloud security concepts
- Experience using the AWS Management Console or AWS CLI.
- For hands on lab create account on [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
# Scenario Covered:
- Basics of IAM in AWS
- Implementing IAM Policies with Least Privilege to Manage S3 Bucket
- Objective: Create an S3 bucket with least privilege IAM policy and validate access.
- Steps:
- Create S3 bucket.
- Attach least privilege policy to IAM user.
- Validate access.
- Exploiting IAM PassRole Misconfiguration
-Allows a user to pass a specific IAM role to an AWS service (ec2), typically used for service access delegation. Then exploit PassRole Misconfiguration granting unauthorized access to sensitive resources.
- Objective: Demonstrate how a PassRole misconfiguration can grant unauthorized access.
- Steps:
- Allow user to pass IAM role to EC2.
- Exploit misconfiguration for unauthorized access.
- Access sensitive resources.
- Exploiting IAM AssumeRole Misconfiguration with Overly Permissive Role
- An overly permissive IAM role configuration can lead to privilege escalation by creating a role with administrative privileges and allow a user to assume this role.
- Objective: Show how overly permissive IAM roles can lead to privilege escalation.
- Steps:
- Create role with administrative privileges.
- Allow user to assume the role.
- Perform administrative actions.
- Differentiation between PassRole vs AssumeRole
Try at [killercoda.com](https://killercoda.com/cloudsecurity-scenario/)
2. Contents
• Introduction to PID Control
• Introduction to Frequency Response
• Frequency Response using Bode Diagram
• Introduction to Complex Numbers (which Frequency Response Theory is
based on)
• Frequency Response from Transfer Functions
• Frequency Response from Input/output Signals
• PID Controller Design and Tuning (Theory)
• PID Controller Design and Tuning using MATLAB
• Stability Analysis using MATLAB
• Stability Analysis of Feedback Systems
• Stability Analysis of Feedback Systems – a Practical Example
• The Bandwidth of the Control System
• Practical PI Controller Example
4. Control System
𝑟 – Reference Value, SP (Set-point), SV (Set Value)
𝑦 – Measurement Value (MV), Process Value (PV)
𝑒 – Error between the reference value and the measurement value (𝑒 = 𝑟 – 𝑦)
𝑣 – Disturbance, makes it more complicated to control the process
𝑢 - Control Signal from the Controller
Controller Process
Sensors
Actuators
Filtering
𝑟 𝑢
𝑒
− 𝑦
𝑣
5. The PID Algorithm
Tuning Parameters:
𝐾𝑝
𝑇𝑖
𝑇𝑑
Where 𝑢 is the controller output and 𝑒 is the
control error:
𝑒 𝑡 = 𝑟 𝑡 − 𝑦(𝑡)
𝑟 is the Reference Signal or Set-point
𝑦 is the Process value, i.e., the Measured value
𝑢 𝑡 = 𝐾𝑝𝑒 +
𝐾𝑝
𝑇𝑖
න
0
𝑡
𝑒𝑑𝜏 + 𝐾𝑝𝑇𝑑 ሶ
𝑒
Proportional Gain
Integral Time [sec. ]
Derivative Time [sec. ]
6. The PI Algorithm
Tuning Parameters:
𝐾𝑝
𝑇𝑖
Where 𝑢 is the controller output and 𝑒 is the
control error:
𝑒 𝑡 = 𝑟 𝑡 − 𝑦(𝑡)
𝑟 is the Reference Signal or Set-point
𝑦 is the Process value, i.e., the Measured value
𝑢 𝑡 = 𝐾𝑝𝑒 +
𝐾𝑝
𝑇𝑖
න
0
𝑡
𝑒𝑑𝜏
Proportional Gain
Integral Time [sec. ]
7. PI(D) Algorithm in MATLAB
• We can use the pid() function in MATLAB
• We can define the PI(D) transfer function
using the tf() function in MATLAB
• We can also define and implement a discrete
PI(D) algorithm
8. Discrete PI Controller Algorithm
We start with:
𝑢 𝑡 = 𝑢0 + 𝐾𝑝𝑒 𝑡 +
𝐾𝑝
𝑇𝑖
න
0
𝑡
𝑒𝑑𝜏
In order to make a discrete version using, e.g., Euler, we can derive both sides of the equation:
ሶ
𝑢 = ሶ
𝑢0 + 𝐾𝑝 ሶ
𝑒 +
𝐾𝑝
𝑇𝑖
𝑒
If we use Euler Forward we get:
𝑢𝑘 − 𝑢𝑘−1
𝑇𝑠
=
𝑢0,𝑘 − 𝑢0,𝑘−1
𝑇𝑠
+ 𝐾𝑝
𝑒𝑘 − 𝑒𝑘−1
𝑇𝑠
+
𝐾𝑝
𝑇𝑖
𝑒𝑘
Then we get:
𝑢𝑘 = 𝑢𝑘−1 + 𝑢0,𝑘 − 𝑢0,𝑘−1 + 𝐾𝑝 𝑒𝑘 − 𝑒𝑘−1 +
𝐾𝑝
𝑇𝑖
𝑇𝑠𝑒𝑘
Where
𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘
We can also split the equation above in 2 different parts by setting:
∆𝑢𝑘 = 𝑢𝑘 − 𝑢𝑘−1
This gives the following PI control algorithm:
𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘
∆𝑢𝑘 = 𝑢0,𝑘 − 𝑢0,𝑘−1 + 𝐾𝑝 𝑒𝑘 − 𝑒𝑘−1 +
𝐾𝑝
𝑇𝑖
𝑇𝑠𝑒𝑘
𝑢𝑘 = 𝑢𝑘−1 + ∆𝑢𝑘
This algorithm can easily be implemented in MATLAB
12. Define PI Transfer function in MATLAB
clear, clc
% PI Controller Transfer function
Kp = 0.52;
Ti = 18;
num = Kp*[Ti, 1];
den = [Ti, 0];
Hpi = tf(num,den)
...
𝐻𝑃𝐼 𝑠 =
𝑢(𝑠)
𝑒(𝑠)
=
𝐾𝑝(𝑇𝑖𝑠 + 1)
𝑇𝑖𝑠
13. PI Controller – State space model
Given:
𝑢 𝑠 = 𝐾𝑝𝑒 𝑠 +
𝐾𝑝
𝑇𝑖𝑠
𝑒 𝑠
We set 𝑧 =
1
𝑠
𝑒 ⇒ 𝑠𝑧 = 𝑒 ⇒ ሶ
𝑧 = 𝑒
This gives:
ሶ
𝑧 = 𝑒
𝑢 = 𝐾𝑝𝑒 +
𝐾𝑝
𝑇𝑖
𝑧
Where
𝑒 = 𝑟 − 𝑦
14. PI Controller – Discrete State space model
Using Euler:
ሶ
𝑧 ≈
𝑧𝑘+1 − 𝑧𝑘
𝑇𝑠
Where 𝑇𝑠 is the Sampling Time.
This gives:
𝑧𝑘+1 − 𝑧𝑘
𝑇𝑠
= 𝑒𝑘
𝑢𝑘 = 𝐾𝑝𝑒𝑘 +
𝐾𝑝
𝑇𝑖
𝑧𝑘
Finally:
𝑒𝑘 = 𝑟𝑘 − 𝑦𝑘
𝑢𝑘 = 𝐾𝑝𝑒𝑘 +
𝐾𝑝
𝑇𝑖
𝑧𝑘
𝑧𝑘+1 = 𝑧𝑘 + 𝑇𝑠𝑒𝑘
15. PI Controller – Discrete State space model
implemented in MATLAB clear, clc
...
for i=1:N
...
e = r - y;
u = Kp*e + z;
z = z + dt*Kp*e/Ti;
...
end
plot(...)
17. Frequency Response
• The frequency response of a system is a frequency dependent
function which expresses how a sinusoidal signal of a given frequency
on the system input is transferred through the system. Each
frequency component is a sinusoidal signal having certain amplitude
and a certain frequency.
• The frequency response is an important tool for analysis and design
of signal filters and for analysis and design of control systems.
• The frequency response can be found experimentally or from a
transfer function model.
• The frequency response of a system is defined as the steady-state
response of the system to a sinusoidal input signal. When the system
is in steady-state, it differs from the input signal only in
amplitude/gain (A) and phase lag (𝜙).
Theory
18. Frequency
Response
Dynamic
System
Input Signal
Output Signal
Gain Phase Lag
Frequency
Amplitude
The frequency response of a system expresses how a sinusoidal signal of a given frequency on the system
input is transferred through the system. The only difference is the gain and the phase lag.
Theory
𝑢 𝑡 = 𝑈 ∙ 𝑠𝑖𝑛𝜔𝑡
𝑦 𝑡 = ด
𝑈𝐴
𝑌
𝑠𝑖𝑛(𝜔𝑡 + 𝜙)
Input Signal
Output Signal
19. Frequency Response - Definition
• The frequency response of a system is defined as the steady-state response of the system to a sinusoidal
input signal.
• When the system is in steady-state, it differs from the input signal only in amplitude/gain (A) (Norwegian:
“forsterkning”) and phase lag (ϕ) (Norwegian: “faseforskyvning”).
and the same for Frequency 2, 3, 4, 5, 6, etc.
Theory
𝑢 𝑡 = 𝑈 ∙ 𝑠𝑖𝑛𝜔𝑡 𝑦 𝑡 = ด
𝑈𝐴
𝑌
𝑠𝑖𝑛(𝜔𝑡 + 𝜙)
Dynamic
System
𝜔 = 1 𝑟𝑎𝑑/𝑠
𝜔 = 1 𝑟𝑎𝑑/𝑠
Input Output
20. Frequency Response - Simple Example
Inside Temperature
Assume the outdoor temperature is varying like a sine function during a year (frequency 1) or during 24 hours (frequency 2).
Then the indoor temperature will be a sine as well, but with different gain. In addition it will have a phase lag.
Note! Only the
gain and phase
are different
Theory
Outside Temperature
Dynamic System
frequency 1 (year)
T = 1 year
frequency 1 (year)
21. Frequency Response - Simple Example
Inside Temperature
Assume the outdoor temperature is varying like a sine function during a year (frequency 1) or during 24 hours (frequency 2).
Then the indoor temperature will be a sine as well, but with different gain. In addition it will have a phase lag.
Note! Only the gain and phase are different
Theory
Outside Temperature
Dynamic System frequency 2 (24 hours)
frequency 2 (24 hours)
T = 24 hours
23. Bode Diagram
𝐿𝑜𝑔 𝜔
𝐿𝑜𝑔 𝜔
𝜑
∆𝐾
𝜔𝑐
𝜔180
You can find the Bode diagram from experiments on the physical process or from the transfer function (the model of the
system). A simple sketch of the Bode diagram for a given system:
The Bode diagram gives a simple Graphical
overview of the Frequency Response for a
given system. A Tool for Analyzing the
Stability properties of the Control System.
With MATLAB you can easily create Bode
diagram from the Transfer function model
using the bode() function
ω [rad/s]
ω [rad/s]
0𝑑𝐵
24. Bode Diagram from experiments
We find 𝐴 and 𝜙 for each of the frequencies,
e.g.:
Based on that we can plot the
Frequency Response in a so-called Bode
Diagram:
Find Data for different frequencies
...
25. Bode Diagram The x-scale is logarithmic
Gain (“Forsterkningen”)
Phase lag (“Faseforkyvningen”)
Note! The y-scale is in [𝑑𝐵]
Normally, the unit for frequency is Hertz [Hz], but in frequency response and Bode
diagrams we use radians ω [rad/s]. The relationship between these are as follows:
The y-scale is in [𝑑𝑒𝑔𝑟𝑒𝑒𝑠]
𝑥 𝑑𝐵 = 20𝑙𝑜𝑔10𝑥
2𝜋 𝑟𝑎𝑑 = 360°
𝜔 = 2𝜋𝑓
26. Frequency Response – MATLAB
clear
clc
close all
% Define Transfer function
num=[1];
den=[1, 1];
H = tf(num, den)
% Frequency Response
bode(H);
grid on
The frequency response is an important tool for analysis and design
of signal filters and for analysis and design of control systems.
Transfer Function:
MATLAB Code:
27. Frequency Response – MATLAB
clear
clc
close all
% Define Transfer function
num = [1];
den = [1, 1];
H = tf(num, den)
% Frequency Response
bode(H);
grid on
% Get Freqquency Response Data
wlist = [0.01, 0.1, 1, 2 ,3 ,5 ,10, 100];
[mag, phase, w] = bode(H, wlist);
for i=1:length(w)
magw(i) = mag(1,1,i);
phasew(i) = phase(1,1,i);
end
magdB = 20*log10(magw); % Convert to dB
freq_data = [wlist; magdB; phasew]'
Transfer Function:
Instead of Plotting the Bode Diagram we
can also use the bode function for
calculation and showing the data as well:
freq_data =
0.0100 -0.0004 -0.5729
0.1000 -0.0432 -5.7106
1.0000 -3.0103 -45.0000
2.0000 -6.9897 -63.4349
3.0000 -10.0000 -71.5651
5.0000 -14.1497 -78.6901
10.0000 -20.0432 -84.2894
100.0000 -40.0004 -89.4271
28. Bode Diagram – MATLAB Example
clear, clc
% Transfer function
num=[1];
den1=[1,0];
den2=[1,1]
den3=[1,1]
den = conv(den1,conv(den2,den3));
H = tf(num, den)
% Bode Diagram
bode(H)
subplot(2,1,1)
grid on
subplot(2,1,2)
grid on
clear, clc
% Transfer function
num=[1];
den=[1,2,1,0];
H = tf(num, den)
% Bode Diagram
bode(H)
subplot(2,1,1)
grid on
subplot(2,1,2)
grid on
or:
MATLAB Code:
29. Example
We will use the following system as an example:
𝐻𝑐 = 𝐾𝑝
𝐻𝑝 =
1
𝑠(𝑠 + 1)
𝐻𝑚 =
1
3𝑠 + 1
Controller Process
Sensors
𝑟 𝑢
𝑒
− 𝑦
30. Bode Diagram – MATLAB Example
clear
clc
num = 1;
den = [1,1,0];
Hp = tf(num,den)
bode(Hp)
grid on
MATLAB Code:
𝐻𝑝 =
1
𝑠(𝑠 + 1)
36. Manually find the Frequency Response
from the Transfer Function
For a transfer function:
𝐻 𝑆 =
𝑦(𝑠)
𝑢(𝑠)
We have that:
𝐻 𝑗𝜔 = 𝐻(𝑗𝜔) 𝑒𝑗∠𝐻(𝑗𝜔)
Where 𝐻(𝑗𝜔) is the frequency response of the system, i.e., we may find the frequency response by setting 𝑠 = 𝑗𝜔
in the transfer function. Bode diagrams are useful in frequency response analysis.
The Bode diagram consists of 2 diagrams, the Bode magnitude diagram, 𝐴(𝜔) and the Bode phase diagram,
𝜙(𝜔).
The Gain function:
𝐴 𝜔 = 𝐻(𝑗𝜔)
The Phase function:
𝜙 𝜔 = ∠𝐻(𝑗𝜔)
The 𝐴(𝜔)-axis is in decibel (dB), where the decibel value of x is calculated as: 𝑥 𝑑𝐵 = 20𝑙𝑜𝑔10𝑥
The 𝜙(𝜔)-axis is in degrees (not radians!)
Theory
𝑠 = 𝑗𝜔
37. Mathematical expressions for 𝐴(𝜔) and 𝜙(𝜔)
cont. next page
We find the Mathematical expressions for 𝐴(𝜔) and 𝜙(𝜔) by setting 𝑠 = 𝑗𝜔 in the transfer function
given by:
𝐻 𝑠 =
𝑦(𝑠)
𝑢(𝑠)
=
𝐾
𝑇𝑠 + 1
The Frequency Response (we replace 𝑠 with 𝑗𝜔) then becomes:
𝐻 𝑗𝜔 =
𝐾
𝑇𝑗𝜔 + 1
=
𝐾
ณ
1
𝑅𝑒
+ 𝑗 ด
𝑇𝜔
𝐼𝑚
Polar form:
𝐻 𝑗𝜔 =
𝐾
12 + 𝑇𝜔 2𝑒
𝑗 𝑎𝑟𝑐𝑡𝑎𝑛
𝑇𝜔
1
=
𝐾
1 + 𝑇𝜔 2
𝑒𝑗 −𝑎𝑟𝑐𝑡𝑎𝑛(𝑇𝜔)
Finally:
𝐻 𝑗𝜔 =
𝐾
1 + 𝑇𝜔 2
𝑒𝑗 −𝑎𝑟𝑐𝑡𝑎𝑛(𝑇𝜔)
38. cont. from previous page
The Gain function becomes:
𝐴 𝜔 = 𝐻(𝑗𝜔) =
𝐾
1 + 𝑇𝜔 2
Or in 𝑑𝐵 (used in the Bode Plot):
𝐴 𝜔 𝑑𝐵 = 𝐻(𝑗𝜔) 𝑑𝐵 = 20𝑙𝑜𝑔𝐾 − 20𝑙𝑜𝑔 1 + 𝑇𝜔 2
The Phase function becomes ( 𝑟𝑎𝑑 ):
𝜙 𝜔 = ∠𝐻 𝑗𝜔 = 𝑎𝑟𝑔 𝐻 𝑗𝜔 = −𝑎𝑟𝑐𝑡𝑎𝑛(𝑇𝜔)
Or in degrees ° (used in the Bode plot):
𝜙 𝜔 = ∠𝐻 𝑗𝜔 = −𝑎𝑟𝑐𝑡𝑎𝑛(𝑇𝜔) ∙
180
𝜋
Note: 2𝜋 𝑟𝑎𝑑 = 360°
40. Manually find the Frequency Response
from the Transfer Function
Given the following transfer function:
𝐻 𝑆 =
4
2𝑠 + 1
The mathematical expressions for 𝐴(𝜔) and
𝜙(𝜔) become:
𝐻(𝑗𝜔) 𝑑𝐵 = 20𝑙𝑜𝑔4 − 20𝑙𝑜𝑔 (2𝜔)2+1
∠𝐻(𝑗𝜔) = −arctan(2𝜔)
Bode Plot:
These equations can easily be implemented in MATLAB (See next slide)
41. clear
clc
% Transfer function
num=[4];
den=[2, 1];
H = tf(num, den)
% Bode Plot
figure(1)
bode(H)
grid on
% Margins and Phases for given Frequencies
% Alt 1: Use bode function directly
disp('----- Alternative 1 -----')
w = [0.1, 0.16, 0.25, 0.4, 0.625, 2.5, 10];
[magw, phasew] = bode(H, w);
for i=1:length(w)
mag(i) = magw(1,1,i);
phase(i) = phasew(1,1,i);
end
magdB = 20*log10(mag); %convert to dB
mag_data = [w; magdB]
phase_data = [w; phase]
clear
clc
w = [0.1, 0.16, 0.25, 0.4, 0.625, 2.5, 10];
% Alt 2: Use Mathematical expressions for H and <H
disp('----- Alternative 2 -----')
gain = 20*log10(4) - 20*log10(sqrt((2*w).^2+1));
phase = -atan(2*w);
phasedeg = phase * 180/pi; %convert to degrees
mag_data2 = [w; gain]
phase_data2 = [w; phasedeg]
figure(2)
subplot(2,1,1)
semilogx(w,gain)
grid on
subplot(2,1,2)
semilogx(w,phasedeg)
grid on
MATLAB Code
43. Transfer functions with Time delay
𝐻 𝑠 =
𝐾
𝑇𝑠 + 1
𝑒−𝑇𝑠
A general transfer function for a 1.order system with time delay is:
Frequency Response functions for gain and phase margin becomes:
𝐴 𝜔 𝑑𝐵 = 20𝑙𝑜𝑔(𝐾) − 20𝑙𝑜𝑔 (𝑇𝜔)2+1
𝜙 𝜔 = − 𝑎𝑟𝑐𝑡𝑎𝑛 𝑇𝜔 − 𝜔 ∙ 𝜏
Or 𝜙 𝜔 in degrees:
𝜙 𝜔 [𝑑𝑒𝑔𝑟𝑒𝑒𝑠] = − arctan 𝑇𝜔 − 𝜔 ∙ 𝜏
180
𝜋
44. Transfer functions with Time delay in MATLAB
K = 3.5;
T = 22;
Tau = 2;
num = [K];
den = [T, 1];
H1 = tf(num, den);
s = tf('s')
H2 = exp(-Tau*s);
H = H1 * H2
bode(H)
K = 3.5;
T = 22;
Tau = 2;
num = [K];
den = [T, 1];
H1 = tf(num, den);
H = set(H1,'inputdelay',Tau)
bode(H);
K = 3.5;
T = 22;
Tau = 2;
s = tf('s');
H = K*exp(-Tau*s)/(T*s+1)
bode(H);
Different ways to implement a time delay in MATLAB:
Alt 1
Alt 2
Alt 3
Alt 4: Use Pade approximation
K = 3.5;
T = 22;
Tau = 2;
num = [K];
den = [T, 1];
H1 = tf(num, den);
N=5;
H2 = pade(Tau, N)
[num_pade,den_pade] = pade(T,N)
Hpade = tf(num_pade,den_pade);
H = series(H1, Hpade);
bode(H);
45. 1. order system with Time delay
Given the following transfer function:
𝐻 𝑠 =
3.2𝑒−2𝑠
3𝑠 + 1
The mathematical expressions for 𝐴(𝜔) and 𝜙(𝜔):
𝐻(𝑗𝜔) 𝑑𝐵 = 20𝑙𝑜𝑔3.2 − 20𝑙𝑜𝑔 (3𝜔)2+1
∠𝐻(𝑗𝜔) = −2𝜔 − arctan(3𝜔)
Or in degrees:∠𝐻 𝑗𝜔 = −2𝜔 − arctan(3𝜔) ∙
180
𝜋
Break frequency:
𝜔 =
1
𝑇
=
1
3
= 0.33 𝑟𝑎𝑑/𝑠
Poles:
𝑝1 = −
1
3
= −0.33
Zeros:
None
46. clear, clc
s = tf('s');
K=3.2;
T=3;
H1=tf(K/(T*s+1));
delay = 2;
H = set(H1,'inputdelay',delay)
bode(H);
p = pole(H)
z = zero (H)
H =
3.2
exp(-2*s) * -------
3 s + 1
Continuous-time transfer function.
p = -0.3333
z = Empty matrix: 0-by-1
clear, clc
s=tf('s');
K=3.2;
T=3;
Tau = 2;
num = K;
den = [T, 1];
H1 = tf(num, den);
s = tf('s')
H2 = exp(-Tau*s);
H = H1 * H2
bode(H);
p = pole(H)
z = zero (H)
or:
48. Frequency Response from sinusoidal
input and output signals
We can find the frequency response of a system
by exciting the system (either the real system or a
model of the system) with a sinusoidal signal of
amplitude 𝐴 and frequency 𝜔 [𝑟𝑎𝑑/𝑠] (Note:
𝜔 = 2𝜋𝑓) and observing the response in the
output variable of the system.
Theory
49. Frequency Response - Definition
• The frequency response of a system is defined as the steady-state response of the system to a sinusoidal
input signal.
• When the system is in steady-state, it differs from the input signal only in amplitude/gain (A) (Norwegian:
“forsterkning”) and phase lag (ϕ) (Norwegian: “faseforskyvning”).
and the same for Frequency 2, 3, 4, 5, 6, etc.
Theory
𝑢 𝑡 = 𝑈 ∙ 𝑠𝑖𝑛𝜔𝑡 𝑦 𝑡 = ด
𝑈𝐴
𝑌
𝑠𝑖𝑛(𝜔𝑡 + 𝜙)
Dynamic
System
𝜔 = 1 𝑟𝑎𝑑/𝑠
𝜔 = 1 𝑟𝑎𝑑/𝑠
Input Output
50. Frequency Response from sinusoidal
input and output signals
The input signal is given by:
𝑢 𝑡 = 𝑈 ∙ 𝑠𝑖𝑛𝜔𝑡
The steady-state output signal will then be:
𝑦 𝑡 = ด
𝑈𝐴
𝑌
𝑠𝑖𝑛(𝜔𝑡 + 𝜙)
The gain is given by:
𝐴 =
𝑌
𝑈
The phase lag is given by:
𝜙 = −𝜔Δ𝑡 [𝑟𝑎𝑑]
Theory
51. Frequency Response from sinusoidal
input and output signals
t
Theory
The gain is given by:
𝐴 =
𝑌
𝑈
The phase lag is given by:
𝜙 = −𝜔Δ𝑡 [𝑟𝑎𝑑]
You will get plots like this for each frequency:
52. Find the gain (𝐴) and the phase (𝜙) for the given frequency from the plot
𝜔 = 1 rad/s
55. Conversion to dB
𝐴 𝑑𝐵 = 20𝑙𝑜𝑔(𝐴)
Example:
𝐴 = 0.68
𝐴 𝑑𝐵 = 20𝑙𝑜𝑔(𝐴)=20𝑙𝑜𝑔(0.68) ≈ −3.35𝑑𝐵
Or the other way:
𝐴 𝑑𝐵 = −3.35𝑑𝐵
𝐴 𝑑𝐵 = 10
−3.35
20 ≈ 0.68
𝐴 = 10
𝐴 𝑑𝐵
20
or the other way:
56. 𝐴 = −3.35 𝑑𝐵
𝜙 = −45.9 °
𝜔 = 1 rad/s
From the Bode diagram we can verify that our calculations are correct:
57. The following MATLAB Code is used to create the Plot:
clear, clc
K = 1;
T = 1;
num = [K];
den = [T, 1];
H = tf(num, den);
figure(1)
bode(H), grid on
% Define input signal
t = [1: 0.1 : 12];
w = 1;
U = 1;
u = U*sin(w*t);
figure(2)
plot(t, u)
% Output signal
hold on
lsim(H, ':r', u, t)
grid on
hold off
legend('input signal', 'output signal')
𝐻 𝑠 =
1
𝑠 + 1
We use the following transfer function:
𝜔 = 1 rad/s
The Frequency used:
60. PID Controller Design
A lot of PID Tuning methods exist, e.g.,
• Skogestad's method
• Ziegler-Nichols’ methods
• Trial and Error Methods
• PID Tuning functionality built into MATLAB
• Auto-tuning built into commercial PID controllers
• ...
61. Skogestad’s method
• The Skogestad’s method assumes you apply a step on the input (𝑢)
and then observe the response and the output (𝑦), as shown below.
• If we have a model of the system (which we have in our case), we can
use the following Skogestad’s formulas for finding the PI(D)
parameters directly.
𝑇𝑐 is the time-constant of the control system which
the user must specify
Originally, Skogestad defined the factor 𝑐 = 4. This gives
good set-point tracking. But the disturbance
compensation may become quite sluggish. To obtain
faster disturbance compensation, you can use 𝑐 = 1.5
Figure: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010.
62. Ziegler–Nichols Frequency Response method
https://en.wikipedia.org/wiki/Ziegler–Nichols_method
Controller 𝐾𝑝 𝑇𝑖 𝑇𝑑
P 0.5𝐾𝑐 ∞ 0
PI 0.45𝐾𝑐
𝑇𝑐
1.2
0
PID 0.6𝐾𝑐
𝑇𝑐
2
𝑇𝑐
8
Assume you use a P controller only 𝑇𝑖 = ∞, 𝑇𝑑 = 0. Then you need to find for
which 𝐾𝑝 the closed loop system is a marginally stable system (𝜔𝑐 = 𝜔180). This 𝐾𝑝
is called 𝐾𝑐 (critical gain). The 𝑇𝑐 (critical period) can be found from the damped
oscillations of the closed loop system. Then calculate the PI(D) parameters using
the formulas below.
𝜔𝑐 = 𝜔180
𝐾𝑐- Critical Gain
𝑇𝑐- Critical Period
Marginally stable system:
𝑇𝑐
Theory
𝑇𝑐 =
2𝜋
𝜔180
64. Controller Design/Tuning using MATLAB
• Frequency Design and Analysis
• pidtune() MATLAB function
• PID Tuner (Interactive Tools)
• ...
Validate with simulations!
65. pidtune() MATLAB function
clear, clc
%Define Process
num = 1;
den = [1,1,0];
Hp = tf(num,den)
% Find PI Controller
[Hpi,info] = pidtune(Hp,'PI')
%Bode Plots
figure(1)
bode(Hp)
grid on
figure(2)
bode(Hpi)
grid on
% Feedback System
T = feedback(Hpi*Hp, 1);
figure(3)
step(T)
𝐾𝑝 = 0.33
𝑇𝑖 =
1
𝐾𝑖
=
1
0.023
≈ 43.5𝑠
66. pidtune() MATLAB function
To improve the response time, you can set a higher
target crossover frequency than the result that pidtune()
automatically selects, 0.32. Increase the crossover
frequency to 1.0.
[Hpi,info] = pidtune(Hp,'PI', 1.0)
The new controller achieves the higher
crossover frequency, but at the cost of a
reduced phase margin.
67. MATLAB PID Tuner
Define your
Process
Define Controller Type Tuning
Add Additional
Plots
Step Response and other
Plots can be shown
PID Parameters
70. Stability Analysis
How do we figure out that the Feedback System
is stable before we test it on the real System?
1. Poles
2. Frequency Response/Bode
3. Simulations (Step Response)
We will do all these things using MATLAB
71. Stability Analysis
Asymptotically stable system
Marginally stable system
Unstable system
Time domain
The Complex domain
Frequency domain
Poles
Tracking
transfer
function
Tracking
transfer
function
Loop
transfer
function
3
2
1
Asymptotically stable system: 𝜔𝑐 < 𝜔180
Marginally stable system: 𝜔𝑐 = 𝜔180
Unstable system: 𝜔𝑐 > 𝜔180
lim
𝑡→∞
𝑦 𝑡 = 𝑘
Figure: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010.
72. Poles
Asymptotically stable system:
Each of the poles of the transfer function lies strictly in the
left half plane (has strictly negative real part).
Marginally stable system:
Unstable system:
At least one pole lies in the right half
plane (has real part greater than zero).
Or: There are multiple and coincident
poles on the imaginary axis.
Example: double integrator 𝐻(𝑠) =
1
𝑠2
One or more poles lies on the imaginary axis
(have real part equal to zero), and all these
poles are distinct. Besides, no poles lie in the
right half plane.
3
1
2
73. Stability Analysis
Asymptotically stable system: Marginally stable system: Unstable system:
Each of the poles of the transfer function lies
strictly in the left half plane (has strictly negative
real part).
One or more poles lies on the imaginary axis (have
real part equal to zero), and all these poles are
distinct. Besides, no poles lie in the right half plane.
At least one pole lies in the right half plane (has
real part greater than zero).
Or: There are multiple and coincident poles
on the imaginary axis. Example: double
integrator 𝐻(𝑠) =
1
𝑠2
Theory
lim
𝑡→∞
𝑦 𝑡 = 𝑘
0 < lim
𝑡→∞
𝑦 𝑡 < ∞
lim
𝑡→∞
𝑦 𝑡 = ∞
Figures: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010.
75. Stability Analysis of
Feedback Systems
Loop Transfer Function
(“Sløyfetransferfunksjonen”):
The Tracking Function (“Følgeforholdet”):
L = ...
T = feedback(L, 1)
Hr = ...
Hp = ...
Hm = ...
L = series(series(Hr, Hp), Hm)
The Sensitivity Function (“Sensitivitetsfunksjonen”):
T = ...
S = 1-T
Theory
3
1
2
76. Frequency Response and Stability Analysis
𝜔𝑐 and 𝜔180 are called the crossover-frequencies
(“kryssfrekvens”)
Δ𝐾 is the gain margin (GM) of the system (“Forsterkningsmargin”).
How much the loop gain can increase before the system becomes
unstable
𝜙 is the phase margin (PM) of the system (“Fasemargin”).
How much phase shift the system can tolerate before it becomes
unstable.
Bode Diagram
Theory
Asymptotically stable system: 𝜔𝑐 < 𝜔180
Marginally stable system: 𝜔𝑐 = 𝜔180
Unstable system: 𝜔𝑐 > 𝜔180
77. Frequency Response and Stability Analysis Theory
Gain Crossover-frequency - 𝜔𝑐 :
𝐿 𝑗𝜔𝑐 = 1 = 0𝑑𝐵
Phase Crossover-frequency - 𝜔180 :
∠𝐿 𝑗𝜔180 = −180𝑜
Gain Margin - GM (𝛥𝐾):
𝐺𝑀 𝑑𝐵 = − 𝐿 𝑗𝜔180 𝑑𝐵
Phase margin PM (𝜑):
𝑃𝑀 = 180𝑜 + ∠𝐿(𝑗𝜔𝑐)
We have that:
1. Asymptotically stable system: 𝜔𝑐 < 𝜔180
2. Marginally stable system: 𝜔𝑐 = 𝜔180
3. Unstable system: 𝜔𝑐 > 𝜔180
The definitions are as follows:
𝜔180 is the gain margin frequency, in
radians/second. A gain margin frequency indicates
where the model phase crosses -180 degrees.
GM (Δ𝐾) is the gain margin of the system.
𝜔𝑐 is phase margin frequency, in radians/second. A
phase margin frequency indicates where the
model magnitude crosses 0 decibels.
PM (𝜑) is the phase margin of the system.
79. Example
We will use the following system as an example:
𝐻𝑐 = 𝐾𝑝
𝐻𝑝 =
1
𝑠(𝑠 + 1)
𝐻𝑚 =
1
3𝑠 + 1
Controller Process
Sensors
𝑟 𝑢
𝑒
−
𝑦
80. Analysis of the Feedback System
Loop transfer function: 𝑳(𝒔)
We need to find the Loop transfer function 𝐿(𝑠) using MATLAB.
The Loop transfer function is defined as:
𝐿 𝑠 = 𝐻𝑐𝐻𝑝𝐻𝑚 We will use the built-in function series() in MATLAB.
Tracking transfer function: 𝑻(𝒔)
We need to find the Tracking transfer function 𝑇(𝑠) using MATLAB.
The Tracking transfer function is defined as:
𝑇 𝑠 =
𝑦(𝑠)
𝑟(𝑠)
=
𝐻𝑐𝐻𝑝𝐻𝑚
1+𝐻𝑐𝐻𝑝𝐻𝑚
=
𝐿(𝑠)
1+𝐿(𝑠)
We will use the built-in function feedback() in MATLAB.
Sensitivity transfer function: 𝑺(𝒔)
We need to find the Sensitivity transfer function 𝑆(𝑠) using MATLAB.
The Sensitivity transfer function is defined as:
𝑆 𝑠 =
𝑒(𝑠)
𝑟(𝑠)
=
1
1+𝐿(𝑠)
= 1 − 𝑇(𝑠)
81. Stability Analysis
• Plot the Bode plot for the system using e.g., the bode()
function in MATLAB
• Find the crossover-frequencies (𝜔180, 𝜔𝑐) and stability
margins GM (𝐴(𝜔)), PM (𝜙(𝜔)) of the system (𝐿(𝑠)) from
the Bode plot.
• Plot also Bode diagram where the crossover-frequencies,
GM and PM are illustrated. Tip! Use the margin() function
in MATLAB.
• Use also the margin() function in order to find values for
𝜔180, 𝜔𝑐, 𝐴(𝜔), 𝜙(𝜔) directly.
• You should compare and discuss the results.
• How much can you increase 𝐾𝑝 before the system
becomes unstable?
82. clear, clc, clf
% The Process Transfer function Hp(s)
num_p=[1];
den1=[1, 0];
den2=[1, 1];
den_p = conv(den1,den2);
Hp = tf(num_p, den_p)
% The Measurement Transfer function Hm(s)
num_m=[1];
den_m=[3, 1];
Hm = tf(num_m, den_m)
% The Controller Transfer function Hr(s)
Kp = 0.35;
Hr = tf(Kp)
% The Loop Transfer function
L = series(series(Hr, Hp), Hm)
% Bode Diagram
figure(1)
bode(L),grid on
figure(2)
margin(L)
[gm, pm, w180, wc] = margin(L);
wc
w180
gm
gmdB = 20*log10(gm)
pm
MATLAB Code:
bode(L)
margin(L)
wc = 0.2649 rad/s
w180 = 0.5774 rad/s
gm = 3.8095
gmdB = 11.6174 dB
pm = 36.6917 degrees
83. 𝜔𝑐 = 0.26
From the Bode plot we can get:
1
10
0.1
0.2
0.3
0.5
𝜔180 = 0.58
∆𝐾 = 11.6 𝑑𝐵
𝜙 = 37 °
84. Stable vs. Unstable System
• We will find and use different values of 𝐾𝑝 where we get a marginally
stable system, an asymptotically stable system and an unstable system.
• We will Plot the time response for the tracking function using the step()
function in MATLAB for all these 3 categories. How can we use the step
response to determine the stability of the system?
• We will find 𝜔180, 𝜔𝑐, 𝐴 𝜔 and 𝜙(𝜔) in all 3 cases. We will see how
we use 𝜔𝑐 and 𝜔180 to determine the stability of the system.
• We will find and plot the poles and zeros for the system for all the 3
categories mentioned above. We will see how we can we use the poles
to determine the stability of the system.
• Bandwidth: We will plot the Loop transfer function 𝐿(𝑠), the Tracking
transfer function 𝑇(𝑠) and the Sensitivity transfer function 𝑆(𝑠) in a
Bode diagram for the system for all the 3 categories mentioned above.
85. Stable System
𝐾𝑝 = 0.35
wc = 0.2649 rad/s
w180 = 0.5774 rad/s
gm = 3.8095
gmdB = 11.6174 dB
pm = 36.6917 degrees
𝐾𝑝𝑚 = 0.35 × Δ𝐾 = 0.35 × 3.8 ≈ 1,32
For what 𝐾𝑝 becomes the system marginally stable?
𝜔𝑐 < 𝜔180 Poles in the left half plane
lim
𝑡→∞
𝑦 𝑡 = 1
86. Marginally Stable System
𝐾𝑝 = 1.32
𝜔𝑐 = 𝜔180 Poles at the imaginary axis
0 < lim
𝑡→∞
𝑦 𝑡 < ∞
wc = 0.5744 rad/s
w180 = 0.5774 rad/s
gm = 1.0101
gmdB = 0.0873 dB
pm = 0.2500 degrees
87. Unstable System
𝐾𝑝 = 2
𝜔𝑐 > 𝜔180 Poles in the right half plane
lim
𝑡→∞
𝑦 𝑡 = ∞
wc = 0.7020
w180 = 0.5774
gm = 0.6667
gmdB = -3.5218
pm = -9.6664
88. MATLAB Code
clear, clc, clf
% The Process Transfer function Hp(s)
num_p=[1];
den1=[1, 0];
den2=[1, 1];
den_p = conv(den1,den2);
Hp = tf(num_p, den_p)
% The Measurement Transfer function Hm(s)
num_m=[1];
den_m=[3, 1];
Hm = tf(num_m, den_m)
% The Controller Transfer function Hr(s)
Kp = 0.35; % Stable System
%Kp = 1.32; % Marginally Stable System
%Kp = 2; % Unstable System
Hr = tf(Kp)
% The Loop Transfer function
L = series(series(Hr, Hp), Hm)
% Tracking transfer function
T=feedback(L,1);
% Sensitivity transfer function
S=1-T;
...
...
% Bode Diagram
figure(1)
bode(L), grid on
figure(2)
margin(L), grid on
[gm, pm, w180, wc] = margin(L);
wc
w180
gm
gmdB = 20*log10(gm)
pm
% Simulating step response for control system
(tracking transfer function)
figure(3)
step(T)
% Poles
pole(T)
figure(4)
pzmap(T)
% Bandwidth
figure(5)
bodemag(L,T,S), grid on
89. “Golden rules” of Stability Margins
for a Control System
Gain Margin (GM): (Norwegian: “Forsterkningsmargin”)
Phase Margin (PM): (Norwegian: “Fasemargin”)
Theory
Reference: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010.
90. The Bandwidth of
the Control System
https://www.halvorsen.blog
Hans-Petter Halvorsen
91. The Bandwidth of the Control System
• You should plot the Loop transfer function
𝐿(𝑠), the Tracking transfer function 𝑇(𝑠)
and the Sensitivity transfer function 𝑆(𝑠) in
the same Bode diagram.
• Use, e.g., the bodemag() function in
MATLAB (only the gain diagram is of
interest in this case, not the phase
diagram).
• Use the values for 𝐾𝑝 and 𝑇𝑖 found in a
previous Tasks.
• You need to find the different bandwidths
𝝎𝒕, 𝝎𝒄, 𝝎𝒔 (see the sketch below).
𝑆
𝑇
𝐿
92. The Bandwidth of the Control System Theory
3 different Bandwidth definitions:
The bandwidth of a control system is the frequency which divides the frequency
range of good tracking and poor tracking.
Good Set-point Tracking: |𝑆(𝑗𝜔)| ≪ 1, |𝑇 (𝑗𝜔)| ≈ 1, |𝐿(𝑗𝜔)| ≫ 1
Good
Tracking
Poor
Tracking
BW
𝑇
𝐿
𝑆
96. PI Controller - Example
We will use the following system as an example:
𝐻𝑝 =
1
𝑠(𝑠 + 1)
𝐻𝑚 =
1
3𝑠 + 1
Controller Process
Sensors
𝑟 𝑢
𝑒
− 𝑦
𝐻𝑐 =
𝐾𝑝(𝑇𝑖𝑠 + 1)
𝑇𝑖𝑠
97. Ziegler–Nichols Frequency Response method
https://en.wikipedia.org/wiki/Ziegler–Nichols_method
Controller 𝐾𝑝 𝑇𝑖 𝑇𝑑
P 0.5𝐾𝑐 ∞ 0
PI 0.45𝐾𝑐
𝑇𝑐
1.2
0
PID 0.6𝐾𝑐
𝑇𝑐
2
𝑇𝑐
8
Assume you use a P controller only 𝑇𝑖 = ∞, 𝑇𝑑 = 0. Then you need to find for
which 𝐾𝑝 the closed loop system is a marginally stable system (𝜔𝑐 = 𝜔180). This 𝐾𝑝
is called 𝐾𝑐 (critical gain). The 𝑇𝑐 (critical period) can be found from the damped
oscillations of the closed loop system. Then calculate the PI(D) parameters using
the formulas below.
𝜔𝑐 = 𝜔180
𝐾𝑐- Critical Gain
𝑇𝑐- Critical Period
Marginally stable system:
𝑇𝑐
Theory
𝑇𝑐 =
2𝜋
𝜔180
98. PI Controller using Ziegler–Nichols
𝐾𝑝 = 0.45𝐾𝑐
𝑇𝑖 =
𝑇𝑐
1.2
From previous Simulations:
𝐾𝑐 = 1.32
𝑇𝑐 =
2𝜋
𝜔180
=
2𝜋
0.58
Ziegler–Nichols (PI Controller):
This gives the following PI Parameters:
𝐾𝑝 = 0.45𝐾𝑐 = 0.45 ∙ 1.32 ≈ 0.6
𝑇𝑖 =
𝑇𝑐
1.2
=
2𝜋
0.58
1.2
≈ 9𝑠
99. Skogestad’s method
• The Skogestad’s method assumes you apply a step on the input (𝑢) and then
observe the response and the output (𝑦), as shown below.
• If we have a model of the system (which we have in our case), we can use the
following Skogestad’s formulas for finding the PI(D) parameters directly.
We set, e.g., 𝑇𝐶 = 5 𝑠 and 𝑐 = 1.5:
𝐻𝑝 =
1
𝑠(𝑠 + 1)
Our Process:
𝐾 = 1, 𝑇 = 1, 𝜏 = 0
𝐾𝑝 =
1
𝐾(𝑇𝑐 + 𝜏)
=
1
1(10 + 0)
=
1
5
= 0.2 𝑇𝑖 = 𝑐 𝑇𝑐 + 𝜏 = 1.5 5 + 0 = 7.5𝑠
𝑇𝑐 is the time-constant of the control system which the user must specify
Figure: F. Haugen, Advanced Dynamics and Control: TechTeach, 2010.
100. MATLAB
Ziegler–Nichols and Skogestad’s Formulas:
% Ziegler-Nicols Method
Kc = 1.32; % Critical Gain
Tc = 2*pi/w180; % Tc - Critical Period
Kp = 0.45 * Kc
Ti = Tc/1.2
% Skogestad's Method
Tc = 5; % time-constant of the control system which the user must specify
c = 1.5;
% H=K*e(-Tau*s)/(T*s+1)*s
Kp = 1/K*(Tc)
Ti = c*(Tc+Tau)
101. pidtune() MATLAB function
clear, clc
%Define Process
num = 1;
den = [1,1,0];
Hp = tf(num,den)
% Find PI Controller
[Hpi,info] = pidtune(Hp,'PI')
%Bode Plots
figure(1)
bode(Hp)
grid on
figure(2)
bode(Hpi)
grid on
% Feedback System
T = feedback(Hpi*Hp, 1);
figure(3)
step(T)
𝐾𝑝 = 0.33
𝑇𝑖 =
1
𝐾𝑖
=
1
0.023
≈ 43.5𝑠
102. MATLAB PID Tuner
Define your
Process
Define Controller Type Tuning
Add Additional
Plots
Step Response and other
Plots can be shown
PID Parameters
104. MATLAB Simulations
clear, clc, clf
% The Process Transfer function Hp(s)
num_p=[1];
den1=[1, 0];
den2=[1, 1];
den_p = conv(den1,den2);
Hp = tf(num_p, den_p);
% The Measurement Transfer function Hm(s)
num_m=[1];
den_m=[3, 1];
Hm = tf(num_m, den_m);
% The PI Controller Transfer function Hc(s)
%Kp = 0.6; Ti = 9; % Ziegler?Nichols
%Kp = 0.2; Ti = 7.5; % Skogestad
Kp = 0.33; Ti = 43.5; % MATLAB pidtune() function
num = Kp*[Ti, 1];
den = [Ti, 0];
Hc = tf(num,den);
% The Loop Transfer function
L = series(series(Hc, Hp), Hm);
% Tracking transfer function
T=feedback(L,1);
% Sensitivity transfer function
S=1-T;
...
...
% Bode Diagram
figure(1)
bode(L), grid on
figure(2)
margin(L), grid on
[gm, pm, w180, wc] = margin(L);
wc
w180
gm
gmdB = 20*log10(gm)
pm
% Simulating step response for control system
(tracking transfer function)
figure(3)
step(T)
% Poles
pole(T)
figure(4)
pzmap(T)
% Bandwidth
figure(5)
bodemag(L,T,S), grid on
105.
106. References
1. D. Ruscio, System Theory - State Space Analysis
and Control Theory, Lecture Notes, 2015
2. F. Haugen, Advanced Dynamics and Control:
TechTeach, 2010.
3. R. C. Dorf and R. H. Bishop, Modern Control
Systems. Eleventh Edition: Pearson Prentice Hall.
4. https://www.halvorsen.blog