The gridiron pendulum was an improvement of clock pendulums invented by John Harrison, consisting of alternating zinc and iron rods assembled so that their different thermal expansions (or contractions) cancel each other out. Its simplest form consists of five rods. A central one runs up from the bob to just below the suspension. At that point a cross-piece (middle bridge) extends from the central rod and carries two rods, one on each side of the central rod, which reach down almost to the bob. These rods are fixed to the bottom bridge which clears the central rod and carries two further rods which run back up to the top bridge attached to the suspension. These two rods and the central one are made of iron and the other two are made of zinc. As the iron expands in heat, the bob drops relative to the top bridge and the middle bridge drops relative to the bottom one. The expansion of the zinc, however, pushes the top bridge and the bob upwards to match the combined drop caused by the iron.
Simply - the upwards expansion of the zinc counteracts the combined downwards expansion of the iron (which has a greater total length). The rod lengths are machined so that the effective length of the iron rods multiplied by iron's expansion coefficient equals the effective zinc rod length multiplied by zinc's coefficient of thermal expansion.
The original construction using brass (zinc not being available) is more complex since brass does not expand as much as zinc does. A further set of rods and bridges is needed giving nine rods in all, five iron and four brass. The exact degree of compensation can be adjusted by having a section of the central rod which is partly brass and partly iron. These overlap (like a sandwich) and are joined by a pin which passes through both metals. A number of holes for the pin are made in both parts and moving the pin up or down the rod changes how much of the combined rod is brass or iron. In the late 19th century the Dent company marketed a further development of the zinc gridiron in which the four outer rods were replaced by two concentric tubes which were linked by a tubular nut which could be screwed up and down to alter the degree of compensation.