FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Forum index » Science and Technology » Engineering » Control
realtime systems, control loop.
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
Author Message
ND
science forum beginner


Joined: 12 Apr 2006
Posts: 5

PostPosted: Wed Apr 12, 2006 7:44 pm    Post subject: realtime systems, control loop. Reply with quote

can someone rewrite the programm using intergal algo. method. to reduce
the error to almost zero. the programm is for the fan to start auto.
and cool the processor when the temp. gets to the set point or to
maintian a steady state. ( i have a graph temp against time
)

if (MV < SP)
{
cs = gain * ((MV - SP) + iterm * (integral));
}
else
{
cs = gain2 * ((MV - SP) + iterm * (integral));
}

if (cs > 1)
{
pwm_max = 0 ;
t = cs ;
if (t > 100) t = 100 ;
fan_max = t ;
}
else if (cs < 1)
{
t = -cs ;
if (t > 100) t = 100 ;
pwm_max = t ;
fan_max = 0 ;
}
else
{
fan_max = pwm_max = 0;
}
sprintf(buffer2,"MV = %2.1f I= %2.1f SP = %2.1f HEATER = %d FAN =
%d",MV,integral*iterm,SP,pwm_max,fan_max);
moveto(100,50);
outtext(buffer2);
smooth[smooth_pnt++] = yscale(MV) ;
smooth_pnt &= 0x3 ;
posit = (int)((smooth[0] + smooth[1] + smooth[2] + smooth[3])/4) ;
Back to top
AntiSPAM_g9u5dd43@yahoo.c
science forum beginner


Joined: 18 Feb 2006
Posts: 6

PostPosted: Fri Apr 14, 2006 2:02 pm    Post subject: Re: realtime systems, control loop. Reply with quote

On 12 Apr 2006 12:44:07 -0700, "ND" <imondc@hotmail.com> wrote:
Quote:
can someone rewrite the programm using intergal algo. method. to reduce
the error to almost zero. the programm is for the fan to start auto.
and cool the processor when the temp. gets to the set point or to
maintian a steady state. ( i have a graph temp against time
)

if (MV < SP)
{
cs = gain * ((MV - SP) + iterm * (integral));
}
else
{
cs = gain2 * ((MV - SP) + iterm * (integral));
}

if (cs > 1)
{
pwm_max = 0 ;
t = cs ;
if (t > 100) t = 100 ;
fan_max = t ;
}
else if (cs < 1)
{
t = -cs ;
if (t > 100) t = 100 ;
pwm_max = t ;
fan_max = 0 ;
}
else
{
fan_max = pwm_max = 0;
}
sprintf(buffer2,"MV = %2.1f I= %2.1f SP = %2.1f HEATER = %d FAN =
%d",MV,integral*iterm,SP,pwm_max,fan_max);
moveto(100,50);
outtext(buffer2);
smooth[smooth_pnt++] = yscale(MV) ;
smooth_pnt &= 0x3 ;
posit = (int)((smooth[0] + smooth[1] + smooth[2] + smooth[3])/4) ;


How about defining some of the variable so people not familiar
with the details will have a better idea of what it is you are doing?
Let me take a guess:

cs?
MV = Measured Value?
SP = Set Point?
fan_max, pwm_max

integral isn't defined. Is that the piece you need?
error = (MV-SP);
integral += error;
Back to top
Google

Back to top
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [2 Posts] View previous topic :: View next topic
The time now is Wed Jan 07, 2009 10:39 pm | All times are GMT
Forum index » Science and Technology » Engineering » Control
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Conservation of Info. and Generation ... Zim Olson Math 0 Thu Jul 20, 2006 7:53 pm
No new posts Psychotronic Weapons Systems - Physic... Jack Sarfatti Math 0 Mon Jul 17, 2006 10:46 pm
No new posts Advantech drivers for PCL-711B contro... Andy Control 2 Sun Jul 16, 2006 10:35 pm
No new posts Fuzzy Inference System (FIS) Based De... amizo1@gmail.com Mechanics 0 Fri Jul 14, 2006 7:26 pm
No new posts Signal earthing to control system easy.wei@gmail.com Control 2 Wed Jul 12, 2006 3:35 am

UK Solicitor Directory | UK Hotels | Ringtone | Sprint Ringtones | Debt Consolidation
Copyright © 2004-2005 DeniX Solutions SRL
Other DeniX Solutions sites: Electronics forum |  Medicine forum |  Unix/Linux blog |  Unix/Linux documentation |  Unix/Linux forums


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1421s ][ Queries: 16 (0.0607s) ][ GZIP on - Debug on ]