A surgical instrument and method of controlling the surgical instrument are disclosed. The surgical instrument includes a housing and an elongated shaft that extends distally from the housing and defines a first longitudinal axis. The surgical instrument also includes a firing rod disposed in the elongated shaft and a drive mechanism disposed at least partially within the housing. The drive mechanism mechanically cooperates with the firing rod to move the firing rod. A motion sensor senses a change in the electric field (e.g., capacitance, impedance, or admittance) between the firing rod and the elongated shaft. The measurement unit determines a parameter of the motion of the firing rod, such as the position, speed, and direction of the firing rod, based on the sensed change in the electric field. A controller uses the measured parameter of the motion of the firing rod to control the drive mechanism.