To estimate the electrical dynamic characteristics and control coefficients of distributed energy resources (DERs) in microgrids, we introduce an improved physics-informed neural network (PINN) for parameters estimation of microgrid devices. The novelty of our approach lies in two key advancements: First, we introduce a data transformation methodology that significantly accelerates the training process, achieving an increase in speed of up to 82.87% compared to the original PINN. Second, we establish ordinary differential equations (ODEs) frameworks that are adaptable to both inverter-based and synchronous-based DERs, thereby enhancing the generalizability of the proposed method. These advancements enhance the application of PINN in microgrids, paving the way for instructive simulation modeling. For analysis, we established typical microgrid systems using real-time digital simulation (RTDS) to generate the necessary data. This paper explores the effectiveness of PINNs across varying ODEs, showcasing the algorithm's adaptability to diverse mathematical models. Additionally, we illustrate the accuracy of PINN in parameter estimation for both synchronous and inverterbased DERs, with our enhanced approach achieving parameter deductions with less than a 5% error margin in a training session.