This study aimed to develop a novel oral drug delivery system for gastroretentive sustained drug release by using a capsular device. A capsular device that can control drug release rates from the inner immediate release (IR) tablet while floating in the gastric fluid was fabricated and printed by a fused deposition modeling 3D printer. A commercial IR tablet of baclofen was inserted into the capsular device. The structure of the capsular device was optimized by applying a design of experiment approach to achieve sustained release of a drug while maintaining sufficient buoyancy. The 2-level factorial design was used to identify the optimal sustained release with three control factors: size, number, and height of drug-releasing holes of the capsular device. The drug delivery system was buoyant for more than 24 h and the average time to reach 80% dissolution (T80) was 1.7–6.7 h by varying the control factors. The effects of the different control factors on the response factor, T80, were predicted by using the equation of best fit. Finally, drug delivery systems with predetermined release rates were prepared with a mean prediction error ≤ 15.3%. This approach holds great promise to develop various controlled release drug delivery systems.