A surgical instrument is provided. The surgical instrument includes: a handle assembly; a jaw assembly comprising a staple cartridge containing a plurality of staples and an anvil to form the plurality of staples upon firing; a drive assembly at least partially located within the handle and connected to the jaw assembly and the lockout mechanism; a motor disposed within the handle assembly and operatively coupled to the drive assembly; and a controller operatively coupled to the motor, the controller configured to control supply of electrical current to the motor and to monitor a current draw of the motor, wherein the controller is further configured to terminate the supply of electrical current to the motor in response to a rate of change of the current draw indicative of a mechanical limit of at least one of the jaw assembly, the drive assembly, or the motor.