3

This is the block diagram I'm trying to draw using the TiKz package. Diagram Picture

Here is the code I have used but I don't know how I can put the \times like shape in the circles and make the circles a little larger. Can you help?

My code:

\documentclass[tikz,14pt,border=10pt]{standalone}
%%%<
\usepackage{verbatim}
%%%>
\usepackage{textcomp}
\usetikzlibrary{shapes,arrows}
\begin{document}
% Definition of blocks:
\tikzset{%
  block/.style    = {draw, thick, rectangle, minimum height = 3em,
    minimum width = 3em},
  sum/.style      = {draw, circle, node distance = 2cm}, % Adder
  input/.style    = {coordinate}, % Input
  output/.style   = {coordinate} % Output
}
% Defining string as labels of certain blocks.
        \tikzset{%
    block/.style    = {draw, thick, rectangle, minimum height = 3em,
        minimum width = 3em},
    sum/.style      = {draw, circle, node distance = 2cm}, % Adder
    input/.style    = {coordinate}, % Input
    output/.style   = {coordinate} % Output
}
\begin{tikzpicture}[auto, thick, node distance=2cm, >=triangle 45]
\draw
node at (0,0) [input, name=input1] {} 
node [sum, right of=input1] (suma1) {}
node at (5,0) [block] (G) {$\mathbf{G}(s)$}
node at (8,0) [output,name = output1con]{}
node [block, below of=G] (K) {$\mathbf{K}(s)$}
node[sum,below of=output1con](suma2){}
node [output, right of=output1con](output1){}
node [output,below of=input1](output2){}
node [input, below of=output1](input2){}
;
% Joining blocks. 
% Commands \draw with options like [->] must be written individually
\draw[->](input1) -- node[near start] {$\mathbf{u}_1(s)$}(suma1)
node[near end,below]{$+$}(suma1);
\draw[->](suma1) -- node {$\mathbf{e}_1(s)$} (G);
\draw[->](G) -- node{}(output1con) -- node[] {}(output1);
\draw[->](output1con) -- node[right,near end]{$+$}(suma2);
\draw[->](K) -| node[near end,above=4mm,left]{$+$} (suma1); 
\draw[->](suma2) -- node[above]{$\mathbf{e}_2(s)$}(K);
\draw[->](K)--node[]{}(output2);
\draw[->](input2) -- node[right=3mm, above]{$\mathbf{u}_2(s)$}(suma2) 
node[near end, above]{$+$}(suma2);
\end{tikzpicture}
\end{document}

My end results: End results

2

Using this approach to draw a circle with a cross and using the minimum size option, this would be one way to get the figure:

\documentclass[tikz,14pt,border=10pt]{standalone}
%%%<
\usepackage{verbatim}
%%%>
\usepackage{textcomp}
\usetikzlibrary{shapes,arrows}
\begin{document}
% Definition of blocks:
\tikzset{%
  block/.style    = {draw, thick, rectangle, minimum height = 3em,
    minimum width = 3em},
  sum/.style      = {draw, circle, node distance = 2cm}, % Adder
  input/.style    = {coordinate}, % Input
  output/.style   = {coordinate} % Output
}
% Defining string as labels of certain blocks.
        \tikzset{%
    block/.style    = {draw, thick, rectangle, minimum height = 3em,
        minimum width = 3em},
    cross/.style={path picture={ 
            \draw[black]
            (path picture bounding box.south east) -- (path picture bounding box.north west) (path picture bounding box.south west) -- (path picture bounding box.north east);
    }},
    sum/.style      = {draw, circle, cross, node distance = 2cm, minimum size = 3ex}, % Adder
    input/.style    = {coordinate}, % Input
    output/.style   = {coordinate} % Output
}
\begin{tikzpicture}[auto, thick, node distance=2cm, >=triangle 45]
\draw
node at (0,0) [input, name=input1] {} 
node [sum, right of=input1] (suma1) {}
node at (5,0) [block] (G) {$\mathbf{G}(s)$}
node at (8,0) [output,name = output1con]{}
node [block, below of=G] (K) {$\mathbf{K}(s)$}
node[sum,below of=output1con](suma2){}
node [output, right of=output1con](output1){}
node [output,below of=input1](output2){}
node [input, below of=output1](input2){}
;
% Joining blocks. 
% Commands \draw with options like [->] must be written individually
\draw[->](input1) -- node[near start] {$\mathbf{u}_1(s)$}(suma1)
node[near end,below]{$+$}(suma1);
\draw[->](suma1) -- node {$\mathbf{e}_1(s)$} (G);
\draw[->](G) -- node{}(output1con) -- node[] {}(output1);
\draw[->](output1con) -- node[right,near end]{$+$}(suma2);
\draw[->](K) -| node[near end,above=4mm,left]{$+$} (suma1); 
\draw[->](suma2) -- node[above]{$\mathbf{e}_2(s)$}(K);
\draw[->](K)--node[]{}(output2);
\draw[->](input2) -- node[right=3mm, above]{$\mathbf{u}_2(s)$}(suma2) 
node[near end, above]{$+$}(suma2);
\end{tikzpicture}
\end{document}
  • Thank you, This works marvelously. cheers. – Al_Fh May 1 at 12:37

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.