Will this program work?

Do you think that 1 amp will be able to be supplied from 5 volt output of the Arduino?
Not a chance. But you need a current output not voltage don't you? That's a little too much in the linear domain for me.

I forgot to mention that the arduino will be supplying a current to a darlington pair which is a current amplifier which THEN will be sent to the field coils. The Darlington can give me a gain of 600 at 10volts input, I'm assuming that if the max the arduino can give me is 5 volts i can get at least a gain of 300, it states that , the max current draw of the arduino uno is 50mA on the 3.3volt output so to play it safe lets just draw 25mA.
Then the gain will be at least 150, therefore 25mA150= 3.75 amps.
lets take this even further, say that if the gain drop dramatically and is not linear to applied voltage and we only get a gain of 50. Then 25mA
50 will still give me an output of 1.25 amps.

I would sample at say 10x the frequency, take a 100 samples and pick the highest.

All this field coil stuff is out of my area I'm afraid, if you want 9v and you get 9v from 1A why not just rig up a current source that delivers 1A?

If it varies according to load or some such that's a different story and you need some control, something like

if monitoring_volts < correct_value
pwm_val += 5;
else
pwm_val -= 5;

analogueWrite (x,pwm_val);

I do need control in this experiment because the load will vary and i need to adjust for it. I see how hysteresis will complicate things because as i apply the current to the coils there will be a delay in the output and the control system needs to adjust for that. Can you point me in the right direction in how to deal with theses and other causes, because ideally i would like for the Arduino uno to compensate for these issues. Thank you for your time and effort.