I've built a weird rotary axis for my CNC machine. Rather than a "4th axis" driven by its own motor, this one is geared off the motion of the gantry. It's still only a 3-axis machine, and there are no electronics changes at all. As the gantry drives back and forth, a toothed rack on the table causes a matching gear to rotate. The gear holds a chuck, which holds the work piece, so that when the gantry moves the work piece rotates.