I want to draw a control system diagram like the one below:
So far the closest guide I have found where I could draw something like this is here.
But it doesnt show me how to place text like "irdref" (in the picture) at the beginning of a line.
And also How to make lines bend.
How do I accomplish this?
The code I have so far is:
\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\begin{document}
\tikzstyle{block} = [draw, fill=blue!20, rectangle,
minimum height=3em, minimum width=6em]
\tikzstyle{sum} = [draw, fill=blue!20, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,black}]
% 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=ID_STAR] {}; %ID*
\node [input, below of=ID_STAR,, node distance=2cm, name=ID] {}; %ID
\node [sum, right of=ID_STAR] (ID_SUM) {};
\node [block, right of=ID_SUM] (VD_GSC) {$VDGSC$}; %place PI block to the right of the summation symbol
\node [sum, right of=VD_GSC, node distance=2cm] (VD_SUM) {};
\node [output, right of=VD_SUM] (output1) {};
% We draw an edge between the controller and VD_SUM block to
% calculate the coordinate u. We need it to place the measurement block.
%\draw [->] (VD_GSC) -- node[name=u] {$u$} (VD_SUM);
%Place the gain blocks
\node [block, below of=VD_GSC] (Lgq) {Lg}; %gain Lg for the Iq current
\node [block, below of=Lgq] (Lgd) {Lg}; %gain Lg for the Id current
%Now place the inputs for these gain blocks
\node [input, left of=Lgq, name=IQLg] {}; %IQ
\node [input, left of=Lgd, name=IDLg] {}; %ID
%Place the Pi ccontoller for the q axis
\node [block, below of=Lgd] (VQ_GSC) {$VQGSC$};
%Place the summing juction for the Q axis PI controller
\node [sum, left of=VQ_GSC, node distance=2cm] (IQ_SUM) {};
%Place the inputs for IQsum
\node [input, left of=IQ_SUM, name=IQ_STAR] {}; %IQSTAR
\node [input, below of=IQ_STAR, name=IQ] {}; %IQ
%Place the voltage summing junction for the Q axis
\node [sum, right of=VQ_GSC, node distance=2cm] (IQ_SUM) {};
%Place the output for the q axis voltage output
\node [output, right of=IQ_SUM] (VQ_GSC) {};
%Now connect them together
%Connect IDSTAR (ID reference)
\draw [draw,->] (ID_STAR) -- node {$I_d^*$} (ID_SUM);
%Connect ID (ID reference)
\draw [draw,->] (ID) -- node {$I_d$} (ID_SUM);
% Once the nodes are placed, connecting them is easy.
%\draw [draw,->] (input) -- node {$r$} (sum);
%\draw [->] (sum) -- node {$e$} (controller);
%\draw [->] (VD_SUM) -- node [name=y] {$y$}(output);
%\draw [->] (y) |- (Lgq);
%\draw [->] (Lgq) -| node[pos=0.99] {$-$}
%node [near end] {$y_m$} (sum);
\end{tikzpicture}
\end{document}
Best Answer
edit: improved version of above mwe by considering answer of Mark Wibrow:
result differ from the the above example in added
-
signs at summators:let me emphasize, that defined
\tikset
you can use in any picture with control or similar schemes in your documents. advantages of it is, that using it all pictures you achieved:CNTRL
style