Energy-Residual-Based approach to gradient plasticity