PI compensator on Arduino . How ??

hello ,
I am trying to improve my transient performance of the closed loop control system using an ultra sonic sensor as feedback and a water pump as a Actuator . after modeling and some control signal math i came to the result of a PI compensator :

Gc = 20*(Z-0.9803)/(Z-1)

but the question is how do i write the code for this one ??

i know that there is PID library for this , but how to do it exactly ??

thank you in advance for your help ,

Zema :wink:

Do you have the same class assignment as this poster? How to express a PI compensator in my program [Water Level Control] - Project Guidance - Arduino Forum

Is Z a complex number ?

jremington:
Do you have the same class assignment as this poster? How to express a PI compensator in my program [Water Level Control] - Project Guidance - Arduino Forum

yes we are in the same team :wink:

michinyon:
Is Z a complex number ?

Z means the complex variable in the Z-plane ,which describes the " Discrete signal " . For " continuous signal " we use S that refers to the Laplace plane .

oussama0716:
yes we are in the same team :wink:

Given that and this...

http://forum.arduino.cc/index.php?topic=288336.msg2017430#msg2017430

This thread is now locked.

@oussama0716, if you want to continue this discussion do it on the other thread.