Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void pi_regler(void)
- {
- //Differenzunterscheidung wegen Heizen und Kühlen
- if(status==KUEHLEN) {regelabweichung=t_vorl-t_soll;}
- if(status==HEIZEN) {regelabweichung=t_soll-t_vorl;}
- //Proportionalregler
- if(regelabweichung>0)
- {
- pband=(Pant*regelabweichung);
- } else
- {
- pband=0;
- }
- if(c_pid==0)
- {
- esum=esum+regelabweichung;
- if(esum>Isat)esum=Isat;
- if(esum<0)esum=0;
- iband=(esum*Iant*Ta);
- //Begrenzung des I-Anteils auf 20% der maximalen Stellgröße
- if(iband>0.25*MAXOUT)iband=0.25*MAXOUT;
- c_pid=20;
- }
- fc302_soll = pband+iband;
- //Stellgrößenbegrenzung
- if (fc302_soll > MAXOUT) // Stellgröße auf 0..1023 begrenzen (10 bit PWM)
- {
- fc302_soll = MAXOUT;
- }
- if (fc302_soll < 1)
- {
- fc302_soll = 1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement