emulating M6, M30 and M0
calculating cost of ark moves and tool changes