The photovoltaic power generation, as the effective complement of the existing grid, usually adopts the on-grid method,which needs to solve the frequency and phase tracking problem; otherwise, once the frequency and phase of the electric energy in the photovoltaic power generation system are different from those in the grid, the solar power will become an interference source of the existing grid. In the on-grid photovoltaic power generation simulate system, use a DC power supply and a resistance to simulate solar cells. The microcontroller outputs SPWM signals to control the status of the high-frequency power tubes in the inverter circuit,thus changing the DC energy power into AC power with the same frequency and phase of the grid. On the other hand, because the light and temperature will affect the outputting features of the solar cells, usually we require the solar cells work at the maximum power output point. In the system, we use the microcontroller to realize the maximum power point tracking algorithm. Seen from the experimental results, the quality of the output wave is good; by testing, the efficiency of the whole machine is above 80%.