Skip to content

Commit

Permalink
Merge pull request #1689 from Philoul/Autotune_Doc
Browse files Browse the repository at this point in the history
Autotune doc
  • Loading branch information
peterleimbach authored Sep 15, 2023
2 parents dabdb97 + 4293621 commit c0c3e0e
Showing 1 changed file with 36 additions and 14 deletions.
50 changes: 36 additions & 14 deletions docs/EN/Usage/autotune.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Autotune plugin is an implementation of OpenAPS autotune algorythm within AAPS.

## Autotune user interface

![Autotune default screen](../images/Autotune/Autotune_1.png)
![Autotune default screen](../images/Autotune/Autotune_1b.png)

- You can select in the Profile dropdown menu the input profile you want to tune (by default your current active profile is selected)
- Note: each time you select a new profile, previous results will be removed and Tune days parameter will be set to default value
Expand All @@ -23,25 +23,25 @@ Autotune plugin is an implementation of OpenAPS autotune algorythm within AAPS.
- "Run Autotune" will launch Autotune calculation with selected profile and the number of Tune days
- Note: Autotune calculation can take a long time. Once launched, you can switch to another view (home, ...) and come back later in Autotune plugin to see results

![Autotune Run start](../images/Autotune/Autotune_2.png)
![Autotune Run start](../images/Autotune/Autotune_2b.png)

- Then during the run you will see intermediate results below

- Note: During run, settings are locked, so you cannot change anymore selected input profile or the number of day. You will have to wait the end of current calculation if you want to launch another run with other parameters.

![Autotune during run](../images/Autotune/Autotune_3.png)
![Autotune during run](../images/Autotune/Autotune_3b.png)

- When Autotune calculation is finished, you will see the result (Tuned profile) and four buttons below.

![Autotune Result](../images/Autotune/Autotune_4.png)
![Autotune Result](../images/Autotune/Autotune_4b.png)

- It's important to always compare input profile (column "Profile"), output profile (column "Tuned") and the percentage of variation for each value (Column "%").

- For basal rates, you also have the number of "missing days". You have missing days when Autotune don't have enough data categorized as "Basal" to tune basal rate for this period (for example after each meal when you have carbs absorption). This number should be as low as possible especially when basal is important (for example during the night or at the end of the afternoon)

- The "Compare profiles" button open the profile comparator view. Input profile is in blue, and output profile (named "Tuned") is in red.

- Note: in the example below input profile has circadian variation for IC and ISF, but output calculated profile has a single value. If it's important for you to get a circadian output profile see [Circadian IC or ISF profile](#circadian-ic-or-isf-profile) below.
- Note: in the example below input profile has circadian variation for IC and ISF, but output calculated profile has a single value. If it's important for you to get a circadian output profile see [Circadian IC or ISF profile](autotune-circadian-ic-or-isf-profile) below.

![Autotune Compare profiles](../images/Autotune/Autotune_5.png)

Expand Down Expand Up @@ -84,13 +84,13 @@ Autotune plugin is an implementation of OpenAPS autotune algorythm within AAPS.

![Autotune default screen](../images/Autotune/Autotune_11.png)

