0
\documentclass[11pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{inputenc}
\usepackage[english,greek]{babel}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage{amsmath}
\usepackage{physics}
\usepackage{graphicx}
\usepackage{indentfirst}
\usepackage{array}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{positioning}   
\usepackage{cancel}

\usetikzlibrary{chains,
                arrows.meta,
                positioning,
                quotes,
                shapes,
                calc}
\tikzset{
block/.style={
  draw, 
  fill=blue!20, 
  rectangle, 
  minimum height=3em, 
  minimum width=1em,
  text centered, 
  text width=2cm
  },
sum/.style={
  draw, 
  fill=blue!20, 
  circle, 
  },
input/.style={coordinate},
output/.style={coordinate},
pinstyle/.style={
  pin edge={to-,thin,black}
  }
}

\begin{document}

\begin{figure}[H]

\centering

\tikzstyle{block} = [draw, rectangle, 
    minimum height=3em, minimum width=3em, fill=blue!20]
\tikzstyle{sum} = [draw, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]

\begin{tikzpicture}[auto,node distance=2cm, thick,node/.style={circle,draw}]
    % We start by placing the blocks
    \node [input, name=input] {};
    \node [input, name=velocities, above of=input] {};
    \node [sum, right of=input] (sum) {};
    \node [block, right of=sum] (controller) {\textlatin{P-Controller}};
    \node [sum, right of=controller, node distance=2cm] (vel_sum) {};
    \node [block, right of=vel_sum] (jacobian) {$\text{\textlatin{J}}^{-1}$};
    \node [block, right of=jacobian,
            node distance=2cm] (integrator) {$\int$};
    % 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=integrator] (output) {};
    \node [block, below of=vel_sum] (fwd_kin) {$\Gamma(.)$};

    % Once the nodes are placed, connecting them is easy. 
    \draw [draw,->] (input) -- node[pos=0.1] {$p_{r},\omega_{r} \ +$} (sum);
    \draw [draw,->] (velocities) -| node[pos=0.01] {$\dot{p}_r,\dot{\omega}_r$} node[pos=0.9] {$+$} (vel_sum);
    \draw [->] (sum) -- node {$e$} (controller);
    \draw [->] (controller) -- node {$+$} (vel_sum);
    \draw [->] (vel_sum) -- node {$ee_{vel}$} (jacobian);
    \draw [->] (jacobian) -- node {$\dot{q}$} (integrator);
    \draw [->] (integrator) -- node [name=q] {$q$}(output);
    \draw [->] (q) |- (fwd_kin);
    \draw [->] (fwd_kin) -| node[pos=0.99] {$-$} 
        node [near end] {$p,\omega$} (sum);
\end{tikzpicture}

\caption{Control Scheme}
\end{figure}
\end{document}

I have written the above script and I would like to modify it in a way such that the painted-black arrow appears. I have spent some time on it, can't find the proper solution and that is why I ask here. Any ideas would be appreciated.

enter image description here

2 Answers 2

2

Your MWE hase many issues:

  • picture elements styles are define twice
  • some TikZ libraries are load twice
  • why you load chains and quotes libraries and then not used them in your image code?
\documentclass[11pt]{article}
\usepackage[english,greek]{babel}
\usepackage[a4paper, total={6in, 8in}]{geometry}
\usepackage{amsmath}
\usepackage{tikz}
\usetikzlibrary{shapes,arrows}
\usetikzlibrary{arrows.meta,
                calc, chains,
                positioning,
                quotes,
                shapes,
                }
\usepackage{cancel}
\usepackage{hyperref}


\tikzset{
  arr/.style = {-{Straight Barb[scale=0.8]},semithick},
block/.style = {draw, fill=blue!20,
                minimum height=3em, minimum width=2em,},
  dot/.style = {circle, fill, inner sep=2pt, outer sep=0pt},
  sum/.style = {circle, draw, fill=blue!20},
every edge/.style = {draw, arr},
every edge quotes/.style = {auto, font=\small}
        }


\begin{document}
\begin{figure}[ht]
\centering
    \begin{tikzpicture}[
node distance=12mm and 11mm,
  start chain = going right 
                        ]
% main branch
    \begin{scope}[nodes={on chain}]
