Why did the Apollo spacecraft use both DC and AC power, requiring heavy inverters? Was it impractical to design everything to run on DC power only? Why? Are both AC and DC power still used in present day and future spacecraft designs?
There was no single DC voltage useful for the whole electronic system. A lot of different voltages were needed, for very noise sensitive systems dedicated DC sources were used to avoid interference.
Using three phase 400 Hz AC current was a well established method used in aircrafts before. Providing 400 Hz AC enabled the use of aircraft instruments within the spacecraft. A lot of weight could be saved at transformer cores by using 400 Hz instead of 50 or 60 Hz, about 87 % less. With three phase AC, very simple, robust and reliable arc free motors could be used. Instrument panel lights required AC current too. Adjusting brightness was done very simple using variacs.
To generate several DC voltages from three phase 400 Hz AC is easy and requires much less filtering than single phase 50/60 Hz AC. Filter condensators could be small if needed at all. Large mainframe computers from CDC and Cray of that time used 400 Hz three phase AC power supplies too, not only in the sixties, but also in the seventies and eighties.
The fuel cells of the Service module needed stabilisation anyway, the nominal voltage was 28 V DC, 27 to 31 V DC under normal load, but at peak power 20.5 V were possible, the inverters delivered 115 ± 2 V. For a reliable redundant design there were 3 fuel cell stacks switchable to 2 DC buses and 3 inverters switchable to 2 AC buses. A single inverter was capable to supply all AC current for the vehicle. But the inverters were not synchronized and could not be paralleled without damage. Therefore only two of the three inverters could be used simultaneously.
After separation from the SM the system used batteries within the Command Module. After Apollo 13 an extra 400 Ah battery was added to the SM.
The Shuttle also used 28 V DC from 3 fuel cell stacks, 3 DC buses and 3 inverters for 3 AC buses with 115 V 3 phase AC 400 Hz current. 3 single phase inverters were used for each 3 phase system, together 9 units.