Circuits
Lagcompensation

Description

The code is a LaTeX document that uses the TikZ package to draw a control system diagram. The diagram consists of several blocks, which are defined using the tikzstyle command. The nodes in the diagram are defined using the node command. The arrows between the nodes are defined using the draw command, and the labels on the arrows are defined using the node command with the label text in curly braces. The diagram represents a control system with input Z_\reZ\_\re and output ZZ, with several intermediate components including a summing junction, two controllers, and a block representing a system with a transfer function of kms2\frac{k}{ms^2}.

Keywords

tikz, amsmath, amssymb, positioning, shapes, arrows, block, controller, sum, input, output.

Source Code

Circuits

\documentclass[tikz]{standalone}
\usepackage{amsmath,amssymb}
\usepackage{tikz}
\usetikzlibrary{positioning}
\usetikzlibrary{shapes,arrows} 
 
\begin{document}
\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{tikzpicture}[auto, >=latex']
	% Nodes
	\node [input] (input) {};
	\node [sum, right = 1cm of input] (sum) {};
	\node [controller, right = 1cm of sum] (con1) {$\frac{s+p_c}{s+z_c}$};
	\node [controller, right = 1cm of con1] (con2) {$K_D s + K_P$};
	\node [block, right = 1cm of con2] (system2) {$\frac{k}{ms^2}$};
	\node [output, right = 2cm of system2] (output) {};
	\node [input, below = 0.5cm of con2] (m) {};
	% Arrows
	\draw [draw,->] (input) -- node {$Z_\re$} (sum);
	\draw [->] (sum) -- (con1);
	\draw [->] (con1) -- (con2);
	\draw [->] (con2) -- node {$I$} (system2);
	\draw [->] (system2) -- node (y) {$Z$}(output);
	\draw [-] (y) |- (m) {} ;
	\draw [->] (m) -| node[pos=0.99] {$-$}  node [near end] {} (sum);
	\end{tikzpicture}  
\end{document}
Deploy to Overleaf