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

very low frequency filter

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



Joined: 07 Jul 2009
Posts: 98
Location: Curtea de Arges, Romania

View user's profile Send private message Send e-mail Yahoo Messenger

very low frequency filter
PostPosted: Tue Oct 06, 2015 7:14 pm     Reply with quote

Hello everyone, I use and i made many filters such as PID, adaptive, elliptic, FIR, IIR, low pass and high pass, complementary, kalman. I really don't remember how many, but all are designed to work on low, medium and high frequency. I want to make a control for precise humidity in a chamber, with my own software. For the moment i have some industrial devices for humidity control, and they don't work really well. Humidity is very low response and i don't have an idea of what filter to use for control.
I use some traditional humidifiers including ultrasound humidifier, also a condensing point with a peltier device, but all respond very very low and single filter with some results was kalman, but is so complex for my 18F pic, too many floating points. Anyone have any reasonable idea ?
I don't ask for code, but here are so many brilliant minds and ....... any idea is welcome. Thanks.
temtronic



Joined: 01 Jul 2010
Posts: 9220
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Oct 06, 2015 7:38 pm     Reply with quote

idea #1. Do NOT use floating point math !! NOT required, takes way too much time and not any better than integer math.

idea #2. Do a lot of testing. I can't comment on what sensor response you have or how tight a spec you need(1%,10%, .1%) humidity or time response required(1 minute, 1 hour,??). If humidity control is anything like temperature it is a slow function,so good baseline testing with a known source is important to not overshoot the setpoint.

idea #3.Check the sensor manufactures website for datasheet and read them several times especially response times. There's no point sampling every microsecond if the sensor has a 1/2 second response time.

idea #4. Only alter ONE variable at a time during testing.IE: Don't change the rate of control AND the chamber size at the same time. You'll never get meaningful data if you do.

Jay
wangine



Joined: 07 Jul 2009
Posts: 98
Location: Curtea de Arges, Romania

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Tue Oct 06, 2015 8:31 pm     Reply with quote

yeea, thanks man. My last sensors are SHT75 and SHT31 (i will post the drivers in library after full tests), the last one is very fast, 10 measurement/s http://www.farnell.com/datasheets/1905459.pdf . On temperature is easy because the temp is not really slow response, even the ordinary PID is awesome. The problem is the overshot humid on 5-10%, and i need less than 2% accuracy on that.
The other problem is: My humidity and temp need to oscillate during one day, several times, between 48-52*C and 74-91% RH, according with my diagram. If i try to keep constant humidity, is not very difficult, but when i try to decrease or increase humidity is annoying. Example: if my actual humidity is 91%RH and i need to decrease in 20 min to 80%, humidity will go below 60%RH for 6-10 minutes and that is really bad because the tobacco leaf becomes dry and stops the fermenting process. Once fermenting process was stopped, it takes 2-3 days to ferment again. That is why mistakes are not acceptable.
Like i say, kalman work good but i don't want to put a 24f or 32F pic for a ordinary humidity and temp control. I became to think the real problem is my hardware humidity control. Thanks for advice, new ideas are open. Wink
temtronic



Joined: 01 Jul 2010
Posts: 9220
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Wed Oct 07, 2015 5:06 am     Reply with quote

query? Do you have a small fan constantly gently blowing in your 'chamber' to equalize the humidity?
This would be necessary, both for the leaves and to get constant, accurate readings.

I know if you did a study and put the 'chart' into MATLAB you can get it to 'reverse engineer' the data into an equation. Perhaps EXCEL can do the same thing? I've never done it, more a hardware guy not a spreadsheet guru, though I did use Visicalc a lot !

Jay
wangine



Joined: 07 Jul 2009
Posts: 98
Location: Curtea de Arges, Romania

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Oct 07, 2015 6:33 am     Reply with quote

Yes exist 3 fans in chamber with different speed. The chamber is designed to work on any temperature of medium (on winter as example) also is thermal isolated. The fans are controlled over 5 temperature sensors on all corners and levels on chamber.
The single way to get out humidity is with condensing point technique. I need more study.
Ttelmah



Joined: 11 Mar 2010
Posts: 19487

View user's profile Send private message

PostPosted: Wed Oct 07, 2015 7:06 am     Reply with quote

It's also worth realising that you can (for instance), use algorithms like 'ID' (no P term), if things change very slowly. Just gently adjust based upon a long term integration, with a D term to catch over-correction.
Generally I use 'scaled integer', perhaps using a 32bit value, or which the top 24bits are considered as the result, with the bottom 8bits being the 'fractional' part that is thrown away before correction. Implement PID with this, and you can get smooth fast responses, without the overheads of FP.....
wangine



Joined: 07 Jul 2009
Posts: 98
Location: Curtea de Arges, Romania

View user's profile Send private message Send e-mail Yahoo Messenger

PostPosted: Wed Oct 07, 2015 7:44 am     Reply with quote

Ok , but how without proportional ? Can schow me a example , or a simple math , i'm confuse right now , anyway i dont realy like a PID filter . thanks
Ttelmah



Joined: 11 Mar 2010
Posts: 19487

View user's profile Send private message

PostPosted: Wed Oct 07, 2015 8:17 am     Reply with quote

Think about what the terms 'do'.

The P term gives an immediate response to an error.
The I term gives a long term response to cumulative error. Slow drift.
The D term catches how fast the output is changing, and slows or accelerates this.

Build yourself some PID functions in a spreadsheet, and feed these with some sample values you have measured. Have the three coefficients adjustable. Then set the P value to 0, and realise that it still will track the errors, but only slowly.
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