Thread: Self Balancing Robot. PID terms?

  1. #1
    Registered User
    Join Date
    Oct 2013
    Posts
    9

    Self Balancing Robot. PID terms?

    Hey guys
    Im trying to tune my PID loop to make my robot balance but i dont know if im using the right terms for my robot?
    Im implementing a contemporary filter for my Gyro(98%) and Acc(2%).
    Is the following right?

    output=(Kp*error)+(Ki*(error*dt))+(Kd*((error-prev_error)/dt))

    error=robot angle --Balance point at 0deg
    prev_error=--Previous error
    dt=0.01 --10ms delay

    thankyou
    Last edited by spitso; 10-23-2013 at 09:17 AM.

  2. #2
    Registered User
    Join Date
    Mar 2011
    Posts
    596
    Based on my somewhat limited knowledge of PID temperature controllers, it basically looks correct.

    You may need to negate the PID sum, depending on the action direction of the servo mechanism.
    It needs to be degenerative (negative feedback).

    -

  3. #3
    Registered User
    Join Date
    Mar 2011
    Posts
    596
    I should add something -

    I don't know exactly how you are implimenting things, but normally the integral value isn't simply summed in
    with the P and D values. The integral action produces a persistant shift or offset in the control output. This offset
    remains even after error*dt has become zero. The I action removes steady state errors.

    For example, the proportional action will not necessarily regulate the robot angle to zero. The loop gain will not be
    high enough to do that. Integral action will remove that type of error.

    The P, I and D values are summed in the sense that they all contribute to the control output. The contribution of the
    I value remains though after equalibriun is restored. At least until another steady state error occurs.

    -

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 10-20-2013, 10:25 PM
  2. Replies: 11
    Last Post: 02-04-2012, 09:46 AM
  3. Avl Tree Balancing
    By Jajo in forum C Programming
    Replies: 0
    Last Post: 08-06-2010, 04:48 AM
  4. AVL tree balancing problem
    By sweets in forum C++ Programming
    Replies: 4
    Last Post: 05-06-2004, 12:17 PM
  5. btree balancing
    By ender in forum C++ Programming
    Replies: 1
    Last Post: 11-09-2001, 02:22 PM