The paper deals with AC substation inverter control for power quality improvement in high speed railways. The advanced substation configuration, already proposed by the authors in previous publications, has been further improved with reference to compensator configuration, inverter control and parameter identification. The configuration is based upon a two-phase inverter, employing modular topology, with nonlinear and variable-structure control system. This solution shows a great ability in single-phase AC-supply railways for obtaining full compensation of load unbalances, constant load voltage, satisfactory power factor and reduction of both disturbances and nonlinear-load effects. The performances highly depend on both the inverter control and selection of the parameters. In this paper, useful considerations are performed, allowing to fully accomplish the power quality requirements. Numerical simulations have been performed for demonstrating the feasibility and the efficiency of the compensator action.