| 1 |
% bloques.sty |
| 2 |
% package based on tikz for control diagrams in power electronics. |
| 3 |
% version 1.0 |
| 4 |
% author: Alejandro Garces |
| 5 |
% [email protected] |
| 6 |
% License: LPPL |
| 7 |
% This work may be distributed and/or modified under the |
| 8 |
% conditions of the LaTeX Project Public License, either version 1.3 |
| 9 |
% of this license or (at your option) any later version. |
| 10 |
% The latest version of this license is in |
| 11 |
% http://www.latex-project.org/lppl.txt |
| 12 |
% and version 1.3 or later is part of all distributions of LaTeX |
| 13 |
% version 2005/12/01 or later. |
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
\usepackage{tikz} |
| 18 |
\usepgflibrary{shapes.misc} |
| 19 |
\usetikzlibrary{arrows,decorations.pathmorphing,backgrounds,positioning,fit,shadows} |
| 20 |
|
| 21 |
\newcommand{\xdistancia}{1.5cm} |
| 22 |
\newcommand{\ydistancia}{1.2cm} |
| 23 |
\newcommand{\minaltura}{0.7cm} |
| 24 |
\newcommand{\tamano}{\footnotesize} |
| 25 |
\newcommand{\colorfondo}{white} |
| 26 |
\newcommand{\colortexto}{black} |
| 27 |
\newcommand{\colorlinea}{black} |
| 28 |
\newcommand{\sombra}{0} |
| 29 |
\newcommand{\ancholinea}{thick} |
| 30 |
|
| 31 |
\newcommand{\bShadow}{\renewcommand{\sombra}{1}} |
| 32 |
\newcommand{\bColorB}[1]{\renewcommand{\colorfondo}{#1}} |
| 33 |
\newcommand{\bColorT}[1]{\renewcommand{\colortexto}{#1}} |
| 34 |
\newcommand{\bColorL}[1]{\renewcommand{\colorlinea}{#1}} |
| 35 |
\newcommand{\ydistance}[1]{\renewcommand{\ydistancia}{#1}} |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
\newcommand{\bStart}[1]{\node [] (NODO1) {\tamano{#1}};} |
| 40 |
|
| 41 |
\newcommand{\bPlusDown}[1]{ |
| 42 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 43 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 44 |
\node [draw=gray!50, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, thin] {}; |
| 45 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 46 |
\node [below of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 47 |
\draw [-latex,\colorlinea] (NODO1) -- (SUMA); |
| 48 |
\node [below of = SUMA, node distance = \ydistancia] (VARIABLE) {\tamano{#1}}; |
| 49 |
\draw [-latex, \colorlinea] (VARIABLE) -- (SUMA); |
| 50 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 51 |
} |
| 52 |
|
| 53 |
|
| 54 |
\newcommand{\bPlusUp}[1]{ |
| 55 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 56 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 57 |
\node [draw=gray!50, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, thin, draw=gray!50] {}; |
| 58 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 59 |
\node [above of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 60 |
\draw [-latex, \colorlinea] (NODO1) -- (SUMA); |
| 61 |
\node [above of = SUMA, node distance = \ydistancia] (VARIABLE) {\tamano{#1}}; |
| 62 |
\draw [-latex, \colorlinea] (VARIABLE) -- (SUMA); |
| 63 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 64 |
} |
| 65 |
|
| 66 |
|
| 67 |
\newcommand{\bMinusDown}[1]{ |
| 68 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 69 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 70 |
\node [cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, thin, draw=gray!50] {}; |
| 71 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 72 |
\node [below of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$-$}}; |
| 73 |
\draw [-latex,\colorlinea] (NODO1) -- (SUMA); |
| 74 |
\node [below of = SUMA, node distance = \ydistancia] (VARIABLE) {\tamano{#1}}; |
| 75 |
\draw [-latex,\colorlinea] (VARIABLE) -- (SUMA); |
| 76 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 77 |
|
| 78 |
} |
| 79 |
|
| 80 |
|
| 81 |
\newcommand{\bMinusUp}[1]{ |
| 82 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 83 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 84 |
\node [thin, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, draw=gray!50] {}; |
| 85 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 86 |
\node [above of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$-$}}; |
| 87 |
\draw [-latex, \colorlinea] (NODO1) -- (SUMA); |
| 88 |
\node [above of = SUMA, node distance = \ydistancia] (VARIABLE) {\tamano{#1}}; |
| 89 |
\draw [-latex, \colorlinea] (VARIABLE) -- (SUMA); |
| 90 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 91 |
} |
| 92 |
|
| 93 |
\newcommand{\bEnd}[1]{ |
| 94 |
\node [right of = NODO1, node distance = 1.7cm] (F) {#1}; |
| 95 |
\draw [-latex,\colorlinea] (NODO1) -- (F); |
| 96 |
\node at (F) [anchor = west] (NODO1) {}; |
| 97 |
} |
| 98 |
|
| 99 |
|
| 100 |
\newcommand{\bGain}[1]{ |
| 101 |
\node [draw=\colorlinea, rectangle, right of = NODO1, node distance= \xdistancia, minimum height = \minaltura, |
| 102 |
\ancholinea, fill=\colorfondo,drop shadow={opacity=\sombra}] (NODO2) { \color{\colortexto}\tamano{#1}}; |
| 103 |
\draw [-latex, \colorlinea] (NODO1)--(NODO2); |
| 104 |
\node at (NODO2.east) [anchor = east] (NODO1) {}; |
| 105 |
|
| 106 |
} |
| 107 |
|
| 108 |
|
| 109 |
\newcommand{\bGainPlus}[2]{ |
| 110 |
|
| 111 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 112 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 113 |
\node [thin, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, draw=gray!50] {}; |
| 114 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 115 |
\node [below of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 116 |
\draw [-latex, \colorlinea] (NODO1) -- (SUMA); |
| 117 |
|
| 118 |
\node [draw=\colorlinea, rectangle, below of = SUMA, node distance = \xdistancia,xshift=-0.3cm, minimum height = \minaltura,\ancholinea, |
| 119 |
fill=\colorfondo,drop shadow={opacity=\sombra}, anchor = east] (NODOG) {\color{\colortexto}\tamano{#2}}; |
| 120 |
\node [left of = NODOG, node distance = \xdistancia] (VARIABLE) {\tamano{#1}}; |
| 121 |
\draw [-latex, \colorlinea] (VARIABLE) -- (NODOG); |
| 122 |
\draw [-latex, \colorlinea] (NODOG) -| (SUMA); |
| 123 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 124 |
} |
| 125 |
|
| 126 |
\newcommand{\bGainMinus}[2]{ |
| 127 |
|
| 128 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 129 |
drop shadow={opacity=\sombra}] (SUMA) {}; |
| 130 |
\node [thin, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, draw=gray!50] {}; |
| 131 |
\node [left of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 132 |
\node [below of = SUMA, node distance = 0.45em] () { \color{\colortexto}\tiny{$-$}}; |
| 133 |
\draw [-latex, \colorlinea] (NODO1) -- (SUMA); |
| 134 |
|
| 135 |
\node [draw=\colorlinea, rectangle, below of = SUMA, node distance = \xdistancia,xshift=-0.3cm, minimum height = \minaltura,\ancholinea, |
| 136 |
fill=\colorfondo,drop shadow={opacity=\sombra}, anchor = east] (NODOG) {\color{\colortexto}\tamano{#2}}; |
| 137 |
\node [left of = NODOG, node distance = \xdistancia] (VARIABLE) {\tamano{#1}}; |
| 138 |
\draw [-latex, \colorlinea] (VARIABLE) -- (NODOG); |
| 139 |
\draw [-latex, \colorlinea] (NODOG) -| (SUMA); |
| 140 |
\node at (SUMA) [anchor = west] (NODO1) {}; |
| 141 |
} |
| 142 |
|
| 143 |
|
| 144 |
\newcommand{\bMinusF}[1]{ |
| 145 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 146 |
drop shadow={opacity=\sombra}] (#1) {}; |
| 147 |
\node [draw, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, thin, draw=gray!50] {}; |
| 148 |
\node [left of = #1, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 149 |
\node [below of = #1, node distance = 0.45em] () { \color{\colortexto}\tiny{$-$}}; |
| 150 |
\draw [-latex, \colorlinea] (NODO1) -- (#1); |
| 151 |
\node at (#1) [anchor = west] (NODO1) {}; |
| 152 |
|
| 153 |
} |
| 154 |
|
| 155 |
|
| 156 |
\newcommand{\bPlusF}[1]{ |
| 157 |
\node [draw=\colorlinea, circle,minimum size=1.5em, right of=NODO1, node distance= \xdistancia,\ancholinea, fill=\colorfondo, |
| 158 |
drop shadow={opacity=\sombra}] (#1) {}; |
| 159 |
\node [thin, cross out, minimum size=1.0em, right of=NODO1, node distance= \xdistancia, draw=gray!50] {}; |
| 160 |
\node [left of = #1, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 161 |
\node [below of = #1, node distance = 0.45em] () { \color{\colortexto}\tiny{$+$}}; |
| 162 |
\draw [-latex, \colorlinea] (NODO1) -- (#1); |
| 163 |
\node at (#1) [anchor = west] (NODO1) {}; |
| 164 |
|
| 165 |
} |
| 166 |
|
| 167 |
|
| 168 |
\newcommand{\bFeedBack}[2]{ |
| 169 |
\node [draw=\colorlinea, rectangle, below left of = NODO1, node distance = \ydistancia, minimum height = \minaltura,\ancholinea, |
| 170 |
fill=\colorfondo,drop shadow={opacity=\sombra}, anchor = west] (NODOG) {\color{\colortexto}\tamano{#1}}; |
| 171 |
\draw [-latex, \colorlinea] (NODO1) -- +(0.5,0) |- (NODOG); |
| 172 |
\draw [-latex, \colorlinea] (NODOG) -| (#2); |
| 173 |
} |
| 174 |
|
| 175 |
|
| 176 |
\newcommand{\bCrossGain}[3]{ |
| 177 |
\node [draw=\colorlinea, rectangle, above right of = #2, minimum height = \minaltura,\ancholinea, |
| 178 |
fill=\colorfondo,drop shadow={opacity=\sombra}, anchor = west] (NODOG) {\color{\colortexto}\tamano{#1}}; |
| 179 |
\draw [-latex, \colorlinea] (#2) |- (NODOG); |
| 180 |
\draw [-latex, \colorlinea] (NODOG) -| (#3); |
| 181 |
} |
| 182 |
|
| 183 |
|
| 184 |
\newcommand{\bNewStart}[2]{ |
| 185 |
\node at #2 (NODO1) {\tamano{#1}}; |
| 186 |
} |
| 187 |
|
| 188 |
|
| 189 |
\newcommand{\bMarkNode}[1]{ |
| 190 |
\node at (NODO1) (#1) {}; |
| 191 |
} |
| 192 |
|
| 193 |
|
| 194 |
\newcommand{\bMarkNodeUp}[1]{ |
| 195 |
\node[above of = NODO1, node distance = \ydistancia] (#1) {}; |
| 196 |
} |
| 197 |
|
| 198 |
|
| 199 |
\newcommand{\bMarkNodeDown}[1]{ |
| 200 |
\node[below of = NODO1,node distance = \ydistancia] (#1) {}; |
| 201 |
} |
| 202 |
|