This paper presents an observer-based dynamic output feedback controller design procedure using Linear Matrix Inequality (LMI) optimization for second-order systems with uncertainty and persistent perturbation in the states. Using linear-quadratic criteria, cost functions are minimized in a two-stage procedure to compute optimal state feedback gains, and observer gains are coupled into a dynamic output feedback optimal controller. The LMI set used in the two stages is matrix inversion-free, a key issue for polytope formulation when uncertainty is present. The approach is tested in a mobile inverted pendulum robotic platform, and the effectiveness is verified in this underactuated and undesensed case.