Worn carbon motor brushes typically cause motor sparking when you're running the mixer.
Unplug the stand mixer and examine the motor brushes for wear. To remove a motor brush, use a screwdriver to unscrew the motor brush cap. Pull the cap and the carbon brush out. Measure the length of the carbon motor brush to determine its level of wear. Replace the carbon motor brushes if either brush is shorter than 5/16-inch because a carbon brush can cause sparks when it wears down below that length. Replace both carbon brushes at the same time to keep the motor running smoothly and efficiently.
These repairs may help solve your stand mixer problem
Replace the stand mixer carbon motor brushes
The carbon motor brushes transfer electrical current to the motor armature. If the lengths of the brushes are worn below 5/16-inch, replace both carbon brushes.