in the loop, in order to check the correctness of the operational conditions for the controlled system. Then, an optimal-switching bangbang controlled was designed and implemented, taking into account the Pontryagin’s Maximum principle, showing a good performance for disturbance rejection, improvement of dynamical features in the response and reduction of error’s energy by mean of verification of optimality criteria. Results show that despite the fact both techniques analyzed; i.e. On-Off and bang-bang, are switching-based laws, the performance index on the optimal controller allows to obtain a cleaner shape with less energy consumption. Ongoing work includes the experimental verification of the optimal technique in laboratory.