^No need to do so many steps. Just bring to boil, chill to zero, and filter.
Do you have values for the solubility of caffeine at 5° C? You go into the final filtration with 300ml of water or so correct? This seems high to me.
That's for 1Kg of pills. 1Kg of pills contain about 15g of caffeine and only 0.01g disolve in 1mL at freezing point so 300mL would contain 3g. I left it to 300 to give a margin, because something fucked up happens at that point, perhaps if a more knowledgeable chemist is here to help me I would appreciate it:
Take for example a solution containing 10g codeine and 20g caffeine. After boiling it down from 300mL to 30mL, the solution becomes brown and the caffeine doesn't precipitate at all even after refrigeration and thorough stirring(not supersaturation). I have no idea what's going on, in my opinion, the caffeine forms a complex with the phosphate ion that keeps it in solution. It just doesn't break out even after refrigeration.
So I have this refrigerated solution, 30mL in volume that contains 20g of caffeine and 10g of codeine. NO precipitate is visible. I had to look up caffeine's solubility...it just doesn't make sense.
The only way I was able break the caffeine out of solution is to freeze it rock solid and melt it back down. When doing so, all the caffeine magically precipitates, to the point where a paste is formed, rendering codeine recovery impossible at that point so you basically gotta add up some more water and CWE the codeine, this time from caffeine!!! And once you do so, a brown solution is recovered, pure white caffeine is left over and after drying it up, the codeine is recovered with a sloppy 90% yield.
I try to come up with a routine like way of doing this but it requires understanding of what the dick is going on! The trouble is that nobody here ever done this before and cannot come up with a relevant hands on experience.