Controller for an artificial arm