I'm designing a custom battery pack for a computer with 2S1P alignment. However, I want to be able to add batteries on the fly, as the computer is designed to be working at all times without reboots. Say, I have 3 (for two cells in series) pins to which I can connect an external battery pack for the computer, making the whole arrangement 2S2P. However, I know that voltage difference shouldn't be too low, else the batteries with highest voltage will charge those with lowest with no current limiting whatsoever. So how could I design such a battery pack? Is there something I can do, like circuit which connects the hotplugged batteries through a resistor for some time, or something MOSFET-controlled? Ideally, my concept would be 4 sockets for removable 18650 cells (2S2P) which I can either remove or add on the fly without interrupting power supply, so I can replace them - or even add an additional battery pack in parallel through a connector - but I somehow have to take into account the possible problems of interconnecting a 3.5V discharged cell with a 4.2V charged one. Any guidelines on what's the simplest way?
The best scheme would be to not actually be trying to put the battery packs in direct parallel for the reasons that you have cited. A better approach would be to design it so that only one battery would drive the computer through a MOSFET switch. A second battery would be switched in automatically through a second MOSFET switch. A control circuit would manage which battery pack switch was active and auto switch to the alternate battery when the the current battery is depleted. The main point that only one battery MOSFET is ON at a time.
A sensor in the control circuit would provide the indication when the battery became depleted and a switch over was necessary. An LED would be placed by each of the battery packs with it being turned on to alert the user that the battery back that needs swapping out.
You would equip the front end power connection to the computer with some capacitors sized to keep the computer powered through the short time that the control circuit switches off one MOSFET and turns on the other MOSFET.