# How to create a Position controller for a Quadrotor

I have a controller that uses Theta,Z,Psi and Phi as a command. Now I want to create a position controller so that I can command a trajectory. I have checked a similar question raised in this attached link Position Controller for a Quadrotor

But I couldn't figure out how to calculate the vx and vy in this equation: \begin{align} \hat{\phi}^d &= k_{p,y} (y-y^d) + k_{d,y} (v_y - v_y^d) + k_{i,y} \int_0^t (y-y^d) dt \\ \hat{\theta}^d &= -k_{p,x} (x-x^d) = k_{d,x} (v_x - v_x^d) - k_{i,x} \int_0^t (x-x^d) dt \end{align} Are we going to use them as one of the command input or are there other ways to calculate them from the position?