This is a fascinating article that gives some insight on Ahmadinejad:
The most remarkable aspect of Mr Ahmadinejad's piety is his devotion to the Hidden Imam, the Messiah-like figure of Shia Islam, and the president's belief that his government must prepare the country for his return.
The prospect of such a man obtaining nuclear weapons is worrying. The unspoken question is this: is Mr Ahmadinejad now tempting a clash with the West because he feels safe in the belief of the imminent return of the Hidden Imam? Worse, might he be trying to provoke chaos in the hope of hastening his reappearance?