xuebaunion@vip.163.com
3551 Trousdale Rkwy, University Park, Los Angeles, CA
留学生论文指导和课程辅导
无忧GPA:https://www.essaygpa.com
工作时间:全年无休-早上8点到凌晨3点

微信客服:xiaoxionga100

微信客服:ITCS521
ECE4132 Project: System Identification and Control for an Artificial Pancreas System Jonathan Lin, Vlad Joukov University of Waterloo Dana Kulic´, James Saunderson Monash University August 2021 Introduction In this project, you will work in a simulation environment to develop a model of the food-insulin response of a type II diabetic patient, and derive a controller for providing appropriate insulin medication to control the blood sugar level of such patients. In healthy people, homeostasis (steady state equilibrium) blood glucose level is regulated by insulin, which is produced by the pancreas. When food intake occurs, the blood glucose level rises. Insulin lowers the blood glucose level by absorbing glucose into the liver, fat, and muscle cells. In Type II diabetics, the body becomes resistant to insulin response, or the body secretes less insulin to counter the sugar presence. A common treatment technique is to apply insulin injections to compensate for the lack of proper body response. One treatment methodology is to require patients to monitor their blood glucose level and self- administer appropriate levels of insulin. This process can be automated by sampling the body’s blood sugar levels and applying an injection of insulin at an appropriate time. Note that continuous blood glucose monitors are often quite noisy (Rodbard 2016). In this project, you will investigate the blood glucose response to insulin and food, and come up with a controller which can provide appropriate insulin medication. The project consists of two parts: 1. Identifying the transfer function that represents the open-loop response of the patient, and 2. implementing an insulin pump that will stabilize the blood glucose level of the patient to a target level following food intake. 1 Submission Due date weight grade based on group selection Friday week 6 0% N/A system ID code part I Friday week 8 15% performance system ID code part II Friday week 11 15% performance control design code part II Friday week 11 30% performance report Friday week 11 40% explanations and understanding Table 1: Breakdown of submissions, due dates, and grading for ECE4132 project. You will work in groups of two to complete the project. Please form your own group and register it on the Moodle site by Friday of week 6. Any questions (and answers!) about the project should be posted to the Moodle discussion forum. Submission and grading overview Details about submissions and grading are in the appropriate sections of this document. Table 1 summarises the submissions you need to make, the due dates, and the percentage of the project grade they contribute. Part I: System Identification Objective: Perform system identification of a Type II diabetic patient by examining the open-loop signal response of insulin (Figure 1). In this part of the project, you will be given a model of a diabetic patient. Your objective will be to come up with a transfer function model of the patient that closely resembles the provided patient model, while keeping the model as simple as possible. To get you started, the sample code provides the transfer function of a simple first order system. You must develop a method of testing the patient model to come up with an improved transfer function that minimizes the root-mean-square error (RMSE) between your transfer function and the true patient model. Note that the underlying model includes an initial condition that can be set, as well as the transfer function itself. Getting started: Download the MATLAB code package and run testSysID single.m. This will generate a simulated patient, run the function sysId.m (the system identification code that you will be modifying), and plot the output against a reference output. The reference output is a fixed first order system that is designed to loosely follow the simulated patient. Modify sysId.m to generate your automated system identification code. You can also modify the inputVector.m code, which currently generates an insulin step input, to see how changing the input can change the output response. Your sysId.m can use any sort of input to perform the identification, but the assessment of this assignment will be done using insulin step response. SysId.m can use any order 2 Figure 1: Open-loop system of a patient. The signal input of this system is insulin, while the disturbance input is food. The output of the system is the blood (plasma) glucose level. Figure 2: The step response of the simulated patient (blue). Your objective is to get the ID RMSE (yellow) to be lower than the reference RMSE (orange). system, not just first order. However, it is always preferable to use the simplest model that can explain the phenomenon being studied. In addition, the model can accept a food (disturbance) input if you are interested in exploring the disturbance response of the patient. You may (or may not) find this to be useful in the control design part of the project (part II), but it is not assessed in the system ID part of the project (part I). Please do not use MATLAB’s built-in system identification functions, as usage of these functions will result in 0% assigned. (Functions such as step or lsim that have been introduced in class, are ok.) The Simulink models have been exported so they should run under MATLAB/Simulink R2016a or later. 3 Code submission part I Please submit only the sysId.m file to the Moodle Part I project submission. Code grading part I You will be graded based on a combination of model performance and complexity. To grade the performance of your system identification, a set of 10 pre-determined patients will be simulated. A given participant will be considered identified if the RMSE between the step response generated from your sysId and the simulated patient is better than the RMSE between the referenceId and the simulated patient. The RMSE is calculated as follows: RMSE = √ Σni=1|xi − yi|2 n (1) For each patient i, the performance mark assigned will be evaluated as follows: mark for patient i: mi,1 = { 0 if RMSE > referenceId 10 otherwise. The total performance grade you obtain will be scaled based on the model complexity, as measured by the model order of your transfer function. If the model you find for patient i has order oi, the final grade will be computed as follows: g1 = 10∑ i=1 mi,1 max(1, oi/5) This means that you will be penalised for using a model of order greater than 5. This part is marked out of 100 and will be worth 15% of your project grade. Part II: Controller Design Objective: Design a controller that will be used within an insulin pump to augment the Type II diabetic patient’s insulin response (Figure 3). This assignment uses the same patient generation process as in Part I (System Identification). You will now design a controller that ensures that the patient’s plasma glucose level always remains within 4 Figure 3: A feedback loop containing the patient model and the controller that you will design. specified bounds and reaches a target steady state value. You must ensure that the plasma glucose level settles between 63 and 126 mg/dl, and does not drop below 39.6 mg/dl or exceed 298.8 mg/dl. Biologically speaking, there is no general absolute limit of when too much or too little plasma glucose is dangerous as it is dependent on the patient. These values are guidelines obtained from population surveys and serve as useful rules of thumb. Your controller must be formulated in the form of a proper LTI model (typically this would be a transfer function with at least as many poles as zeros). Just as with system models, control designs with simpler controllers are preferable. Your controller will also be assessed based on a combination of performance and controller complexity. Getting started: Download the MATLAB code package and run testControl single.m. This will generate a simulated patient, run ctrlDesign.m (the controller design code that you will be mod- ifying), and plot the output response to food disturbances. You can comment out line 10 or 11 of testControl single.m to switch between a fasting response (no food) and a 3 meal response. You can (and should) alter the food vector to test your design on a range of different eating patterns. As with the system identification step, the patients are randomly generated, so if your controller depends on knowing the patient model parameters, please incorporate system identification code (in the sysID4Ctl subfunction of ctrlDesign.m). If you wish to improve your system identification code, you can do so during this stage of the project. 5 Figure 4: Glucose response of the patient with no controller. The orange line plots the patient’s glucose level throughout the day. You can notice 3 spikes, corresponding to 3 meals eaten by the patient. The green zone indicates the target glucose range. The red zone indicates dangerous glucose range. Your objective is to keep the patient glucose level (orange) in the green region as much as possible, while avoiding the red regions. 6 Code submission part II Please submit your ctrlDesign.m file to Moodle Part II project submission. Please also submit an updated version of your sysID.m file to Moodle Part II project submission. Note that the sysID4Ctl subfunction of ctrlDesign.m need not be the same as your sysID.m file. Code grading part II System identification In part II, you have the opportunity to refine your system identification. Your model performance will again be evaluated based on a combination of model performance and size. To evaluate the performance of your system identification for Part II, for each of the 10 patients, we will compute the RMSE of your model, using Equation 1. The performance will be assessed via the following formula: mark for patient i: mi,2 = 0 if RMSE > referenceId 10− 10 (RMSE−1)referenceId if 1 ≤ RMSE ≤ referenceId 10 if RMSE < 1. In the (unlikely) event that referenceId < 1 you will get 10 for that patient. The value of 1 comes about because the sensor measurement noise limits how small your RMSE value should be. The total performance grade you obtain will be scaled based on the model complexity, as measured by the model order of your transfer function. If the model you identify for patient i has order oi, the final grade will be computed as follows: gsysid,2 = 10∑ i=1 mi,2 max(1, oi/5) This means that you will be penalised for using a model of order greater than 5. This part of the project is marked out of 100 and is worth 15% of your total project mark. Control design Your controller will be evaluated on a combination of control performance and com- plexity. To evaluate the performance of your controller, for each of the 10 patients, we will generate a random eating pattern, simulate your closed loop system for 24 hours and assign a mark out of 10 via the following formula: mark for patient i: ci = { 0 if response enters the red zone 10× (proportion of time spent in green zone) otherwise. The performance grade will be scaled based on the complexity of your controller. Given the order of your controller transfer function for patient i is pi, the final grade will be computed as follows: 7 gctrl,2 = 10∑ i=1 ci max(1, pi/5) (2) This means that you will be penalised for using a controller of order greater than 5. When stress-testing your controller for robustness, you can assume that the eating pattern used for assessment satisfies the following specifications: • Maximum sugar intake over a 24 hour period would be 200g • Sugar intake will not exceed 5g per minute • there will be at least one and at most three meals a day This part of the project is marked out of 100 and is worth 30% of the total project mark. Written submission and grading As part of the project, you must submit a report of at most 4 A4 pages (11pt font, inclusive of figures, tables, etc). The report is expected to explain the rationale behind your system ID and control design methods. Further details about expectations for the report will be released (together with a rubric) as a separate document. References: 1. C. Man, R. Rizza and C. Cobelli, “Meal Simulation Model of the Glucose-Insulin System,” in IEEE Transactions on Biomedical Engineering, vol. 54, no. 10, pp. 1740-1749, 2007. 2. Center for Disease Control, “National Health and Nutrition Examination Survey,” 1994. Available online: https://wwwn.cdc.gov/nchs/nhanes/nhanes3/Default.aspx 3. United States National Library of Medicine, “MedlinePlus: Low Blood Sugar”, 2018. Available online: https://medlineplus.gov/ency/patientinstructions/000085.htm 4. D. Rodbard, “Continuous glucose monitoring: a review of successes, challenges, and opportunities.” in Diabetes technology & therapeutics 18.S2 (2016): S2-3. 8 Figure 5: This figure illustrates the insulin concentration of healthy (solid) and Type II diabetics after consuming a meal, averaged over several participants. Note that diabetic response has a much larger peak and settles at a higher value (Man et al., 2007). 9