Skip to main content
. 2021 Mar 10;21(6):1936. doi: 10.3390/s21061936
Algorithm 1: Period of computation of power self-optimizing process
Input: Battery level, Charging current
Output: Transmission period
Period = 10;
IncreaseLevel = 30;
DecreaseLevel = 10;
MaxPeriod = 120;
MultistepOperationTime = 10;
SafetyLevel = 80%;
q = 1;
repeat
   if Battery level ≥ SafetyLevel then // select state according to battery level
   NextState = 1;
   else
   NextState = 0;
   endif
   Ptotal= Pmcu+(Pm×q) / Preiod; // calculate total power
   if NextState = 1 then // decide period
   if Ptotal>Pcharge then
     Period = Period + IncreaseLevel;
     if Period >= MaxPeriod then
     Period = MaxPeriod;
     endif
     else
     Period = Period − DecreaseLevel;
     if Period < MultistepOperationTime then
     Period = MultistepOperationTime;
     endif
     endif
endif