1680s; from machine (n.) + -ery. Originally theatrical, "devices for creating stage effects" (which also was a sense of Greek mēkhanē); meaning "machines or parts of machines considered collectively," is attested from 1731. Transferred meaning "any complex system of (non-mechanical) means to carry on a particular work" is by 1770. Middle English had machinament "a contrivance" (early 15c.).
"in the exact middle," 1874, the noun phrase (1836) in reference to lathes or other rotating machinery, meaning the point which does not revolve; see dead (adj.).