High speed atomic force microscopy can provide the possibility of many new scientific observations and applications ranging from nano-manufacturing to the study of biological processes. However, the limited imaging speed has been an imperative drawback of the atomic force microscopes. One of the main reasons behind this limitation is the excitation of the AFM dynamics at high scan speeds, severely undermining the reliability of the acquired images. In this research, we propose a piezo based, feedforward controlled, counter actuation mechanism to compensate for the excited out-ofplane scanner dynamics. For this purpose, the AFM controller output is properly filtered via a linear compensator and then applied to a counter actuating piezo. An effective algorithm for estimating the compensator parameters is developed. The information required for compensator design is extracted from the cantilever deflection signal, hence eliminating the need for any additional sensors. The proposed approach is implemented and experimentally evaluated on the dynamic response of a custom made AFM. It is further assessed by comparing the imaging performance of the AFM with and without the application of the proposed technique and in comparison with the conventional counterbalancing methodology. The experimental results substantiate the effectiveness of the method in significantly improving the imaging performance of AFM at high scan speeds.