In this paper, an INS compensation algorithm is proposed using the accelerometer from IMU. First, we denote the basic INS algorithm and show that how to compensate the position error when low cost IMU is used. Second, considering the ship's characteristic and ocean environments, we consider with a drift as a periodic external environment change which is affected with exact position. To develop the compensation algorithm, we use a repetitive method to reduce the external environment changes. Lastly, we verify the proposed algorithm through the experiments, where the acceleration sensor is used to acquire real data.