Hi Peter.
I'll talk about the switches first. I'd like two switches, A and B. When the motor powering the generator runs up, I'd like the AVR to be off initially. This is to stop the MOSFET from being permanently closed at standstill and low speeds, to prevent over voltage. I'd like the motor to spin the generator to full speed, then press switch/button A to bring in the regulation (without having to hold it down). I'd also like switch/button B, once pressed (and not having to hold it down either), to stop the regulation before the machine is stopped and allowed to run down. This is to prevent the MOSFET from attempting to increase the field strength to compensate for the machine slowing down.
I'm aware that at the point of A being pressed there will be a massive difference between demand and output, so I'm anticipating a massive rise to get the error reduced ASAP.
For control algorithms, I know a little about PID (but I'm not great at the maths behind it). I wasn't aware that a dedicated control algorithm needed to be used, which is why I mentioned incrementing or decrementing the PWM to the MOSFET gate appropriately. As I've never used P/PI/PD/PID on Arduino before, I wouldn't know how to go about tuning via the Z-N method, beyound altering the sketch every time until the response oscillates, etc.
Thanks a lot for your responses. I'll try to alter my above post with CODE tags and use them in future.