PID-filter routine (2nd try).


Closed Thread
Results 1 to 40 of 132

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Default

    Hi,
    The very first thing to tend to, IMHO, is to make the update rate as stable as possible - it is very important for stability. If you haven't already seen it, here's a pretty good article on digital PID filter implementation. It's a good read even if you're not actually writing the PID filter code - just using it.

    Keep at it and keep us posted!

  2. #2
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,146


    Did you find this post helpful? Yes | No

    Default

    I recall downloading that article, but did not read it. Will do.

    My pre-PID implementation was based on a loose control loop like this one:

    Code:
    if out_value < (setpoint - 1) then
        pwm_signal=pwm_signal+1
    endif
    
    if out_value > (setpoint + 1) then
        pwm_signal=pwm_signal-1
    endif
    It is a very simple idea that gives also a hysteresis of +/-2 points. So if the out_value is within the "dead band" nothing happens.

    The down side is that, depending on the overall loop it may take too long to reach the setpoint and also may do some oscillations also if there is delay getting the correct analog feedback.

    My first impressions using the PID is that has the potential to be very fast and accurate, despite the fact I did not managed to make it work reliable yet.

    Will come back after correcting the setup.

    Ioannis
    Last edited by Ioannis; - 30th December 2010 at 20:48.

Similar Threads

  1. Darrel's latest 16 bit averaging routine?
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 17th October 2009, 01:57
  2. 2nd order Low-pass passive RC filter on PWM
    By munromh in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 29th January 2009, 19:03
  3. Atod Digital Filter
    By GeoJoe in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 2nd April 2008, 17:04
  4. PID controller in 16F737
    By joeri in forum mel PIC BASIC
    Replies: 8
    Last Post: - 24th June 2006, 11:39
  5. 2nd Order Digital Filter for 24-bit
    By sefayil in forum mel PIC BASIC
    Replies: 0
    Last Post: - 2nd December 2005, 21:55

Members who have read this thread : 2

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

Tags for this Thread

Posting Permissions

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