Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Kristian Soltesz
PIDopt
Commits
48724d85
Commit
48724d85
authored
Sep 06, 2017
by
Kristian Soltesz
Browse files
Added script that will contain a use case example.
parent
cdeebb5e
Changes
1
Hide whitespace changes
Inline
Sidebyside
example.m
0 → 100644
View file @
48724d85
% This example demonstrates how to invoke the scripts for obtaining
%IEoptimal and IAE optimal (with or without LP filter) PID controllers.
%
% Downloaded from git@gitlab.control.lth.se:kristian/PIDopt.git
%% SETUP
% Process model (continuous time LTI SISO system)
s
=
tf
(
's'
);
P
=
5
/(
s
+
1
)/(
3
*
s
+
1
)
*
exp
(

2
*
s
);
% Note: While defaults in the optimization code work for many processes,
% you may need to change grids and tolerances for some.
%
% Note: The optimization scripts were primarily written with stable process
% models in mind. If applied to unstable process models, they may need to
% be modified.
%
% Note: The optimization scripts assume contunuous time process models.
% Modifying them to accomodate discrete time process models is
% straightforward.
%
% Note: If a filter has been designed for the process, simply incorprate it
% into the process model (that is, as a series connected component of P).
Ms
=
1.5
;
% Maximum allowed sensitivity function magnitude
Mt
=
1.5
;
% Maximum allowed complementary sensitivity function magnitude
Mks
=
10
;
% Maximum allowed magnitude of transfer function from process
% output to control signal, sometimes referred to as noise
% sensitivity.
%% Design
% IEoptimal design
p0
=
[
0
0
0
]
'
;
% Parameters of any PID controller, which stabilizes P.
% See pidIE.m for details. Use p = [0 0] to synthesize PI
% controller.
[
K1
,
p1
]
=
pidIE
(
P
,
Ms
,
Mt
,
Mks
,
p0
)
% IAEoptimal design
[
K2
,
p2
]
=
pidIAE
(
P
,
Ms
,
Mt
,
Mks
,
p1
)
% Hotstart with K1 parameters
% IAEoptimal design with filter
[
K
,
p3
]
=
pidfIAE
(
P
,
Ms
,
Mt
,
Mks
,
p2
)
% Hotstart with K2 parameters
% Note: The IEoptimal design method relies on convexconcave optimization.
% It guarantees robustness but not stability. So if you choose the grid in
% an unfortunate way, you might end up with a robustly unstable design.
% Note: Behaviour of the methods is undefined (or at least unexplained
% here) if the constraint combinatioon Ms,Mt,Mks is infeasible for P.
%
% Note: Neither the IE nor IAE (with or without filter) guarantee
% optimality. However, both methods have been verified to find the true
% optimum in a large number of cases, such as ...
%% Evaluation
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment