Automated control of artificial lung systems to meet patient metabolic needs