Abstract: A milling machine and method for automatically determining the Z origin are provided. In one embodiment, a milling machine comprises a support surface; a clamp comprising a first clamp portion and a second clamp portion to accept and secure a work piece, wherein the second clamp portion comprises a sensor; a spindle movable in a Z direction; and a controller. The controller is configured to automatically determine a position of a top of the work piece by having the spindle be positioned over the sensor and then moving the spindle in the Z direction until the controller receives a signal from the sensor indicating that a tool held by the spindle contacted the sensor. Other embodiments are provided.