Sunday, July 12, 2009

Universal Proportional Integral Derivative Controller


It has been quite a while since my last post. For some reason or another, these 2 months were a bit hectic during the weekends. For the past few weeks the weekends were spent attending the Hajj (Pilgrimage) Crash Course. I am hoping to go for my Hajj this year. More on that later....

I've also put on hold the project on my HUD. I was asked by my colleague to develop a Proportional,Integral and Derivative (PID) controller for an engine test equipment. So that kept me away from the HUD project (will finish the HUD thing later). Then I thought this could also be used for any system that need PID control. This thing will take any 0-5 volt input (you can also make it 0-10 or whatever by putting a voltage divider). Then there is this PID algorithm that will compute the voltage output. The DAC0830 will then output this voltage. You can use to control whatever thing that require voltage output.

Sometimes you need to trick a system by giving false input. For example, you want to tell the engine that the intake manifold pressure is high so that the engine will inject more fuel. You will get more power. This same hardware can also be used. I've developed the source codes for this. You just need to recalibrate the voltage i.e. the actual one and the desired one.

Here are the components needed:

1. PIC 16F877 - 1 (RM27)
2. buttons - 4 units
3. DAC0830LCN - 1 unit (RM10)
4. op amp LF351N - 1 unit
5. 2pole dipswitch -
6. npn transistor C337 - 1 unit
7. relay (automotive type) CMA51-S-12V - 1 unit
8. LCd display
9. resistors
10. capacitors
11. 20MHz crystal
12 some length of wires

Oh ya, you also need the negative voltage supply. I got it from the old PC power supply. See my previous post on using this power supply.

PID source code is here . The hex file is here

Signal modifier code is here .The hex file is here

I don't have the schematics yet. Maybe later....