Controlling large-scale particle or robot systems is challenging because of their high dimensionality. We use a centralized stochastic approach that allows for optimal control at the cost of a central element instead of a decentralized approach. Previous works are often restricted to the assumption of fully actuated robots. Here we propose an approach for underactuated robots that allows for energy-efficient control of the robot system. We consider a simple task of gathering the robots (minimizing positional variance) and steering them towards a goal point within a bounded area without obstacles. We make two main contributions. First, we present a generalized coordinate transformation for underactuated robots, whose physical properties should be considered. We choose Euler- Lagrange systems that describe a large class of robot systems. Second, we propose an optimal control mechanism with the prime objective of energy efficiency. We show the feasibility of our approach in numerical simulations and robot simulations.