A surgical instrument includes a handle assembly, an elongate member, and a motor assembly. The elongate member extends from the handle assembly and defines a longitudinal axis of the surgical instrument. The motor assembly is disposed within the handle assembly and is configured to rotate the elongate member about the longitudinal axis relative to that handle assembly in response to sensed movement of the handle assembly about the longitudinal axis.