A surgical instrument comprising: (a) a body assembly that includes a motor unit; (b) a shaft assembly extending distally from the body assembly; (c) an anvil; and (d) a stapling head assembly positioned at a distal end of the shaft assembly, wherein the stapling head assembly comprises: (i) at least one annular array of staples, (ii) a staple driver configured to drive the at least one annular array of staples against the anvil to deform the staples, and (iii) a trocar comprising: a shaft defining a longitudinal axis, an actuating feature coupled with the motor unit, and at least one coupling feature (812, 814), wherein the motor unit is configured to actuate the actuating feature to move the at least one coupling feature (812, 814) of the trocar in a transverse direction relative to the longitudinal axis of the shaft between a contracted position and an expanded position, wherein in the contracted position the shaft of the trocar is configured to move along the longitudinal axis relative to the anvil, wherein in the expanded position the shaft of the trocar is configured to move together with the anvil along the longitudinal axis. (a) a body assembly that includes a motor unit; (b) a shaft assembly extending distally from the body assembly; (c) an anvil; and (d) a stapling head assembly positioned at a distal end of the shaft assembly, wherein the stapling head assembly comprises: (i) at least one annular array of staples, (ii) a staple driver configured to drive the at least one annular array of staples against the anvil to deform the staples, and (iii) a trocar comprising: a shaft defining a longitudinal axis, an actuating feature coupled with the motor unit, and at least one coupling feature (812, 814), wherein the motor unit is configured to actuate the actuating feature to move the at least one coupling feature (812, 814) of the trocar in a transverse direction relative to the longitudinal axis of the shaft between a contracted position and an expanded position, wherein in the contracted position the shaft of the trocar is configured to move along the longitudinal axis relative to the anvil, wherein in the expanded position the shaft of the trocar is configured to move together with the anvil along the longitudinal axis. (i) at least one annular array of staples, (ii) a staple driver configured to drive the at least one annular array of staples against the anvil to deform the staples, and (iii) a trocar comprising: a shaft defining a longitudinal axis, an actuating feature coupled with the motor unit, and at least one coupling feature (812, 814), wherein the motor unit is configured to actuate the actuating feature to move the at least one coupling feature (812, 814) of the trocar in a transverse direction relative to the longitudinal axis of the shaft between a contracted position and an expanded position, wherein in the contracted position the shaft of the trocar is configured to move along the longitudinal axis relative to the anvil, wherein in the expanded position the shaft of the trocar is configured to move together with the anvil along the longitudinal axis. a shaft defining a longitudinal axis, an actuating feature coupled with the motor unit, and at least one coupling feature (812, 814), wherein the motor unit is configured to actuate the actuating feature to move the at least one coupling feature (812, 814) of the trocar in a transverse direction relative to the longitudinal axis of the shaft between a contracted position and an expanded position, wherein in the contracted position the shaft of the trocar is configured to move along the longitudinal axis relative to the anvil, wherein in the expanded position the shaft of the trocar is configured to move together with the anvil along the longitudinal axis.