This is a short video but I find this very helpful against opponents that try and smash the knee down and drive to get out of my triangle.

Frames are everything in jiujitsu and will help you in many situation. This Frame will give you time to adjust your hips back into position. Even if your knee is on the ground put your hand on the knee and push until you get the frame connected. You will have to use your hips to pull back under with the pushing of your knee.