I've started the process of designing my own S2 balancing LiPo charger (yes for "fun" ... that and the cheap one that came with my hex copter is trying to murder batteries) so I've been going through the schematic with a fine toothed comb and have some additional insights to share. I'll start with the most obvious bits worthy of additional mention and go into the less than obvious bits.
Circuits like this one abound in this design. They serve 2 obvious purposes.
1) Allow the MC to force the system 'off' / give the MC the ability to act as a safety officer - however, this role (of safety) is best handled in analog when dealing with so much energy
2) Ensure the circuit is in a known, and safe, sate on power up, before the MC code has a chance to take control of its ports.
It took me a couple of minutes to understand this one - I've never built an RC filter so integrated with op amps - but that's what this is. It uses the time constants of the many distributed caps and resistors to create an RC filter system which converts the PWM signal into a, mostly, analog current target.
In simulation I observed some significant overshoot - in actual application I would ramp the PWM up to avoid damaging overshoots. Overshoot can also be reduced by increasing R24.
In the simulation the observed current drops to 0 with every cycle but this may or may not be something which happens in the real world. This can be reduced to oscillation by increasing PWM frequency (I used a 10kHz signal).
Frankly I wouldn't use this circuit - I'd use a much more strait forward PWM into a 2 stage RC filter which sets the target current (target sense resistor voltage drop).
This circuit has only one job and it's not at all obvious at first - Dave even missed it in the video. This circuit is here to protect against reverse battery hookup - nothing else. As far as I can tell it has no part in the constant current or constant voltage processes. It doesn't even cut the circuit if the battery leads were to be shorted to each other - there must be a negative potential for it to turn the FET off. How negative depends on the potential of the buck/boost cap - the more voltage in that cap the more negative this needs to be ... e.g. about -5v when the buck boost cap is at 15v. This isn't as un-safe as it may sound because once the cap is discharged enough the FET will be turned off (assuming that the buck boost isn't running).
Another point Dave missed on this one in the video is the feedback loop. It doesn't take the long way around - it's just being used as a compariator. There is no valid way for this circuit to ever get 14% of BAT- to be equal to 19% BAT+ (and we really don't want that anyway!).
I hope others find this helpful - if I have any other revelations I'll share them as well, and if I actually build a charger I'll share it in its own thread