Gray designed marine engines and various types of machinery at George Forrester's. In 1866 he patented a steam
steering engine that incorporated feedback. It was first used in the
SS Great Eastern, the largest and most advanced ship of the day. This brought him acclaim in the engineering world. At that time as many as a hundred men might be needed to work the steering gear in an armoured cruiser moving at full speed. Gray was asked to look into using steam power for the steering gears. The invention was first tried in March 1867. The trial was successful and the steam steering gear was generally adopted. Gray said of the steering device much later, In Gray's invention the angle of the
rudder is transmitted to a
differential screw, which in turn controls a steam valve that supplies power to a motor that turns the rudder. As the rudder approaches the desired angle indicated by the helm the steam valve is adjusted to reduce power. If it moves away from that angle the valve opens to increase power and return the rudder to its position. Gray had invented a
servomechanism, a name coined by the French engineer
Joseph Farcot. Farcot must be given equal credit for the concept, which he had developed independently. Gray became a member of the
Institution of Mechanical Engineers in 1865. He also became a member of the
Royal Institution of Naval Architects. He was a Vice-President of the Institute of Marine Engineers from its foundation in 1889. McFarlane Gray wanted engineers to act according to the importance of their position. He said, "If engineers will aim at so conducting themselves that they are never spoken of otherwise as being 'quite equal if not superior to the deck officers in their language and behaviour', and if that pertains to their highly intellectual calling that makes themselves masters both of theory and the practice, the time would not be very distant when their importance in steamers would be fully recognized." Gray was employed by the
Board of Trade in Liverpool, then in
Cork and finally in
London, where he was appointed chief examiner of marine engineers. In this position his influence was limited since Board of Trade policy did not allow publication of the individual opinions of their engineering officers, but he was able to present some theoretical papers at meetings of engineers. Macfarlane Gray was instrumental in introducing the use of entropy-temperature diagrams, described by Professor
Josiah Willard Gibbs, for solving steam engine problems. He retired in 1906 and settled in Edinburgh. He died 14 January 1908 aged 76. ==Publications==