Referring to the discussion in the basic wishlist forum,
http://www.mikroe.com/forum/viewtopic.php?t=175
I am definitely interested in a PID library for use with dsPIC. While it is/has been important to have the base functions of the language and most essential libraries working first, the PID library wish should not be put away. I see several applications relating to temperature and pump/pressure/flow control where it would be useful.
PID library
Hi OT,
i know its a old post but the prob with PID control depand to analogic input AND analogic output so they depand of wich D/A converter you use ... event the brand new DSpic33F dont have analogic output... Worst of all , most of industrial control work on 4 to 20ma... so with 0-5 volt input and output you have to use resistor to be able to use the ouput. When you use resistor you lost some precision... I have make some test and with 5% resistor on 10 bit D/A converter i lost .625 celsius degree at 20 degree and 2.5 at 250 ... and that is without the imprecision of the temp reader... If you want to control the temp of your aquarium or pool, that isnt a matter but if you want make some good beer, that imprecision can scrap your batch
i know its a old post but the prob with PID control depand to analogic input AND analogic output so they depand of wich D/A converter you use ... event the brand new DSpic33F dont have analogic output... Worst of all , most of industrial control work on 4 to 20ma... so with 0-5 volt input and output you have to use resistor to be able to use the ouput. When you use resistor you lost some precision... I have make some test and with 5% resistor on 10 bit D/A converter i lost .625 celsius degree at 20 degree and 2.5 at 250 ... and that is without the imprecision of the temp reader... If you want to control the temp of your aquarium or pool, that isnt a matter but if you want make some good beer, that imprecision can scrap your batch
But they all have PWM, which can be easily used for analog out. And if you need 4-20 ma, Burr-Brown makes some 4-20 ma driver chips.piort wrote:. event the brand new DSpic33F dont have analogic output...
The bigger problem as I see it with a PID library, is that it has to be interrupt-driven, because timing is critical. I don't know if anyone has figured out a good way to integrate library functions and interrupts. If you can solve that problem, it should be easy.
If you know what you're doing, you're not learning anything.