A tracking system for estimating the position and orientation of an object inside a patient comprising electromagnets that generate magnetic fields used to navigate an object, including rotating and translating the object, are used to track the position of the object. Position tracking of the object is concurrent with navigating the object or interleaved with navigating the object. Using the same electromagnets for navigation and tracking ensure coordinate system registration between the navigation system and the position tracking system. A tracking sensor attached to the object comprises at least a single coil generating signals in response to time varying tracking magnetic field generated by the electromagnets. Iterative algorithm is used to estimate position and orientation from sensors signal. Linearly time varying current in the tracking electromagnets is produced by applying calculated voltage waveform to the electromagnet coils.