mpp1

来源:互联网 发布:java云课堂是什么软件 编辑:程序博客网 时间:2024/06/03 19:50
void MPPTRoutine(void) {int deltaV = 0; //inputAverageCompletedFlag = 0; // 即将计算// Store last InputPower information, calculate new InputPowerprevInputPower = inputPower;inputPower = (__builtin_mulss((int) inputVoltageAverage,(int) inputCurrentAverage) >> 15);deltaV = inputVoltageAverage - prevInputVoltageAverage;if (inputPower >= (prevInputPower)) { //功率升高  //修改if (deltaV <= -100) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV < -30) {mpptFactor += MININCREMENTMPPTFACTOR; //30} else if (deltaV < -10) {mpptFactor += 35; //35  //添加} else if (deltaV < 0) {mpptFactor += MAXINCREMENTMPPTFACTOR; //40} else if (deltaV >= 30) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV >= 20) {mpptFactor -= 65; //添加} else if (deltaV >= 10) {mpptFactor -= 40;} else if (deltaV > 0) {mpptFactor -= 20; //-50}} else if (inputPower < (prevInputPower)) { //功率降低if (deltaV <= -150) {mpptFactor -= (MAXDECREMENTMPPTFACTOR << 2); //-320} else if (deltaV <= -100) {mpptFactor -= (MAXDECREMENTMPPTFACTOR << 1); //添加} else if (deltaV <= -30) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV < 0) {mpptFactor -= MINDECREMENTMPPTFACTOR; //-50} else if (deltaV >= 30) {mpptFactor += MININCREMENTMPPTFACTOR; //30} else if (deltaV > 0) {mpptFactor += MAXINCREMENTMPPTFACTOR; //40}}//else { //维持功率//else if (deltaV <= -60) {//mpptFactor -= MINDECREMENTMPPTFACTOR; //-50//}//}// Saturate the MPPT limit to min and max valuesif (mpptFactor >= mpptFactorMaximum) {mpptFactor = mpptFactorMaximum;} else if (mpptFactor <= MPPTFACTORMINIMUM) {mpptFactor = MPPTFACTORMINIMUM;}prevInputVoltageAverage = inputVoltageAverage;}
void MPPTRoutine(void) {int deltaV = 0; //inputAverageCompletedFlag = 0; // 即将计算// Store last InputPower information, calculate new InputPowerprevInputPower = inputPower;inputPower = (__builtin_mulss((int) inputVoltageAverage,(int) inputCurrentAverage) >> 15);deltaV = inputVoltageAverage - prevInputVoltageAverage;if(order==0){mpptFacotrPower[0]=inputPower;//储存/*下一次*/mpptFactor=mpptFactorBase;//order1的mppt 中间order=1;}else if(order==1){mpptFacotrPower[1]=inputPower;/*下一次*/mpptFactor=mpptFactorBase+mpptFactorDelta; //order2的mppt 右边order=2;}else if(order==2){mpptFacotrPower[2]=inputPower;/*比较判断*/if(mpptFacotrPower[0]<mpptFacotrPower[1])mpptCompare=1;else mpptCompare=-1;if(mpptFacotrPower[1]<mpptFacotrPower[2])mpptCompare+=1;else mpptCompare-=1;if(mpptCompare==2){mpptFactorBase+=MININCREMENTMPPTFACTOR;}else if(mpptCompare==-2){mpptFactorBase-=MINDECREMENTMPPTFACTOR;}else {;}/*限幅*/if (mpptFactorBase >= mpptFactorMaximum) {mpptFactorBase = mpptFactorMaximum;} else if (mpptFactorBase <= MPPTFACTORMINIMUM) {mpptFactorBase = MPPTFACTORMINIMUM;}/*下一次*/mpptFactor=mpptFactorBase-mpptFactorDelta; //order0的mppt 左边order=0;}/*if (inputPower >= (prevInputPower)) { //功率升高  //修改if (deltaV <= -100) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV < -30) {mpptFactor += MININCREMENTMPPTFACTOR; //30} else if (deltaV < -10) {mpptFactor += 35; //35  //添加} else if (deltaV < 0) {mpptFactor += MAXINCREMENTMPPTFACTOR; //40} else if (deltaV >= 30) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV >= 20) {mpptFactor -= 65; //添加} else if (deltaV >= 10) {mpptFactor -= 40;} else if (deltaV > 0) {mpptFactor -= 20; //-50}} else if (inputPower < (prevInputPower)) { //功率降低if (deltaV <= -150) {mpptFactor -= (MAXDECREMENTMPPTFACTOR << 2); //-320} else if (deltaV <= -100) {mpptFactor -= (MAXDECREMENTMPPTFACTOR << 1); //添加} else if (deltaV <= -30) {mpptFactor -= MAXDECREMENTMPPTFACTOR; //-80} else if (deltaV < 0) {mpptFactor -= MINDECREMENTMPPTFACTOR; //-50} else if (deltaV >= 30) {mpptFactor += MININCREMENTMPPTFACTOR; //30} else if (deltaV > 0) {mpptFactor += MAXINCREMENTMPPTFACTOR; //40}}*///else { //维持功率//else if (deltaV <= -60) {//mpptFactor -= MINDECREMENTMPPTFACTOR; //-50//}//}// Saturate the MPPT limit to min and max valuesif (mpptFactor >= mpptFactorMaximum) {mpptFactor = mpptFactorMaximum;} else if (mpptFactor <= MPPTFACTORMINIMUM) {mpptFactor = MPPTFACTORMINIMUM;}//prevInputVoltageAverage = inputVoltageAverage;}


原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 win10 电脑账户被停用怎么办 电脑一键还原后黑屏怎么办 win一键还原后黑屏怎么办 打架对方群殴我我怎么办 杀了人没钱赔怎么办 团伙打架被对方所刀捅伤怎么办 过失致人重伤赔偿不起怎么办 被别人打了派出所不管怎么办 先动手的被打伤怎么办 自为伤了人怎么办? 孩子被打不敢还手怎么办 小孩给电打了怎么办 电打了手都黑了怎么办 手指被电打伤了怎么办 电打了手有点麻怎么办 没打人对方确弄个轻伤证明怎么办 对人造成轻伤害怎么办 如果有人要砍我怎么办 美版手机坏了怎么办 战地4ping太高怎么办 喝了红牛睡不着怎么办 球球大作战总是闪退怎么办解决方法 球球大作战手机号己绑定怎么办 弄的底窝中药味太大怎么办 锤子手机上不了网怎么办 ppt没保存就卡了怎么办 ppt卡了没保存怎么办 匡威鞋舌头跑偏怎么办 霍尼韦尔dcs cb锁死怎么办 谷歌身份验证器丢失 怎么办 叛乱2手雷没了怎么办 王者转移号封了怎么办? 电脑被入侵挖矿怎么办 我把exe删除了怎么办 大学图书馆借书超过期限了怎么办 win10更新完鼠标没有了怎么办 打开软件提示运行出错怎么办 电脑中了u盘病毒怎么办 电脑中病毒自动重启怎么办 病毒软件不断发信息买服务怎么办 qq被腾讯屏蔽了怎么办