Need help with drone pid

Hey guys, I am trying to make a drone. I am done with the program except the PID part.

Current status:
I have the pitch and roll angle (Variables: xangle and yangle).
I have the rotational rate of pitch and roll (Variables: xrate and yrate).
I have the pitch and roll input from the transmitter on a range from -25 to +25.
Throttle input is from 0 to 1000.

Main problem:
I have pretty much no clue on how to use both the rotational rate and angle in the PID. Like, what data should be used in which part of the PID etc.

I was hoping anyone could explain on how to program the PID in detail.
I was following this tutorial series 'YMFC-3D part 5 – Quadcopter PID controller and PID tuning. - YouTube' but couldn't understand this PID part.
I am also ready to use any other way than the method specified in the video.

Thanks.

bottom right of your posts is other/modify
change the subject line to need help with drone PID
it will help a lot to get people who know drones to help

If you want to use the code of other people, look at ArduPilot. If you want somebody to write the code for you, ask in Gigs and Collaborations. Otherwise start learning how the drone motors affect the drone orientation, roll etc.

You have pitch and roll control inputs from the receiver. You have xangle (pitch?) and yangle (roll?). Use the control inputs from the receiver as the Setpoints (desired position). Use the angle values as the Inputs (current position). The PID loops will calculate Outputs: the amount to change the controls to make the Inputs match the Setpoints.

To increase pitch, add the pitch Output value to the front two motors and subtract it from the back two.
To increase roll, add roll Output value to the left two motors and subtract it from the right two.

Add the Throttle value to all four motors.

Note: To make the quad 'yaw' you would add a value to the CW motors and subtract it from the CCW motors.

But I saw using angles alone won't work. How will I use both angles and °/s to calculate PID ???

Use a Kalman filter.

PROBOT135:
But I saw using angles alone won't work. How will I use both angles and °/s to calculate PID ???

The angles alone will work but you can use "Sensor Fusion" Sensor fusion - Wikipedia to get more accurate angle values by combining the angle and rate values. In the end, it's the angle alone that goes into the PID Input.

well, okay then.

Thanks.