[Breadboard/PIC18F4550/PID]

Discrete Transfer Function and PID example.

1- Use potentiometer to define setpoint
2- Use RB0 switch to select open loop or closed loop with PID controller

Use octave or matlab to calculate transfer function coeficients:

>>gs = tf([1],[0.2 0.25 1]);

Transfer function 'gs' from input 'u1' to output ...

               1
 y1:  --------------------
      0.2 s^2 + 0.25 s + 1

Continuous-time model.

>> gd=c2d(gs,0.1)

Transfer function 'gd' from input 'u1' to output ...

       0.02389 z + 0.02291
 y1:  ----------------------
      z^2 - 1.836 z + 0.8825

Discrete-time model Ts=0.1.


MPLABX PID project


Download (pzw)

View Online