PID controller tuning for insulin regulation system

11 views (last 30 days)
Hello there,
I am working on a project related to BioSystems, I have the attached model for the system, I am wondering what is the best way to tune the PID controllers in order to get the desired glucose level.
How should I select the P I D to get the best results.
I have attacehd the model in earlier version of Matlab aswell 2015b.
Abdulrahman Odhah
Abdulrahman Odhah on 14 Jan 2021
Edited: Abdulrahman Odhah on 14 Jan 2021
You are totally right for the second PID, but you if you noticed the second PID will be activated only at the saturation and won't affect anything in other cases, actually this is the way that anti windup mechanism has been implemented and yeah the I part will be zero in this case for the sack of the antiwindup.
about the results it is not about stability here in this system it is about forcing or let's say controlling the doses of the insulin injected into the patient as per the following scenario:
1- sensor is reading the current glucose level in the blood, which is supposed to be normal ( 90-120)
2- patient eat snacks or meals that contains sugar, this action increases teh level of the sugar in the blood and since the body can't produce enough insulin to process this amount of sugar (diabetes) , the sugar sensor will trigger the insulin pump to work.
3- the insulin motivates the cells to process the sugar which means decrease the sugar level again to the normal range or close to it.
So back to our topic , tuning the PID, the good result can be obtained in the following conditison:
1- assumption that all the existing parameters in the model are OK and just the PID parameters shall be manuplated.
2- the sugar level shouln't go below 50 at any case.
3- the suger level can resonate between 60 -120 +/- 10.
4- the faster degrade of the sugar level is better.
5- a spark of sugar level is expected after a meal.
6- the a ttached image shows an acceptable operation of the system with the curvers shows the following:
- curve in black (thin) is the response in the body without the system.
- curve in black (thik line) is the desirable response.
- RED is good.
- green is not good because the level drops below the safety line.

Sign in to comment.

Answers (1)

Abhiroop Rastogi
Abhiroop Rastogi on 15 Feb 2022
Hi Abdulrahman,
I am not sure if you have gotten your answer to this question yet, but just in case it did not happen, I want to mention that there are PID tuner tools available in Simulink that can be utilized for the purpose you are looking for.
You can follow the section on PID Controller tuning in Simulink which will let you adjust the type of responce you need in terms of "Response Time" or "Transient Behaviour" also.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!