Learning While Preventing Mechanical Failure Due To Random Motions