Fourier ptychographic microscopy (FPM) is a newly developed imaging approach for achieving wide field and high resolution. However, image quality will degraded by the pupil aberration because of the limitation of geometrical optics. In this paper, two correction algorithms of pupil aberration combining original FPM algorithm with ptychographical iterative engine (PIE) are presented and justified. And the standard coefficients of Zernike polynomial are applied for constructing the pupil aberration in the simulation. Compared to original FPM algorithm, these algorithms add constraints to the sample and the pupil during each iteration, so that the image can be reconstructed and the pupil function can be recovered simultaneously. Furthermore, we illustrate that these algorithms can not only improve robustness, but also have faster convergence under different aberrations.