A surgical device including: a handle assembly including a controller and a motor; an adapter assembly including: a tubular housing having a proximal end portion configured to couple to the handle assembly and a distal end portion; and an actuation assembly configured to couple to the motor; a reload configured to couple to the distal end portion of the adapter assembly; and an anvil assembly including an anvil head pivotally coupled to an anvil shaft, the anvil assembly configured to couple to the actuation assembly and the reload, wherein the controller is configured to control the motor to actuate the actuation assembly to move the anvil assembly in a distal direction for a distance based on a dimension of one of the reload or the anvil head, thereby pivoting the anvil head relative to the anvil shaft, wherein the controller includes a memory storing a plurality of distance values; and wherein the reload includes a storage device storing a dimension value of one of the reload or the anvil head; and wherein the controller is configured to access the storage device to read the dimension value; and wherein the controller is configured to select one distance value from the plurality of distance values based on the dimension value; and wherein the controller is configured to control the motor based on the selected distance value. a handle assembly including a controller and a motor; an adapter assembly including: a tubular housing having a proximal end portion configured to couple to the handle assembly and a distal end portion; and an actuation assembly configured to couple to the motor; a tubular housing having a proximal end portion configured to couple to the handle assembly and a distal end portion; and an actuation assembly configured to couple to the motor; a reload configured to couple to the distal end portion of the adapter assembly; and an anvil assembly including an anvil head pivotally coupled to an anvil shaft, the anvil assembly configured to couple to the actuation assembly and the reload, wherein the controller is configured to control the motor to actuate the actuation assembly to move the anvil assembly in a distal direction for a distance based on a dimension of one of the reload or the anvil head, thereby pivoting the anvil head relative to the anvil shaft, wherein the controller includes a memory storing a plurality of distance values; and wherein the reload includes a storage device storing a dimension value of one of the reload or the anvil head; and wherein the controller is configured to access the storage device to read the dimension value; and wherein the controller is configured to select one distance value from the plurality of distance values based on the dimension value; and wherein the controller is configured to control the motor based on the selected distance value. wherein the controller includes a memory storing a plurality of distance values; and wherein the reload includes a storage device storing a dimension value of one of the reload or the anvil head; and wherein the controller is configured to access the storage device to read the dimension value; and wherein the controller is configured to select one distance value from the plurality of distance values based on the dimension value; and wherein the controller is configured to control the motor based on the selected distance value.