An uncertain Lagrangian dynamic controlled plant with PMDC-actuator, governed by a system of ordinary differential equations, is treated. The state variables (generalized coordinates and their velocities) are assumed to be measurable. The controller design is based on Sliding Mode concept, aimed to minimize a given convex (not obligatory strongly convex) function of the current state. The sub-gradient of this cost function is supposed to be measurable on-line. An optimization type algorithm is developed and analyzed using ideas of the averaged sub-gradient technique. The main results consist in proving the reachability of the "practical desired regime" (nonstationary analogue of sliding surface) from the beginning of the process and obtaining an explicit upper bound for the cost function decrement, that is, a functional convergence is proven and the rate of convergence is estimated. Numerical example, dealing with a robot manipulator of three freedom degrees illustrates the effectiveness of the suggested approach.