A surgical instrument is provided. The surgical instrument includes: a handleassembly;a jaw assembly comprising a staple cartridge containing a plurality of staplesand an anvil toform the plurality of staples upon firing; a drive assembly at least partiallylocated within thehandle and connected to the jaw assembly and the lockout mechanism; a motordisposed withinthe handle assembly and operatively coupled to the drive assembly; and acontroller operativelycoupled to the motor, the controller configured to control supply ofelectrical current to the motorand to monitor a current draw of the motor, wherein the controller is furtherconfigured toterminate the supply of electrical current to the motor in response to a rateof change of thecurrent draw indicative of a mechanical limit of at least one of the jawassembly, the driveassembly, or the motor.