Automatic voltage regultor of generator

I have make already done some work on it. I have made ac voltmeter. Which measures generator output voltage and showed it on arduino serial monitor. I want when pin of arduino works as variable dc supply and it should connected to rotor of generator for feedback when voltage of generator drops. That variable source from arduino pin give suitable voltage to rotor in order to maintain output voltage.