Circuits
Firstordersystem

Description

The given code is a LaTeX document that produces a block diagram using the TikZ package. The diagram shows a closed-loop control system with a setpoint input, a feedback signal, and two blocks representing the plant and controller. The controller block is represented by a red rectangle with the transfer function Ks\frac{K}{s} and the plant block is represented by a blue rectangle with the transfer function 1Ts+1\frac{1}{Ts+1}. The setpoint input is connected to the summing junction with a blue circle representing the summing operation. The output of the plant is connected to the feedback loop, which is represented by a node with the feedback signal CC and a line connecting it to the summing junction. Finally, there is a negative feedback loop formed between the output of the feedback node and the summing junction with a line and a minus sign in the middle.

Keywords

tikz, positioning, shapes, arrows, block, controller, sum, input, output, nodes, auto, coordinate.

Source Code

Circuits

\documentclass[tikz]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows} 
 
\tikzstyle{block} = [draw, fill=blue!20, rectangle, minimum height=3em, minimum width=4em]
\tikzstyle{controller} = [draw, fill=red!20, rectangle, minimum height=3em, minimum width=4em]
\tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
 
\begin{document}
 
\begin{tikzpicture}[auto, >=latex']
% Nodes
\node [input] (input) {};
\node [sum, right = 1cm of input] (sum) {};
\node [controller, right = 1cm of sum] (system) {$\frac{K}{s}$};
\node [block, right = 1cm of system] (system2) {$\frac{1}{Ts+1}$};
\node [output, right = 2cm of system2] (output) {};
\node [input, below = 0.5cm of system] (m) {};
% Arrows
\draw [draw,->] (input) -- node {$R$} (sum);
\draw [->] (sum) -- node {} (system);
\draw [->] (system) --  (system2);
\draw [->] (system2) -- node (y) {$C$}(output);
\draw [-] (y) |- (m) {} ;
\draw [->] (m) -| node[pos=0.99] {$-$}  node [near end] {} (sum);
\end{tikzpicture}  
\end{document}
Deploy to Overleaf