“The height of the derailleur is also critical for smooth shifting”
Fitting a front derailleur
Step 1: Shift to the smallest chainring at the front, and the smallest sprocket at the back. Undo the cable clamp bolt and release the cable from the derailleur. Next, remove the bolt that fixes your derailleur onto your frame. Unfold the hinge that traps the band around the frame and
pull the derailleur away from the frame.
Step 2: Check the back of the derailleur cage on both old and new derailleurs. If they’ve both got a little screw holding the derailleur together, you’re in luck – undo and remove the screw and go to step 3. If either or both are a rivet, you’ll have to split the chain, either using a chain tool or a Powerlink. Thread the chain back through the new derailleur.
Step 3: Spread the back of the derailleur cage and slide out the chain. Reverse the process with
the new derailleur, ease the cage back into shape and refit the small bolt.
Step 4: Rest the back of the derailleur cage against the chainstay so you can tighten the bolt
securely without deforming the derailleur cage. Now refit the derailleur back onto the frame and
replace the fixing bolt. Don’t reconnect the gear cable yet.
Step 5: The derailleur needs to be positioned so that the outer face of the derailleur cage is
exactly parallel to the outer chainring. Pull the derailleur gently away from the frame with your
hands, to check the alignment. If it needs rotating on the frame, release it so it springs back
towards the seat tube, loosen the fixing bolt, rotate on the frame and retest.
Step 6: The height of the derailleur is also critical for smooth shifting. Pull the derailleur away from the frame, so the outer plate of the cage is exactly over the outer chainring and look from the side. The gap between teeth and cage should be 2–3mm (1⁄8 inch). If the height needs adjusting, let the derailleur drop back and adjust the height without rotating the derailleur. See below to refit the cable.
Adjusting a front derailleur
Turn the pedals and use the right-hand shifter to move the chain into the largest sprocket at the back. With the cable disconnected, the front derailleur should spring back towards the frame, pulling the chain onto the smallest chainring. If the chain doesn’t drop onto the smallest chainring, you need to adjust the low limit screw (marked ’L’ on the derailleur). Undo the screw a turn, then turn the pedals again. Repeat until the chain drops into the smallest chainring. With the chain in the largest sprocket at the back and the smallest chainring at the front, adjust the ’L’ limit screw until there is 1–2mm (1⁄16–1⁄8 inch) clearance between the inside of the chain and the inner plate of the derailleur cage. Pull the end of the still-disconnected gear cable gently and shift through the gears on the handlebars. You will feel the cable pull and release as you shift in either direction. Shift a few times to make sure the cable is in its most relaxed position. The chain should still be in the smallest chainring. Look carefully at the pinch bolt on the front derailleur and check for the position of the groove under the cable clamp bolt. Lay the cable in place and pull gently with one hand, just enough to take up any slack in the cable. Tighten the clamp bolt. Now use the instructions for fitting a new derailleur cable to adjust the cable tension.
Source : BIKE MAINTENANCE TIPS, TRICKS & TECHNIQUES
See also bike maintenance tips, tricks and techniques “Setting the end-stop screws (Part 1)”