ED-E's a little crazy. I'm not sure if it's an intended effect or an actual code glitch, but sometimes he just goes crazy. I suggest reloading the immediate save before he starts a fight, take him as far from people as possible in the area, and tell him to wait for you. I've had it happen in Primm, Camp McCarran, and inside the Atomic Wrangler.