An artificial pancreas system includes a continuous glucose monitoring device, a drug delivery device configured to exchange data with the continuous glucose monitoring device and containing a control algorithm, and possibly a remote controller configured to exchange data with the drug delivery device. The algorithm contains an insulin-glucose model, but is decoupled mathematically from the insulin injected by the user to offset the ingested carbohydrates. The control algorithm is designed to calculate two versions of insulin-on-board-patient-facing insulin-on-board (PFIOB) and system-facing insulin-on-board (SFIOB) to properly parse boluses and inform the system of only the insulin that is intended for high glucose correction, but not carbohydrate offsetting.