Diagrammes de Bode, Black et Nyquist avec TikZ
Diagrammes de Bode, Black et Nyquist avec TikZ
PGF/TIKZ
Papanicola Robert∗
4 novembre 2023
1
— ajout d’un style pour les puces ;
version 1.1 : 03/05/2009, ajout ;
— abaque temps de réponse 2nd ordre,
— abaque des dépassements d’un 2nd ordre ;
version 1 : mise en ligne de la version initiale 06/04/2009.
1 Introduction / Introduction
Ce package permet de tracer les dia- This package allows to draw Bode, Ni-
grammes de Bode, Black et Nyquist à chols and Nyquist graphs using Gnuplot
l’aide de Gnuplot et Tikz. Les fonctions and Tikz. Basic transfer functions and
de transfert élémentaires et les correc- correctors are pre-installed to be used in
teurs courants sont préprogrammés pour the tracing functions.
être utilisés dans les fonctions de tracé.
2
1.2 Composition du package / Composition of Package
Ce package est constitué de trois fichiers : Package This package consists of three
— [Link] : le package pro- files :
prement dit ; — [Link] : the package itself ;
— [Link] : macro-commandes — [Link] : macros defining curves
de définition des courbes iso- iso-module
module ; — [Link] : macros definition curves
— [Link] : macro-commandes iso-arguments.
de définition des courbes iso- [Link] file, the file containing
arguments. the documentation. Gnuplot precompu-
et du fichier [Link], ce fichier ted curves are in the directory /gnuplot/.
contenant la documentation. Les courbes
gnuplot précalculées sont dans le réper-
toire /gnuplot/.
1.4 À faire / To Do
— Compléter les fonctions élémen- — Complete the basic functions
taires, — Better english !!!
— Traduction correcte en anglais, — ...
— ...
3
10
\begin{tikzpicture}
0
[yscale=2/30,xscale=7/5]
\semilog{-2}{3}{-20}{10} −10
\end{tikzpicture}
−20
10−2 10−1 100 101 102 103
10
\begin{tikzpicture}
0
[yscale=2/30,xscale=7/5]
\semilog*{-2}{3}{-20}{10} −10
\end{tikzpicture}
−20
10−2 10−1 100 101 102 103
4
\begin{tikzpicture}
[yscale=3/50,
xscale=0.9\textwidth/3cm]
\semilogNG{3}{50}
\end{tikzpicture}
dB
20
\begin{tikzpicture} 10
0
[xscale=7/5] −10
\begin{scope}[yscale=3/80] −20
\UnitedB −30
−40
\semilog*{-1}{4}{-60}{20} −50
\end{scope} −60 rad/s
10◦−1 100 101 102 103 104
\begin{scope} 0
[yshift=-3cm,yscale=3/180] −30
\UniteDegre −60
\OrdBode{30} −90
\semilog*{-1}{4}{-180}{0} −120
\end{scope} −150
\end{tikzpicture} −180 rad/s
10−1 100 101 102 103 104
— \UnitedB
permet d’afficher les unités pour un allows to attach unites for an ampli-
diagramme d’amplitude tude graph
— \UniteDegre
permet d’afficher les unités pour un allows to attach unites for a phase
diagramme de phase. graph.
— \OrdBode{pas}
5
permet de préciser le pas des gradua- allows to specify the step of vertical
tions verticales (par défaut 10) du dia- graduations ( 10 by default) of the
gramme semilog. graph
Les styles de tracé par défaut sont définis Default drawing styles are defined by the
à l’aide de la commande \tikzset (voir command \tikzset ( see figure 4)
figure 4)
6
\begin{tikzpicture}
\begin{scope}[yscale=2/50,xscale=0.9\textwidth/2cm]
\semilog∗{0}{2}{−20}{30}
\end{scope}
\begin{scope}[yshift=−3cm,
yscale=2/50,xscale=0.9\textwidth/2cm]
\tikzset{
semilog lines/.style={thin, blue},
semilog lines 2/.style={semilog lines,red!50 },
semilog half lines/.style={semilog lines 2,dotted },
semilog label x/.style= {semilog lines, below,font=\tiny},
semilog label y/.style={semilog lines,right,font=\tiny}
}
\semilog∗{0}{2}{−20}{30}
\end{scope}
\end{tikzpicture}
30
20
10
0
−10
−20
100 101 102
30
20
10
0
−10
−20
100 101 102
Vous pouvez, en modifiant ces styles agir You can move the defaults drawings by
les tracés par défaut (fig. 4). modifying these styles
7
Trois commandes permettent de tracer Three commands allow you to draw am-
les diagrammes d’amplitude et de phase. plitude and phase diagrams (fig. 5).
(fig. 5).
— \BodeGraph[Options]{domain}{fonction} :
pour le diagramme d’amplitude et de for the amplitude and phase graph.
phase.
— \BodeGraph*[Options]{domain}{fonction}{[options]{texte}}
réalise le tracé et ajoute le texte avec draw the graph and add the text by
les options précisées à l’extrémité. using the options at the end.
— \BodePoint[Options]{liste}{fonction}
place les points de la liste sur le dia- place the list points on the graph.
gramme.
avec / with
— domain :
le domaine du tracé précisé en puis- the graph domain precised in power
sance de 10, ainsi pour tracer une of 10 le, therefore to draw a function
fonction de 10−2 rad s−1 à 103 rad s−1 of 10−2 rad s−1 to 103 rad s−1 you will
on notera le domaine {-2 :3} . note the domain {-2 :3} .
— fonction
la fonction à tracer écrite avec la syn- the function on the drawing written
taxe gnuplot. with gnuplot syntax.
— options
Toutes les options de tracé de tikz et all the options of tikz and gnuplot
de gnuplot peuvent être utilisées et drawings can be used to replace the
substituent à celle par défaut, on no- default ones, it may be noted mainly :
tera principalement :
8
— Nom du fichier créé / File name [id=nomdufichier]
— Répertoire par défaut / default directory prefix=gnuplot/\jobname
— valeurs par défaut / default values : [samples=50, thick, blue] ) l
Il est à noter que tikz, sauvegarde It should be noticed that tikz saves
au premier appel de gnuplot la at the first order of gnuplot the
table des valeurs et que si celle- table of values and if it is not
ci est inchangée lors d’une com- modified at the time of a further
pilation ultérieure, tikz réutilise compilation, tikz reuses the table
la table précédemment sauvée. il previously saved. Therefore, it is
est donc important pour minimi- important, in order to reduce the
ser le temps de compilation de pré- compilation time, to specify a dif-
ciser un id différent pour chaque ferent id for each curve. As default
courbe, par défaut les macros sau- macros save the graphs into dif-
vegardent les graphes dans des ferent files (incrementing a coun-
fichiers différents (incrémentation ter).
d’un compteur).
\tikzset{gnuplot def/.style={samples=50,id=\arabic{idGnuplot},prefix=gnuplot/\jobname } }
9
2.4.2 Exemples / Examples
dB
10
\begin{tikzpicture}
[xscale=5/4,yscale=5/30]
\NomGnuplot[orde1-] 0
\UnitedB
\semilog{-2}{2}{-20}{10}
\BodeGraph{-2:2} −10
{20*log10(abs(3/sqrt(1+(0.3*10**t)**2)))}
\end{tikzpicture}
−20 rad/s
10−2 10−1 100 101 102
Module en dB
10
\begin{tikzpicture}
[xscale=6/4,yscale=5/30]
\Unites{rad/s}{Module en dB} 0
\semilog{-2}{2}{-20}{10}
\BodePoint{0.1,0.15,0.5,1,2.5,
5,10,20,50,80}
{20*log10(abs(3/sqrt −10
(1+(0.3*10**t)**2)))}
\end{tikzpicture}
−20 rad/s
10−2 10−1 100 101 102
10
2.5 Fonctions de transfert élémentaires préprogrammées /
pre-programmed elementary transfer functions
Les fonctions de base pour tracer les Basic functions to draw Bode graphs of
diagrammes de Bode des systèmes du the first, second order systems, and inte-
premier, du second ordre, et l’inté- gration, are directly implemented in the
gration, sont directement implémentées package, as well as asymptotic graphs of
dans le package ainsi que les diagrammes the same functions.
asymptotiques de ces même fonctions.
Ces fonctions ne peuvent être utilisées These functions can only be used with
qu’avec les commandes de tracé : the drawing commands :
— \BodeGraph[Options]{domaine}{fonction} ;
— \BodeGraph*[Options]{domaine}{fonction} ;
Le tracé des asymptotes présente un dé- Asymptotes graph presents a defect on
faut à la cassure, cela est du à la fi- the break, this is due to the thinness of
nesse du tracé avec gnuplot, pour amé- the graph with gnuplot. To improve this
liorer ce tracé, il est possible d’utiliser drawing, it is possible to use the option
l’option const plot qui permet de tracer const plot which allows to draw crenels
des créneaux et d’augmenter le nombre and to increase the number of points to
de points à calculer samples=xxx et mais calculate samples=xxx . However, this
cela risque d’accroître le temps de compi- risks to increase the compilation time.
lation.
11
2.5.1 Premier ordre / First order
Deux commandes implémentent les for- Two commands implement formulae
mules permettant le tracé des dia- which allow the drawing of amplitude
grammes d’amplitude et de phase par and phase graphs , through gnuplot, of
gnuplot de la fonction du premier ordre K
the first order function H1 (s) =
K 1+τ ·s
H1 (s) = et deux autres les dia- And two others for the asymptotic graphs
1+τ ·s
grammes asymptotiques (fig. 12) : (fig. 12) :
\begin{tikzpicture} 20
[xscale=7/4]
\begin{scope}[yscale=4/40] 10
\semilog{-2}{2}{-20}{20}
\BodeGraph[asymp 0
lines,red,samples=100]
{-2:2}{\POAmpAsymp{6}{0.3}} −10
\BodeGraph{-2:2}
{\POAmp{6}{0.3}} −20
\end{scope} 10−2 10−1 100 101 102
\begin{scope} 0
[yshift=-3.5cm,yscale=4/90] −10
\semilog{-2}{2}{-90}{0} −20
\BodeGraph[asymp lines, −30
red, samples=100, −40
const plot]{-2:2} −50
{\POArgAsymp{6}{0.3}} −60
\BodeGraph{-2:2} −70
{\POArg{6}{0.3}} −80
\end{scope} −90
10−2 10−1 100 101 102
\end{tikzpicture}
12
Remarque : K n’est pas utile pour tracer Note : K is not useful anymore to trace a
le diagramme de phase, il est juste main- phase graph,it is only kept to simplify the
tenu pour faciliter l’écriture de la fonc- writing od the function by a direct copy
tion par copie directe de la commande de of the module drawing.
tracer du module.
\begin{tikzpicture}[xscale=7/3]
\tikzset{
mylines/.style={very
thick, red}, dB
20
myasymp/.style={Bode
lines,thin,blue}}
\begin{scope}[yscale=4/40] 10
\UnitedB
\semilog{-1}{2}{-20}{20} 0
\BodeGraph[myasymp]{-1:1.7}
{\SOAmpAsymp{6}{0.3}{10}} −10
\BodeGraph[mylines,
samples=101]{-1:1.7} −20 rad/s
10−1 100 101 102
{\SOAmp{6}{0.3}{10}} ◦
\end{scope} 0
\begin{scope} −30
[yshift=-3cm,yscale=4/180]
\OrdBode{30} −60
\UniteDegre −90
\semilog{-1}{2}{-180}{0}
−120
\BodeGraph[myasymp,
const plot]{-1:2} −150
{\SOArgAsymp{6}{0.3}{10}} −180 rad/s
\BodeGraph[mylines]{-1:2} 10−1 100 101 102
{\SOArg{6}{0.3}{10}}
\end{scope}
\end{tikzpicture}
13
Deux commandes implémentent les for- Two commands implement formulae
mules permettant le tracé des dia- which allow the drawing of amplitude
grammes d’amplitude et de phase par and phase graphs of the second order
gnuplot de la fonction du second ordre K
function H2 (s) = And two
K 1 + 2·z · s + s2
H2 (s) = 2
et deux pour le ωn 2
ωn
2·z
1 + ωn · s + s 2 for the asymptotic graphs (fig. 8) :
ωn
tracé des asymptotes (fig. 8) :
40
\begin{tikzpicture} 30
\begin{scope} 20
10
[xscale=7/4,yscale=2.5/80] 0
\semilog{-2}{2}{-40}{40} −10
−20
\BodeGraph{-2:2}{\IntAmp{1}} −30
\end{scope} −40
10−2 10−1 100 101 102
\begin{scope}[yshift=-2cm, 10
0
xscale=7/4,yscale=2.5/110] −10
−20
\semilog{-2}{2}{-100}{10} −30
−40
\BodeGraph{-2:2}{\IntArg{1}} −50
−60
\end{scope} −70
−80
−90
\end{tikzpicture} −100
10−2 10−1 100 101 102
Figure 9 – Intégrateur
14
2.5.4 Gain seul / Gain alone
HK (s) = K
Pour le diagramme d’amplitude (pas de diagramme de phase). / for the amplitude
graph (not the phase graph) :
\KAmp{K}
\begin{tikzpicture}[xscale=7/4]
\begin{scope}[yscale=4/40]
10
\semilog{-2}{2}{-20}{10}
\BodeGraph{-2:2}
0
{\POgAmp{3}{4}{5}{6}{70}}
\BodeGraph[thin,red]{-2:2}
{\POgAmpAsymp{3}{4}{5}{6}{70}} −10
\end{scope}
\begin{scope} −20
10−2 10−1 100 101 102
[yshift=-4cm,yscale=4/180] 60
\OrdBode{30}
30
\semilog{-2}{2}{-90}{60}
\BodeGraph{-2:2} 0
{\POgArg{3}{4}{5}{6}{70}} −30
\BodeGraph[thin,red,const
plot]{-2:2} −60
{\POgArgAsymp{3}{4}{5}{6}{70}} −90
\end{scope} 10−2 10−1 100 101 102
\end{tikzpicture}
15
\begin{tikzpicture}[xscale=12/3]
\begin{scope}[yscale=3.5/50]
\UnitedB
\semilog{0}{3}{−40}{10}
\BodeGraph{0:3}{\RetAmp{0.08}}
\BodeGraph[red]{0:3}{\POAmp{1.0}{0.08}}
\BodeGraph[black]{0:3}{\POAmp{1.0}{0.08}+\RetAmp{0.08}}
\draw [latex−](2.2,−0)−−++(−0.1,−5)node[left] {retard};
\draw [latex−](2.2,−22)−−++(−0.1,−5)node[left] {1er ordre};
\draw [latex−](2.2,−22) −−++(−0.1,−10)node[left] {1er ordre retardé};
\end{scope}
\begin{scope}[yshift=−3.5cm,yscale=3.5/180]
\UniteDegre
\OrdBode{30}
\semilog{0}{3}{−180}{0}
\BodeGraph{0:3}{\RetArg{0.08}}
\BodeGraph[red]{0:3}{\POArg{1}{0.08}}
\BodeGraph[black]{0:3}{\POArg{1}{0.08}+\RetArg{0.08}}
\draw [latex−](2.8,−50)−−++(−0.1,−10)node[left] {retard};
\draw [latex−](2.8,−88)−−++(−0.1,+10)node[left] {1er ordre};
\draw [latex−](2.8,−140) −−++(−0.1,−10)node[left] {1er ordre retardé};
\end{scope}
\end{tikzpicture}
dB
10
0
retard
−10
−20
−30
1er ordre
1er ordre retardé
−40 rad/s
10◦0 101 102 103
0
−30
−60 retard
−90
1er ordre
−120
−150 1er ordre retardé
−180 rad/s
100 101 102 103
— \RetAmp{Tr} :
Tracé du diagramme d’amplitude. Plotting the amplitude diagram.
16
— \RetArg{Tr} :
Tracé du diagramme de phase. Plotting the phase graph.
Sur la figure 11 on note l’effet d’un retard In the figure 11, we note the effect of a
sur une fonction de transfert du premier delay on a first order transfer function.
ordre.
À partir des fonctions élémentaires ci- Using the basic functions above, it is pos-
dessus il est facile de tracer les fonc- sible to draw the inverse functions just by
tions inverses en changeant uniquement changing their sign.
le signe.
\begin{tikzpicture} 30
[xscale=7/4]
\begin{scope}[yscale=4/40] 20
\semilog{-2}{2}{-10}{30}
\BodeGraph[asymp 10
lines,red,samples=100]
{-2:2}{-\POAmpAsymp{1}{0.3}} 0
\BodeGraph{-2:2}
{-\POAmp{1}{0.3}} −10
\end{scope} 10−2 10−1 100 101 102
\begin{scope} 90
[yshift=-6cm,yscale=4/90] 80
\semilog{-2}{2}{0}{90} 70
\BodeGraph[asymp lines, 60
red, samples=100, 50
const plot]{-2:2} 40
{-\POArgAsymp{1}{0.3}} 30
\BodeGraph{-2:2} 20
{-\POArg{1}{0.3}} 10
\end{scope} 0
10−2 10−1 100 101 102
\end{tikzpicture}
17
— pour le module / for module :
\BodeGraph[Options]{domain}{-\POAmp{1}{T}}
— pour la phase / for phase :
\BodeGraph[Options]{domain}{-\POArg{1}{T}}
Second ordre au numérateur / Second order in the numerator :
2·z s2
N2 (s) = 1 + 2 ·s+ 2
ωn ωn
avec / with
— pour le module / for module :
\BodeGraph[Options]{domain}{-\SOAmp{1}{z}{Wn}}
— pour la phase / for phase :
\BodeGraph[Options]{domain}{-\SOArg{1}{z}{Wn}}
Dérivateur : Nd (s) = s avec
— Module / Module : \BodeGraph[Options]{domain}{-\IntAmp{1}}
— Phase / Phase : \BodeGraph[Options]{domain}{-\IntArg{1}}
18
2.6 Correcteurs
Les correcteurs de base sont aussi pré- Basic correctors are also pre-
programmés. programmed.
\begin{tikzpicture}[xscale=7/3]
\begin{scope}[yscale=3/40]
\UnitedB
\BodeGraph[thick]{0:3} dB
30
{\PIAmp{2}{0.08}}
\BodeGraph[black]{0:3} 20
{\PIAmpAsymp{2}{0.08}}
10
\semilog{0}{3}{-10}{30}
\end{scope} 0
\begin{scope}[yshift=-1.5cm,
yscale=3/90] −10 rad/s
10◦0 101 102 103
\UniteDegre 0
\OrdBode{15} −15
\semilog{0}{3}{-90}{0} −30
\BodeGraph[thick]{0:3} −45
{\PIArg{2}{0.08}}
−60
\BodeGraph[black
−75
,samples=201,const
−90 rad/s
plot]{0:3} 100 101 102 103
{\PIArgAsymp{2}{0.08}}
\end{scope}
\end{tikzpicture}
19
2.6.1 Correcteur Proportionnel Derivée (PD) / Derived proportional controller
(PD)
C(s) = Kp · (1 + Td · s)
Le correcteur PD programmé est un cor- Controller PD programmed is an ideal
recteur idéal, pour réaliser un correcteur corrector. To create an real corrector, you
réel, on utilisera le correcteur à avance de can use the advance phase controller
phase (fig. 14). (fig. 14)
\begin{tikzpicture}[xscale=7/3]
\begin{scope}[yscale=3/50]
\UnitedB
\semilog{0}{3}{0}{50} dB
50
\BodeGraph[thick]{0:3}
40
{\PDAmp{2}{0.08}}
\BodeGraph[black]{0:3} 30
{\PDAmpAsymp{2}{0.08}} 20
\end{scope} 10
\begin{scope}[yshift=-3.5cm,
0◦ rad/s
yscale=3/90] 0 101 102 103
9010
\UniteDegre
75
\OrdBode{15}
60
\semilog{0}{3}{0}{90}
45
\BodeGraph[thick]{0:3}
{\PDArg{2}{0.08}} 30
\BodeGraph[black,samples=201 15
,const plot] 0 rad/s
100 101 102 103
{0:3}{\PDArgAsymp{2}{0.08}}
\end{scope}
\end{tikzpicture}
20
2.6.2 Correcteur à Avance de phase / Advance phase corrector
1 + a · Ta · s
CAP (s) = Kp · (fig. 15)
1 + Ta · s
Courbes réelles / Real curves
\begin{tikzpicture}
[xscale=7/3]
\begin{scope}[yscale=4/40]
\UnitedB
dB
\semilog{0}{3}{0}{30} 30
\BodeGraph{0:3}
{\APAmp{2}{0.02}{3}} 20
\BodeGraph[thick,samples=101,
red] 10
{0:3}{\APAmpAsymp{2}{0.02}{3}}
\end{scope} 0 rad/s
\begin{scope} 100 101 102 103
◦
[yshift=-3cm,yscale=4/180] 90
\UniteDegre
\OrdBode{30} 60
\semilog{0}{3}{-30}{90} 30
\BodeGraph{0:3}
0
{\APArg{2}{0.02}{3}}
\BodeGraph[thick,samples=201, −30 rad/s
red,const plot] 100 101 102 103
{0:3}{\APArgAsymp{2}{0.02}{3}}
\end{scope}
\end{tikzpicture}
21
2.6.3 Correcteur à Retard de phase / Phase delay corrector
1 + Tr · p
CRP (p) = Kp · (fig. 16)
1 + a · Tr · p
Courbes réelles / Real curves
\begin{tikzpicture}[xscale=7/3]
\begin{scope}[yscale=3/40]
\UnitedB
%\node{\tiny dB
\PIAmp{3}{0.5}}; 30
\semilog{0}{3}{-10}{30}
20
\BodeGraph[thick]
{0:3}{\RPAmp{2}{0.02}{3}} 10
\BodeGraph[,thin,samples=101,red]
0
{0:3}{\RPAmpAsymp{2}{0.02}{3}}
\end{scope} −10 rad/s
10 0 101 102 103
\begin{scope} ◦
[yshift=-3cm,yscale=3/180] 90
\UniteDegre 60
\OrdBode{30} 30
\semilog{0}{3}{-90}{90} 0
\BodeGraph[thick] −30
{0:3}{\RPArg{2}{0.02}{3}} −60
\BodeGraph[thin,samples=201, −90 rad/s
red,const plot] 100 101 102 103
{0:3}{\RPArgAsymp{2}{0.02}{3}}
\end{scope}
\end{tikzpicture}
22
2.6.4 Correcteur proportionnel intégral dérivateur (forme série) PID / proportio-
nal integral derivative corrector (series form) (PID)
1 + Ti · s
C(s) = Kp · · (1 + Td · s) (fig. 17)
Ti · s
Courbes réelles / Real curves
\begin{tikzpicture}[xscale=7/3]
\begin{scope}[yscale=3/40]
\UnitedB dB
\semilog{0}{3}{-10}{30} 30
\BodeGraph{0:3}
20
{\PIDAmp{2}{0.08}{0.02}}
\BodeGraph[black] 10
{0:3}{\PIDAmpAsymp{2}{0.08}{0.02}}
0
\end{scope}
\begin{scope}[yshift=-3cm,yscale=3/180]
−10 rad/s
100 101 102 103
\Unites{rad/s}{Argument Argument en degré
en degré} 90
\OrdBode{30} 60
\semilog{0}{3}{-90}{90} 30
\BodeGraph{0:3} 0
{\PIDArg{2}{0.08}{0.02}} −30
\BodeGraph[samples=2, −60
black,samples=201] −90 rad/s
100
{0:3}{\PIDArgAsymp{2}{0.08}{0.02}} 101 102 103
\end{scope}
\end{tikzpicture}
23
2.7 Fonctions de transfert complexes / Complex functions of trans-
fer
Pour tracé les diagrammes de Bode d’un To trace Bode plot of a complex transfer
fonction de transfert complexe, définie function, defined by the product of ba-
par le produit de fonctions élémentaires, sic functions, you can simply sum up the
il suffit de sommer les représentations, representations, of the function graph as
aussi bien pour le tracé de la fonction que well as of the asymptotes.
pour les asymptotes.
\begin{tikzpicture}
[xscale=7/4]
\begin{scope}
60
[yscale=4/100] 50
\semilog{-2}{2}{-40}{60} 40
\BodeGraph[thin,samples=100] 30
{-1.5:1.5} 20
{\POAmpAsymp{8}{0.5} 10
0
+\IntAmp{1}} −10
\BodeGraph{-1.8:1.5} −20
{\POAmp{8}{0.5}+\IntAmp{1}} −30
\end{scope} −40
10−2 10−1 100 101 102
\begin{scope}
[yshift=-2.5cm,yscale=4/200] 0
−20
\OrdBode{20}
−40
\semilog{-2}{2}{-200}{0} −60
\BodeGraph[samples=100,thin, −80
red,const plot] −100
{-2:2} −120
−140
{\POArgAsymp{8}{0.5}
−160
+\IntArg{1}} −180
\BodeGraph{-2:2} −200
{\POArg{8}{0.5}+\IntArg{1}} 10−2 10−1 100 101 102
\end{scope}
\end{tikzpicture}
24
Second ordre généralisé / Second order generalised :
1 + 0,01 · s 5
H2g = 5 · 2
= (1 + 0,01 · s) (fig. 19)
2 · 0,3 s 2 · 0,3 s2
1+ ·s+ 2 1+ ·s+ 2
15 15 15 15
\begin{tikzpicture}
[xscale=7/5]
\begin{scope}[yscale=4/80]
\semilog{-1}{4}{-50}{30} 30
\BodeGraph[red]{-1:4} 20
{\SOAmpAsymp{5}{0.3}{15}- 10
\POAmpAsymp{1}{0.01}} 0
\BodeGraph[smooth,samples=100, −10
thick]{-1:4} −20
{\SOAmp{5}{0.3}{15} −30
-\POAmp{1}{0.01}} −40
\end{scope} −50
\begin{scope} 10−1 100 101 102 103 104
[yshift=-3.5cm,yscale=4/210]
0
\OrdBode{30}
\semilog{-1}{4}{-180}{10} −30
\BodeGraph[samples=100, −60
red,const plot]{-1:4} −90
{\SOArgAsymp{5}{0.3}{15} −120
-\POArgAsymp{1}{0.01}}
−150
\BodeGraph[thick]{-1:4}
{\SOArg{5}{0.3}{15} −180
10−1 100 101 102 103 104
-\POArg{1}{0.01}}
\end{scope}
\end{tikzpicture}
25
3 Diagramme de black nichols / black nichols diagram
Ce package permet aussi de tracer les This package also allows you to draw
diagrammes de Black avec des com- Black diagrams with commands similar
mandes analogues à celles utilisées pour to those used for Bode diagrams.
les diagrammes de Bode.
— \BlackGraph[options de trace]{domaine}{argument,module}
— {domaine} :
c’est le domaine de tracé au sens de it’s the domain of graph in the sense
GnuPlot, il est conseillé de définir of GnuPlot, I suggest to define the
le domaine décade (entière ou non) domain in decades (integer or not)
comme {-1 :3}, GnuPlot va tracer la like {-1 :3}, GnuPlot will trace the
fonction pour ω compris entre 10−1 function for ω including between
et 103 . 10−1 et 103 .
— {argument,module} :
la fonction à tracer doit être définie the function to trace must be de-
par l’argument qui retourne l’argu- fined by the argument function
ment en ◦ et le module qui retourne which returns the argument in ◦ ,
le module en dB. On peut bien sur and the module function which re-
utiliser les fonctions définies au des- turns the module in dB. You can also
sus pour les diagrammes de Bode use the functions defined on the top
pour ces fonctions. for the bode graphs for these func-
tions.
— [options de trace] :
toutes les options tikz pour tracer des fonctions gnuplot. / all of the tikz
options to trace gnuplot functions.
— \BlackGraph*[options de trace]{domaine}{argument,module}{[options]{texte}}
cette commande permet de rajouter This command allows to add again
commentaire (nom, référence, équa- comments (name, reference, equa-
tion) à l’extrémité d’un tracé. Les pa- tion) at the bottom of a drawing. Para-
ramètres sont identiques, se rajoute meters are identical, you only re-add
uniquement {[options]{texte}}. {[options]{texte}} .
— [options] :
26
ce sont les options d’écriture du these are the options of the writing
texte (couleur, position,. . .) style of a text (colour, position,. . .),
— {texte} , le texte à écrire entre parenthèses ; / text to write between bra-
ckets ;
— \BlackPoint[options]{liste pulsations}{argument,module} :
cette commande permet de tracer this command allows to trace and
et noter des points particuliers du mark specific points of the graph, the
graphe, la valeur de la pulsation est pulsation value is placed on the side
placée à coté (droite par défaut). (on the right by default.
— [options] options de tracé (couleur, id, prefix,. . .), / tracing options (co-
lour, id, prefix,. . .),
— {liste pulsations} pulsations en rad/s séparées par une virgule, /
beats in rad/s separated by a comma,
— {argument,module} identique à / identical to \BlackGraph
— \BlackPoint*[options]{liste pulsations}{argument,module} :
— \BlackText[options]{pulsation/pos/texte}{argument,module} :
cette commande permet de position- this command allows to position a
ner un texte par rapport à la courbe text in relation to the curve defined
définie par {argument,module} le by {argument, module} once the text
texte étant positionné à la pulsation is positioned at the beat, the parame-
pulsation, le paramètre pos permet ter pos allows to specify the text po-
de préciser la position du texte ( right, sition (right, above, below left, . . .).
above, below left, . . .). Le point est The point is named NBlack.
nommé NBlack.
— \BlackText*[options]{pulsation/pos/texte}{argument,module} :
cette commande est identique à la this command is identical to the pre-
précédente mais ne dessine pas de vious one but it does not draw any
points. points.
27
3.1.1 Styles par défaut / Default styles
28
1 5
H1 (p) = , H3 (p) = ,
2 · 0.1 p2 2·2 p2
1+ ·p+ 1+ ·p+
1500 15002 150 1502
5 5
H2 (p) = , H4 (p) = ,
2 · 0.2 p2 1+3·p
1+ ·p+
150 1502
1 0.43 · (1 + 0.0009 · p)2
H5 (p) = ·
2 · 0.1 p2 0.0009 · p
1+ ·p+
1500 15002
\begin{tikzpicture}
\begin{scope} dB
[xscale=6/180,yscale=8/60]
\BlackGraph*[samples=150,red,
smooth,ultra thick,-<] +10
{-2:1}{\SOBlack{1}{0.1}{1500}}
{[red,right]{\footnotesize ◦
$H_1$}}
\BlackGraph*[samples=150,black, -180 -135 -90 -45 0
smooth,ultra thick]
{-1:3.5}{\SOArg{5}{0.2}{150}, -10
\SOAmp{5}{0.2}{150}}
{[right]{$H_2 $}}
\BlackGraph*[samples=150,blue, H1
smooth,ultra thick]
{-1:3.5}{\SOArg{5}{2}{150},
\SOAmp{5}{2}{150}}
{[right]{$H_3 $}}
\BlackGrid HH
2 3
\end{scope}
\end{tikzpicture}
Pour les deux derniers exemples, les For the last two examples, the curves
courbes ont été graduées en pulsation were graduated in pulsation with the
avec la commande \BlackPoint et anno- command \BlackPoint and annotated
tées la commande \BlackText. with the command \BlackText.
29
\begin{tikzpicture}
\begin{scope}
[xscale=6/180,yscale=8/60]
\BlackGraph[samples=150,blue,
smooth,ultra thick] dB
{1:5}{\SOArg{1}{0.1}{1500}+
\IntArg{0.43/0.0009}-2*\POArg{1}{0.0009}, 25
\SOAmp{1}{0.1}{1500}+\IntAmp{0.43/0.0009}
-2*\POAmp{1}{0.0009}} 80
\BlackGraph*[samples=100,purple,smooth] 1500
0.1
{-3:2}{\POArg{5}{3},\POAmp{5}{3}}
+10
{[purple!50,right]{\footnotesize
$H_3$}} 1 500 ◦
\BlackPoint[purple]{0.1,1,3,12,65}
{\POArg{5}{3},\POAmp{5}{3}} -180 -135 -90 -45 0
\BlackPoint*[black]{25/right, 3
80/above right, -10
4000
500/above,1500/above,4000/right} H4
{\SOArg{1}{0.1}{1500}+\IntArg{0.43/0.0009} 12
-2*\POArg{1}{0.0009},\SOAmp{1}{0.1}{1500}+
\IntAmp{0.43/0.0009}-2*\POAmp{1}{0.0009}}
\BlackText[blue]{5000/left/{\normalsize
$H_4$}} 65
{\SOArg{1}{0.1}{1500}+\IntArg{0.43/0.0009} H3
-2*\POArg{1}{0.0009},\SOAmp{1}{0.1}{1500}+
\IntAmp{0.43/0.0009}-2*\POAmp{1}{0.0009}}
\BlackGrid
\end{scope}
\end{tikzpicture}
30
3.3.2 Abaque de Black-Nichols / Nichols chart
\AbaqueBlack
permet de tracer les courbes isomodule allows to trace isomodule curves and
et isoargument de l’abaque de Black- isoargument of Nichols chart (figure 17).
Nichols (fig. 22).
Les seules valeurs possibles pour ces The only values possible for these curves
courbes de gain et d’argument sont les of gain and argument are the following :
suivantes :
— isomodule, gain en dB : -30, -25, -20, -15, -12, -10, -8, -6, -5, -4, -3, -2, -1, -0.5,
-0.2, 0, 0.2, 0.5, 1, 2, 2.3, 3, 4, 5, 6, 8, 10 ;
— isoargument, en ◦ : 359, 357, 354, 350, 345, 340, 330, 315, 300, 285, 270, 255,
240 , 225, 210,195, 190, 170,165, 150, 135, 120, 105, 90, 75, 60, 45, 30, 20, 15,
10, 6, 3, 1.
Deux autres commandes permettent de Two other commands allow to limit the
limiter l’affichage à quelques courbes : display to certain curves :
— \IsoModule[listedB]
cette commande permet de tracer uni- this command allows to trace only the
quement les courbes d’amplitude de amplitude curves of the list edB list,
la liste listedB, par défaut, toutes les all the curves are drawn by default.
courbes sont dessinées.
— \IsoArgument[listedeg]
cette commande permet de tracer uni- this command allows to trace only the
quement les courbes d’amplitude de amplitude curves of the listedeg list,
la liste listedeg, par défaut, toutes les all the curves are drawn by default.
courbes sont tracées.
Le style des courbes tracées est modi- The style of the traced curve can be chan-
fiable à l’aide des deux commandes : ged using two commands :
31
Remarque : pour ne pas trop ralen- Note : do not slow down the compila-
tir la compilation, les courbes sont pré- tion too much, curves are already pre-
calculées. Elles sont définies dans les calculated. They are defined by the files
deux fichiers [Link] et [Link] (respec- [Link] and [Link] (respectively for the
tivement pour le module et l’argument). module and for the argument). If you
Si vous souhaitez ajouter de nouvelles would like to add new curves, you must
courbes, il faut les ajouter dans ces fi- add them in the files and using the same
chiers en respectant la syntaxe. syntax.
32
\begin{tikzpicture}
\begin{scope}[xscale=15/360,yscale=11/60]
\BlackGraph[samples=100,purple,smooth]{−1:1}{\IntArg{0.3}+\SOArg{3.9}{0.4}{3},
\IntAmp{0.3}+\SOAmp{3.9}{0.4}{3}}
\def\valmaxBf{−360}
\StyleIsoM[blue,dashed]
\StyleIsoA[blue]
\AbaqueBlack
\StyleIsoM[blue,thick]
\IsoModule[2.3]
\BlackGrid
\BlackText[black]{2.6/right/{\normalsize $\omega_r\approx 2.6~rad/sec$}}
{\IntArg{0.3}+\SOArg{3.9}{0.4}{3},
\IntAmp{0.3}+\SOAmp{3.9}{0.4}{3}}
\end{scope}
\end{tikzpicture}
dB
0dB
0.2dB −0.2dB
0.5dB −0.5dB
1dB
−1dB
2dB
2.3dB
3dB −2dB
+10
4dB
5dB −3dB
6dB
8dB −4dB
10dB
−5dB ◦
−6dB
-360 -315 -270 -225 -180 -135 -90 -45 0
ωr ≈ 2.6 rad/sec −8dB
−10dB
−12dB -10
−15dB
−359◦ −20dB
−1◦
−357◦◦ −3◦
−354 ◦ −6◦◦
−25dB
−350 ◦ −10◦
−345 ◦ −15
◦
−340 ◦ −20
◦
−330 −30
−315◦ ◦ −45◦
−300 ◦ −60◦
◦ −30dB
−285 ◦−75
−270◦ ◦ −90
◦
−255 −105
−240◦ ◦ −120
◦
◦
−225 ◦ ◦ ◦ −135
◦
−210 −190
◦ −170 −150
◦
−195 −165
\begin{tikzpicture}[scale=0.8]
\begin{scope}
\NyquistGraph[smooth,samples=81]{-1:4} I
1m
{\POAmp{3}{0.5}}{\POArg{3}{0.5}}
%\NyquistGraph[purple,smooth,samples=81,] -1 0 1 Re
%{-2:2}{\SOAmp{3}{0.5}{10}}{\SOArg{3}{0.5}{10}}
\NyquistGraph[red,samples=151,smooth,] -1
{-3:2}{\POAmp{4}{0.5}+\POAmp{1}{2}}
{\POArg{4}{0.5}+\POArg{1}{2}}
\NyquistGraph[green,samples=101,smooth,]
{0.5:2}{\SOAmp{15}{0.5}{10}+\IntAmp{1}}
{\SOArg{15}{0.5}{10}+\IntArg{1}}
\end{scope}
\NyquistGrid
\end{tikzpicture}
— [options]
options de tracé options of drawing
— {domaine}
le domaine de tracé doit être défini domain of drawing must be indica-
en décade ted in decades
— {Module en dB}
34
\begin{tikzpicture}[scale=0.8]
\begin{scope}
{\SOArg{15}{0.5}{10}+\IntArg{1}}
\NyquistGraph[black,smooth,]{-1:2}
{\POAmp{4}{0.5}+\RetAmp{1.8}}
{\POArg{4}{0.5}+\RetArg{1.8}}
\NyquistGraph*[black,smooth,samples=2, I
only marks,mark=.]{-1:0.3} 1m
{\POAmp{4}{0.5}+\RetAmp{1.8}} -1 0 1 Re
{\POArg{4}{0.5}+\RetArg{1.8}}{[above]
{\footnotesize $H_3$}} 20 -1
\NyquistGraph[purple,smooth,samples=81,]
{-2:2}{\SOAmp{3}{0.5}{10}}{\SOArg{3}{0.5}{10}} H3
\NyquistPoint*[black,]{8/below
right,
10 Texte 8
10/below left,20/left}
{\SOAmp{3}{0.5}{10}}{\SOArg{3}{0.5}{10}}
\NyquistText[red]{8/below
left/Texte}
{\SOAmp{3}{0.5}{10}}{\SOArg{3}{0.5}{10}}
\end{scope}
\NyquistGrid
\end{tikzpicture}
le module doit être écrit en dB, the module must be written in dB,
on peut bien sûr utiliser les fonc- you can also use the basic functions
tions élémentaires ci-dessus comme above such as \POAmp, \SOAmp to
\POAmp, \SOAmp pour obtenir ce obtain the module.
module.
— {Argument en degre}
l’argument doit être définie en de- the argument must be indicated in
gré, on peut utiliser les fonctions ar- degrees, you can use the argument
guments ci-dessus comme \POArg, functions above such as \POArg,
\SOArg. \SOArg.
— \NyquistGraph*[options]{domaine}{Module en dB}{Argument en degre}{[options]{texte}}
cette version étoilée permet de rajou- this allows to add again a comment at
ter un commentaire à l’extrémité du the bottom of the drawing.
tracé.
35
cette commande permet de tracer this command allows to trace and
et noter des points particuliers du msrk specific points of the graph, the
graphe, la valeur de la pulsation est pulsation value is place on the side
placée à coté (droite par défaut). (on the right side by default).
Une grille peut être ajoutée au tracé You can add a grid to the drawing by
par la commande \NyquistGrid, par dé- the command \NyquistGrid, the grid
faut le pas de la grille est de 1 mais step is 1 by default, but it can be modi-
peut être réglé avec les deux variables fied using the two variables \valgridNx
\valgridNx et \valgridNy. La commande and \valgridNy. The starred command
étoilée trace la grille seule sans gradua- traces only the grid without graduation,
tion, la commande simple trace en plus the simple command traces also the unit
le cercle unitaire, le point critique (-1,0). circle, the critic point (-1,0).
36
— Nyquist grid/.style={ultra thin,brown} :
style de la grille ; : grid style ;
1
— H1 (p) =
2 · 0.1 p2
1+ ·p+
1500 15002
5
— H2 (p) =
2 · 0.2 p2
1+ ·p+
150 1502
5
— H3 (p) =
1+3·p
1 2 · 0.1 p2 0.43 · (1 + 0.0009 · p)2
— H4 (p) = ·p+ + ·
1 1500 15002 0.0009 · p
37
5 Réponse temporelle / Time response
fig. 25
— \RepTemp[options]{domaine}{fonction}
trace la fonction, la fonction doit être traces the function, function must be
définie comme une fonction Gnuplot. defined like a gnuplot function.
— \RepTemp*[options]{domaine}{fonction}{[options]{texte}}
trace la fonction et ajoute le texte à traces the function and adds the text
l’extrémité. at the bottom.
\begin{tikzpicture}[xscale=5/2,yscale=7/2]
\RepTemp*[color=black,samples=31,
smooth,]{0:1.8} s
{-.198*exp(-35.4*x)-.638*exp(-2.28*x)
*cos(18.3*x)
-.462*exp(-2.28*x)*sin(18.3*x)+.833 1 2
}{[right]{\small 1}} 1
\RepTemp*[color=blue,samples=31,smooth
]{0:1.8}{1-.117*exp(-24.1*x)-.883*exp(-2.94*x)
*cos(7.03*x)
-.769*exp(-2.94*x)*sin(7.03*x)
}{[right]{\small 2}}
\def\valmaxx{1.8} t
0
\def\valmaxy{1.2} 0 1
\TempGrid[xstep=0.2,ystep=0.2]
\end{tikzpicture}
38
6 Abaques / Abacus
Ces deux dernières commandes per- These last two commands allow you to
mettent de tracer les abaques caractéris- draw the characteristic charts of a second
tiques d’un système du second ordre order system.
Tr · ωn
80
50
30
\begin{tikzpicture}
[xscale=2.5,yscale=3] 10
\AbaqueTRsecond
\end{tikzpicture} 5
z
0.05
0.1
0.2
0.3
0.4
0.5
0.7
1
1.5
2
3
4
5
10
6.2 Abaque des dépassements indiciels / Abacus of index overruns
D
1
0.8 D1
0.7
0.6 D2
0.5 D3
0.4 D4
0.3 D5
D6
0.2
\begin{tikzpicture} D7
D8
[scale=6/2]
0.1
\AbaqueDepassement D1
\end{tikzpicture} 0.05 1
D3
D4
D2
z
0.01
01
05
2
3
0.5
0.6
7
1
0.4
0.
0.
0.
0.
0.
0.
39
Table des matières
1 Introduction / Introduction 2
1.1 Nécessite / Need . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.2 Composition du package / Composition of Package . . . . . . . . . . . 3
1.3 Utilisation / Use . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
1.4 À faire / To Do . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
40
5 Réponse temporelle / Time response 38
5.1 Styles / Styles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6 Abaques / Abacus 39
6.1 Temps de réponse d’un second ordre / Second order response time
chart . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.2 Abaque des dépassements indiciels / Abacus of index overruns . . . . 39
41