In summary, Greg is looking for help to write the coorect PID algorithm for heating controller. He has sent a graph and references to someone who can help.f
The one thing you need to remember when trying to regulate a heating controller is the time lag through whatever you are trying to regulate. This lag can easily run into hours.
I know the formula for PID. But If You have seen my first drawing You should see that We are regulating the time when the relay is ON. We all supposed to regulate the time when the relay is OFF. Is it possible to make it by one formula or I will have to make two formula with time: first when the relay is ON second when the relay is OFF and make a loop.
We are regulating the time when the relay is ON. We all supposed to regulate the time when the relay is OFF.
I'm not sure i understand that statement.
ONtime is (1-OFFtime).
You're mixing linear control with" on-off control" here, sometimes that's called "Bang-Bang control"
and the math of that is another world. I won't go there myself
From a quick search:
Here's a paper... http://dimacs.rutgers.edu/Workshops/AIMS/slides/SLafrica4.pdf
Your best bet is to keep your on-off intervals short compared to the process time constants and treat it as linear
or insert a PWM at your controller output.