是否可以在控制系统块中添加最小-最大限制例如:控制系统原理? pin edge 能做到这一点吗?
答案1
是的,您可以使用 s 来完成这项工作pin
。
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows.meta,decorations}
\pgfdeclaredecoration{strange pin}{initial}
{
\state{initial}[width=0pt,next state=final] {
\pgfpathlineto{\pgfpointadd{\pgfpointdecoratedpathlast}{\pgfpoint{0pt}{-2pt}}}
}
\state{final}
{
\pgfpathlineto{\pgfpointadd{\pgfpointdecoratedpathlast}{\pgfpoint{0pt}{-12pt}}}
}
}
\begin{document}
\tikzset{block/.style={draw, fill=blue!20, rectangle,
minimum height=3em, minimum width=6em},
sum/.style={draw, fill=blue!20, circle, node distance=1cm},
input/.style={coordinate},
output/.style={coordinate},
custom pin/.style={pin edge={solid,semithick,black,decorate,decoration={strange pin}}}}
% The block diagram code is probably more verbose than necessary
\begin{tikzpicture}[auto, node distance=2cm,>=Latex]
% We start by placing the blocks
\node [input, name=input] {};
\node [sum, right of=input] (sum) {};
\node [block, right of=sum] (controller) {Controller};
\node [block, right of=controller, pin={[custom pin]above:Disturbances},
node distance=3cm] (system) {System};
% We draw an edge between the controller and system block to
% calculate the coordinate u. We need it to place the measurement block.
\draw [->] (controller) -- node[name=u] {$u$} (system);
\node [output, right of=system] (output) {};
\node [block, below of=u, pin={[custom pin]below:duck}] (measurements) {Measurements};
% Once the nodes are placed, connecting them is easy.
\draw [draw,->] (input) -- node {$r$} (sum);
\draw [->] (sum) -- node {$e$} (controller);
\draw [->] (system) -- node [name=y] {$y$}(output);
\draw [->] (y) |- (measurements);
\draw [->] (measurements) -| node[pos=0.99] {$-$}
node [near end] {$y_m$} (sum);
\end{tikzpicture}
\end{document}