PID-filter routine (2nd try).


Closed Thread
Results 1 to 40 of 132

Hybrid View

  1. #1
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Smile thx

    Thank you so much Henrik, now I got it!
    I'll test it as soon as I can. Then i'll bother you again

    I have another question in a new thread, not related to PID, but related to counting position. Thread title: "Pulse count matching"
    "Beethoven had his critics too, see if you can name 3 of them"

  2. #2
    Join Date
    Jan 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    can i use the code to control speed and position of motor using same pic?

  3. #3
    Join Date
    May 2007
    Posts
    65


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by infinitrix View Post
    can i use the code to control speed and position of motor using same pic?
    First step (get), you Get variables from hardware (via pot, encoder, ...)
    Second step (control), you correct those variables (PID between desired and got variables)) to reach your desired speed, direction & position by PWM and polarity (depending on the type of motor DC, BLDC or what ever). That is control.

    And yes, both steps you can perform them in a single MCU. Motor control oriented MCU's works great for this, such as a dsPIC30F3011; or for this compiler, a PIC18F2431 (or any of the family PIC18Fxx31) which have QEI peripheral, where QEI stands for Quadrature Encoder Interface, which decodes signal from a rotary Quadrature Encoder, ideal for gathering motor rotation activity.

    Rodrigo M.-
    Last edited by RodSTAR; - 27th March 2009 at 17:36.
    "Beethoven had his critics too, see if you can name 3 of them"

  4. #4
    Join Date
    Jan 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    i'm using 1 channel incremental encoder and PIC16F877A.i use timer 1 to count pulse on background.to get the speed i use "count" instruction but it take a 0.5 second.is there any faster solution to calculate speed?

    i decide to use incPID program to control speed,but how can i tune to find Kp,Ki, and Kd value..
    Last edited by infinitrix; - 27th March 2009 at 22:41.

  5. #5
    Join Date
    Jan 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    anyone know how to tune PID coefficient? help me..

  6. #6


    Did you find this post helpful? Yes | No

    Default pid stuff/theory question for Mr Olsson

    .5 sec is too long to get speed reading, you may be able to timer/counter 1 pulse duration to get speed ref faster .
    PID itself is hard to tune. Isn't each correction just how-much and how fast ? and slowing-down and reducing each correction until there is no overshoot ? I made an alternator/regulator controller that self-tuned by jointly reducing correction amount and slowing corrections (longer pauses) until there were no more overshoots. The output was the PWM to MOSFET. You could also adjust up/down the gain/time with a pot input ref.
    Are you interested in PID discussion ?
    don
    amgen

  7. #7
    Join Date
    Jan 2009
    Posts
    7


    Did you find this post helpful? Yes | No

    Default

    i'm interested in pid to control position and speed.. can u show me some program and schematic for self tune pid.. i use 3 pot to adjust kp,ki and kd.. i'm just not very clear about tuning the pid..

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