My personal Pym theory:
He sees the Ultimates mounting an attack on the Liberators and decides he needs to finally do the right thing. He activates an overide of the Ultron robots and orders them to aid in the attack. They do some damage to the invading force and contribute to the win. After the battle is won, Cap comes up to Hank and tells him he won't kill him, but his betrayal can never be "washed clean." Cap leaves and we see hank take a gun and shoot himself. As he's dying, we see his Ultron robots standing over him...
This is meant to be an allusion to how the 616 Vision was originally created from the mind of Wonderman.