Active compensation of field errors within 2ppm in superconducting magnets