3

I'll let this question open for a few more days if someone posts an interesting answer

I came across bloques library for tikz (http://www.ctan.org/tex-archive/graphics/pgf/contrib/bloques), found it quite nice but I soon noticed it was lacking some options, so I decided to rework it / extend features.

I achieved this style file so far:

\usepackage{tikz,circuitikz}
\usepgflibrary{shapes.misc}
\usetikzlibrary{calc,arrows,decorations.pathmorphing,backgrounds,positioning,fit,shadows}

\newcommand{\horizdist}{1.5cm}
\newcommand{\verticdist}{1.2cm}
\newcommand{\phasedist}{3.5cm}
\newcommand{\minheight}{0.7cm}
\newcommand{\textsize}{\footnotesize}
\newcommand{\backgroundcolor}{white}
\newcommand{\colortext}{black}
\newcommand{\linecolor}{black}
\newcommand{\dark}{0}
\newcommand{\linetype}{thick}

\newcommand{\bShadow}{\renewcommand{\dark}{1}}
\newcommand{\bColorB}[1]{\renewcommand{\backgroundcolor}{#1}}
\newcommand{\bColorT}[1]{\renewcommand{\colortext}{#1}}
\newcommand{\bColorL}[1]{\renewcommand{\linecolor}{#1}}

\newcommand{\bDownTo}[3]{
    \node[above of=#1, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linetype] (#2) -- (#1);
}

\newcommand{\bUpTo}[3]{
    \node[below of=#1, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linetype] (#2) -- (#1);
}

\newcommand{\bRightTo}[3]{
    \node[left of=#1, node distance=\horizdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linetype] (#2) -- (#1);
}

\newcommand{\bLeftTo}[3]{
    \node[left of=#1, node distance=\horizdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linetype] (#2) -- (#1);
}

\newcommand{\bPlusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin] {};   
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex,\linetype] (#1) -- (#2);          
}

\newcommand{\bPlusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);                
}

\newcommand{\bMinusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin] {};   
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex,\linetype] (#1) -- (#2);          
}

\newcommand{\bMinusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);        
}

\newcommand{\bMinusPlus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusMinus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusMinus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusPlus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of=#1, node distance= \horizdist,\linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of=#1, node distance= \horizdist, thin, draw=gray!50] {}; 
    \node [left of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of = #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bGain}[3]{
    \node [draw=\linecolor, circle, right of = #1, node distance= \horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) { \color{\colortext}\textsize{#3}}; 
    \draw [-latex, \linecolor] (#1)--(#2);
}

\newcommand{\bGainBackDown}[4]{
    \node [draw=\linecolor, circle, below right of = #1, node distance=\horizdist+.1cm, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark},anchor=west] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#2)|-(#3);
    \draw [-latex, \linecolor] (#3)-|(#1);
}

\newcommand{\bGainBackUp}[4]{
    \node [draw=\linecolor, circle, above right of = #1, node distance=\horizdist+.1cm, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark},anchor=west] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#2)|-(#3);
    \draw [-latex, \linecolor] (#3)-|(#1);
}

\newcommand{\bGainBackUpCross}[4]{
    \node [draw=\linecolor, circle, above left of = #1, node distance=\horizdist+.1cm, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark},anchor=east] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(-\horizdist/2,0) -- ($(#2)-(0,\verticdist)$) -- (#2);
}

\newcommand{\bGainBackDownCross}[4]{
    \node [draw=\linecolor, circle, below left of = #1, node distance=\horizdist+.1cm, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark},anchor=east] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(-\horizdist/2,0) -- ($(#2)+(0,\verticdist)$) -- (#2);
}

\newcommand{\bTF}[3]{       
    \node [draw=\linecolor, rectangle, right of = #1, node distance= \horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};    
    \draw [-latex, \linecolor] (#1)--(#2);
}

\newcommand{\bTFForthUpCross}[4]{
    \node [draw=\linecolor, rectangle, above right of = #1, node distance=\horizdist+.1cm, minimum height = \minheight, \linetype, fill=\backgroundcolor,drop shadow={opacity=\dark},anchor=west] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)-(0,\verticdist)$) -- (#2);
}

\newcommand{\bTFForthDownCross}[4]{
    \node [draw=\linecolor, rectangle, below right of = #1, node distance=\horizdist+.1cm, minimum height = \minheight, \linetype, fill=\backgroundcolor,drop shadow={opacity=\dark},anchor=west] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)+(0,\verticdist)$) -- (#2);
}

\newcommand{\bMarkNode}[2]{
    \node[fill=\linecolor,circle,inner sep=0pt,minimum size=.5em,right of = #1, node distance= \horizdist] (#2) {};
    \draw [\linecolor] (#1)--(#2);
}

\newcommand{\bOut}[3]{
    \node[right of=#1, node distance= \horizdist] (#2) {\color{\colortext}\textsize{#3}};
    \draw [-latex, \linecolor] (#1)--(#2);
}

I was able with this example to draw the block diagram of a RL load and it's corresponding control in synchronous reference frame (for those who know about that, but it's just for the example purpose).

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{bloquesshapes} % above sty file

\begin{document}

\begin{tikzpicture}
    \bShadow
    \node (1) at (0,0) {\color{\colortext}\textsize{$i_{sc\alpha}$}};
    \bMinusUp{1}{2}
    \bDownTo{2}{3}{$i_{s\alpha}$}
    \bMinusPlus{2}{3}
    \bTF{3}{4}{$\dfrac{1}{sl}$}
    \bMarkNode{4}{5}
    \bGainBackUp{3}{5}{6}{$r$}
    \bOut{5}{7}{$i_{s\alpha}$}
    \node (A) at (0,-\phasedist) {\color{\colortext}\textsize{$u_{s\beta}$}};
    \bMinusDown{A}{B}
    \bUpTo{B}{C}{$u_{i\beta}$}
    \bMinusMinus{B}{C}
    \bTF{C}{D}{$\dfrac{1}{sl}$}
    \bMarkNode{D}{E}
    \bGainBackDown{C}{E}{F}{$r$}
    \bOut{E}{G}{$i_{s\beta}$}
    \bGainBackUpCross{E}{3}{H}{$\omega l$}
    \bGainBackDownCross{5}{C}{8}{$\omega l$}
\end{tikzpicture}

\begin{tikzpicture}[>=stealth']
    \bShadow
    \node (1) at (0,0) {\color{\colortext}\textsize{$i_{sc\alpha}$}};
    \bMinusUp{1}{2}
    \bDownTo{2}{3}{$i_{s\alpha}$}
    \bMarkNode{2}{3}
    \bTF{3}{4}{$\frac{1+sT_n}{sT_i}$}
    \bMinusDown{4}{5}
    \bOut{5}{7}{$u_{cm\alpha}$}
    \node (A) at (0,-\phasedist) {\color{\colortext}\textsize{$i_{sc\beta}$}};
    \bMinusDown{A}{B}
    \bUpTo{B}{C}{$i_{s\beta}$}
    \bMarkNode{B}{C}
    \bTF{C}{D}{$\frac{1+sT_n}{sT_i}$}
    \bPlusUp{D}{E}
    \bOut{E}{G}{$u_{cm\beta}$}
    \bTFForthDownCross{3}{E}{H}{$\dfrac{\omega T_n}{sT_i}$}
    \bTFForthUpCross{C}{5}{8}{$\dfrac{\omega T_n}{sT_i}$}
\end{tikzpicture}

\end{document}

The graphical result is quite nice in my opinion. illustration

I would appreciate:

  • any idea on how to actually make in a simpler way the same drawing
  • a \bStartcommand who take as input a node name, a node position (x,y) and a node label (the trick has to be found for the node position)
  • a fix for the \bMarkNode (delete white space around the thick dot)
  • a less trick way for $r$ and $\omega l$ nodes (vertical alignment)
  • for more flexibility I had to increase complexity with a variable amount of arguments for the commands, something that was not present with bloques; any idea is welcome All shapes of the same kind take the same number of arguments
  • I'm guessing there's a typo in your first line. If so, you might want to correct it lest people run away screaming... ;). – cfr Jun 7 '14 at 20:42
  • damn auto-correction... thx @cfr – s__C Jun 7 '14 at 20:48
2

Ok I think I go it this time.

  • The drawing commands seems simple enough for me.
  • \bStart I don't care
  • \bMarkNode fixed with inner/outer sep
  • Vertical alignement fixed. As above right and other behave weird, I decided to do so: above/below of=, distance=\verticdist, xshift=+-\horizdist
  • More or less done.

Here is my style file at this moment:

\usepackage{tikz,circuitikz}
\usepgflibrary{shapes.misc}
\usetikzlibrary{calc,arrows,decorations.pathmorphing,backgrounds,fit,shadows}

\newcommand{\horizdist}{1.5cm}
\newcommand{\verticdist}{1.2cm}
\newcommand{\phasedist}{3.5cm}
\newcommand{\minheight}{0.7cm}
\newcommand{\textsize}{\footnotesize}
\newcommand{\backgroundcolor}{white}
\newcommand{\colortext}{black}
\newcommand{\linecolor}{black}
\newcommand{\dark}{0}
\newcommand{\linetype}{thick}

\newcommand{\bShadow}{\renewcommand{\dark}{1}}
\newcommand{\bColorB}[1]{\renewcommand{\backgroundcolor}{#1}}
\newcommand{\bColorT}[1]{\renewcommand{\colortext}{#1}}
\newcommand{\bColorL}[1]{\renewcommand{\linecolor}{#1}}

\tikzset{every node/.style={anchor=center, text centered, align=center}}

\newcommand{\bDownTo}[3]{
    \node[above of= #1, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linecolor] (#2) -- (#1);
}

\newcommand{\bDownToGain}[5]{
    \node [draw=\linecolor, circle, above of= #1, node distance= \verticdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};
    \node[above of= #2, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#4) {\textsize{#5}};
    \draw[-latex, \linecolor] (#2) -- (#1);
    \draw[-latex, \linecolor] (#4) -- (#2);
}

\newcommand{\bUpToGain}[5]{
    \node [draw=\linecolor, circle, below of= #1, node distance= \verticdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};
    \node[below of=#2, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#4) {\textsize{#5}};
    \draw[-latex, \linecolor] (#2) -- (#1);
    \draw[-latex, \linecolor] (#4) -- (#2);
}

\newcommand{\bUpTo}[3]{
    \node[below of= #1, node distance=\verticdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linecolor] (#2) -- (#1);
}

\newcommand{\bRightTo}[3]{
    \node[left of= #1, node distance=\horizdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linecolor] (#2) -- (#1);
}

\newcommand{\bLeftTo}[3]{
    \node[left of= #1, node distance=\horizdist, \linetype, fill=\backgroundcolor] (#2) {\textsize{#3}};
    \draw[-latex, \linecolor] (#2) -- (#1);
}

\newcommand{\bPlusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin] {};  
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex,\linecolor] (#1) -- (#2);         
}

\newcommand{\bPlusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);                
}

\newcommand{\bMinusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin] {};  
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex,\linecolor] (#1) -- (#2);         
}

\newcommand{\bMinusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw=gray!50, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);        
}

\newcommand{\bMinusPlus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusPlusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusMinusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusMinusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusPlusDown}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusPlusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusMinusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusMinusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusPlusUp}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusMinus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bMinusMinus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$-$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bPlusPlus}[2]{
    \node [draw=\linecolor, circle,minimum size=1.5em, right of= #1, node distance= \horizdist, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {};
    \node [draw, cross out, minimum size=1.0em, right of= #1, node distance= \horizdist, thin, draw=gray!50] {};    
    \node [left of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [above of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \node [below of= #2, node distance = 0.45em] () { \color{\colortext}\tiny{$+$}};
    \draw [-latex, \linecolor] (#1) -- (#2);            
}

\newcommand{\bGain}[3]{
    \node [draw=\linecolor, circle, right of= #1, node distance= \horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};
    \draw [-latex, \linecolor] (#1)--(#2);
}

\newcommand{\bGainForthDown}[3]{
    \node [draw=\linecolor, circle, below of= #1, node distance=\verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};
    \draw [-latex, \linecolor] (#1)|-(#2);
}

\newcommand{\bGainForthUp}[3]{
    \node [draw=\linecolor, circle, above of= #1, node distance=\verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}};
    \draw [-latex, \linecolor] (#1)|-(#2);
}

\newcommand{\bGainBackDown}[4]{
    \node [draw=\linecolor, circle, below of= #1, node distance=\verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) {\color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#2)|-(#3);
    \draw [-latex, \linecolor] (#3)-|(#1);
}

\newcommand{\bGainBackUp}[4]{
    \node [draw=\linecolor, circle, above of= #1, node distance= \verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) {\color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#2)|-(#3);
    \draw [-latex, \linecolor] (#3)-|(#1);
}

\newcommand{\bGainBackUpCross}[4]{
    \node [draw=\linecolor, circle, above of= #1, node distance= \verticdist, xshift=-\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(-\horizdist/2,0) -- ($(#2)-(0,\verticdist)$) -- (#2);
}

\newcommand{\bGainBackDownCross}[4]{
    \node [draw=\linecolor, circle, below of= #1, node distance= \verticdist, xshift=-\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(-\horizdist/2,0) -- ($(#2)+(0,\verticdist)$) -- (#2);
}

\newcommand{\bGainForthUpCross}[4]{
    \node [draw=\linecolor, circle, above of= #1, node distance= \verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)-(0,\verticdist)$) -- (#2);
}

\newcommand{\bGainForthDownCross}[4]{
    \node [draw=\linecolor, circle, below of= #1, node distance= \verticdist, xshift=\horizdist, minimum size = 1.5em, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)+(0,\verticdist)$) -- (#2);
}

\newcommand{\bTF}[3]{       
    \node [draw=\linecolor, rectangle, right of= #1, node distance= \horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}}; 
    \draw [-latex, \linecolor] (#1)--(#2);
}

\newcommand{\bTFForthDown}[3]{      
    \node [draw=\linecolor, rectangle, below of= #1, node distance= \verticdist, xshift=\horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}}; 
    \draw [-latex, \linecolor] (#1)|-(#2);
}

\newcommand{\bTFForthUp}[3]{        
    \node [draw=\linecolor, rectangle, above of= #1, node distance= \verticdist, xshift=\horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor, drop shadow={opacity=\dark}] (#2) {\color{\colortext}\textsize{#3}}; 
    \draw [-latex, \linecolor] (#1)|-(#2);
}

\newcommand{\bTFForthUpCross}[4]{
    \node [draw=\linecolor, rectangle, above of= #1, node distance= \verticdist, xshift=\horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor,drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)-(0,\verticdist)$) -- (#2);
}

\newcommand{\bTFForthDownCross}[4]{
    \node [draw=\linecolor, rectangle, below of= #1, node distance= \verticdist, xshift=\horizdist, minimum height = \minheight, \linetype, fill=\backgroundcolor,drop shadow={opacity=\dark}] (#3) { \color{\colortext}\textsize{#4}};
    \draw [-latex, \linecolor] (#1)|-(#3);
    \draw [-latex, \linecolor] (#3) -- ++(\horizdist/2,0) -- ($(#2)+(0,\verticdist)$) -- (#2);
}

\newcommand{\bMarkNode}[2]{
    \node[fill=\linecolor,circle,inner sep=0pt, outer sep=0pt, minimum size=.5em,right of = #1, node distance= \horizdist] (#2) {};
    \draw [\linecolor] (#1)--(#2);
}

\newcommand{\bJumpNode}[3]{
    \coordinate (#2) at (#3);
    \draw [\linecolor] (#1)--(#2);
}

\newcommand{\bLink}[2]{
    \draw [-latex,\linecolor] (#1)--(#2);
}

\newcommand{\bOut}[3]{
    \node[right of= #1, node distance= \horizdist] (#2) {\color{\colortext}\textsize{#3}};
    \draw [-latex, \linecolor] (#1)--(#2);
}

And 3 examples to show what can be (simply) done.

\documentclass{standalone}
\usepackage{amsmath}
\usepackage{tikz}
\usepackage{bloquesshapes} % the above .sty file

\begin{document}

\begin{tikzpicture}
    \bShadow
    \node (1) at (0,0) {\color{\colortext}\textsize{$i_{sc\alpha}$}};
    \bMinusUp{1}{2}
    \bDownTo{2}{3}{$i_{s\alpha}$}
    \bMinusPlus{2}{3}
    \bTF{3}{4}{$\dfrac{1}{sl}$}
    \bMarkNode{4}{5}
    \bGainBackUp{3}{5}{6}{$r$}
    \bOut{5}{7}{$i_{s\alpha}$}
    \node (A) at (0,-\phasedist) {\color{\colortext}\textsize{$u_{s\beta}$}};
    \bMinusDown{A}{B}
    \bUpTo{B}{C}{$u_{i\beta}$}
    \bMinusMinus{B}{C}
    \bTF{C}{D}{$\dfrac{1}{sl}$}
    \bMarkNode{D}{E}
    \bGainBackDown{C}{E}{F}{$r$}
    \bOut{E}{G}{$i_{s\beta}$}
    \bGainBackUpCross{E}{3}{H}{$\omega l$}
    \bGainBackDownCross{5}{C}{8}{$\omega l$}
\end{tikzpicture}

\begin{tikzpicture}
    \bShadow
    \node (1) at (0,0) {\color{\colortext}\textsize{$i_{sc\alpha}$}};
    \bMinusUp{1}{2}
    \bDownTo{2}{3}{$i_{s\alpha}$}
    \bMarkNode{2}{3}
    \bTF{3}{4}{$\frac{1+sT_n}{sT_i}$}
    \bMinusDown{4}{5}
    \bOut{5}{7}{$u_{cm\alpha}$}
    \node (A) at (0,-\phasedist) {\color{\colortext}\textsize{$i_{sc\beta}$}};
    \bMinusDown{A}{B}
    \bUpTo{B}{C}{$i_{s\beta}$}
    \bMarkNode{B}{C}
    \bTF{C}{D}{$\frac{1+sT_n}{sT_i}$}
    \bPlusUp{D}{E}
    \bOut{E}{G}{$u_{cm\beta}$}
    \bTFForthDownCross{3}{E}{H}{$\dfrac{\omega T_n}{sT_i}$}
    \bTFForthUpCross{C}{5}{8}{$\dfrac{\omega T_n}{sT_i}$}
\end{tikzpicture}

\begin{tikzpicture}
    \bShadow
    \node (1) at ($(0,0)+(0,\verticdist)$) {\color{\colortext}\textsize{$i_{c\alpha}$}};
    \bMinusUp{1}{2}
    \bDownTo{2}{3}{$i_{\alpha}$}
    \bMarkNode{2}{4}
    \bTFForthDown{4}{5}{$\dfrac{1}{sT_e}$}
    \bMarkNode{5}{6}
    \bGain{6}{7}{$k_{Rr}$}
    \bPlusMinusDown{7}{8}
    \coordinate[right of=4, node distance=2*\horizdist] (10);
    \bJumpNode{4}{10}{10}
    \bGain{10}{11}{$k_w$}
    \bMinusPlus{11}{12}
    \bLink{8}{12}
    \bDownToGain{12}{13}{$k_v$}{14}{$u_{i\alpha}$}
    \bOut{12}{15}{$y_{R\alpha}$}
    \node (A) at ($(0,0)+(0,-\phasedist-\verticdist)$) {\color{\colortext}\textsize{$i_{c\beta}$}};
    \bMinusDown{A}{B}
    \bUpTo{B}{C}{$i_{\beta}$}
    \bMarkNode{B}{D}
    \bTFForthUp{D}{E}{$\dfrac{1}{sT_e}$}
    \bMarkNode{E}{F}
    \bGain{F}{G}{$k_{Rr}$}
    \bPlusPlusUp{G}{H}
    \coordinate[right of=D, node distance=2*\horizdist] (J);
    \bJumpNode{D}{J}{J}
    \bGain{J}{K}{$k_w$}
    \bPlusMinus{K}{L}
    \bLink{H}{L}
    \bUpToGain{L}{M}{$k_v$}{N}{$u_{i\beta}$}
    \bOut{L}{O}{$y_{R\alpha}$}
    \bGainForthDownCross{6}{H}{9}{$k_{Ri}$}
    \bGainForthUpCross{F}{8}{I}{$k_{Ri}$}
\end{tikzpicture}

\end{document}

The visual result is the following 3 examples

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.