# Problem with plotting a function with NIntegrate

Why does the following Plot3D command never terminate?

m=0.8;i=5.6;w=100*Pi;
vma[t_, v0_] := m Sin[w t] + v0;
vmb[t_, v0_] := m Sin[w t-2*Pi/3] + v0;
vmc[t_, v0_] := m Sin[w t+2*Pi/3] + v0;
ia[t_, theta_] := i Sin[w t + theta];
ib[t_, theta_] := i Sin[w t + theta-2*Pi/3];
ic[t_, theta_] := i Sin[w t + theta+2*Pi/3];
in[t_, theta_,v0_] := -(Sign[vma[t, v0]] vma[t, v0] ia[t, theta] +
Sign[vmb[t, v0]] vmb[t, v0] ib[t, theta] +
Sign[vmc[t, v0]] vmc[t, v0] ic[t, theta]);
vc1[theta_?NumericQ, v0_?NumericQ] := 280 + 1/(2*4700*^-6) *
NIntegrate[in[t, theta, v0], {t, 0, 0.3}];
Plot3D[vc1[theta,v0], {theta,-Pi, Pi}, {v0, -0.2, 0.2}]

-

First, I don't know anything about this particular function and I've not examined the definitions closely at all. If you simply try to execute something like vc1[0.1,0.1], though, you'll find that it takes 3 or 4 seconds to evaluate. vc1[0,0] throws errors, so these things need to be more efficient. I simply changed your definition of vc1 to include some standard tricks to speed up the integration.

vc1[theta_?NumericQ, v0_?NumericQ] := 280 + 1/(2*4700*^-6) *
NIntegrate[in[t, theta, v0], {t, 0, 0.3},
PrecisionGoal -> 5, AccuracyGoal -> 3,

Note that the decrease of PrecisionGoal and AccuracyGoal may be problematic for some applications, but this level of precision cannot be discerned in a plot anyway.
Now, we can also tone the expectations of Plot3D down a bit be decreasing PlotPoints and setting MaxRecursion to zero. The following now takes about 8 seconds on my machine.
Plot3D[vc1[theta, v0], {theta, -Pi, Pi}, {v0, -0.2, 0.2},