Need help with understanding PID control


Closed Thread
Results 1 to 12 of 12

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: Need help with understanding PID control

    Ok, I am actually starting to understand it better now, thanks to all.

    I would like to ask, if I use pot to set this gain, the maximum decimal value I will get is 1024 i.e. $0400 (1024/256) which is 4 in terms of Kp. How do I increase Kp if I want to? (If I multiply Kp by 2 or 3 or 4 etc then I start to skip few 2nd decimal digits (pic attached). Any way around it?Name:  Capture.PNG
Views: 794
Size:  7.4 KB

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: Need help with understanding PID control

    Hi,
    Well, you could introduce some oversampling and increase the effective resolution from 10 to say 12 bits. Ie take 40 samples, add them up and divide the result by 10, you now have a 12bit value instead of a 10bit one. Or, you could use two pots, one for coarse and one for fine adjustment.

    However, I wouldn't worry too much about dropping a digit after the decimal point. Just do what you we're going to and multiply your ADC value with whatever you need to get into the range that you want, it'll work fine.

    /Henrik.

  3. #3
    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 a lot. I now will start with the prop control and add integral and then post the code to discuss any issues.

  4. #4
    Join Date
    Jan 2011
    Location
    Sydney, Australia
    Posts
    172


    Did you find this post helpful? Yes | No

    Default Re: Need help with understanding PID control

    If you need to increase the gain greater than 1024 (1024/256 = 4) without losing resolution then simply add 1024 to the ADC pot value (range 1024-2048).
    If you still need more gain then add 2048 to the ADC pot value (range 2048 -3072).

    I do agree with Henrik though, don't worry too much about dropping a digit after the decimal point.
    Perhaps use the multiplication method to quickly get you into the ball park and then use the addition method to fine tune the control if required.
    This is the method I used to tune my motor speed controller PID loop.

    Cheers
    Barry
    VK2XBP

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