The University of Illinois has developed a hardware-in-loop (HIL) attitude simulation platform called CubeSim for the testing and calibration of attitude determination and control systems (ADCS) for NanoSatellites. This system is currently being used to calibrate the LAICE and CubeSail satellites, both based on the Il-liniSat-2 bus, which are scheduled for launch in early 2017. It consists of hardware elements (Helmholtz cage (HC3), custom power supply) and a software package. To further improve the capabilities of CubeSim, this study introduces two main modifications to the CubeSim software package improving simulation accuracy. The first would discuss calibration techniques developed for CubeSim that enable robust and fast calibration of magnetometers. Subsequently the study would evaluate the inclusion of the Enhanced Magnetic Model (EMM) instead of the International Geomagnetic Reference Field (IGRF) model for production higher fidelity of magnetic field.