An On-line Observer-Based Controller for Constrained Systems