Sample or tip contanmanation is possibe. But for your description, it should be follow.
AFM Z axis piezo can work in a limited range. If there tip is too far away from surface, there is no feedback. It mean no signal and image is flat.Please check extend and withdraw range of Z Piezo.The normal situation is that Z piezo should stay at middle of scan range (0 volt). There are some reasons to make Z piezo extend or withdraw just after engage. If initial setting is no good, the Z piezo is force to extend or withdraw a range, then Z piezo do not have enough room to move during scanning.
Why this happened :
Becasue there is static electric force or other force interact with tip during engage. The AFM get signal and stop to engage, then start to scanning. If interaction force is very big, then engage failure. If it is small, it it possible for tip to engage ucessfully. But Z piezo will not be at center position. If there is sample tilt, you will see that the image just after scanning is ok.But image away from engage poisiton is nothing.
How to do
You can use motor up or down to force piezo back to center position just after engage.Please be advised to use smallest step size for motor setting.Otherwise the tip will be broken.
Sometimes, it is system problem. The Z feedback control is out of order, non stable. The reason is circuit. Then you need to check PC board.