An automatic focusing and astigmatism correction system for the SEM and CTEM