If the output of the op amp is stuck at a voltage close to one of the supply rails (i.e. the output is railed), what\s the cause?
There are many ways to “rail” an op amp. The hard part is keeping it from railing. If the input exceeds the input voltage range, the output will generally go to one supply voltage rail. If the output would theoretically go beyond the actual supply voltage, given a hypothetically higher voltage supply, then again the op amp will rail. If the feedback around the amplifier is either nonexistent or in the wrong polarity, again the op amp will rail. Also, if the positive input is higher than the negative input, the op amp will rail. The op amp application should be analyzed to be sure the input voltage(s) and gain are appropriate for the supply voltage used, so that in normal operation the input voltage is within the operating ratings, and the output voltage is within its normal bounds.