servo code adapted for motor controller