Just another thought. Are you fully straightening your knee when you are moving? If you are keeping your knee bent, you will be using your hamstring to do this, and therefore causing it to go into spasm. You need to ensure full movement of the knee, stretching of all the muscles surrounding the knee and ultimately strengthening of it.