| 1 |
\documentclass[onecolumn,a4paper,10pt]{IEEEtran} |
| 2 |
%\documentclass{article} |
| 3 |
|
| 4 |
\usepackage{kblocks} |
| 5 |
%\tikzexternalize[prefix=figs/] % activate tikzpicture exports |
| 6 |
|
| 7 |
\usepackage{bm} |
| 8 |
\usepackage{listings} |
| 9 |
|
| 10 |
\usepackage{verbatim} |
| 11 |
\usepackage{fancyvrb} % extended verbatim environments |
| 12 |
\usepackage{fancyvrb-ex} |
| 13 |
|
| 14 |
|
| 15 |
\usepackage{units} |
| 16 |
|
| 17 |
\usepackage{zi4} |
| 18 |
%\usepackage{garamondx} |
| 19 |
%\usepackage[lig=true]{baskervald} |
| 20 |
%\usepackage{palatino} |
| 21 |
%\def\rmdefault{zi4} |
| 22 |
%\def\sfdefault{zi4} |
| 23 |
\usepackage[defaultsans]{lato} |
| 24 |
|
| 25 |
\usepackage{csquotes} |
| 26 |
|
| 27 |
\newcommand*{\kblocks}{\relax~\textit{k}\textsc{blocks}} |
| 28 |
\newcommand*{\Tikz}{ |
| 29 |
Ti\textit{k}Z |
| 30 |
} |
| 31 |
\newcommand*{\TikzPGF}{\relax~{Ti\textit{k}Z/\textsc{pgf}}} |
| 32 |
\newcommand*{\spacetweak}{\medskip\medskip} |
| 33 |
|
| 34 |
\DefineVerbatimEnvironment |
| 35 |
{cvl}{Verbatim} |
| 36 |
{formatcom=\color{blue!10!black!90}, |
| 37 |
numbers=left,numbersep=2mm,gobble=0, |
| 38 |
frame=lines,rulecolor=\color{gray},framesep=1mm, |
| 39 |
fontseries=,labelposition=none,fontsize=\normalsize, |
| 40 |
xrightmargin=1cm, samepage=false} |
| 41 |
% |
| 42 |
\newenvironment{apilist}{ |
| 43 |
\vspace{1ex}}% |
| 44 |
{\vspace{1em}} |
| 45 |
% |
| 46 |
\newcommand{\cvhd}[1]{{ |
| 47 |
{\subsection{#1}}{\mbox{}\break}\vspace{-5ex} |
| 48 |
}} |
| 49 |
|
| 50 |
% |
| 51 |
\fvset{formatcom=\color{darkgray}, |
| 52 |
fontfamily=tt,fontsize=\footnotesize, fontseries=b, |
| 53 |
frame=single,rulecolor=\color{olive},label=\fbox{A}, |
| 54 |
numbers=left,numbersep=5pt} |
| 55 |
%red,green,blue,cyan,magenta,yellow,black,gray,white, |
| 56 |
%darkgray,lightgray,brown,lime,olive,orange,pink,purple,teal,violet |
| 57 |
|
| 58 |
\usepackage[open]{bookmark} |
| 59 |
\newcommand*{\urlink}[1]{{ |
| 60 |
{\texttt{\url{#1}}} |
| 61 |
}} |
| 62 |
|
| 63 |
\begin{document} |
| 64 |
|
| 65 |
\title{\kblocks~Package} |
| 66 |
\author{ |
| 67 |
|
| 68 |
\IEEEauthorblockN{ |
| 69 |
\textsc{Oluwasegun~Somefun}~(\textbf{[email protected]}) \\ |
| 70 |
\footnotesize{\textsc{Department of Computer Engineering, Federal University of Technology, Akure, Nigeria}} |
| 71 |
} |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
\markboth{01,~February~2021.~\kblocks~Documentation.~Version~2.0}; |
| 76 |
|
| 77 |
\maketitle |
| 78 |
|
| 79 |
\section{Introduction} |
| 80 |
Welcome to the demo documentation of\kblocks. Desiring to typeset control block diagrams in \LaTeX~and dissatisfied with the other \LaTeX~macro packages that |
| 81 |
can be found online, I thought: \textit{why not write my own macro package for this purpose}. |
| 82 |
|
| 83 |
I wish to start with the question, \enquote{What is\kblocks?} The\kblocks~macro package is the product of using\TikzPGF~to |
| 84 |
directly typeset beautiful control block diagrams and signal flow graphs in my Masters' dissertation and papers directly with \LaTeX. |
| 85 |
Basically, it just defines a dedicated \enquote{kblock} environment and a number of macro commands to make drawing control block diagrams with\TikzPGF{} more structured and easier. In a sense, when you |
| 86 |
use\kblocks~you \textit{program} or typeset graphics for control block diagrams, just as you “program” graphics in your document when you use |
| 87 |
\LaTeX~using\TikzPGF. |
| 88 |
|
| 89 |
The powerful options offered by\TikzPGF~often intimidates beginner users not ready to spend careful time learning about\TikzPGF. Like all |
| 90 |
\LaTeX~packages,\TikzPGF~inherits the steep learning curve of \LaTeX, that is, no \textit{what you see is what you get}. |
| 91 |
The\kblocks~macro reduces the length of this learning curve, by focusing the graphics theme on control block diagrams only. |
| 92 |
|
| 93 |
|
| 94 |
Fortunately this documentation as it grows and gets to be improved, will come with a number of demos and proper documentation of the\kblocks{} API, which will guide you on creating control block diagrams with\kblocks{} without your having to read the\TikzPGF~manual. |
| 95 |
|
| 96 |
My wish is that you do find it useful and helpful. |
| 97 |
|
| 98 |
Please, don't forget to share and star the Github repo: \urlink{https://github.com/somefunAgba/kblocks}, if you did. |
| 99 |
|
| 100 |
I will readily welcome any issues or emails for improvement or suggestion with respect to |
| 101 |
using\kblocks{} and making it useful for researchers, students and others involved in the applications and field of control theory and signal processing. |
| 102 |
|
| 103 |
|
| 104 |
\pagebreak |
| 105 |
\section{Demos} |
| 106 |
\centering |
| 107 |
\spacetweak |
| 108 |
\subsection{Ex:A}\spacetweak |
| 109 |
\begin{SideBySideExample}[label=\fbox{A},xrightmargin=10cm] |
| 110 |
\begin{kblock} |
| 111 |
% global ref point |
| 112 |
\kJumpCS{init} |
| 113 |
%% blocks |
| 114 |
\kMarkNodeRight{0.2cm}{0cm}{$r$}{init}{rin} |
| 115 |
\kPlusPlusMinus{rin}{sb1}{0.2cm} |
| 116 |
\kTFRight[0.2cm]{sb1}{tfb1}{$\frac{1}{s}$} |
| 117 |
\kMarkNodeRight{0.2cm}{0cm}{}{tfb1}{ny} |
| 118 |
\kOutRight[0.2cm]{ny}{yout}{$y$}{0cm} |
| 119 |
%% links |
| 120 |
\kLink[]{rin}{sb1} |
| 121 |
\kLink[$e$]{sb1}{tfb1} |
| 122 |
\kLinkn[]{tfb1}{ny} |
| 123 |
\kLinkVHHVBelow[0cm]{$1$}{ny}{sb1}{0cm}{0cm} |
| 124 |
\kLinkVHHVAbove[0cm]{$1$}{ny}{sb1}{0cm}{0cm} |
| 125 |
\end{kblock} |
| 126 |
\end{SideBySideExample} |
| 127 |
|
| 128 |
\subsection{Ex:B} |
| 129 |
\spacetweak\spacetweak |
| 130 |
\begin{SideBySideExample}[label=\fbox{B},xrightmargin=10cm] |
| 131 |
\begin{kblock} |
| 132 |
% global ref point |
| 133 |
\kJumpCS{init} |
| 134 |
%% blocks |
| 135 |
\kMarkNodeRight{0.2cm}{0cm}{$r$}{init}{rin} |
| 136 |
\kPlusMinusDown{rin}{sb1}{0.2cm} |
| 137 |
\kTFRight[0.25cm]{sb1}{tfb1}{$G\left( s \right)$} |
| 138 |
\kTFBelow[0.2cm]{tfb1}{tfb2}{$H\left( s \right)$} |
| 139 |
\kMarkNodeRight{0.2cm}{0cm}{}{tfb1}{ny} |
| 140 |
\kOutRight[0.2cm]{ny}{yout}{$y$}{0cm} |
| 141 |
%% links |
| 142 |
\kLinkVH[$y$]{ny}{tfb2}{0cm}{0cm}{0cm}{} |
| 143 |
\kLinkHV[$\hat{y}$]{tfb2}{sb1}{0cm}{0cm}{9}{} |
| 144 |
\kLink[]{rin}{sb1} |
| 145 |
\kLink[$e$]{sb1}{tfb1} |
| 146 |
\kLinkn[]{tfb1}{ny} |
| 147 |
%% coverings |
| 148 |
\kCoverRect[blue]{sb1}{1cm}{2cm}{0.5cm}{3cm} |
| 149 |
\kCoverTextLeft{2cm}{1cm}{covtx}{Closed-loop system}; |
| 150 |
\end{kblock} |
| 151 |
\end{SideBySideExample} |
| 152 |
|
| 153 |
\subsection{Ex:C} |
| 154 |
\spacetweak\spacetweak |
| 155 |
\begin{SideBySideExample}[label=\fbox{C},xrightmargin=10cm] |
| 156 |
\begin{kblock} |
| 157 |
% ref |
| 158 |
\kJumpCS{spt} |
| 159 |
% top blocks |
| 160 |
\kMarkNodeRight{0cm}{0cm}{$I^\star$}{spt}{inI} |
| 161 |
\kPlusMinusDown{inI}{sb1}{1.cm} |
| 162 |
\kTFRight[0.2cm]{sb1}{tfb1}{$s$} |
| 163 |
\kTFBelow[0.5cm]{sb1}{tfb2}{$\frac{1}{2}$} |
| 164 |
\kPlusDownPlusUpL{tfb2}{sb2}{0cm} |
| 165 |
\kMinusPlusUp{tfb1}{sb3}{0cm} |
| 166 |
\kTFRight[0cm]{sb3}{tfb3}{$0.2$} |
| 167 |
\kTFRight[0cm]{tfb3}{tfb4}{$K_3$} |
| 168 |
\kMarkNodeAbove{0cm}{0cm}{$V_{dc}$}{inI}{inVdc} |
| 169 |
\kMarkNodeBelow{0cm}{0.3cm}{$V_2$}{inI}{inV2} |
| 170 |
\kMarkNodeBelow{0cm}{-0.4cm}{$V_3$}{inV2}{inV3} |
| 171 |
% bottom blocks |
| 172 |
\kMarkNodeBelow{3cm}{0cm}{$V_1$}{inI}{inV1} |
| 173 |
\kPlusPlusUpB{tfb4}{sb4}{3cm} |
| 174 |
\kPlusMinusDown{inV1}{sb5}{0cm} |
| 175 |
\kTFRight[0cm]{sb5}{tfb5}{$\lambda$} |
| 176 |
\kOutRight[0cm]{sb4}{outV}{$V_{out}^{\star}$}{0cm} |
| 177 |
\kMarkNodeBelow{0cm}{0cm}{$V_4$}{inV1}{inV4} |
| 178 |
% top links |
| 179 |
\kLinkHV[]{inVdc}{sb3}{0cm}{0cm}{0}{} |
| 180 |
\kLinkHV[]{inV2}{sb2}{0cm}{0cm}{0}{} |
| 181 |
\kLinkHV[]{inV3}{sb2}{0cm}{0cm}{0}{} |
| 182 |
\kLink[]{inI}{sb1} |
| 183 |
\kLink[]{sb1}{tfb1} |
| 184 |
\kLink[$I_{\beta}$]{tfb2}{sb1} |
| 185 |
\kLink[]{tfb1}{sb3} |
| 186 |
\kLink[]{sb2}{tfb2} |
| 187 |
\kLink[]{sb3}{tfb3} |
| 188 |
\kLink[]{tfb3}{tfb4} |
| 189 |
\kLink[$V_{\alpha}$]{tfb4}{sb4} |
| 190 |
% bottom links |
| 191 |
\kLink[]{inV1}{sb5} |
| 192 |
\kLink[]{sb5}{tfb5} |
| 193 |
\kLink[]{tfb5}{sb4} |
| 194 |
\kLinkHV[]{inV4}{sb5}{0cm}{0cm}{0}{} |
| 195 |
\end{kblock} |
| 196 |
\end{SideBySideExample} |
| 197 |
|
| 198 |
\subsection{Ex:D} |
| 199 |
\spacetweak\spacetweak |
| 200 |
\begin{SideBySideExample}[label=\fbox{D},xrightmargin=10cm] |
| 201 |
\begin{kblock} |
| 202 |
% ref |
| 203 |
\kJumpCS{ioref} |
| 204 |
|
| 205 |
% blks |
| 206 |
\kTFRight[0cm]{ioref}{tfb1}{ |
| 207 |
$\bm{\hat{m}$}\\\textbf{PID} |
| 208 |
\\\textbf{model}} |
| 209 |
\kTFRight[1cm]{tfb1}{tfb2}{$\bm{K\left(y_m,y\right)}$ |
| 210 |
\\\textbf{PID}\\\textbf{controller}} |
| 211 |
\kTFBelowRight{0.25cm}{0.5cm}{tfb2}{tfb3} |
| 212 |
{$\bm{P\left(s\right)}$\\\textbf{process}} |
| 213 |
|
| 214 |
% links |
| 215 |
\kInLeft[0cm]{tfb1}{inR}{$r$}{0cm} |
| 216 |
\kOutDown[0cm]{tfb1}{outU}{$u_m$}{0cm} |
| 217 |
\kLink[$y_m$]{tfb1}{tfb2} |
| 218 |
\kLinkHV[$u$]{tfb2}{tfb3}{0cm}{0cm}{1}{} |
| 219 |
\kLinkHV[$y$]{tfb3}{tfb2}{0cm}{0cm}{4}{} |
| 220 |
\end{kblock} |
| 221 |
\end{SideBySideExample} |
| 222 |
|
| 223 |
\subsection{Ex:E} |
| 224 |
\spacetweak\spacetweak |
| 225 |
\begin{SideBySideExample}[label=\fbox{E},xrightmargin=10cm] |
| 226 |
\begin{kblock} |
| 227 |
% ref |
| 228 |
\kJumpCS{refpt} |
| 229 |
|
| 230 |
% blks |
| 231 |
\kTFRight[0cm]{refpt}{tfb1}{ |
| 232 |
$\bm{\hat{m}$}\\\textbf{closed PID-loop} |
| 233 |
\\\textbf{model}} |
| 234 |
\kTFRight[2cm]{tfb1}{tfb2}{\textbf{PID}$\bm{(y_m,y)}$} |
| 235 |
\kTFBelow[0.25cm]{tfb2}{tfb3} |
| 236 |
{$\bm{P\left(s\right)}$\\\textbf{process}} |
| 237 |
|
| 238 |
% links |
| 239 |
\kInLeft[0cm]{tfb1}{inR}{$r$}{0cm} |
| 240 |
\kOutDown[0cm]{tfb1}{outU}{$u_m$}{0cm} |
| 241 |
\kLink[$y_m$]{tfb1}{tfb2} |
| 242 |
\kLinkHVHRight[0]{$u$}{tfb2}{tfb3}{0cm}{0cm}{1cm} |
| 243 |
\kLinkHVHLeft[0.8cm]{$y$}{tfb3}{tfb2}{0cm}{-0.2cm} |
| 244 |
\end{kblock} |
| 245 |
\end{SideBySideExample} |
| 246 |
|
| 247 |
\subsection{Ex:F} |
| 248 |
\spacetweak\spacetweak |
| 249 |
\begin{SideBySideExample}[label=\fbox{F},xrightmargin=10cm] |
| 250 |
\begin{kblock} |
| 251 |
% generic coordinate reference points |
| 252 |
%\kJumpCS[$(0,0)$]{i} |
| 253 |
\kJumpCS{i} |
| 254 |
\kJumpCSRight[-0.5cm]{i}{iR}{0cm}{3} |
| 255 |
\kJumpCSLeft[-0.5cm]{i}{iL}{0cm}{9} |
| 256 |
\kJumpCSAbove[-0.5cm]{i}{iA}{0cm}{12} |
| 257 |
\kJumpCSBelow[-0.5cm]{i}{iB}{0cm}{6} |
| 258 |
|
| 259 |
% blks |
| 260 |
\kTFBelow[]{iB}{tfb1}{\kmT{\mathcal{K}(\cdot)}} |
| 261 |
\kTFBelow[]{tfb1}{tfb2}{\kmT{\mathcal{P}(s)}} |
| 262 |
|
| 263 |
% links |
| 264 |
\kInLeftM[0cm]{tfb1}{inR}{$r$}{0.05cm}{6} |
| 265 |
\kMarkNodeLeft{0cm}{0cm}{}{tfb2}{ny} |
| 266 |
\kOutLeft[-0.5cm]{ny}{outY}{$y$}{0cm} |
| 267 |
\kLinkn[]{ny}{tfb2} |
| 268 |
\kLinkVH[$y$]{ny}{tfb1}{-0.1cm}{0cm}{2}{} |
| 269 |
\kLinkHVHRight[0.6cm]{$u$}{tfb1}{tfb2}{0cm}{0cm} |
| 270 |
|
| 271 |
% covers |
| 272 |
\kCoverRect[magenta!5!red]{tfb2} |
| 273 |
{0.1cm}{0.1cm}{0.3cm}{0.3cm} |
| 274 |
\kCoverTextBelow{0cm}{0cm}{txt1} |
| 275 |
{physical system (e.g: a dc motor)}; |
| 276 |
% |
| 277 |
\kCoverRect[green!75!blue!80!]{tfb1} |
| 278 |
{0.1cm}{0.1cm}{0.2cm}{0.2cm} |
| 279 |
\kCoverTextAbove{0cm}{0cm}{txt2} |
| 280 |
{computing system (embedded control algorithm)}; |
| 281 |
\end{kblock} |
| 282 |
\end{SideBySideExample} |
| 283 |
|
| 284 |
\subsection{Ex:G} |
| 285 |
\spacetweak\spacetweak |
| 286 |
\begin{SideBySideExample}[label=\fbox{G},xrightmargin=10cm] |
| 287 |
\centering |
| 288 |
|
| 289 |
\begin{kblock} |
| 290 |
\kJumpCS{R} |
| 291 |
|
| 292 |
% blks |
| 293 |
\kTFRight{R}{tfb1}{$\bm{P}$} |
| 294 |
\kTFBelow{tfb1}{tfb2}{$\bm{C}$} |
| 295 |
|
| 296 |
% links |
| 297 |
\kInLeftM[0cm]{tfb1}{inW}{$w$}{0.05cm}{2} |
| 298 |
\kInLeftM[0cm]{tfb2}{inR}{$r$}{-0.05cm}{5} |
| 299 |
\kOutRight[0cm]{tfb1}{outZ}{$z$}{0.05cm} |
| 300 |
\kOutRight[0cm]{tfb2}{outV}{$v$}{-0.05cm} |
| 301 |
\kLinkHVHRight[0.6cm]{$y$}{tfb1}{tfb2}{-0.1cm}{0.1cm} |
| 302 |
\kLinkHVHLeft[0.6cm]{$u$}{tfb2}{tfb1}{0.1cm}{-0.1cm} |
| 303 |
|
| 304 |
% covers |
| 305 |
\kCoverRect[blue!50!]{tfb1} |
| 306 |
{0.1cm}{0.1cm}{0.3cm}{0.3cm} |
| 307 |
\kCoverTextAbove{0cm}{0cm}{txt1}{Physical System}; |
| 308 |
% |
| 309 |
\kCoverRect[red]{tfb2} |
| 310 |
{0.1cm}{0.1cm}{0.3cm}{0.3cm} |
| 311 |
\kCoverTextBelow{0cm}{0cm}{txt2}{Computing System}; |
| 312 |
\end{kblock} |
| 313 |
\end{SideBySideExample} |
| 314 |
|
| 315 |
\subsection{Ex:H} |
| 316 |
\spacetweak\spacetweak |
| 317 |
\begin{SideBySideExample}[label=\fbox{H},xrightmargin=10cm] |
| 318 |
% Description: Closed PID-loop |
| 319 |
\centering |
| 320 |
\begin{kblock} |
| 321 |
% global ref point |
| 322 |
\kJumpCS{SRef} |
| 323 |
|
| 324 |
%% blocks |
| 325 |
\kTFAbove[5cm]{SRef}{tfD}{\kmT{D}} |
| 326 |
\kMarkNodeLeft{0.1cm}{0cm}{}{tfD}{yin} |
| 327 |
\kPlusMinusDownPlaceAbove{yin}{S1}{0cm} |
| 328 |
\kTFAbove[]{tfD}{tfA}{\kmT{A}} |
| 329 |
\kTFAbove[]{tfA}{tfB}{\kmT{B}} |
| 330 |
\kPlusPlusMinus{tfA}{S2}{0cm} |
| 331 |
\kTFRight[0.5cm]{S2}{tfP}{\kmT{\mathcal{P}(s)}} |
| 332 |
|
| 333 |
%% other nodes-paths |
| 334 |
\kMarkNodeRight{0cm}{0cm}{}{tfP}{ycut} |
| 335 |
\kInLeft[0.1cm]{S1}{rin}{$r$}{0cm} |
| 336 |
\kOutRight[0.1cm]{ycut}{yout}{$y^*$}{0cm} |
| 337 |
\kMarkNodeRight{-0.4cm}{0cm}{}{rin}{rcut} |
| 338 |
|
| 339 |
%% links |
| 340 |
\kLink[$e$]{S1}{tfA} |
| 341 |
\kLinkVH[]{rcut}{tfB}{0cm}{0cm}{0}{} |
| 342 |
\kLink[]{tfA}{S2} |
| 343 |
\kLinkHV[]{tfB}{S2}{0cm}{0cm}{0}{} |
| 344 |
\kLink[$u^*$]{S2}{tfP} |
| 345 |
\kLinkHV[]{tfD}{S2}{0cm}{0cm}{0}{} |
| 346 |
\kLinkn[]{tfP}{ycut} |
| 347 |
\kLinknVHHVBelow[1.2cm]{}{ycut}{yin}{0cm}{0cm} |
| 348 |
\kLink[]{yin}{tfD} |
| 349 |
\kLink[]{yin}{S1} |
| 350 |
\end{kblock} |
| 351 |
\end{SideBySideExample} |
| 352 |
|
| 353 |
\subsection{Ex:I} |
| 354 |
\spacetweak\spacetweak |
| 355 |
\begin{SideBySideExample}[label=\fbox{I},xrightmargin=10cm] |
| 356 |
% Description: Closed PID-loop |
| 357 |
\centering |
| 358 |
\begin{kblock} |
| 359 |
% global ref point |
| 360 |
\kJumpCS{SRef} |
| 361 |
|
| 362 |
%% blocks |
| 363 |
|
| 364 |
\kTFAbove[]{SRef}{tfA}{\kmT{A}} |
| 365 |
\kPlusMinusDownL{tfA}{S1}{0cm} |
| 366 |
\kTFAbove[]{tfA}{tfB}{\kmT{B}} |
| 367 |
\kPlusPlusMinus{tfA}{S2}{0cm} |
| 368 |
\kTFRight[0.5cm]{S2}{tfP}{\kmT{\mathcal{P}(s)}} |
| 369 |
\kTFBelow[0cm]{tfP}{tfD}{\kmT{D}} |
| 370 |
\kMarkNodeRight{0cm}{0cm}{}{tfP}{ycut} |
| 371 |
\kMarkNodeBelow{0cm}{0cm}{}{ycut}{yin} |
| 372 |
\kInLeftM[0.1cm]{S1}{rin}{$r$}{0cm}{0} |
| 373 |
\kOutRight[0.1cm]{ycut}{yout}{$y^*$}{0cm} |
| 374 |
\kMarkNodeRight{-0.4cm}{0cm}{}{rin}{rcut} |
| 375 |
|
| 376 |
%% links |
| 377 |
\kLink[$e$]{S1}{tfA} |
| 378 |
\kLinkVH[]{rcut}{tfB}{0cm}{0cm}{0}{} |
| 379 |
\kLink[]{tfA}{S2} |
| 380 |
\kLinkHV[]{tfB}{S2}{0cm}{0cm}{0}{} |
| 381 |
\kLink[$u^*$]{S2}{tfP} |
| 382 |
\kLinkHV[]{tfD}{S2}{0cm}{0cm}{0}{} |
| 383 |
\kLinkn[]{tfP}{ycut} |
| 384 |
\kLinkn[]{ycut}{yin} |
| 385 |
\kLinknVHHVBelow[0.5cm]{}{yin}{S1}{0cm}{0cm} |
| 386 |
\kLink[]{yin}{tfD} |
| 387 |
\end{kblock} |
| 388 |
\end{SideBySideExample} |
| 389 |
|
| 390 |
\subsection{Ex:J} |
| 391 |
\spacetweak\spacetweak |
| 392 |
\begin{SideBySideExample}[label=\fbox{J},xrightmargin=10cm] |
| 393 |
% Description: Anon |
| 394 |
\centering |
| 395 |
\begin{kblock} |
| 396 |
% global ref point |
| 397 |
\kJumpCS{o} |
| 398 |
|
| 399 |
%% blocks |
| 400 |
\kTFAbove[0cm]{o}{tfi}{\kmT{f_i(\cdot)}} |
| 401 |
\kTFAbove[0.5cm]{tfi}{tfd}{\kmT{f_d(\cdot)}} |
| 402 |
\kTFAbove[0.5cm]{tfd}{tfp}{\kmT{f_p(\cdot)}} |
| 403 |
|
| 404 |
%% links |
| 405 |
\kInUpM[0cm]{tfp}{inu}{$u$}{0cm}{0} |
| 406 |
\kOutRight[0.3cm]{tfp}{kp}{$K_p$}{0cm} |
| 407 |
\kOutRight[0.3cm]{tfi}{ki}{$K_i$}{0cm} |
| 408 |
\kOutRight[0.3cm]{tfd}{kd}{$K_d$}{0cm} |
| 409 |
\kInLeftM[0cm]{tfd}{inwn}{$\omega_n$}{0cm}{6} |
| 410 |
\kInLeftM[0cm]{tfp}{iny}{$y$}{0.15cm}{6} |
| 411 |
\kInLeftM[0cm]{tfp}{inym}{$y_m$}{-0.15cm}{4} |
| 412 |
\kMarkNodeLeft{-0.35cm}{0cm}{}{kp}{kpcut} |
| 413 |
\kLinkVH[$\lambda$]{kpcut}{tfd}{0.2cm}{0cm}{2}{kpcutb} |
| 414 |
\kLinkVH[]{kpcutb}{tfi}{0.2cm}{0cm}{0}{} |
| 415 |
\kMarkNodeRight{-0.8cm}{0cm}{}{inwn}{wncut} |
| 416 |
\kLinkVH[]{wncut}{tfi}{0cm}{0cm}{0}{} |
| 417 |
\end{kblock} |
| 418 |
\end{SideBySideExample} |
| 419 |
|
| 420 |
\subsection{Ex:K} |
| 421 |
\spacetweak |
| 422 |
\begin{SideBySideExample}[label=\fbox{K},xrightmargin=10cm] |
| 423 |
% DESCRIPTION: CPLMFC-Algorithm |
| 424 |
\begin{kblock} |
| 425 |
% global ref point |
| 426 |
\kJumpCS{SRef} |
| 427 |
%% blocks |
| 428 |
% place TF_fts right of global ref. |
| 429 |
\kTFRight[4cm]{SRef}{TF_fts}{ \kmTw{f_\mathrm{t_s}} } |
| 430 |
% place TF_mfc at h cm above TF_fts |
| 431 |
\kTFAbove[0.3cm]{TF_fts}{TF_mfc}{ \kmT{f_\mathrm{MFC}} } |
| 432 |
\kTFAbove[0.3cm]{TF_mfc}{TF_pid}{ \kmT{f_\mathrm{PID}} } |
| 433 |
\kTFRight[3cm]{TF_mfc}{TF_sys}{ \kmTw{ \mathcal{P} } } |
| 434 |
|
| 435 |
%% nodes and links |
| 436 |
% mark visible node N1 right of TF_mfc |
| 437 |
\kMarkNodeRight{0.6cm}{0cm}{}{TF_mfc}{N1} |
| 438 |
\kMarkNodeBelow{-0.8cm}{0cm}{}{N1}{N2} |
| 439 |
\kMarkNodeRight{-0.6cm}{0cm}{}{N1}{N3} |
| 440 |
\kMarkNodeRight{0cm}{}{}{TF_sys}{N4} |
| 441 |
% extend node-path outwards |
| 442 |
\kOutRight[0.1cm]{N4}{Y1}{$y^*$}{0cm} |
| 443 |
\kMarkNodeLeft{0.3cm}{0cm}{}{TF_fts}{N5} |
| 444 |
\kMarkNodeLeft{0.3cm}{-0.12cm}{}{TF_mfc}{N6} |
| 445 |
\kInLeft[0.12cm]{TF_pid}{R1}{$r$}{-0.12cm} |
| 446 |
\kMarkNodeLeft{0cm}{-0.12cm}{}{TF_pid}{N7} |
| 447 |
% link TF_sys to N4 |
| 448 |
\kLinkn[]{TF_sys}{N4} |
| 449 |
\kLink[$u^*$]{N3}{TF_sys} |
| 450 |
\kLink[]{N1}{TF_mfc} |
| 451 |
\kLinkHV[]{TF_fts}{N2}{0cm}{0cm}{0}{} |
| 452 |
% HV link from TF_pid to N1 |
| 453 |
%\kLinkHV[]{$(TF_pid.east) + (0,0cm)$}{N1}{0cm}{0cm}{0}{} |
| 454 |
\kLinkHV[]{TF_pid}{N1}{0cm}{0cm}{0}{} |
| 455 |
% link N1 to N3 |
| 456 |
%\kLink[]{N1}{N3} |
| 457 |
% link N2 to N3 |
| 458 |
\kLink[]{N2}{N3} |
| 459 |
% VHHV feedback link from N4 to N5 |
| 460 |
\kLinknVHHVBelow[1.5cm]{}{N4}{N5}{0cm}{0cm} |
| 461 |
\kLink[]{N5}{TF_fts} |
| 462 |
\kLink[]{N6}{$(TF_mfc.west) + (0,-0.12cm)$} |
| 463 |
% arrowless link N5 and N6 |
| 464 |
\kLinkn[]{N5}{N6} |
| 465 |
\kLinkVH[]{N6}{TF_pid}{0.12cm}{0cm}{0}{} |
| 466 |
\kLinkVH[]{N7}{TF_mfc}{0.12cm}{0cm}{0}{} |
| 467 |
%% vector links |
| 468 |
% link from inside TF_fts to TF_mfc |
| 469 |
\kVecLink[$$]{TF_fts}{TF_mfc} |
| 470 |
% link from inside TF_mfc to TF_pid |
| 471 |
%\kVecLink[$$]{TF_mfc}{TF_pid} |
| 472 |
\kVecLink[$$]{$(TF_mfc.north) + (-0.15cm,0cm)$} |
| 473 |
{$(TF_pid.south) + (-0.15cm,0cm)$} |
| 474 |
% link from inside TF_pid to TF_mfc |
| 475 |
\kVecLink[$$]{$(TF_pid.south) + (0.15cm,0cm)$} |
| 476 |
{$(TF_mfc.north) + (0.15cm,0cm)$} |
| 477 |
|
| 478 |
%% cover-sectioning |
| 479 |
\kCoverRect[gray]{TF_mfc} |
| 480 |
{1.8cm}{1.8cm}{1.5cm}{1.6cm} |
| 481 |
\kCoverTextAbove{0cm}{0cm}{CT1}{CPLMFC Algorithm};% |
| 482 |
|
| 483 |
\end{kblock} |
| 484 |
\end{SideBySideExample} |
| 485 |
% \kLinkVH[$\bm{\omega_n}$]{T3}{T1}{0cm}{0cm}{0}{} |
| 486 |
% |
| 487 |
% \kVecLinkVH[$\bm{\kappa_{pid}}$]{T2}{T3}{0.1cm}{-0.1cm}{8} |
| 488 |
% \kVecLinkHV[$\bm{\kappa_{pid,\lambda_{id}}}$]{T3}{T2}{-0.1cm}{0.1cm}{1} |
| 489 |
% \kVecInUp[-0.3cm]{T3}{TS2}{$\bm{t_s,\tau_l}$}{0.5cm} |
| 490 |
|
| 491 |
\subsection{Ex:L}\spacetweak\spacetweak |
| 492 |
\spacetweak\spacetweak |
| 493 |
\begin{SideBySideExample}[label=\fbox{L},xrightmargin=10cm] |
| 494 |
\begin{kblock} |
| 495 |
\kJumpCS{fspt} |
| 496 |
|
| 497 |
% blks |
| 498 |
\kTFBelow[0.5cm]{fspt}{plt}{\kmT{P(s)}} |
| 499 |
\kTFBelow[0cm]{plt}{pidcm}{ |
| 500 |
\textbf{PID closed-loop model}\\ |
| 501 |
$ |
| 502 |
\begin{array}{c} |
| 503 |
\bm{\dot{x}_m=\mathcal{S}({x_m},{r})} |
| 504 |
\end{array} |
| 505 |
$ |
| 506 |
} |
| 507 |
\kTFBelow[0.33cm]{pidcm}{tscalc} |
| 508 |
{\kmT{f_{\omega_n}(\cdot)}} |
| 509 |
\kTFBelow[0.33cm]{tscalc}{fis}{\kmT{f_{x_s}(\cdot)}} |
| 510 |
\kTFBelow[0.2cm]{fis}{pid}{ |
| 511 |
\textbf{PID Control Law}\\ |
| 512 |
\kmT{u = f_{pid}(\cdot)} |
| 513 |
} |
| 514 |
\kTFRight[2.5cm]{tscalc}{obs}{ |
| 515 |
\textbf{State Observer}\\ |
| 516 |
$ |
| 517 |
\begin{array}{c} |
| 518 |
\bm{\hat{\dot{x}}=\mathcal{S}(\hat{x},{r})}\\ |
| 519 |
\end{array} |
| 520 |
$ |
| 521 |
} |
| 522 |
|
| 523 |
% links |
| 524 |
\kInDown[-0.4cm]{pid}{cp}{\kmT{\lambda_p}}{-0.6cm} |
| 525 |
\kInDown[-0.4cm]{pid}{ci}{\kmT{\lambda_i}}{0.6cm} |
| 526 |
\kInDown[-0.2cm]{pid}{cd}{\kmT{\lambda_d}}{0cm} |
| 527 |
\kLinkHVHLeft[2cm]{\kmT{u}}{pid}{plt}{0cm}{0cm}{} |
| 528 |
\kLinkHV[\kmT{y}]{plt}{obs}{0cm}{0cm}{1}{} |
| 529 |
\kLinkVH[\kmT{\hat{x}}]{obs}{pid}{-0.1cm}{0cm}{3}{} |
| 530 |
\kLinkHVHRight[]{\kmT{{x}_m}}{pidcm}{pid}{0cm}{0.1cm} |
| 531 |
\kLink[$\bm{\omega_n}$]{tscalc}{pidcm} |
| 532 |
\kLink[$\bm{x_s}$]{fis}{tscalc} |
| 533 |
\kLink[$\bm{b,c}$]{pid}{fis} |
| 534 |
\kMarkNodeAbove{-0.5cm}{0cm}{}{tscalc}{mkwn} |
| 535 |
\kLinkHV[]{mkwn}{pid}{0cm}{1cm}{0cm}{} |
| 536 |
\kMarkNodeAbove{-0.5cm}{0cm}{}{fis}{mkxts} |
| 537 |
\kLinkHV[]{mkxts}{pid}{0cm}{0.8cm}{0}{} |
| 538 |
\kInLeftM[0cm]{pidcm}{rin}{$\bm{r}$}{-0.15cm}{3} |
| 539 |
\kOutLeft[0cm]{pidcm}{umout}{$\bm{u_m}$}{0.15cm} |
| 540 |
\kInLeftM[0.2cm]{tscalc}{tsl}{$\bm{t_s,t_l}$}{0cm}{6} |
| 541 |
\kMarkNodeRight{-0.84cm}{0cm}{}{tsl}{mktsl} |
| 542 |
\kLinkVH[]{mktsl}{pid}{0.15cm}{0cm}{0}{} |
| 543 |
\kMarkNodeBelow{0cm}{0cm}{}{obs}{mkxhat} |
| 544 |
\kLinkHV[]{mkxhat}{obs}{0cm}{-0.5cm}{0}{} |
| 545 |
\end{kblock} |
| 546 |
\end{SideBySideExample} |
| 547 |
|
| 548 |
\pagebreak |
| 549 |
%% API |
| 550 |
\spacetweak\spacetweak |
| 551 |
\section{\kblocks{} API} |
| 552 |
\bfseries TODO ... |
| 553 |
%\begin{apilist} |
| 554 |
%\cvhd{Place an invisible Node at origin, as reference point} |
| 555 |
%\begin{cvl} |
| 556 |
%\kJumpCS{current coordinate label} |
| 557 |
%\end{cvl} |
| 558 |
% |
| 559 |
%\cvhd{Place Node with variable x-y coordinate shift} |
| 560 |
%\begin{cvl} |
| 561 |
%\kMarkNodeLeft{node x distance shift}{node y distance shift} |
| 562 |
%{node text-label}{from node label}{to node or current node label} |
| 563 |
% |
| 564 |
%\kMarkNodeRight{node x distance shift}{node y distance shift} |
| 565 |
%{node text-label}{from node label}{to node or current node label} |
| 566 |
% |
| 567 |
%\kMarkNodeAbove{node x distance shift}{node y distance shift} |
| 568 |
%{node text-label}{from node label}{to node or current node label} |
| 569 |
% |
| 570 |
%\kMarkNodeBelow{node x distance shift}{node y distance shift} |
| 571 |
%{node text-label}{from node label}{to node or current node label} |
| 572 |
%\end{cvl} |
| 573 |
% |
| 574 |
%\cvhd{Place a Node at a specific coordinate} |
| 575 |
%\begin{cvl} |
| 576 |
%\kMarkNode{optional x distance shift}{optional y distance shift} |
| 577 |
%{node label}{current node coordinate} |
| 578 |
%\end{cvl} |
| 579 |
% |
| 580 |
%\cvhd{Arithmetic Summer Blocks} |
| 581 |
%\begin{cvl} |
| 582 |
%\kPlusPlusMinus{from node label}{to current sum node label} |
| 583 |
%{optional horizontal position shift} |
| 584 |
%\end{cvl} |
| 585 |
% |
| 586 |
%\cvhd{Transfer-Function block} |
| 587 |
%\begin{cvl} |
| 588 |
%\kTFRight[optional shift dimension]{from node label} |
| 589 |
%{to current tf node label}{tf text content} |
| 590 |
%\end{cvl} |
| 591 |
% |
| 592 |
%\cvhd{Scalar Link (arrowed) and Linkn (no arrow)} |
| 593 |
%\begin{cvl} |
| 594 |
%\kLink[optional signal label]{from node label}{to node label} |
| 595 |
% |
| 596 |
%\kLinkn[optional signal label]{from node label}{to node label} |
| 597 |
%\end{cvl} |
| 598 |
% |
| 599 |
% |
| 600 |
%\cvhd{Output Link from a node point} |
| 601 |
%\begin{cvl} |
| 602 |
%\kOutRight[optional distance shift]{from node label} |
| 603 |
%{to current node label}{out signal label}{direction shift} |
| 604 |
%\end{cvl} |
| 605 |
% |
| 606 |
% |
| 607 |
%\cvhd{Scalar Link Full Feedback/FeedForward Vertical (Up or Down) to Horizontal (Right or Left) to Vertical (Up or Down)} |
| 608 |
%\begin{cvl} |
| 609 |
%\kLinkVHHVBelow[optional link shift]{unity link label} |
| 610 |
%{from node{to node}{from node direction shift}{to node direction shift} |
| 611 |
% |
| 612 |
%\kLinkVHHVAbove[optional link shift]{unity link label} |
| 613 |
%{from node}{to node}{from node direction shift}{to node direction shift} |
| 614 |
%\end{cvl} |
| 615 |
% |
| 616 |
% |
| 617 |
% |
| 618 |
% |
| 619 |
%\end{apilist} |
| 620 |
\spacetweak\spacetweak |
| 621 |
|
| 622 |
|
| 623 |
|
| 624 |
|
| 625 |
\end{document} |