The algorithm for collecting flowers in the maximum number of passes will be as follows:
\begin{enumerate}
\item On the first pass through the flower bed, the robot will collect exactly $6$ flowers, as it visits $6$ cells (marked in red in the pictures).
\item Each subsequent pass will go through exactly one new cell, so the robot will collect the next $6$ flowers in $6$ passes.
\end{enumerate}
In total, $1+6 = 7$ passes.

\begin{center}
  \includegraphics[scale=1.5]{problem_B2.png} \\
  \small{Diagram of the robot's paths from the first example in the problem statement.}
\end{center}