Pulse wave from sum of sinusoids
Essentially, you are evaluating the partial sum of a Fourier Series of the rectangular periodic pulse. The pulse is symmetric around $t=0$, so the sine-parts can be omitted, leaving only the cosine-parts, as you have shown. However, you miss an essential thing: the frequency zero (i.e. the DC part), which is the overall mean of your waveform. 

I dont know exactly, how you came up with the different values for amp, but it turns out the waveform with dcyc=0.5 has an amplitude of approximated 0.78. So, the mean of a waveform with a given $d_{cyc}$ is given by 

$$a_0=0.78d_{cyc}+(1-d_{cyc})(-0.78)$$

You need to add this mean value to your Fourier Series to generate the equal-amplitude waveform. See below:

length = 1024
nharms = 8
dcyc = 0.2
step = 2*np.pi/length
harm = 1

A = 0.78
mean = (dcyc) * A + (1-dcyc)*(-A)


j = np.arange(4*length)

table = 0
for i in range(nharms):
    amp = np.sin(harm*dcyc*np.pi)/harm
    table = table + amp*np.cos(step*harm*j)
    harm = harm + 1
table = table + mean

plt.plot(j, table);
plt.grid(True)