Hello there,
There are a couple of simple equations that are used with boost converters that can help you get to the right circuit values and settings pretty quick. The first is the calculation of the minimum inductor value, and the second is the calculation of the required duty cycle.
The minimum inductor value is based loosely on:
V=L*di/dt
which translates to:
Vin=L*imax/ton
where
Vin is the input voltage,
imax is the max current, and
ton is the 'on' time of the transistor.
The on time is determined by the frequency and duty cycle, but for a 50 percent duty cycle it will be:
ton=1/(2*f)
where f is the frequency,
and the max current is determined by either the max collector current of the transistor or the available max input current, whichever is the least.
Solving that equation:
Vin=L*imax/ton
for L gives us:
L=Vin*ton/imax
and that L is the min inductance so we'll call it Lmin:
Lmin=Vin*ton/imax
With your current setup,Vin=5 and f=20000 so ton=1/40000. imax input is 1 amp but perhaps the transistor is only 500ma, so we'll use 500ma just for now.
Using that equation we get:
Lmin=Vin*ton/imax
Lmin=5*0.000025/0.500=0.00025 or 250uH.
You can double check your actual circuit limits and recalculate if needed.
The second equation relates the duty cycle to the output voltage and is:
Vout=Vin/(1-D)
where
Vin is again the input voltage, Vout the output voltage, and D is the duty cycle expressed as a fraction (D=0.5 for a 50 percent duty cycle).
Although this equation is not exact (it will err on the low side), it does give us a quick estimate of what we might expect on the output.
For your setup, Vin=5 and D=0.5 so we get:
Vout=Vin/(1-D)
Vout=5/(1-0.5)=10 volts.
Notice that already we dont get enough output.voltage if we really want 12 volts.
To get 12v output we can solve that equation for D so we know what to set the duty cycle at:
Vout=Vin/(1-D)
D=1-Vin/Vout
Plugging in the values for Vin and Vout we get:
D=1-5/12=0.583333
so the duty cycle would have to be about 58.3 percent, but because there will be losses in the circuit we increase that a little to say 62 percent and try that. This of course means you'll have to change some of the values in your circuit or make adjustments to get the duty cycle up higher.
Also, when we calculated the min inductor value above we assumed a duty cycle of 50 percent, so now we have to recalculate the min inductor value.
With a frequency of 20kHz that gives us a period of 50us and since the duty cycle will be 62 percent the on time will now be:
ton=Tp*D
ton=50us*0.62=31us.
Going back to the equation for min inductance:
Lmin=Vin*ton/imax
now we calculate:
Lmin=Vin*ton/imax
Lmin=5*0.000031/0.500=0.000310 or 310uH.
In short, to get the required 12v output you'll have to make sure the inductance is large enough and you'll also have to make sure the duty cycle is high enough. Of course you also have to make sure that the transistor can handle the current and that its saturation voltage is low.