create a new function to convert cmds to motor