Need help with PWM + PID project

Discussion in 'The Projects Forum' started by usef88, Jul 30, 2008.

  1. usef88

    Thread Starter New Member

    Jul 30, 2008
    i am trying to drive a DC motor via a PWM. the system consists of 2 PCBs: one for the PWM and and another for the PID

    the PWM i have made is done using a microchip (16f877), 2 buttons, an LCD screen (16x2) and another input for the motor encoder.

    -the 2 buttons are used to increase and decrease the speed/duty cycle of the PWM.

    -the encoder input is used to read and calculate the RPM of the motor

    -the LCD screen is to display the RPM

    the PWM part works fine but i am having trouble with the PID.. i used Matlab to get the PID gains and they are as follows:
    Kp= 0.408
    Ki= 0.612
    Kd= 0.204

    how do i implement those gains physically as in what capacitor and resistor values to use (i know how to implement Kp its stright forward)..

    for those who are interested in commenting here is the block diagram:

    ..................|_ _ _ _ _encoder_ _ _ _ _|

    thank you
  2. S_lannan

    Active Member

    Jun 20, 2007