I am trying to use MATLAB to calculate a steady-state error. I have found a weblink that gives code for finding the steady-state error, but when I use that code I get a value of the steady-error greater than 1. In my understanding, a steady-state error should be less than 1, because formula of steady-state error in case of step input = 1/(1+k)
The code:
sserror=abs(SP-y(end))
When I try to incorporate the above code into my code to get the steady-state error:
clc;clear all;close all
%defining parameters values
Ra=1
Kt=10
Kb=0.1
j=2
b=0.5
%defining numerator & denominator of system1 (1/js+b)
num=[1]
den=[j b]
% creating transfer function for system 1
sys1=tf(num,den)
%Applying block diagram reduction and simplification techniques
sys2=(-Kb)*Kt/Ra
%Creating a positive feedback system from above two systems sys1 and sys2
a=feedback(sys1,sys2,1)
%Introducing the effect of disturbance input
OL=-1*a
%Calculating step response & extracting amplitude & time matrices
[y,t]=step(OL)
%Plotting values of amplitude matrix extracted from step resposne
plot(y)
%Calculating length(total number of elements) for timing matrix
z=length(t)
%Finding value of last element of amplitude matrix
%That is also value of steady state speed
open_loop_steady_state_speed=y(z)
SP=1 % set point incase of step input
sserror=abs(SP-y(end))
I am trying to simulate a block diagram from a book, Modern Control Systems. I am also attaching a snapshot of that block diagram.
There are two block diagrams in the snapshot, one is for an open-loop control system and the other is for a closed-loop control system.
I am considering and trying to write code for an open-loop system.
Update: Note: Plot has been added in response to comment