Gradient estimate for parameter design of threshold controllers in a failure-prone production system