4. As shown in Figure 2, it is known that ray $O M$ and ray $O N$ are perpendicular to each other, $A$ is a point on a semicircular iron sheet with diameter $P Q$ of $6 \mathrm{~cm}$, and the degree of $\overparen{A Q}$ is $60^{\circ}$. A moving point $P$ starts sliding from point $O$ along ray $O M$, while point $Q$ slides on $O N$. When point $Q$ slides to point $O$ and stops, the distance traveled by point $A$ is $\qquad$
4. $(9-3 \sqrt{3}) \mathrm{cm}$.

In $\angle M O N$, draw ray $O B$ through point $O$ such that $\angle B O N = 30^{\circ}$. Connect $A P$ and $A Q$.
Since $P Q$ is the diameter of the semicircle, and $\overparen{A Q^{\circ}} = 60^{\circ}$, we have $\angle P A Q = 90^{\circ}$ and $\angle A P Q = 30^{\circ}$.
Therefore, $A P = P Q \cos \angle A P Q = 6 \cos 30^{\circ} = 3 \sqrt{3}(\mathrm{~cm})$, and $A Q = P Q \sin \angle A P Q = 6 \sin 30^{\circ} = 3(\mathrm{~cm})$.
(1) When point $P$ is at point $O$, point $A$ is on ray $O B$, and the distance from point $A$ to point $O$ is $3 \sqrt{3} \mathrm{~cm}$.
(2) When point $P$ is on $O M$ and $0 \mathrm{~cm} < O P < 6 \mathrm{~cm}$, connect $O A$ (as shown in Figure 10).
Since $\angle P O Q + \angle P A Q$
$$
= 180^{\circ},
$$

points $O, P, A, Q$ are concyclic.
Thus, $\angle A O Q = \angle A P Q = 30^{\circ}$, meaning point $A$ is on ray $O B$.
When $A P \perp O M$, point $A$ is farthest from point $O$. At this time, $O A = 6 \mathrm{~cm}$.
(3) When point $P$ is on $O M$ and $O P = 6 \mathrm{~cm}$, point $A$ is still on ray $O B$, and at this time, $A O = A Q = 3 \mathrm{~cm}$.

In summary, there are three points $A_{0}, A_{1}, A_{2}$ on the ray, and $O A_{0} = 3 \sqrt{3} \mathrm{~cm}, O A_{1} = 6 \mathrm{~cm}, O A_{2} = 3 \mathrm{~cm}$. Point $A$ always moves on ray $O B$. Point $A$ starts from point $A_{0}$ and moves to point $A_{1}$, then from $A_{1}$ to $A_{2}$, and stops at $A_{2}$. Therefore, the distance traveled by point $A$ is
$$
\left(O A_{1} - O A_{0}\right) + \left(O A_{1} - O A_{2}\right) = (9 - 3 \sqrt{3})(\mathrm{cm})
$$