Debian Codegraph @

texmf-dist/doc/latex/bloques/example.tex

raw
1 \documentclass[a4paper,onecolumn]{IEEETran}
2 \usepackage{bloques}
3 \usepackage{verbatim}
4 \oddsidemargin=-1.5cm
5
6
7 \title{The Bloques Package}
8 \author{Alejandro Garces Ruiz \\ [email protected]}
9
10 \begin{document}
11
12 \maketitle
13
14 \section{Functions}
15
16
17 The \textbf{bloques} package is a very simple set of commands based on \textbf{tikz} to generate control blocks. The only packages required in the definition are:
18
19 \begin{verbatim}
20 \usepackage{tikz}
21 \usepackage{bloques}
22 \end{verbatim}
23
24 The package is very efficient for sequential blocks as follow:
25
26 \begin{verbatim}
27 \bStart{TEXT}
28 \bPlusDown{TEXT}
29 \bPlusUp{TEXT}
30 \bMinusDown{TEXT}
31 \bMinusUp{TEXT}
32 \bEnd{TEXT}
33 \bGain{TEXT}
34
35 \bGainPlus{TEXT1}{TEXT2}
36 \bGainMinus{TEXT1}{TEXT2}
37
38
39 \end{verbatim}
40
41 For Feedback controls, it is required to mark the nodes with the following functions:
42
43 \begin{verbatim}
44
45 \bMinusF{NODENAME}
46 \bPlusF{NODENAME}
47 \bFeedBack{TEXT}{NODENAME}
48 \bCrossGain{TEXT}{NODENAME1}{NODENAME2}
49 \bNewStart{TEXT}{POSITION}
50 \bMarkNode{NODENAME}
51 \bMarkNodeUp{NODENAME}
52 \bMarkNodeDown{NODENAME}
53 \end{verbatim}
54
55
56 To change colors and distances, the following functions are available
57
58 \begin{verbatim}
59 \bShadow{NUMBER} % default = 0
60 \bColorB{COLOR} % default = white
61 \bColorT{COLOR} % default = black
62 \ydistance{NUMBER} % default = 1.2 cm
63 \end{verbatim}
64
65 \newpage
66
67 \section{examples}
68
69 \begin{figure}[h!]
70 \begin{tikzpicture}
71 \bStart{$X_{ref}$}
72 \bMinusDown{$X$}
73 \bGain{$k_{p}$}
74 \bPlusUp{$Y$}
75 \bGainPlus{$U$}{$\omega L$}
76 \bEnd{$V_{x}$}
77 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
78 {
79 \begin{verbatim}
80 \begin{figure}
81 \begin{tikzpicture}
82 \bStart{$X_{ref}$}
83 \bMinusDown{$X$}
84 \bGain{$k_{p}$}
85 \bPlusUp{$Y$}
86 \bGainPlus{$U$}{$\omega L$}
87 \bEnd{$V_{x}$}
88 \end{tikzpicture}
89 \end{figure}
90 \end{verbatim}
91 };
92
93 \end{tikzpicture}
94 \caption{Simple Control diagram }
95 \end{figure}
96
97
98
99 \begin{figure}[h!]
100 \begin{tikzpicture}
101 \bShadow
102 \bStart{$X_{ref}$}
103 \bMinusDown{$X$}
104 \bGain{$k_{p}$}
105 \bPlusUp{$Y$}
106 \bGainPlus{$U$}{$\omega L$}
107 \bEnd{$V_{x}$}
108 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
109 {
110 \begin{verbatim}
111 \begin{figure}
112 \begin{tikzpicture}
113 \bShadow
114 \bStart{$X_{ref}$}
115 \bMinusDown{$X$}
116 \bGain{$k_{p}$}
117 \bPlusUp{$Y$}
118 \bGainPlus{$U$}{$\omega L$}
119 \bEnd{$V_{x}$}
120 \end{tikzpicture}
121 \end{figure}
122 \end{verbatim}
123 };
124
125 \end{tikzpicture}
126 \caption{Control diagram with shadow}
127 \end{figure}
128
129
130
131 \begin{figure}[h!]
132 \begin{tikzpicture}[thick]
133 \draw[fill=blue!20, draw=white] (-0.5,-3) rectangle (8,2);
134 \draw[fill=green!20, dashed,thick] (4,-2) rectangle (7,0.5);
135 \bShadow
136 \bColorB{blue!80!green!50}
137 \bColorT{yellow}
138 \bColorL{white}
139 \bStart{$X_{ref}$}
140 \bMinusDown{$X$}
141 \bGain{$k_{p}$}
142 \bColorB{blue!30!green!80}
143 \bPlusUp{$Y$}
144 \bGainPlus{$U$}{$\omega L$}
145 \bEnd{$V_{x}$}
146 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
147 {
148 \begin{verbatim}
149 \begin{figure}
150 \begin{tikzpicture}[thick]
151 \draw[fill=blue!20, draw=white]
152 (-0.5,-3) rectangle (8,2);
153 \draw[fill=green!20, dashed]
154 (4,-2) rectangle (7,0.5);
155
156 \bShadow
157 \bColorB{blue!50!green!45}
158 \bColorT{yellow}
159 \bColorL{white}
160 \bStart{$X_{ref}$}
161 \bMinusDown{$X$}
162 \bGain{$k_{p}$}
163 \bColorB{blue!30!green!80}
164 \bPlusUp{$Y$}
165 \bGainPlus{$U$}{$\omega L$}
166 \bEnd{$V_{x}$}
167 \end{tikzpicture}
168 \end{figure}
169 \end{verbatim}
170 };
171
172 \end{tikzpicture}
173 \caption{Control diagram with shadow and different colors}
174 \end{figure}
175
176
177
178
179 \begin{figure}[h!]
180 \begin{tikzpicture}
181 \bColorB{blue!70!green!20}
182 \bStart{$X_{r}$}
183 \bMinusF{NODEX}
184 \bGain{$k_{p}+\frac{k_{i}}{S}$}
185 \bFeedBack{$k_{x}$}{NODEX}
186 \bEnd{$X$}
187
188 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
189 {
190 \begin{verbatim}
191 \begin{figure}
192 \begin{tikzpicture}
193 \bColorB{blue!70!green!20}
194 \bStart{$X_{r}$}
195 \bMinusF{NODEX}
196 \bGain{$k_{p}+\frac{k_{i}}{S}$}
197 \bFeedBack{$k_{x}$}{NODEX}
198 \bEnd{$X$}
199 \end{tikzpicture}
200 \end{figure}
201 \end{verbatim}
202 } ;
203
204 \end{tikzpicture}
205 \caption{Control diagram with feedback}
206 \end{figure}
207
208
209
210
211 \begin{figure}[h!]
212 \begin{tikzpicture}
213 \bColorB{blue!30!green!50}
214 \bColorT{white}
215 \bStart{$X_{r}$}
216 \bMinusF{NODEX}
217 \bGain{$k_{p}+\frac{k_{i}}{S}$}
218 \bGain{$K_{2}$}
219 \bPlusDown{$Y$}
220 \ydistance{2.5cm}
221 \bFeedBack{$k_{x}$}{NODEX}
222 \bEnd{$X$}
223
224 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
225 {
226 \begin{verbatim}
227
228 \begin{figure}
229 \begin{tikzpicture}
230 \bColorB{blue!30!green!50}
231 \bColorT{white}
232 \bStart{$X_{r}$}
233 \bMinusF{NODEX}
234 \bGain{$k_{p}+\frac{k_{i}}{S}$}
235 \bGain{$K_{2}$}
236 \bPlusDown{$Y$}
237 \ydistance{2.5cm}
238 \bFeedBack{$k_{x}$}{NODEX}
239 \bEnd{$X$}
240 \end{tikzpicture}
241 \end{figure}
242
243
244 \end{verbatim}
245 } ;
246
247
248 \end{tikzpicture}
249 \caption{Change the ydistance}
250 \end{figure}
251
252
253 \begin{figure}[h!]
254 \begin{tikzpicture}
255 \bStart{$I_{d(ref)}=0$}
256 \bMinusDown{$I_{d}$}
257 \bGain{PI1}
258 \bPlusF{NODET}
259 \bEnd{$V_{d}$}
260 \bNewStart{$\omega_{ref}$}{(-2,-4)}
261 \bMinusDown{$\omega_{s}$}
262 \bGain{PI2}
263 \bMinusUp{$I_{q}$}
264 \bMarkNodeUp{NODEX}
265 \bGain{PI3}
266 \bEnd{$V_{q}$}
267 \bCrossGain{$\omega L$} {NODEX} {NODET}
268
269
270 \node[right of = NODO1, text width=8.5cm, node distance = 6.0cm, drop shadow={opacity=1}, fill=blue!20, rounded corners] (C4)
271 {
272 \begin{verbatim}
273
274
275 \begin{figure}
276 \begin{tikzpicture}
277 \bStart{$I_{d(ref)}=0$}
278 \bMinusDown{$I_{d}$}
279 \bGain{PI1}
280 \bPlusF{NODET}
281 \bEnd{$V_{d}$}
282 \bNewStart{$\omega_{ref}$}{(-2,-4)}
283 \bMinusDown{$\omega_{s}$}
284 \bGain{PI2}
285 \bMinusUp{$I_{q}$}
286 \bMarkNodeUp{NODEX}
287 \bGain{PI3}
288 \bEnd{$V_{q}$}
289 \bCrossGain{$\omega L$} {NODEX} {NODET}
290 \end{tikzpicture}
291 \end{figure}
292
293 \end{verbatim}
294 };
295
296 \end{tikzpicture}
297 \caption{More compex controls}
298 \end{figure}
299
300
301 \end{document}
302
303
304
305