Failure Detection Algorithms Applied to Control System Design for Improved Diagnostics and Reliability