1

I have looked at the LaTex code, form this post: Block Diagrams using Tikz
My question is, where can I get description of: input, sum, block,...I want to use multiplication, but I can't find anywhere the documentation of those elments.

EDIT: I got the answer where those blocks come from, now I would like to ask if there are some kind of premade block that can I import, it is really difficult for me to draw in LaTex and I don't feel capable to make my own blocks.

\tikzset{
block/.style = {draw, fill=white, rectangle, minimum height=3em, minimum width=3em},
tmp/.style  = {coordinate}, 
sum/.style= {draw, fill=white, circle, node distance=1cm},
input/.style = {coordinate},
output/.style= {coordinate},
pinstyle/.style = {pin edge={to-,thin,black}
}
}

    \begin{tikzpicture}[auto, node distance=2cm,>=latex']
        \node [input, name=rinput] (rinput) {};
        \node [sum, right of=rinput] (sum1) {};
        \node [block, right of=sum1] (controller) {$k_{p\beta}$};
        \node [block, above of=controller,node distance=1.3cm] (up){$\frac{k_{i\beta}}{s}$};
        \node [block, below of=controller,node distance=1.3cm] (rate) {$sk_{d\beta}$};
        \node [sum, right of=controller,node distance=2cm] (sum2) {};
        \node [block, above = 2cm of sum2](extra){$\frac{1}{\alpha_{\beta2}}$};  %
        \node [block, right of=sum2,node distance=2cm] (system) 
    {$\frac{a_{\beta 2}}{s+a_{\beta 1}}$};
        \node [output, right of=system, node distance=2cm] (output) {};
        \node [tmp, below of=controller] (tmp1){$H(s)$};
        \draw [->] (rinput) -- node{$R(s)$} (sum1);
        \draw [->] (sum1) --node[name=z,anchor=north]{$E(s)$} (controller);
        \draw [->] (controller) -- (sum2);
        \draw [->] (sum2) -- node{$U(s)$} (system);
        \draw [->] (system) -- node [name=y] {$Y(s)$}(output);
        \draw [->] (z) |- (rate);
        \draw [->] (rate) -| (sum2);
        \draw [->] (z) |- (up);
        \draw [->] (up) -| (sum2);
        \draw [->] (y) |- (tmp1)-| node[pos=0.99] {$-$} (sum1);
        \draw [->] (extra)--(sum2);
        \draw [->] ($(0,1.5cm)+(extra)$)node[above]{$d_{\beta 2}$} -- (extra);
        \end{tikzpicture}
  • 1
    Look again at the post to which you refer. In the MWE, each of those elements are defined using \tikzstyle (before \begin{tikzpicture}). They are not standard TikZ functions. If you are using TeX Live, you can type texdoc tikz at the command line to find the manual. – erik Mar 24 '16 at 19:14
  • @erik I see now, they are declared before, I thought they were part of Tikz. I will update the question. – Marko Buršič Mar 24 '16 at 19:21
  • @MarkoBuršič Yes, those are customized styles. Some of those carry default values and some don't. – Alenanno Mar 24 '16 at 19:47
  • @erik texdoc tikz on my TeXLive (Ubuntu 14.04) pops up the tikz-3dplot manual. Probably a packaging error, but the correct file tikzpgfmanual.pdf is not installed (nor anywhere in the packages). – Rmano Mar 25 '16 at 12:03
  • Be careful with the version you have --- 3.0 is current, but a lot of systems still ships 2.something. You have a nice resume here: tex.stackexchange.com/questions/153392/… – Rmano Mar 25 '16 at 12:06
3

If I correctly understand your question,. you actually are not interested for PI controller scheme but how to design some elements ... I will try to answer in two steps:

  • modernize your MWE with syntax which is preferable now (if you will carefully compare both solution, you will easy find differences)

  • suggest how to design some "building blocks" for drawing control schemes

First revision of your MWE:

enter image description here

 \documentclass[border=3mm,
                tikz]{standalone}
\usetikzlibrary{arrows, 
                calc,
                quotes,
                positioning,
                babel} % <--- added for
    \tikzset{
       block/.style = {rectangle, draw, %fill=white, 
                       minimum size=3em},
         tmp/.style = {coordinate},
         sum/.style = {circle, draw, minimum size=1ex, inner sep=1pt,
                       node contents={} },
         dot/.style = {sum, fill=black, minimum size=2pt,
                       node contents={} },
       input/.style = {coordinate},
      output/.style = {coordinate},
    pinstyle/.style = {pin edge={to-,thin,black}}
            }

    \begin{document}
        \begin{tikzpicture}[auto, 
    node distance = 3mm and 13mm,
                > = latex']
    \coordinate (input) at (0,0);
    \node (sum1)   [sum, right=of input];
    \node (input') [dot, right=of sum1];
    \node (cntrl)  [block, right=of input'] {$k_{p\beta}$};
    \node (up)   [block, above=of cntrl]    {$\frac{k_{i\beta}}{s}$};
    \node (rate) [block, below=of cntrl]    {$sk_{d\beta}$};
    \node (sum2) [sum, right=of cntrl];
    \node (extra)[block, 
                  above=of up.north -| sum2]     {$\frac{1}{\alpha_{\beta2}}$};  %
    \node (extra') [above=of extra]              {$d_{\beta 2}$};
    \node (system) [block, right=of sum2]        {$\frac{a_{\beta 2}}{s+a_{\beta 1}}$};
    \coordinate[right=of system] (output);
    \node [tmp, below=of cntrl] (tmp1)      {$H(s)$};
    %
    \draw[->]   (input)     to ["$R(s)$"]   (sum1) 
                (sum1)      edge["$E(s)$"]  (input')
                (input')    edge            (cntrl)
                (cntrl)     edge       (sum2)
                (sum2)      edge["$U(s)$"]  (system)
                (system)    edge["$Y(s)$"]  (output)
                (extra')    edge            (extra);
    \draw[->]   (input') |- (up);
    \draw[->]   (input') |- (rate);
    \draw[->]   (up)     -| (sum2);
    \draw[->]   (rate)   -| (sum2);
    \draw       (extra)  -- (extra |- up);
    \draw[->]   ($(system.east)!0.5!(output)$) node[dot] -- + (0,-22mm)   -| (sum1);
         \end{tikzpicture}
    \end{document}

Already here you can observe, how are designed sum and dot. Symbol for summation as well for multiplication are not standardized (actualy, they are, but rare used ...). So you need first to decide how you like to have they looks out. Below are examples of those symbols which are quite common in signal processing and in control too.

\documentclass[border=1mm,
               tikz,{standalone}
\usetikzlibrary{arrows,
                calc,
                quotes,
                positioning,
                babel}

    \begin{document}
\begin{tikzpicture}[
shorten <>/.style = {shorten >=#1, shorten <=#1},
mlt-s/.style={fill=#1,   % <-- symb. for multiplication, square
    rectangle, draw, minimum size=6mm,
    path picture={\draw[very thick,shorten <>=1.5mm]
    (path picture bounding box.north west)edge(path picture bounding box.south east)
    (path picture bounding box.south west) -- (path picture bounding box.north east);
                },% end of node contents
            node contents={}},
mlt-c/.style={fill=#1,    % <-- symb. for multiplication, circle
    circle, draw, minimum size=6mm,
    path picture={\draw[very thick,shorten <>=2mm]
    (path picture bounding box.north west)edge(path picture bounding box.south east)
    (path picture bounding box.south west) -- (path picture bounding box.north east);
                },% end of node contents
            node contents={}},
sum/.style={fill=#1,    % <-- symb. for summation
    circle, draw, minimum size=6mm,
    path picture={\draw[very thick,shorten <>=1mm]
    (path picture bounding box.north)edge(path picture bounding box.south)
    (path picture bounding box.west)  -- (path picture bounding box.east);
                },% end of node contents
            node contents={}},
                    ]
\node (a) [sum=gray!10];
\node (b) [mlt-s=gray!10,right=of a];
\node (c) [mlt-c=gray!20,right=of b];
\draw (a) -- (b);
\end{tikzpicture}
    \end{document}

Use of those symbols is demonstrated in example image. Note: since this symbols haven't any text, they are designed so, that empty text is part of node definition, consequently no empty curly braces is needed. This require, that node names should be before node definition (see code above).

enter image description here

Edit: Use of TikZ library quotes is sensitive on used babel packages. For some languages (Slovene is one of them) change catcode for quotes. To eliminate this problem is designed library babel. So, for documents in language other than English, it is sensible precaution to add it as it is now done in the both above codes.

  • Thank you, my intention is to draw various cascade loops including PI controllers and feedforward paths, but I have strated to draw a circuit where there is an multiplication. The very first question was: where to find multiplication block in Tikz, so I will mark your answer as accepted. – Marko Buršič Mar 25 '16 at 8:44
  • But when it comes to ["$R(s)$"] it gives an error – Marko Buršič Mar 25 '16 at 9:30
  • The ` ["$R(s)$"] ` is standard syntax for use of quotes library in edge labels. The presented image is generated with code in answer. Compilation doesn't give any warnings nor errors. Which version of TikZ you have? – Zarko Mar 25 '16 at 9:57
  • Paragraph ended before \language@active@arg" was complete. \draw[->] (input) to ["$R(s)$"] (sum1). I can't find version of TikZ, there are lot of files with different timestam. I installed MikTex and the packages have installed automaticly, that was three weeks ago. – Marko Buršič Mar 25 '16 at 10:15
  • I have made a new document and it is OK, I don't understand why is different if I add picture in my document. – Marko Buršič Mar 25 '16 at 10:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.