PD of PID in a balancing robot

Ok, I changed it, now is this the idea? Please have a look:
http://i48.tinypic.com/34zyp9t.png

So, how are you determining the lean angle of your 'bot?

The x axis of accelerometer is set in the direction of movement of the robot and horizontally, as seen in the picture, gyroscope feels rotation around 'y' axis, i.e. the rotation of x axis between -g and g. So I combine both of their output to get the lean angle. I learned this by reading a lot online, I never seen a technique somewhere used to differentiate the signal of the motor rotation from the robot lean. May be that is the reason it is oscillating this much fast?

Well, here how I combine accel and gyro output:

      accel_raw = (signed int) analogRead(A_PIN) - A_ZERO;
      gyro_raw =  (signed int) analogRead(G_PIN) - G_ZERO;
  
  rate = (float) gyro_raw * G_GAIN;

  angle = A * (angle + rate * DT) + (1 - A) * (float) accel_raw * A_GAIN;