  The problem of PID type controller tuning has been addressed in this paper.
In particular, a method of selection of PD settings based on the solution of
linear-quadratic optimisation problem using the energy criterion has been
investigated. Thus, the possibility of transforming optimal settings of the
linear-quadratic regulator into the settings of the controller in the classical
control system has been given. The presented methodology has been used during
synthesis of control system for a two-wheeled balancing robot. Finally, the
performance of the proposed control system has been validated by simulation in
Matlab-Simulink environment with the use of a two-wheeled balancing robot
model.
