Error analysis of gratings in optical pickup heads