As a general response to the Hulk, people say that it's just general (extreme) stress that brings out the Hulk.
However, over time Dr. Banner has come to control the Hulk. Eg. In "The Incredible Hulk" he claimed he "might be able to aim it", but by the end of the movie, was able to bring it out on command. This is the same in the Avengers.
From my (basic) understanding of the human psychology, a person cannot willingly bring himself under that much emotional stress at will.
So my question is: What is the trigger for the Hulk, and how does Dr. Banner bring out the Hulk at will?