Techniques for feedback control of oscillations in the flow past a cavity are presented. Low-order models are obtained using two methods (empirical Galerkin models, and a simple nonlinear oscillator model), and validated against 2D direct numerical simulations of the flow, which is actuated by a body force at the leading edge of the cavity. The models are used to construct dynamic observers, which reconstruct the flow state from a single pressure sensor, and perform much better than static estimators commonly used for flow estimation. Several control approaches are compared, including simple proportional control with a phase lag, LQG control using Galerkin models, and a dynamic phasor approach based on the work of Noack et al (2003). All three controllers are implemented in the full simulation, and able to reduce the amplitude of oscillations. The LQG regulator requires careful tuning, and the closed-loop behavior often does not match that predicted by the model, but the dynamic phasor approach eliminates the oscillations completely in the full simulation, with a transient response that matches that predicted by the low-order model.