Control: control action of a PID controller with feedback

I'm programming the controller for a drone and I've got a question that may be basic, but I need to understand this perfectly to continue with the most interesting part of the project.

The sensors of my drone give me the position (x,y,z) and orientation (quaternion: x,y,z,w) of the drone, and I need to control the altitude of the drone, so I need to control the velocity in the z coordinate because that velocity is send to a topic of my drone (for those who use ROS, to the cmd_vel topic) and changing the velocity I can control the altitude.

So, basically the input of the controller is the desired position of the drone, then I have a PID controller and the plant (unknown model, so I have to "guess" the parameters of the PID), and the feedback is the current position.

Which would be the output of the controller (I mean, the $$u_k$$, with the discrete model of the PID that is the input of the plant)? Is it a position or a velocity? If it is a position, then I can do something like: (position_current - position_before)/timestep. But I don't know what is theoretically correct, because maybe I can find some $$k_p$$, $$k_i$$ and $$k_d$$ to have the desired velocity as the output.

Thanks :D

Edit: this is basically the model I'm using • If that's the interface to your drone, there's a good chance there's already a PID controller wrapped around the velocity. In that case, there's absolutely no reason to have a PID controller of your own -- you just want a proportional controller. Dec 13 '19 at 21:45
• Supposing that you measure the position of your plant (drone) and feeding a desired position as a reference signal, you can control the position and not the velocity. So, the output of the controller is based on the position error. The control signal indicates the input voltage to the motors. If, for example, you have servo motors attached to the drone, then the control signal would be the duty cycle for the pwm signals. Same would be with dc motors. Apr 12 '20 at 14:10

• OK, but the output of the controller ($u_k$) is what feeds the plant (remember that the model of the plant is unknown). Imagine that I only want to control the velocity of the z coordinate of the drone. The control action $u_k$ would be the new z velocity or the new z position or what? Nov 18 '18 at 18:32
• I added an image in the main post with the controller model that I'm using. So what is $u_k$? Can I search for $k_p$, $k_i$ and $k_d$ like $u_k$ is the new z velocity or is it a position? Nov 18 '18 at 18:59
• (wanted to fix a typo in my last comment, but accidentally deleted my comment before that) If $u_k$ would be a position then that would imply that the plant is a gain of one. If $u_k$ would be a velocity then that would imply that the plant is an integrator. Both of these imply knowing what the plant, but you claim that the plant is unknown, which is a contradiction. Nov 18 '18 at 20:57