Start with the basics.
The fundamental inductor equation is:
V = L * dI/dt
Fortunately, we're working with square wave voltages and triangle ramp currents, so we don't need calculus; the 'd's are deltas and we simply evaluate each voltage state.
On state: V = Vin
One side of the inductor goes to Vin, the other side is clamped to ground by the switch. Current rises linearly with time. After pulse width dt = Tcyc * D, it's risen by: dI = Vin * Tcyc * D / L
Off state: V = Vin - Vout
One side of the inductor goes to Vin, the other side is connected to Vout by the diode (or a synchronous rectifier transistor, or [1]). Voltage has reversed, so current falls linearly with time. After pulse width dt = Tcyc * (1-D), it's changed by: dI = (Vin-Vout) * Tcyc * (1-D) / L
[1] Which we can generalize as a half bridge (one inductor-to-GND switch, one inductor-to-Vout switch). With a boost diode, we can only have inductor current flowing from Vin to Vout. With a pair of switches, there's no requirement for the average current to be positive or negative; it can be anything. It's just a random constant of integration. Well, what's a boost converter that draws power from its output? A buck converter, of course! So everything works out precisely the same if we flip the circuit "left to right". Buck and boost are the same thing if you have free switches. You have to stick to one or the other, of course, if you replace one switch with a diode.
This is for a duty cycle D and period Tcyc = 1 / Fclk.
It's in steady state if the total dI's are zero. That is, we add up the two expressions above, and if we get right back where we started, we've gone one full cycle and changed nothing on average. This gives:
0 = (Vin * Tcyc * D / L) + ((Vin-Vout) * Tcyc * (1-D) / L)
A lot of gibberish, but Tcyc and L drop out, and we get:
Vout = Vin / (1-D)
If we take some typical cases:
D = 50%: Vout = Vin/(0.5) = 2Vin -- it doubles, that's handy.
D = 90%: Vout = Vin/(0.1) = 10Vin -- it goes way up, whew...
D = 99%: see where I'm going with this..?
D = 100%: uh, you done fucked up...
So... a very important property of the boost converter (any switcher, really), you don't want to leave it stuck on. Because that breaks things.
If you follow the textbook plan, where a PWM generator feeds a switch, you will have a bad time, because sooner or later, the PWM generator will generate 100% duty, and output suddenly goes to zero! And also your switch explodes!
How to solve this?
It seems very suspicious to have an unaccounted variable, just floating around in the system. Namely, inductor current. We can control dI/dt, but I itself is just anything. We probably shouldn't allow that, because very large I makes transistors explode...
There are two simple solutions to this; one is a little better, but harder to implement.
Peak Current Mode Control
------------------------------
Suppose, instead of driving the switch with a PWM generator, we simply turn it on, then turn it off when the inductor current reaches some peak value. We need a comparator to detect the current, and a flip-flop to do the latching action. Voila, we've solved the inductor current problem, because it's controlled, not just in general, but as fast as possible: each and every cycle! Typical controllers include UC3842.
Downsides to this method are, every time the switch turns off, we're simply *hoping* that the inductor discharges fully -- current isn't being monitored continuously, so how would we know?
If we add another detector and latch, so we wait at least until the inductor has discharged, we get BCM (boundary conduction mode) operation. This has some advantages of its own, but the main disadvantage is high ripple: you get one big gulp of energy, then you simply wait until you need another.
If you ignore that and simply charge on ahead, resetting the flip-flop at a constant frequency (as the UC3842 does), then sometimes you'll be waiting a long time between pulses (discontinuous current mode, DCM), and sometimes you'll be turning on before the inductor has discharged (continuous, CCM). CCM is tricky, because a peak current controller is actually a chaotic system (an analog implementation of the Logistic Map -- look it up if you like pretty pictures!). There are some hints, but you mainly want to avoid CCM operation.
CCM is a good technique for higher power circuits, because you save on inductor losses and output ripple. Peak current mode control is therefore best suited to smaller circuits, where the high ripple of DCM/BCM isn't such a big deal. It's also excellent for high efficiency, low power circuits: if you don't mind the ripple, and only need a gulp every so often, then you can save a lot of power by not switching when you don't need to.
TI's Eco-mode series (like TPS54140) are perhaps the most fully realized examples of this method. They include slope compensation for better behavior at high currents, and frequency reduction for high efficiency at low currents.
Average Current Mode Control
----------------------------------
This is the harder method, usually:
Suppose we do the textbook PWM approach, but instead of closing the loop on voltage, we regulate current.
Obviously, current is only ever going up and down, so we need to do this carefully. If we change PWM% too slowly, we can get situations where, say, the output becomes shorted and current rises dangerously high. We can't be too fast, either: a very fast error amplifier would simply be a comparator, and feeding 0 or 1 into a PW modulator simply gives 0 or 1 at the output; it does nothing, it's just a hysteretic controller. (Which itself isn't bad -- but there are some gotchas.)
If we read the inductor current, say with a shunt resistor in series with the output, and filter it slightly, so it's still got some ripple, but it's not the full triangle wave, then we can apply average current mode control. The filtering accomplishes the averaging, and we no longer have to worry about PWM% lagging behind load changes: the inductor current stays just where we put it, and PWM% varies to accommodate it.
If we needed a constant current buck output, we could simply stop here. This is great for LEDs, for example! But most times, we need a constant voltage, and we might need to use topologies other than buck. Recall the boost converter is strongly nonlinear, with Vout being hyperbolic with D! Closing the loop on current eliminates that nonlinearity (and nonlinearity is bad for control loops!), but we need to get voltage back.
So we add a second error amplifier: a loop outside the current loop. In fact, what we're doing is using the current-error-amp, PW modulator, switch and inductor, as a transconductance amplifier: voltage in, current out. We can simply control this stage, with another error amp, to regulate voltage.
This technique works great, but it requires more hardware. It's also a bit slower, because of the necessity of filtering the inductor current signal. For these reasons, you'd typically use this for larger circuits, hundreds of watts perhaps. The added expense of a current shunt resistor, or a pair of current transformers*, is made up for the cost and efficiency savings on the inductor (can be an otherwise rather lossy powdered iron type) and capacitors (bog standard electrolytics).
(*You can use current transformers to measure DC, as long as the DC is always switching. In a buck converter, if you use one CT for the switch and one for the diode, and combine their outputs with diodes, you get a DC-accurate output which follows the inductor current precisely. The downside is, it has to be switching, so you can't go above maybe 90% duty cycle. So the controller and converter parts might be okay up to 100% duty, but not your current sensor. Which is kind of scary, and necessitates the same hack the textbook PWM boost circuit needs: hard limiting the maximum PWM%.)
Tim