1

I would like to draw this block diagram, but I'm having problems with all arrows and this last block in the first row. Can someone help me?

enter image description here

Here is what I have right now.

\documentclass[border=0.2cm]{standalone}
 
% More defined colors
\usepackage[dvipsnames]{xcolor}
 
% Required package
\usepackage{tikz}

\usetikzlibrary{arrows,shapes,backgrounds,patterns,fadings,matrix,arrows,calc,
    intersections,decorations.markings,
    positioning,external,arrows.meta}
\tikzset{
    block/.style = {draw, rectangle,
        minimum height=1cm,
        minimum width=2cm},
    input/.style = {coordinate,node distance=1cm},
    output/.style = {coordinate,node distance=6cm},
    arrow/.style={draw, -latex,node distance=2cm},
    pinstyle/.style = {pin edge={latex-, black,node distance=2cm}},
    sum/.style = {draw, circle, node distance=1cm},
}
 
 
\begin{document}
 
\begin{tikzpicture}

\node[input, name=input] {};
\node[sum, right=2cm of input, line width=0.25mm,] (sum) {};
 
\node [draw,
    minimum width=2cm,
    minimum height=1.2cm,
    right=1.5cm of sum
]  (controller) {$A(s)$};

\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm,
    right=1.5cm of controller
] (system1) {$B(s)$};


\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm,
    right=1.5cm of system1
] (system) {$C(s)$};


\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm,
    right=1.5cm of system
] (system3) {$D(s)$};


\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm, 
    above = 1cm  of system1
]  (sensor) {$E(s)$};

\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm, 
    above = 1cm  of system
]  (sensor) {$F(s)$};

\node [draw,
    minimum width=2cm, 
    minimum height=1.2cm, 
    above = 1cm  of system3
]  (sensor3) {};

\draw[-stealth] (controller.east) -- (system1.west) node[midway,above]{$x$};

\draw[-stealth] (system1.east) -- (system.west) node[midway,above]{$x$};

\draw[-stealth] (system1.east) -- (system.west) node[midway,above]{$x$};

\draw[-stealth] (system.east) -- (system3.west) node[midway,above]{$x$};

 
\end{tikzpicture}
 
\end{document}

1 Answer 1

2

Welcome to TeX.SE community!

Sorry, but your sketch is not very clear, so I left out content of the far upper right node and just guess some connection between nodes.

enter image description here

At drawing above block diagram I use chains library for placing nodes in main branch of diagram and for some arrows use ext.paths.ortho library:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                calc, chains,
                ext.paths.ortho,    % defined in the tikz-ext package,
                                    % https://ctan.org/pkg/tikz-ext?lang=en
                positioning,
                quotes}
\tikzset{
    node distance = 8mm and 6mm,
      start chain = A going right,
       arr/.style = {-Straight Barb},
     block/.style = {draw, thick, minimum height=11mm, minimum width=22mm},
       dot/.style = {circle, fill, inner sep=1.2pt, node contents={}},
       sum/.style = {circle, draw, thick, inner sep=6pt, node contents={}}
        }

\begin{document}
    \begin{tikzpicture}
% main branch
    \begin{scope}[nodes = {on chain=A, join=by arr}]
\coordinate (in);
\node[sum];                 % A-2
\node[block]    {$A(s)$};
\node[block]    {$B(s)$};
\node[block]    {$C(s)$};
\node[dot];
\node[block]    {$D(s)$};
\node[dot];                 % A-7
\coordinate (out);          
    \end{scope}
    \path[draw=none]   (A-8) to["$x$"] (out);
% top branch
\node [block, above=of A-4]  (sensor1) {$E(s)$};
\node [block, above=of A-5]  (sensor2) {$F(s)$};
\node [block, above=of A-7]  (sensor3) {};
% arrows not considered in the join macro
\draw[arr]  (sensor3) edge (sensor2)
            (sensor2) edge (sensor1);

\draw[arr]  ([xshift=-3mm] sensor1.south) |-| (A-3);
\draw[arr]  ([xshift=+3mm] sensor1.south) |-| ([xshift=-3mm] A-5.north);
\draw[arr]  ([xshift=+3mm] A-5.north) |-| (sensor3);

\draw[arr]  (A-6) |-      ([yshift=-6mm] sensor3.south) 
                                r-rl    ([yshift=-2mm] sensor3.east);
\draw[arr]  (A-8) |- ([yshift=2mm] sensor3.east);

\draw[->]   (A-8) r-du (A-2);  
    \end{tikzpicture}
\end{document}

Addendum:
One more guessing with a little bit improved code:

\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{arrows.meta,
                calc, chains,
                ext.paths.ortho,    % defined in the tikz-ext package,
                                    % https://ctan.org/pkg/tikz-ext?lang=en
                positioning,
                quotes}
\tikzset{
    node distance = 8mm and 6mm,
      start chain = A going right,
       arr/.style = {-Straight Barb},
     block/.style = {draw, thick, minimum height=11mm, minimum width=22mm},
       dot/.style = {suspend join, 
                     circle, draw, fill, inner sep=1.2pt, node contents={}},         % changed
       sum/.style = {circle, draw, thick, inner sep=2pt, node contents={\huge +}}    % changed
        }
\makeatletter
\tikzset{suspend join/.code={\def\tikz@after@path{}}}   % new
\makeatother
\begin{document}
    \begin{tikzpicture}
% main branch
    \begin{scope}[nodes = {on chain=A, join=by arr}]
\coordinate (in);
\node[sum];                             % A-2
\node[block]    {$A(s)$};
\node[block]    {$B(s)$};
\node[block]    {$C(s)$};
\node[dot, join=by -];    % changed
\node[block]    {$D(s)$};
\node[dot, join=by -];    % A-7,  changed
\coordinate (out);          
    \end{scope}
    \path[draw=none]   (A-8) to["$x$"] (out);
% top branch
\node [block, above=of A-4]  (sensor1) {$E(s)$};
\node [block, above=of A-5]  (sensor2) {$F(s)$};
\node [block, above=of A-7]  (sensor3) {};
% arrows not considered in the join macro
\draw[arr]  (sensor3) edge (sensor2)
            (sensor2) edge (sensor1);

\draw[arr]  ([xshift=-3mm] sensor1.south) |-| (A-3);
\draw[arr]  ([xshift=+3mm] sensor1.south) |-| ([xshift=-3mm] A-5.north);
\draw[arr]  (sensor3) |-| ([xshift=+3mm] A-5.north);    % changed

\draw[arr]  (A-6) |-      ([yshift=-6mm] sensor3.south) 
                                r-rl    ([yshift=-2mm] sensor3.east);
\draw[arr]  (A-8) |- ([yshift=2mm] sensor3.east);

\draw[->]   (A-8) r-du (A-2);  
    \end{tikzpicture}
\end{document}

enter image description here

3
  • Hi @Zarko, thank you for your answer. It is event-triggering block that I am not sure how to draw :)
    – Andersa
    Aug 16 at 9:38
  • I can't compile this: ackage tikz Error: I did not find the tikz library 'ext.paths.ortho'. I looked for files named tikzlibraryext.paths.ortho.code.tex and pgflibraryext.paths.ortho.code.tex, but neither could be found in the current texmf trees
    – Andersa
    Aug 16 at 9:43
  • @Andersa, if you check code carefully you should notice the comment where is given link to CTAN site, where you can find package tikz-ext which define among other libraries also one used in my answer. If you not have instaled it, install it by utility of your LaTeX installation (in my case I use MiKTeX console).
    – Zarko
    Aug 16 at 10:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .