Research Article A New Type-3 Fuzzy PID for Energy Management in Microgrids Weiping Fan , 1 Ardashir Mohammadzadeh , 2 Nasreen Kausar , 3,4 Dragan Pamucar , 5 and Nasr Al Din Id 6 1 Swan College, Central South University of Forestry and Technology, Changsha, 410210 Hunan, China 2 Multidisciplinary Center for Infrastructure Engineering, Shenyang University of Technology, Shenyang 110870, China 3 Department of Mathematics and Statistics, Quaid e Azam university, Islamabad, Pakistan 4 Department of Mathematics, Faculty of Arts and Sciences, Yildiz Technical University, Esenler, 34210 Istanbul, Turkey 5 Faculty of Organizational Sciences, University of Belgrade, Belgrade, Serbia 6 Department of Mathematics, University of Aleppo, Aleppo, Syria Correspondence should be addressed to Nasr Al Din Id; ide1112002@yahoo.ca Received 3 June 2022; Accepted 4 July 2022; Published 29 July 2022 Academic Editor: S. E. Naja Copyright © 2022 Weiping Fan et al. This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited. More recently, type-3 (T3) fuzzy logic systems (FLSs) with better learning ability and uncertainty modeling have been presented. On other hand, the proportional-integral-derivative (PID) is commonly employed in most industrial control systems, because of its simplicity and eciency. The measurement errors, nonlinearities, and uncertainties degrade the performance of conventional PIDs. In this study, for the rst time, a new T3-FLS-based PID scheme with deep learning approach is introduced. In addition to rules, the parameters of fuzzy sets are also tuned such that a fast regulation eciency is obtained. Unlike the most conventional approaches, the suggested tuning approach is done in an online scheme. Also, a nonsingleton fuzzication is suggested to reduce the eect of sensor errors. The proposed scheme is examined on a case-study microgrid (MG), and its good frequency stabilization performance is demonstrated in various hard conditions such as variable load, unknown dynamics, and variation in renewable energy (RE) sources. 1. Introduction Today, as technology advances and the consumerist popula- tion grows, providing sustainable, safe, and clean energy is one of the humans core concerns. Regarding limitation of non-RE resources and the environmental problems caused by their consumption, dierent countries have decided to choose other energy sources, including renewable sources, as a future and sustainable energy source. Although RE sources are available worldwide, many of these sources are not available seven days a week, 24 hours a day. Some days may be windier than others, the sun does not shine at night, and droughts may occur for a period of time. It can be unpredictable weather events that disrupt these technologies. To improve the sustainability, some energy storage systems and modern controllers should be used to make a balance between consumption and germination [1, 2]. Because of its simplicity and capacity, PID control sys- tems are extensively employed in most industrial problems such as mechanical engineering, chaotic systems, and electri- cal engineering [3]. In proportional control mode of PID, the output is proportional to the amount of error (hence, it is called proportional). If the error is large, the controller output is large, and if the error is small, the controller output is small. The adjustable parameter of proportional control is called controller gain. The higher the controller gain leads to the higher the proportional error. If the gain is adjusted too high, the control loop will start to oscillate and become unstable [4]. On the other hand, if the gain is too low, responding to disturbances or changes in the setpoint will not be eective enough. There is one major drawback to using a proportional controller alone, and that is oset. Oset is a persistent error that cannot be eliminated by proportional control alone. The integrated control mode continuously Hindawi Advances in Mathematical Physics Volume 2022, Article ID 8737448, 15 pages https://doi.org/10.1155/2022/8737448