Ok, being devil's advocate ....
Why do you actually need an arduino for a 4th axis?
All you do is set mach3 up with an a axis, and set it as a rotary motion in the configuration.
Why do you need pid?
What error are you expecting to have to correct for?
What are you actually going to use the 4th axis for?
Most cnc users even with a forth axis are not actually 3d machining, but index their 4th axis, or use it as a rotary axis.... Sort of a quazi linear rotary axis motion
.. not 3d
Sorry not trying to be critical of anyone's ideas and I appologise if it reads that way.... Just trying to expand on what you plan to do or more so why?
I bought a rotary table (6" / hv6) of Chinese origin, then bought a cnc adapter for a nema 23 stepper from here
http://medw.co.uk/wiki/Rotary+Table+CNC+Options.. built the 4th axis, and discovered the backlash was well... A lot, and motion was not fast.... I kind of forgot the purpose for me which was a 4th axis for a plasma cutter... Ok... Stop... Time to do some calcs.... Then I bought a 4" Chinese 6:1 4th axis, belt drive, changed the stepper motor, and now have a very fast with fast acceleration 4th axis for the plasma (and a cnc rotary table for the mill....
http://i.ebayimg.com/images/i/251320056397-0-1/s-l1000.jpgL