Is claiming per diem mandatory

Do I have to claim per diem? I am an owner operator and I have claimed it in the past. I just didn't know if it was mandatory or not.