Using a resonant mechanism to reduce energy consumption in robotic arms