This paper proposes a new control design to compensate for the residual control error from charge feedback control. A part of the applied voltage is consumed by the hysteresis effect because of the nature of the piezoelectric material; moreover, this effect is difficult to overcome because it is rate dependent. This work utilizes a piezoelectric electromechanical model to propose a precompensation algorithm for a piezoelectric actuator. A nonlinear compensator can be used to treat both the hysteresis nonlinearity and the rate dependency of the system, and the adjustable parameters are specified through adaptive identification with only basic system information. The proposed design can position a piezoelectric stage with a magnifying mechanism within a few nanometers of a target, and the leftover hysteresis phenomenon is negligible.