Military grade weapons are immune to EM pulses. They are shielded and have EM sensors to shut down the exposed sensors during the EM pulse so nothing is effected. That is like a surge surpressor, they can watch for the leading edge of a spike and shut down before damage, then switch back on a millisecond later after the EM pulse is gone.
Source: While in university I had a part time job working for a defense contractor. Weapons had an "operate through" checkbox on the CDRL that needed to be validated. "Operate through" meant Operate through a nuclear em pulse. If the military was building missiles 20 years ago that could fly through an EM pulse from a megaton nuclear airburst, your home-made EM cannon will do nothing to military grade robots.