Step 1: Find the critical points by setting the first derivative to zero.
To find the locations of local extrema, we first compute the derivative of $f(x)$. \[ f'(x) = \frac{d}{dx}(2x^3-9ax^2+12a^2x+1) = 6x^2 - 18ax + 12a^2. \] Set $f'(x)=0$ to find the critical points: \[ 6x^2 - 18ax + 12a^2 = 0. \] Divide the entire equation by 6: \[ x^2 - 3ax + 2a^2 = 0. \] Factoring the quadratic gives $(x-a)(x-2a)=0$. The critical points are $x=a$ and $x=2a$.
Step 2: Use the second derivative test to classify the critical points.
Compute the second derivative: \[ f''(x) = \frac{d}{dx}(6x^2 - 18ax + 12a^2) = 12x - 18a. \] Evaluate $f''(x)$ at each critical point. At $x=a$: $f''(a) = 12(a) - 18a = -6a$. Since we are given $a>0$, $f''(a)$ is negative, which indicates a local maximum. At $x=2a$: $f''(2a) = 12(2a) - 18a = 24a - 18a = 6a$. Since $a>0$, $f''(2a)$ is positive, which indicates a local minimum.
Step 3: Apply the given condition $p^2=q$.
From our analysis, the local maximum occurs at $p=a$. The local minimum occurs at $q=2a$. Substitute these into the given condition: \[ (a)^2 = 2a. \]
Step 4: Solve for a.
\[ a^2 - 2a = 0 \implies a(a-2) = 0. \] The possible solutions are $a=0$ or $a=2$. The problem specifies that $a>0$, so we must choose the solution $a=2$. \[ \boxed{a=2}. \]
