We investigate a mathematical model of tapping mode atomic force microscopy (AFM), which includes surface interaction via both van der Waals and meniscus forces. We also take particular care to include a realistic representation of the integral control inherent to the real microscope. Varying driving amplitude, amplitude setpoint and driving frequency independently shows that the model can capture the qualitative features observed in AFM experiments on a flat sample and a calibration grid. In particular, the model predicts the onset of an instability, even on a flat sample, in which a large-amplitude beatingtype motion is observed. Experimental results confirm this onset and also confirm the qualitative features of the dynamics suggested by the simulations. The simulations also suggest the mechanism behind the beating effect; that the control loop over-compensates for sufficiently high gains. The mathematical model is also used to offer recommendations on the effective use of AFMs in order to avoid unwanted artefacts.