The gist of the fight is this:
1. Every time you get near the machine, use the weapon technique on it. If you have the energy.
2. Then shoot one salvo of bolts which make the machine enter a shocked state.
3. Once the machine is shocked and keeps firing with shock bolts doing this the machine never leaves the state until dead.