Balancing robot - Tuning

Obviously, it is not tuned correctly, or you have one or more serious program errors (wrong sign of derivative, etc.).