A surgical device comprising: a handle assembly including: a controller ; a first motor ; and a second motor ; an adapter assembly including: a tubular housing defining a longitudinal axis having a proximal end portion configured to couple to the handle assembly, and a distal end portion ; a first actuation assembly disposed within the tubular housing and coupled to the first motor; and a second actuation assembly disposed within the tubular housing and coupled to the second motor; and an end effector configured to couple to the distal end portion of the adapter assembly, the end effector coupled to the first actuation assembly that articulates the end effector about an articulation axis that is perpendicular to the longitudinal axis, the end effector includes a flexible drive beam coupled to the second actuation assembly and movable axially by the second actuation assembly, wherein the end effector includes an anvil assembly and a cartridge assembly , wherein the flexible drive beam is configured to move axially through the anvil assembly and the cartridge assembly to pivot the anvil assembly relative to the cartridge assembly wherein the controller includes a memory and said surgical device being; characterised in that the controller is configured to maintain an initial articulation position of the end effector in response to axial movement of the flexible drive beam, wherein the controller stores the initial articulation position of the end effector in the memory, wherein the controller is further configured to adjust the first motor to compensate for a change in the initial articulation position due to movement of the flexible drive beam to maintain the initial articulation position. a handle assembly including: a controller ; a first motor ; and a second motor ; a controller ; a first motor ; and a second motor ; an adapter assembly including: a tubular housing defining a longitudinal axis having a proximal end portion configured to couple to the handle assembly, and a distal end portion ; a first actuation assembly disposed within the tubular housing and coupled to the first motor; and a second actuation assembly disposed within the tubular housing and coupled to the second motor; and a tubular housing defining a longitudinal axis having a proximal end portion configured to couple to the handle assembly, and a distal end portion ; a first actuation assembly disposed within the tubular housing and coupled to the first motor; and a second actuation assembly disposed within the tubular housing and coupled to the second motor; and an end effector configured to couple to the distal end portion of the adapter assembly, the end effector coupled to the first actuation assembly that articulates the end effector about an articulation axis that is perpendicular to the longitudinal axis, the end effector includes a flexible drive beam coupled to the second actuation assembly and movable axially by the second actuation assembly, wherein the end effector includes an anvil assembly and a cartridge assembly , wherein the flexible drive beam is configured to move axially through the anvil assembly and the cartridge assembly to pivot the anvil assembly relative to the cartridge assembly wherein the controller includes a memory and said surgical device being; characterised in that the controller is configured to maintain an initial articulation position of the end effector in response to axial movement of the flexible drive beam, wherein the controller stores the initial articulation position of the end effector in the memory, wherein the controller is further configured to adjust the first motor to compensate for a change in the initial articulation position due to movement of the flexible drive beam to maintain the initial articulation position. <EOS>