While that video showed things ( I didn't get any sound, did anyone else? )
I've done a bit of research and this is what I have come to conclude...
Algorithm with just P gain ( no I or D )
Heli is in a hover then introduce some wind from the side.
The heli leans say 3 degrees to the right. The FBL goes through one sample, sees the 3 degrees that was uncommanded and calculates based on the P gain value the response. Lets say is 1-2 so the FBL does a 6 degrees left aileron.
It samples again and say it 2 1/2 degrees off now so its response is 5 degrees left. Samples again 2 degrees off so it outputs 4 degrees left.
The flaw with P gain only is it will never get back to level. If it does happen to get level, the output is level and the wind will blow it off level again. But as it gets closer to level, the output gets less so it will eventually come to some equalibrium with say 2 degrees right and FBL output 4 degrees left will just stay there with the applied wind.
Now a PI loop ( no D gain )
Same as above, heli is blown 3 degrees right. One sample of the FBL sees the 3 degrees and gives 6 degrees left. I records the number of 6
FBL samples again and the heli is 2 1/2 degrees off so P gain says left aileron 5 degrees and the I recorded ( lets say I is 10% ) so it takes 10% of the recorded 6 so the FBL outputs 5.6 degrees left aileron and the I records the 5 + 6 from before.
FBL samples again, heli is 2 degrees off so P says 4 degrees left and the I of 11 and 10% add another 1.1 degrees so the FBL outputs left aileron of 5.1.
So what happens is the I gain keeps stacking up until the heli gets back level and when the FBL samples and the heli is level, the stacked up I values drop off.
Problem with this is the I drops off when the heli got back to level but the servos have to go to 0 position and the heli itself has some momentum so it will over shoot the level position then the cycle goes again but in the other direction.
Thats why the PI part of the video shows it zigzaging the center line.
Now the PID loop
Same as above. Heli 3 degrees right. P say do 6 degrees left. FBL outputs 6 deg left and I records 6. D records heli is 3 degrees off.
Next sample, heli off 2 1/2 degrees P says left ail 5 degrees. I adds 10% of the recorded 6 from previous sample so it adds .6 degrees. We are at 5.6 degrees left aileron the D says heli was at 3 off now its only 2 1/2 off so a difference of 1/2 degree of correction has occured. Say D is at 10% also. It actually removes 10% of the 1/2 degree the heli moved. So -.05 degrees from the D. FBL output is 5.55 degrees.
Next sample, heli is 2 degrees off so P says left ail of 4 degrees I ( same as above ) the 5+6 is 11 so it adds 1.1 deg so the same 5.1 now the D sees the same 1/2 degree correction and removes .05 degrees so the FBL outputs 5.05 degrees.
I'm not going to go way out, but as the I starts stacking up and the heli starts moving faster back to level, the D gain see the increasingly faster correction of the heli as the I keeps stacking up and actually removes some of the output correction.
Basically saying if the heli is not correcting, let the I stack up until you get the heli correcting. After the I stacks up high there is significant correction going on and the D will smooth down the rapidly increasing correction and keeps the heli from overshooting its level position.
Hows does this sounds for an explination?
CRAP!!! The first time I watched that, there was no sound. I thought it was odd. How can you understand from just watching the screen.
Anyway, watched it again and there is explination. However, I am not deleting my above post.