I’ve posted this analysis elsewhere, but it answers your question nicely, I think:
The read I took away from “The Avengers” - which is supported from what I’ve read in interviews - is that, from the start of the movie, Banner has the aptitude to control the Hulk. This stemmed from his realization sometime before the film begins that acknowledging his constant inner anger is necessary to do so (hence “The secret is, I’m always angry”).
So at the beginning of “The Avengers,” we have a Bruce Banner who can (somewhat) control whether the Other Guy appears or not via his understanding of his own constant anger. He could Hulk out voluntarily at any moment. But what’s important is that* that’s not something he’d ever choose to do at this point.* Banner is still striving purely to repress the Hulk - hence Black Widow’s line about how it’s been more than year between “incidents.” Banner accepts this wording because, to him, each Hulk-out is still just that - an unfortunate incident, a loss of control. For all his newfound ability to keep that part of himself under wraps, he still ultimately views the Hulk as a frightening expression of what he hates about himself - hence calling it the “Other Guy.”
The conversation Banner has with Tony Stark aboard the Helicarrier is his first step towards realizing true control over the Hulk. Even then, we see how dedicated Banner is to repressing that part of himself, as demonstrated by his deadpan response to being zapped by Stark. Stark urges Banner to embrace the Hulk as a gift as much as a curse, implying that doing so will also help clear Banner’s head in a more general sense. Banner seems unconvinced, but doesn’t reject the notion outright.
Unfortunately, a few hours later, Banner is thrown into one of the most chaotic and terrifying moments of his life, as he learns that SHIELD has been lying to him and the giant flying airship he’s on comes under violent attack. All of this while being psychologically warped by Loki’s staff, which he picks up and seems prepared to use without even realizing it.
As the lab explodes underneath him, all of Banner’s careful repression of the Other Guy disintegrates in that moment of betrayal, mental torment, and physical pain, and the Hulk emerges. Uncontrolled. Untethered. And most importantly, against Banner’s will. The circumstances are beyond anything Banner had prepared himself for, and his method of controlling the monster up to this point utterly fails. The last bit of Banner we see in this scene is the horror and apology in his eyes directed at Black Widow as he is subsumed by the Other Guy.
Everyone knows the Hulk best as the id of Bruce Banner, and the following scene is the pure expression of that mode. The Other Guy is unrestrained fury, but it’s not mindless - it just acts on instinct. And its instinct right now is this: “Destroy everything that is hurting me/ Banner.” Nothing in this moment embodies that more than Natasha Romanov, the representative of SHIELD that recruited him into this ridiculous scheme in the first place. Hence the Hulk’s single-minded pursuit of Black Widow through the corridors of the Hellicarrier… until other things start showing up that direct pain against him in an even more visceral manner. First Thor and his bloody hammer, then the fighter jet and its pilot (“TARGET ANGRY! TARGET VERY, VERY ANGRY!”).
Of course, here’s where the uncoordinated instinct of the id kind of fails as military strategy - if you’re a landbound being, even a monster capable of jumping hundreds of feet in the air, it’s not the best plan to leap onto an airplane and then proceed to demolish it. Hulk plummets out of the sky. But in our (and what will be Banner’s) first hint that even the Hulk maintains some of Banner’s mind, the Hulk avoids populated areas in his descent and crashes into an unoccupied warehouse.
Cut to several hours later. Bruce Banner wakes up, confused and instantly horrified. He assumes that he’s had another catastrophic “incident” (which is pretty much exactly what happened). But for the first time, he’s approached by someone who saw what he was and doesn’t fear him it. It helps that it’s Harry Dean Stanton. HDS accepts Banner with some dry humor, and informs him that even as the Hulk, he seemed to be making some effort to avoid killing innocents.
This is the most important moment of the film for the character of Bruce Banner - not, as most people seem to assume, the “I’m always angry” line (that’s a defining moment for the rest of the Avengers in understanding and accepting Banner, not for Banner himself). It is here that Banner truly comes to understand what “controlling the Hulk” means - not just burying the Other Guy ever deeper, but accepting his anger as part of himself and learning to direct it in a proactive and useful way. He must choose to use his anger as a tool.
When Banner finally arrives at the battle, he exudes a sense of peace we haven’t seen in him before. He’s still got that wry, quiet humor, but it’s missing the nervousness from earlier in the film. It reflects the epiphany that he reached during his conversation with HDS, and reaches its culmination seconds later as he finally Hulks out on purpose for the first time in his life. His acceptance of his anger finally gives him the means to control that anger - and its expression in the Hulk.
That’s why the Hulk takes orders in the final battle. That’s why the Hulk only goes after the bad guys (Thor suckerpunch aside). And that’s why the Hulk is able to deliver the best one-liner in the whole damn movie after pulverizing Loki.
tl;dr version: Bruce Banner could have voluntarily Hulked out at any time in the movie, because he’s always angry and he knows it. But until the last 30 minutes of the film, it’s a decision he would NEVER MAKE, because he viewed the Hulk as something bad to be repressed. Which means, when it happens against his will on the Helicarrier, he’s incapable of stopping the Hulk from emerging, nor from trying to turn Black Widow into a fine paste.