19 Given the parabola $y^{2}=2 p x(p>0)$ with two moving points $A\left(x_{1}, y_{1}\right)$ and $B\left(x_{2}, y_{2}\right)$, and $O$ as the origin, $O A \perp O B$.
(1) Find the equation of the trajectory $C$ of the midpoint of segment $A B$;
(2) If the distance from a point on $C$ to the line $x-2 y+2 \sqrt{5}-p=0$ is $d$, find the minimum value of $d$.
(19) Let $y_{1}^{2}=2 p x_{1}, y_{2}^{2}=2 p x_{2}$, then $x_{1} x_{2}=\frac{1}{4 p^{2}}\left(y_{1} y_{2}\right)^{2}$. Since $O A \perp O B$, we have $x_{1} x_{2}+y_{1} y_{2}=0$. Therefore, $y_{1} y_{2}+\frac{1}{4 p^{2}}\left(y_{1} y_{2}\right)^{2}=0$, which implies $y_{1} y_{2}=-4 p^{2}$.
(1) Let the midpoint of $A B$ be $(x, y)$, then $x=\frac{x_{1}+x_{2}}{2}, y=$ $\frac{y_{1}+y_{2}}{2}$. Thus,
$$
\begin{aligned}
x & =\frac{1}{2}\left(x_{1}+x_{2}\right)=\frac{1}{4 p}\left(y_{1}^{2}+y_{2}^{2}\right) \\
& =\frac{1}{4 p}\left[\left(y_{1}+y_{2}\right)^{2}-2 y_{1} y_{2}\right] \\
& =\frac{1}{4 p}\left[4 y^{2}+8 p^{2}\right],
\end{aligned}
$$

which gives $y^{2}=p x-2 p^{2}$ as the equation of the trajectory of the midpoint.
(2)
$$
\begin{aligned}
d & =\frac{|x-2 y+2 \sqrt{5}-p|}{\sqrt{5}} \\
& =\frac{\left|\frac{1}{p}\left(y^{2}+2 p^{2}\right)-2 y+2 \sqrt{5}-p\right|}{\sqrt{5}} \\
& =\frac{\left|(y-p)^{2}+2 \sqrt{5} p\right|}{\sqrt{5} p} \geqslant 2,
\end{aligned}
$$

when $y=p$, $x=3 p, d_{\text {min }}=2$.