- Automation Switch Profile (default Off): see [Run Autotune with an automation rule](#run-autotune-with-an-automation-rule) below. If you change this setting to On, the input profile will automatically be updated by the Tuned profile, and it will be activated.
- Automation Switch Profile (default Off): see [Run Autotune with an automation rule](autotune-run-autotune-with-an-automation-rule) below. If you change this setting to On, the input profile will automatically be updated by the Tuned profile, and it will be activated.
- **Be Carefull, you must trust and verified during several following days that after an update and activation of Tuned profile without modification, it improves your loop**

- Categorize UAM as basal (default On): This setting is for the users using AndroidAPS without any carbs entered (Full UAM). It will prevent (when Off) to categorize UAM as basal.
- Note: if you have at least one hour of Carbs absorption detected during one day, then all data categorized as "UAM" will be categorized as basal, whatever this setting (On or Off)
- Number of days of data (default 5): You can define default value with this setting. Each time your select a new profile in Autotune plugin, Tune days parameter will be replaced by this default value
- Apply average result in circadian IC/ISF (default Off): see [Circadian IC or ISF profile](#circadian-ic-or-isf-profile) below.
- Apply average result in circadian IC/ISF (default Off): see [Circadian IC or ISF profile](autotune-circadian-ic-or-isf-profile) below.

### Other settings

Expand All @@ -102,7 +102,7 @@ Autotune plugin is an implementation of OpenAPS autotune algorythm within AAPS.

## Advanced feature

(circadian-ic-or-isf-profile)=
(autotune-circadian-ic-or-isf-profile)=

### Circadian IC or ISF profile

Expand All @@ -116,7 +116,21 @@ Autotune plugin is an implementation of OpenAPS autotune algorythm within AAPS.



(run-autotune-with-an-automation-rule)=
### Tune specific days of the week

- If you click on the checkbox with the eye on the right of "Rune days" parameter, you will see the day selection. You can specify which day of the week should be included in Autotune calculation (in screenshot below you can see an example for "working days" with Saturday and Sunday removed from autotune calculation)
- If the number of day included in Autotune calculation is lower than the number of Tune days, then you will see how many days will be included on the right of Tune days selector (10 days in the example below)
- This setting gives good results only if the number of remaining days is not to small (for example if you Tune a specific profile for week end days with only Sunday and Saturday selected, you should select a minimum of 21 or 28 Tune days to have 6 or 8 days included in Autotune calculation)

![Autotune default screen](../images/Autotune/Autotune_14b.png)

- During Autotune calculation, you can see the progress of the calculations ("Partial result day 3 / 10 tuned" on example below)

![Autotune default screen](../images/Autotune/Autotune_15b.png)



(autotune-run-autotune-with-an-automation-rule)=

## Run Autotune with an automation rule

Expand All @@ -138,17 +152,25 @@ Note: for more information on how to set an automation rule, see [here](./Automa

- You can then select Autotune Action to adjust parameters for your run. Default parameters are "Active Profile", default Tune days value defined in Autotune Plugin preferences, and All days are selected.

![Autotune default screen](../images/Autotune/Autotune_19.png)
![Autotune default screen](../images/Autotune/Autotune_19b.png)

- After a few days, if you fully trust Autotune results and percentage of modification is low, you can modify [Autotune settings](autotune-plugin-settings) "Automation Switch Profile" to enabled to automatically update and activate profile tuned after calculation.

Note: if you want to automatically tune profiles for specific days of the week (for example a profile for "Weekend days" and another one for "Working days"), then create one rule for each profile, select the same days in Trigger and in Autotune Action, Tune days must be high enough to be sure tuning will be done with at least 6 or 8 days, and don't forget to select time after 4AM in trigger...

- See below an example of rule to tune "my profile" on all "Working days" with 14 Tune days selected (so only 10 days included in autotune calculation).

![Autotune default screen](../images/Autotune/Autotune_20b.png)


- After a few days, if you fully trust Autotune results and percentage of modification is low, you can modify [Autotune settings](#autotune-plugin-settings) "Automation Switch Profile" to enabled to automatically update and activate profile tuned after calculation.

## Tips and trick's

Autotune works with information existing in your database, so if you just installed AAPS on a new phone, you will have to wait several days before being able to launch Autotune with enough days to get relevant results.

Autotune is just an help, it's important to regularly check if you agree with calculated profile. If you have any doubt, change Autotune settings (for example the number of days) or copy results in local profile and adjust profile before using it.

Always use Autotune several days manually to check results before applyling them. And it's only when you fully trust Autotune results, and when variation becomes tiny between previous profile and calculated profile than you start to use Automation (Never before)
Always use Autotune several days manually to check results before applying them. And it's only when you fully trust Autotune results, and when variation becomes tiny between previous profile and calculated profile than you start to use Automation (Never before)

- Autotune can work very well for some users and not for others, so **If you don't trust Autotune result, don't use it**

Expand All @@ -167,6 +189,6 @@ We advise to not use Autotune in the following cases:

- Your carbs absorption is very slow: if most of your carbs absorption are calculated with min_5m_carbimpact parameter (you can see these periods with a little orange dot in the top of COB curve), the calculation of COB could be wrong and leads to wrong results.
- When you practice sport, you are generally more sensitive and your BG doesn't rise a lot, so during or after an exercice, it's usual to see some periods with slow carbs. But if you have too often unexpected slow carb absorption, then you may need a profile adjustment (higher value of IC) or a min_5m_carbimpact a bit too high.
- You have a "very bad days", for example stuck several hours in hyperglycemia with a huge amount of insulin to be able to go down within the range, or after a sensor change you got long periods of wrong BG values.
- You have a "very bad days", for example stuck several hours in hyperglycemia with a huge amount of insulin to be able to go down within the range, or after a sensor change you got long periods of wrong BG values. If during the pas weeks you only have one or 2 "bad days", you can disable manually these days in autotune calculation to exclude them from calculation, and again **check carefully if you can trust the results**
- If the percentage of modification is too important
- You can try to increase the number of days to get smoother results
- You can try to increase the number of days to get smoother results

0 comments on commit c0c3e0e

Please sign in to comment.