\coordinate (in-1); 
\node[sum]      (sum-1) {};
\node[block]    (cntrl) {\textlatin{P-Controller}};
\node[sum]      (sum-2) {};
\node[block]    (jacobian)   {$\mathrm{J}^{-1}$};
\node[block]    (int)   {$\int$};
\node[dot]      (dot)   {};
\coordinate (out);
    \end{scope}
\coordinate[above=of in-1] (in-2);
\node[block, below=of sum-2] (fwd_kin) {$\Gamma(\cdot)$};
% edges
\draw   (in-1)  edge["{$p_{r},\omega_{r}\ +$}"] (sum-1)
        (sum-1) edge["$e$"]                     (cntrl)
        (cntrl) edge[pos=0.9, "$+$"]            (sum-2)
        (sum-2) edge["$ee_{\mathrm{vel}}$"]     (jacobian)
        (jacobian) edge["$\dot{q}$"]            (int)
        (int)   edge[pos=0.25, "$q$"]           (out);
\draw[->]   (dot)       |- (fwd_kin);
\draw[->]   (dot)       |- (in-2 -| jacobian) -- (jacobian);
\draw[->]   (fwd_kin)   -| node[pos=0.95, left] {$-$}
                           node [near end, left] {$p,\omega$} (sum-1);
\draw[->]   (in-2)  node[above right]   {$\dot{p}_r,\dot{\omega}_r$} -|
                    node[pos=0.85,right] {$+$}   (sum-2);
\end{tikzpicture}

\caption{Control Scheme}
\end{figure}
\end{document}

enter image description here

2
\documentclass[tikz, border=1cm]{standalone}

\usetikzlibrary{chains,
                arrows.meta,
                positioning,
                quotes,
                shapes,
                calc}
\tikzset{
block/.style={
  draw, 
  fill=blue!20, 
  rectangle, 
  minimum height=3em, 
  minimum width=1em,
  text centered, 
  text width=2cm
  },
sum/.style={
  draw, 
  fill=blue!20, 
  circle, 
  },
input/.style={coordinate},
output/.style={coordinate},
pinstyle/.style={
  pin edge={to-,thin,black}
  }
}

\begin{document}

\tikzstyle{block} = [draw, rectangle, 
    minimum height=3em, minimum width=3em, fill=blue!20]
\tikzstyle{sum} = [draw, circle, node distance=1cm]
\tikzstyle{input} = [coordinate]
\tikzstyle{output} = [coordinate]

\begin{tikzpicture}[auto,node distance=2cm, thick,node/.style={circle,draw}]
    % We start by placing the blocks
    \node [input, name=input] {};
    \node [input, name=velocities, above of=input] {};
    \node [sum, right of=input] (sum) {};
    \node [block, right of=sum] (controller) {P-Controller};
    \node [sum, right of=controller, node distance=2cm] (vel_sum) {};
    \node [block, right of=vel_sum] (jacobian) {${J}^{-1}$};
    \node [block, right of=jacobian,
            node distance=2cm] (integrator) {$\int$};
    % 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=integrator] (output) {};
    \node [block, below of=vel_sum] (fwd_kin) {$\Gamma(.)$};

    % Once the nodes are placed, connecting them is easy. 
    \draw [draw,->] (input) -- node[pos=0.1] {$p_{r},\omega_{r} \ +$} (sum);
    \draw [draw,->] (velocities) -| node[pos=0.01] {$\dot{p}_r,\dot{\omega}_r$} node[pos=0.9] {$+$} (vel_sum);
    \draw [->] (sum) -- node {$e$} (controller);
    \draw [->] (controller) -- node {$+$} (vel_sum);
    \draw [->] (vel_sum) -- node {$ee_{vel}$} (jacobian);
    \draw [->] (jacobian) -- node {$\dot{q}$} (integrator);
    \draw [->] (integrator) -- node [name=q] {$q$}(output);
    \draw [->] (q) |- (fwd_kin);
    \draw [->] (fwd_kin) -| node[pos=0.99] {$-$} 
        node [near end] {$p,\omega$} (sum);
\draw[->]  (q) -- +(0,1) -| (jacobian); %added
\end{tikzpicture}
\end{document}

Block diagram

2
  • Why you define picture elements twice? The second, written in obsolete syntax \tikzstyle{...}= should be deleted.
    – Zarko
    Jul 13 at 6:12
  • When there are so many issues with OP's code, I only correct stuff until it compiles and then add the answer. Jul 13 at 10:42

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.