Not easy to help from that description... Unknown CNC, unknown electronics, unknown wiring... a lot of unknown but important facts. When you say "it sparks" do you mean literally? In that case you have a serious electrical issue. Also, you have two wires. Does it sparks regardless which wire you touch the collet with? Probably you have a grounding issue, but it is impossible to say from this post. I think you should find someone near you with some (the more the better) electrical knowledge who can measure and fix your problems.