i solved it in another way..
another question:
i need to make a sort of pid NOT realtime.. i explain this:
if I put a sine wave with frequency 1Hz i need the system to try to follow the wave..
sometimes it does not (the system is late with high frequency) but i need that the system follows the sine wave anyway..
how can i do that?
Example:
sine wave(0s)=0
temperature wave(os)=0 (OK)
sine wave (1s)=1
temperature wave(1s)=0,95 (acceptable)
sine wave(2s)=2
temperature wave(2s)=1,7 (not acceptable)
every value after 2sec is late. So when sine wave reaches the maximun value (example 5 for 5sec) the temperature wave is lower that 5 (example 4.5).
The sine wave is now going down but the temperature wave still going up: the temperature doesn't reach the value 5 because when it is 4.85 the sine wave is going down and so the temperature has to follow the sine wave.
At the end i have the sine wave as a sine wave (obvious) but the temperature wave as a triangle wave.
How can i force the temperature to follow the sine wave, without thinking about its late?
Thank you