This paper introduces a robust proportional integral derivative higher-order sliding mode controller (PID-HOSMC) based on a double power reaching law (DPRL) to enhance large-signal stability in DC microgrids. The microgrid integrates a solar photovoltaic (SPV) system, an energy storage system (ESS), and DC loads. Efficient DC-DC converters, including bidirectional and boost converters, are employed to maintain a constant voltage level despite the lower SPV output power. An artificial neural network (ANN) generates the optimal reference voltage for the SPV system. The dynamical model, which incorporates external disturbances, is initially developed and based on this model, and the PID-HOSMC is designed to control output power by generating switching gate pulses. Afterwards, Lyapunov stability theory is used to demonstrate the model’s closed-loop stability, and theoretical analysis indicates that the controller can converge tracking errors to zero within a finite time frame. Finally, a comparative numerical simulation result is presented, demonstrating that the proposed controller exhibits a 58% improvement in settling time and an 82% improvement in overshoot compared to the existing controller. Experimental validation using processor-in-the-loop (PIL) confirms the proposed controller’s performance on a real-time platform.