My code is:
%\documentclass{article}
\documentclass[border=3mm]{standalone}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usepackage{verbatim}
\usepackage[utf8]{inputenc}
\begin{document}
\tikzstyle{block} = [draw, fill=blue!20, rectangle,minimum height=3em, minimum width=4em]
\tikzstyle{block2} = [draw, fill=white!20, rectangle,minimum height=3em, minimum width=4em]
\tikzstyle{block3} = [draw, fill=green!20, rectangle,minimum height=3em, minimum width=4em]
\tikzstyle{sum} = [draw, fill=white!20, circle, node distance=1.5cm]
\tikzstyle{sum1} = [draw, fill=white!20, circle, node distance=1.5cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]
\tikzstyle{pinstyle} = [pin edge={to-,thin,white}]
% The block diagram code is probably more verbose than necessary
\begin{tikzpicture}[auto,node distance=3.0cm,>=latex']
% We start by placing the blocks
\node [input, name=input]{};
\node [sum, right of=input] (sum){$\Sigma$};
\node [block, right of=sum,pin={[pinstyle]below:\scriptsize Controlador PI 1}, node distance = 2.5cm](controlador1){$K_{pv}+\frac{K_{iv}}{s}$};
\node [sum1, right of=controlador1,node distance = 2.5cm] (sum1){$\Sigma$};
\node [block, right of=controlador1,pin={[pinstyle]below:\scriptsize Controlador PI 2}, node distance = 5cm](controlador2){$K_{pi}+\frac{K_{ii}}{s}$};
\node [block2, right of=controlador2,pin={[pinstyle]below:\scriptsize Planta de Corrente}, node distance = 3cm](planta1){$G_i(s)$};
\node [block2, right of=planta1,pin={[pinstyle]below:\scriptsize Planta de Tensão}, node distance = 3cm](planta2){$G_v(s)$};
% calculate the coordinate vpwm. We need it to place the ems block.
\draw [->] (controlador2) -- node[name=vpwm] {$d$} (planta1);
\node [output, right of=planta2,node distance=2.8cm] (output) {};
\node [block3, below of=sum1,pin={[pinstyle]below:\scriptsize }] (ems) {$Energy\ Management\ System$};
%connect the nodes
\draw [draw, ->](input) -- node {$V_{ref}$}(sum);
\path [->] (sum) edge node {$V_{err}$} (controlador1);
\path [->] (controlador1) edge node {$I^*_{batt}$}(sum1);
\path [->] (sum1) edge node {$I_{err}$}(controlador2);
\path [->] (controlador2) edge node {}(planta1);
\path [->] (planta1)edge node {$I_{bat}$}(planta2) node[pos=0.95]{$+$};
\path [->] (planta2) edge node [name=theta] {$V_{DC}$}(output);
\draw [->] (theta) |- (ems);
\draw [->] (ems) -| node[pos=0.99] {$-$}
node [near end] {$V_{med}$} (sum);
\end{tikzpicture}
\end{document}
The result I desire is:




\tikzstyleagain? – Jun 29 '18 at 19:57