CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

PID question. Sampling frequency?

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
valemike
Guest







PID question. Sampling frequency?
PostPosted: Tue Sep 14, 2004 9:18 am     Reply with quote

I'm using pin RB0 as a zero cross detector from the AC line.
My period for the heater is 8 cycles (thus 8 x 16.6ms = 133ms).
The duty cycle is 0 thru 8, giving me a fraction of n/8.

If doing PID regulation, how often do I have to sample the temperature? Everytime the 8 cycles has elapsed? Or more often, less often?
Ttelmah
Guest







Re: PID question. Sampling frequency?
PostPosted: Tue Sep 14, 2004 9:45 am     Reply with quote

valemike wrote:
I'm using pin RB0 as a zero cross detector from the AC line.
My period for the heater is 8 cycles (thus 8 x 16.6ms = 133ms).
The duty cycle is 0 thru 8, giving me a fraction of n/8.

If doing PID regulation, how often do I have to sample the temperature? Everytime the 8 cycles has elapsed? Or more often, less often?

It depends on other things. How quickly the sensor responds to changes in the temperature, how fast the heater responds etc.. If the system has a 'slow' response time, you can sample at a much lower frequency. If however the response if fast, then the 'control loop' also needs to be fast.
The loop time, needs to be significantly faster than the system response time, or oscillation is likely.

Best Wishes
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Tue Sep 14, 2004 9:55 am     Reply with quote

In your case once per eight cycles would be ideal, preferably near the end of cycle eight when the heater is almost allways off. For a heater it doesn't matter much but if it was an electrically noisy load like a motor it is especially good to sample when the load is off.

If you were to sample every 7 or 9 cycles you could get a "beat note" between the PWM cycles and the sampling cycles that can cause problems. Keep the sampling a constant multiple (or sub-multiple) of the PWM cycle.
_________________
The search for better is endless. Instead simply find very good and get the job done.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group