Automatic voltage regulator for an alternator/synchronous generator

Please use CODE tags when posting code to stop the forum software from munging your code.

You need to decide what sort of control algorithm you are going to use. One option would be a simple proportional algorithm where the output applied more and more correction, the further the inputs were away from your desired condition. This is easy to implement but has the disadvantage that it will not completely eliminate steady state errors. Another option is to implement a rate-limited integral feedback where the controller will keep nudging the output in the right direction to eliminate the error. This is also easy to implement but has the disadvantage that it does not cope well with big transients. Another option is to implement a PID feedback algorithm. This gives a very powerful solution but has the disadvantage that you need to understand how to use PID and then go through a tuning process to use it in your application.

Turning your LEDs on and off just needs a threshold comparison.

You need to explain more clearly what your 'on'/'off' switches do i.e. are they intended to power down the alternator (does your controller have enough control authority to do that) or just stop trying to control it, or what?