When connecting a Li-On battery and ebike DC controller, oftentimes we see a spark on the wire. The reason why is the surge current that flows into the controller because of the large capacitor that gets charged. Sparking that you have is pretty normal. The controllers with large capacitors may have this issue, it’s because you’re filling the capacitors quickly and that’s causing the spark.
To prevent this event you can use an on/off switched battery. It will eliminate the spark that you see. Although some ebike users proceed with another option to eliminate the sparks. They use a pre-charge resistor. Pre-charge resistors slow down the current by the capacitors in the controller when it’s connected to the battery. However, we don’t recommend this option to eliminate sparks. For a permanent resolution, an on/off switched battery would be the best option.