Latex course for IAS IEEE branch
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
1.5 KiB

  1. \documentclass{article}
  2. \usepackage{tikz}
  3. \usetikzlibrary{shapes,arrows}
  4. \begin{document}
  5. % 1:
  6. \tikzstyle{block} = [draw, fill=gray!20, rectangle,
  7. minimum height=3em, minimum width=6em]
  8. \tikzstyle{sum} = [draw, fill=gray!20, circle, node distance=1cm]
  9. \tikzstyle{input} = [coordinate]
  10. \tikzstyle{output} = [coordinate]
  11. \tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
  12. % The block diagram code is probably more verbose than necessary
  13. \begin{tikzpicture}[auto, node distance=2cm,>=latex']
  14. %2: We start by placing the blocks
  15. \node [input, name=input] {};
  16. \node [sum, right of=input] (sum) {};
  17. \node [block, right of=sum] (controller) {Controller};
  18. \node [block, right of=controller, pin={[pinstyle]above:Disturbances},
  19. node distance=3cm] (system) {System};
  20. %3: We draw an edge between the controller and system block to
  21. % calculate the coordinate u. We need it to place the measurement block.
  22. \draw [->] (controller) -- node[name=u] {$u$} (system);
  23. \node [output, right of=system] (output) {};
  24. \node [block, below of=u] (measurements) {Measurements};
  25. %4: Once the nodes are placed, connecting them is easy.
  26. \draw [draw,->] (input) -- node {$r$} (sum);
  27. \draw [->] (sum) -- node {$e$} (controller);
  28. \draw [->] (system) -- node [name=y] {$y$}(output);
  29. \draw [->] (y) |- (measurements);
  30. \draw [->] (measurements) -| node[pos=0.99] {$-$}
  31. node [near end] {$y_m$} (sum);
  32. \end{tikzpicture}
  33. \end{document}