I set both limit screws with the cable disconnected and moving the derailleur by hand. Turn the crank and rapidly push the derailleur toward the inner (largest cog) stop. You want the shift to be solid but not to spill the chain inward. Adjust the low (largest cog) limit screw to obtain that performance. You similarly adjust the high (smallest cog) limit screw by letting the derailleur's spring quickly shift to the smallest cog and adjust the limit screw to get a solid shift but not over shift the chain. When the limit screws are set you reconnect the cable and adjust it's tension to index properly.