Self-tuning regulator design for nodal voltage waveform control in electrical power systems