Design of a magnetometer using multiple COTS sensors for attitude control