If you place the wire near a permanent magnet, this temporary magnetic field interacts with the permanent magnet field. You will know that two magnets placed near one another either attract or repel. In the same way, the temporary magnetism around the wire attracts or repels the permanent magnetism from the magnet, and that is what causes the wire to jump.
A ferrite sleeve around the three power conductors as they leave the drive will help to reduce common-mode noise current. Take all three conductors two or three times through the core. If it runs hot reduce the number of turns.
Here is where metallurgy comes into play. A motor rich in magnetically soft material will be more efficient, producing more work with less heat. And since the magnetic capacity of a motor also is influenced by the amount of active material (more core, more laminations), the tendency might be to try to add as much magnetically soft material to your design as possible.
In our experience, we disassemble, repair and reassemble objects we can see and touch. Our goal is a repair. However, to repair today vehicles, we must expand our understanding beyond things we can touch, see and use wrenches on. We must apply the technician approach to learning, information gathering and analysis.