Technology advances have made possible improvements such as Continuous Glucose Monitors, giving the patient a glucose reading every few minutes, or insulin pumps, allowing more personalized therapies. With the increasing number of available closed-loop systems, new challenges appear regarding algorithms and functionalities. Several of the analysed systems in this paper try to adapt to changes in some patients’ conditions and, in several of these systems, other variables such as basal needs are considered fixed from day to day to simplify the control problem. Therefore, these systems require a correct adjustment of the basal needs profile which becomes crucial to obtain good results. In this paper a novel approach tries to dynamically determine the insulin basal needs of the patient and use this information within a closed-loop algorithm, allowing the system to dynamically adjust in situations of illness, exercise, high-fat-content meals or even partially blocked infusion sites and avoiding the need for setting a basal profile that approximately matches the basal needs of the patient. The insulin sensitivity factor and the glycemic target are also dynamically modified according to the situation of the patient. Basal insulin needs are dynamically determined through linear regression via the decomposition of previously dosed insulin and its effect on the patient’s glycemia. Using the obtained value as basal insulin needs and other mechanisms such as basal needs modification through its trend, ISF and glycemic targets modification and low-glucose-suspend threshold, the safety of the algorithm is improved. The dynamic basal insulin needs determination was successfully included in a closed-loop control algorithm and was simulated on 30 virtual patients (10 adults, 10 adolescent and 10 children) using an open-source python implementation of the FDA-approved (Food and Drug Administration) UVa (University of Virginia)/Padova Simulator. Simulations showed that the proposed system dynamically determines the basal needs and can adapt to a partial blockage of the insulin infusion, obtaining similar results in terms of time in range to the case in which no blockage was simulated. The proposed algorithm can be incorporated to other current closed-loop control algorithms to directly estimate the patient’s basal insulin needs or as a monitoring channel to detect situations in which basal needs may differ from the expected ones.