Académique Documents
Professionnel Documents
Culture Documents
Fonctions FFFFFF
Fonctions FFFFFF
Une introduction à
MATLAB - CONTROL SYSTEM TOOLBOX (version R2012a)
TD MATLAB No 1
1 Fonction de transfert
K
T (p) =
1+T p
Instructions :
>> K=10;
>> T=0.5;
>> num = [K];
>> den = [T 1];
>> sys = tf(num,den)
ou de manière condensée :
>> K=10;
>> T=0.5;
>> sys = tf(K,[T 1])
Sortie :
Transfer function:
10
---------
0.5 s + 1
1
>> sys.inputname = ’débit’;
>> sys.outputname = ’niveau’
Sortie :
1.2 Exemple 2
p+1
T (p) =
p2 + 4
Sortie :
Transfer function:
s + 1
-------
s^2 + 4
1.3 Exemple 3
p2 + p + 1
T (p) =
(p + 1)(p + 2)
Sortie :
2
Transfer function:
s^2 + s + 1
-------------
s^2 + 3 s + 2
>> zpk(sys)
Sortie :
Zero/pole/gain:
(s^2 + s + 1)
--------------
(s+2) (s+1)
Instructions :
>> K=10;
>> T=0.5;
>> sys = tf(K,[T 1])
>> sys.InputDelay = 2
ou
>> K=10;
>> T=0.5;
>> sys = tf(K,[T 1])
>> set(sys,’InputDelay’,2)
>> sys
Sortie :
Transfer function:
10
exp(-2*s) * ---------
0.5 s + 1
1
Attention l’instruction zpk() ne renvoie pas le gain statique du système.
3
1.5 Propriétés des fonctions de transfert
p+1
sys1 =
p+2
3
sys2 =
p2 +p+1
3(p + 4)
sys3 =
p2 +2p+1
10
sys4 =
p2 + 3 p + 2
10
sys5 =
(p + 1)2
p+1
sys6 =
p(p + 2)(p + 3)
p2 + p + 1
sys7 = 10
(p + 2)(p + 3)
p + 1 −3p
sys8 = e
p+2
5
sys9 =
p2 +5p+6
Pour chacune de ces fonctions de transfert, exécuter (pas à pas) la série d’instructions
suivante :
>> sys=sys1
>> class(sys)
>> size(sys)
>> get(sys)
>> dcgain(sys)
>> pole(sys)
>> zero(sys)
>> damp(sys)
>> pzmap(sys)
4
1.6 Accès aux données
2 Analyse temporelle
5
>> sys = tf(10,[0.5 1]);
>> sys.InputDelay = 2
>> step(sys)
>> title(’Réponse à un échelon unité’)
>> stepinfo(sys1)
>> stepinfo(sys2)
>> t = [0:0.1:3];
>> input = t;
>> plot(t,input,t,dcgain(sys)*t,t,lsim(sys,input,t))
>> title(’Réponse à une rampe’)
6
2.3.3 Réponse à une sinusoı̈de
>> [u,t]=gensig(’sin’,1,30,0.01);
>> plot(t,u,t,lsim(sys,u,t))
>> title(’Réponse à une sinusoı̈de’)
1 + τa p
H(p) = K
(1 + τ1 p)(1 + τ2 p)
avec : K = 1, τ1 = 15 et τ2 = 5
a) τa = −10
b) τa = 0
c) τa = 10
d) τa = 15
e) τa = 50
7
La modélisation simplifiée en vue de l’asservissement en position d’un actionneur élec-
tromécanique et de sa charge a conduit au schéma de la Figure 1.
M = 30 kg , k = 15 N/m , f = 15 N.s/m , R = 10 Ω
L = 10 H , α = 0, 2 V.s/m , β = 6 N/A
di dy
u−Ri−L −α =0
dt dt
d2 y dy
M = −f −ky+βi
dt 2 dt
8
Y ∗ (p) β
=
U (p)
∗ L M p + (R M + L f ) p + (R f + L k + α β) p + R k
3 2
1ère partie :
3) Quels sont les pôles du système ? Afficher les pôles et les zéros du système dans le
plan complexe.
2ème partie :
11) Quels sont les pôles du système ? Afficher les pôles et les zéros du système dans le
plan complexe.
12) Tracer la réponse y ∗(t) lorsqu’on envoie une impulsion de tension au système.
9
13) Tracer la réponse y ∗ (t) lorsqu’on applique un échelon de tension u∗ = 100 V au
système.
3 Analyse fréquentielle
K = 10 ; ξ = 0.01 ; wn = 10
1+aτ p
T (p) =
1+τ p
10
3) Tracer le diagramme de Bode pour a = 10 et τ = 0, 06.
Comparer au résultat de la question 2).
General.
ctrlpref - Set Control System Toolbox preferences.
InputOutputModel - Overview of input/output model objects.
DynamicSystem - Overview of dynamic system objects.
lti - Overview of linear time-invariant system objects.
Linear models.
tf - Create transfer function (TF) models.
zpk - Create zero/pole/gain (ZPK) models.
ss - Create state-space (SS) models.
dss - Create descriptor state-space models.
delayss - Create state-space models with delayed terms.
frd - Create frequency response data (FRD) models.
pid - Create PID controller in parallel form.
pidstd - Create PID controller in standard form.
11
tf/exp - Create pure continuous-time delays (TF and ZPK only)
filt - Specify digital filters.
InputOutputModel/set - Set/modify properties of model object.
setDelayModel - Specify internal delay model (state space only).
Data extraction.
tfdata - Extract numerators and denominators.
zpkdata - Extract zero/pole/gain data.
ssdata - Extract state-space matrices.
dssdata - Descriptor version of SSDATA.
frdata - Extract frequency response data.
piddata - Extract PID parameters in parallel form.
pidstddata - Extract PID parameters in standard form.
InputOutputModel/get - Access properties of model object.
ss/getDelayModel - Access internal delay model (state space only).
Model conversion.
tf - Conversion to transfer function.
zpk - Conversion to zero/pole/gain.
ss - Conversion to state space.
frd - Conversion to frequency data.
pid - Conversion to PID controller in parallel form.
pidstd - Conversion to PID controller in standard form.
c2d - Continuous to discrete conversion.
d2c - Discrete to continuous conversion.
d2d - Resample discrete-time model.
upsample - Upsample discrete-time systems.
chgTimeUnit - Change time units.
imp2exp - Implicit to explicit conversion.
System interconnection.
append - Aggregate models by appending inputs and outputs.
parallel - Connect models in parallel (see also overloaded +).
series - Connect models in series (see also overloaded *).
feedback - connect models with a feedback loop.
lft - Generalized feedback interconnection.
connect - Arbitrary block-diagram interconnection.
sumblk - Specify summing junction (for use with connect).
strseq - Builds sequence of indexed strings (for I/O naming).
System dynamics.
dcgain - Steady-state (D.C.) gain.
pole - System poles.
zero - Zeros and gain of SISO system.
12
tzero - Invariant zeros of MIMO system.
order - System order (number of states).
pzmap - Pole-zero map.
iopzmap - Input/output pole-zero map.
damp - Natural frequency and damping of system poles.
esort - Sort continuous poles by real part.
dsort - Sort discrete poles by magnitude.
stabsep - Stable/unstable decomposition.
modsep - Region-based modal decomposition.
Time-domain analysis.
step - Step response.
stepinfo - Step response characteristics (rise time, ...)
impulse - Impulse response.
initial - Free response with initial conditions.
lsim - Response to user-defined input signal.
lsiminfo - Linear response characteristics.
gensig - Generate input signal for LSIM.
covar - Covariance of response to white noise.
Frequency-domain analysis.
bode - Bode diagrams of the frequency response.
bodemag - Bode magnitude diagram only.
sigma - Singular value frequency plot.
nyquist - Nyquist plot.
nichols - Nichols plot.
freqresp - Frequency response over a frequency grid.
evalfr - Evaluate frequency response at given frequency.
margin - Gain and phase margins.
allmargin - All crossover frequencies and related gain/phase margins.
bandwidth - System bandwidth.
getPeakGain - Peak gain of frequency response.
getGainCrossover - Gain crossover frequencies.
DynamicSystem/norm - H2 and Hinfinity norms of LTI models.
Model simplification.
minreal - Minimal realization and pole/zero cancellation.
sminreal - Structurally minimal realization (state space).
hsvd - Hankel singular values (state contributions)
balred - Reduced-order approximations of linear models.
modred - Model order reduction.
Compensator design.
pidtune - Tune PID controller based on linear plant model.
13
rlocus - Evans root locus.
place - Pole placement.
estim - Form estimator given estimator gain.
reg - Form regulator given state-feedback and estimator gains.
ss/lqg - Single-step LQG design.
lqr, dlqr - Linear-Quadratic (LQ) state-feedback regulator.
lqry - LQ regulator with output weighting.
lqrd - Discrete LQ regulator for continuous plant.
lqi - Linear-Quadratic-Integral (LQI) controller.
kalman - Kalman state estimator.
kalmd - Discrete Kalman estimator for continuous plant.
lqgreg - Build LQG regulator from LQ gain and Kalman estimator.
lqgtrack - Build LQG servo-controller.
augstate - Augment output by appending states.
Time delays.
hasdelay - True for models with time delays.
totaldelay - Total delay between each input/output pair.
absorbDelay - Replace delays by poles at z=0 or phase shift.
pade - Pade approximation of continuous-time delays.
thiran - Thiran approximation of fractional discrete-time delays.
14
db2mag - Convert decibels (dB) to magnitude.
15
Matrix equation solvers and linear algebra.
lyap, dlyap - Solve Lyapunov equations.
lyapchol, dlyapchol - Square-root Lyapunov solvers.
care, dare - Solve algebraic Riccati equations.
gcare, gdare - Generalized Riccati solvers.
bdschur - Block diagonalization of a square matrix.
Demonstrations.
Type "demo toolbox control" for a list of available demos.
16