I went through the following application note from microchip that deals with designing a bidirectional power supply for charging a battery pack (pages 16/30 and 17/30).
The application note says that when a power supply of 6.5V to 7V presents from the right side (J2 in the schematic), the circuit works as a boost converter to charge the battery pack.
Let's start from this point. To charge an Li-Ion battery pack, we need two loops (Constant current loop and a constant voltage loop ). At this configuration, we have only the current loop composed of U4:A and its surrounding components, In my behalf, I don't think that the voltage loop composed of U3:B will take effect in this configuration because it is placed at the input side of the boost configuration. So, where is the voltage loop when the circuit is in the boost configuration ?
When the circuit is concidered from left to right, the battery pack is concidered to be the input voltage to the rest of the circuit which is now working as a voltage mode buck converter (controlled by U3:B that is now at the output of the circuit). And the current flowing through the shunt resistors R4 and R5 is now negative, so how does the current loop react to this current knowing that the OPAMP is fed only with a positive 5V ?