A particle $P$ is projected from a point $O$ on a horizontal plane and moves freely under gravity. Its initial speed is $u\,\mathrm{m\,s^{-1}}$ and its angle of projection is $\sin^{-1}\!\left(\frac{4}{5}\right)$ above the horizontal. At time $8$ seconds after projection, $P$ is at the point $A$. At time $32$ seconds after projection, $P$ is at the point $B$. The direction of motion of $P$ at $B$ is perpendicular to its direction of motion at $A$. Find the value of $u$. [7]