Hello again,
That's a cute robot
Adding a controller usually gives us smoother action because it's measuring the error and giving the system the ability to update itself at a fast rate and so correct the errors before they get too large.
Here is the generalized transfer function for the PID controller:
Out=In*(s*K3+K2/s+K1+P(s))/(F(s)*(s*K3+K2/s+K1+P(s))+1)
where
P(s) is the plant,
F(s) is the feedback sensor,
K1 is the proportional gain,
K2 is the integral gain,
K3 is the derivative gain.
That equation can be simplified but then we loose some generality. As it is, we can construct any kind of controller we want like PI, PD, ID, PD, or leave it as it is for PID.
For example, to make a PI controller, eliminate all the terms that contain K3. If we did that we would get:
Out=In*(K2/s+K1+P(s))/(F(s)*(K2/s+K1+P(s))+1)
and then this can be simplified and analyzed.
We can look at an example if you like.