Need help with understanding PID control


Results 1 to 12 of 12

Threaded View

  1. #5
    Join Date
    Nov 2009
    Location
    London
    Posts
    251


    Did you find this post helpful? Yes | No

    Default Re: Need help with understanding PID control

    Thanks Henrik. So, is there any way I can tell what is the actual gain setting ( like 2.14 or 3.5 etc) before I multiply with 10 or 100. For example just by looking at lets say for example $0324?

    I tried the following code, but my duty stays at 255 and is not coming down after overshoot.
    'PROPORTIONAL VARIABLES
    Error_P Var Word
    Kp Var Word
    '---------------------------
    Kp=$0900

    Main:
    Gosub Get_Sensor_Value ' Get value from sensor

    ' ----- PROPORTIONAL CONTROL----------
    Error_P=Set_Point-Sensor
    Drive_p=(ABS Error_P) */ Kp
    If Error_P.15 then Drive_P=-Drive_P

    '--------------------------------------
    Drive_T=Drive_T+Drive_P '(I used DriveT=Drive_T+... to keep some level of drive)
    Duty=Drive_T
    Gosub Duty_Mosfet
    Pause 250
    Goto Main

    Duty_Mosfet:
    If Duty>255 then Duty=255
    If Duty.15=1 then Duty=0
    HPWM 1,Duty,500
    Return
    Last edited by Megahertz; - 1st December 2013 at 00:29.

Similar Threads

  1. PID help
    By Macgman2000 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 4th November 2011, 06:32
  2. Replies: 0
    Last Post: - 27th March 2011, 20:10
  3. Re: PID control + radiant heating
    By Steve_88 in forum Off Topic
    Replies: 2
    Last Post: - 18th January 2011, 13:11
  4. Pid
    By colarsson in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd November 2005, 10:18
  5. PID control with Picbasicpro
    By swordman in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 6th August 2004, 14:37

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts