The principal objective of the paper is to show the importance of the Hamiltonian in control theory. Instead of using the Lagrangian formulation of electromechanical or robotic systems, our work is focused on robot dynamics by its Hamiltonian. Using the iterative Newton–Euler, we generate the local Hamiltonians and the derivative of the moments at each joint of the robot manipulator. Thus, we can apply decentralized controllers at each joint. We compare and discuss the efficiency of the controllers. We show that the performance of the sliding modes controller is more robust than that of the PD or Bang–Bang controllers.