A surgical instrument includes an end effector, a drive assembly operably coupled to the end effector, and a replaceable motor cartridge that includes a motor control circuit board and a motor. The surgical instrument further includes a main control circuit board including a processor and a computer-readable storage device storing program instructions, which when executed by the processor, cause the processor to detect a malfunction of the motor cartridge. The surgical instrument also includes an interface including a mechanical interface portion configured to releasably couple the motor to the drive assembly and an electrical interface portion configured to releasably couple the motor control circuit board to the main control circuit board.