Arm code update including closed-form solution and toggling joysticks