The High Contrast Imaging Laboratory at Princeton University has been researching and testing telescope/starshade technology for over a decade. Currently, one of the main challenges of using such technology is the need to design controllers for formation flying to maximize the number of targets accessible for a given mission. For that reason, this paper details the design and implementation of a formation flying hardware-in-the-loop simulation in the existing Princeton Starshade Testbed to validate formation sensing and control algorithms while maintaining high contrast with a flight-like starshade. In particular, trajectory tracking is achieved through a linear quadratic controller with integral action and estimation is done with an unscented Kalman filter. An important aspect of the performance of the proposed control and estimation strategy is that it includes the use of a pupil imaging sensor of the starshade's diffraction pattern for high-precision position determination. We also present initial experimental results showing that the control strategy yields fast processing times, small position errors, robust steady-state, and low values of total Δv, all helping advance the starshade technology gap of formation sensing and control.