Linear motor for automatic screw machine