If the particle is in a loop, then, there are two forces: the gravity force and the centripetal force. The total force in any point of the loop, wil be, the sum of the gravity force and the centripetal force in the point. If you have the object in the top point, then the sum tht force gravity and the centripetal force is cero, then the gravity force is equal to the centripetal force, but the diference is the sign.
mg\bar{u_g}+m\frac{v^2}{r}\bar{u_r}=0 This is the condition in the maximun
mg\bar{u_g}=-m\frac{v^2}{r}\bar{u_r} Look at the sign