Residual Generation and Reference Governor Design