The ptychographical iterative engine (or PIE) is a recently developed phase retrieval algorithm that employs a series of diffraction patterns recorded as a known illumination function is translated to a set of overlapping positions relative to a target sample. The technique has been demonstrated successfully at optical and X-ray wavelengths and has been shown to be robust to detector noise and to converge considerably faster than support-based phase retrieval methods. In this paper, the PIE is extended so that the requirement for an accurate model of the illumination function is removed.