上海大学毕业设计(论文)
目 录
摘要:------------------------------------------------------------------------------------------------------3 ABSTRACT--------------------------------------------------------------------------------------------------4 第一章 绪论-------------------------------------------------------------------------------------------- 5 1.1 课题研究背景-----------------------------------------------------------------------------------5 1.2 PID参数调整方法综述-----------------------------------------------------------------------6 1.3 本文主要研究内容--------------------------------------------------------------------------- 14 第二章 PID控制及其MATLAB仿真---------------------------------------------------------- 15 2.1 引言---------------------------------------------------------------------------------------------15 2.2 PID控制的基本原理------------------------------------------------------------------------ 15 2.3 模拟PID控制及其MATLAB仿真----------------------------------------------------- -16 2.4 数字PID控制及其MATLAB仿真------------------------------------------------------ 18 2.4.1 位置式PID控制算法------------------------------------------------------------------18 2.4.2 增量式PID控制算法------------------------------------------------------------------19 2.5 小结-------------------------------------------------------------------------------------------- 20 第三章 遗传算法------------------------------------------------------------------------------------22
3.1 引言-------------------------------------------------------------------------------------------- 22 3.2 遗传算法概述-------------------------------------------------------------------------------- 22
3.2.1 遗传算法的发展史-----------------------------------------------------------------------22 3.2.2 遗传算法的概念--------------------------------------------------------------------------24 3.2.3 遗传算法的特点--------------------------------------------------------------------------25 3.2.4 遗传算法的基本用语--------------------------------------------------------------------25 3.1.5 遗传算法的研究方向--------------------------------------------------------------------26 3.3 遗传算法的工作原理------------------------------------------------------------------------27 3.4 遗传算法的模式定理----------------------------------------------------------------------- 33 3.5 小结-------------------------------------------------------------------------------------------- 34 第四章 遗传算法工具箱-------------------------------------------------------------------------- -35 4.1 引言-------------------------------------------------------------------------------------------- 35 4.2 遗传算法工具箱结构------------------------------------------------------------------------35 4.3 遗传算法工具箱通用函数------------------------------------------------------------------37 4.4 小结---------------------------------------------------------------------------------------------43 第五章 基于GA算法参数调整的PID控制系统---------------------------------------------44 5.1 引言-------------------------------------------------------------------------------------------- 44 5.2 基于GA算法参数调整的PID控制系统的结构----------------------------------------44 5.3 基于GA算法参数调整的PID控制系统的仿真----------------------------------------46 5.3.1 基于GA算法参数调整的PID控制系统的具体实现---------------------------46 5.3.2 5.3.2 仿真研究与结果分析---------------------------------------------------------- 49 5.4 小结---------------------------------------------------------------------------------------------51 第六章 总结与展望----------------------------------------------------------------------------------52 6.1 总结---------------------------------------------------------------------------------------------52 6.2 展望---------------------------------------------------------------------------------------------53
1
上海大学毕业设计(论文)
致谢------------------------------------------------------------------------------------------------------54 参考文献------------------------------------------------------------------------------------------------55 附录------------------------------------------------------------------------------------------------------56
2
上海大学毕业设计(论文)
基于GA的PID参数调整
摘要
PID控制已有80余年历史,由于其算法简单、鲁棒性好和可靠性高,被广泛应用于工业过程控制,尤其适用于可建立精确数学模型的确定性控制系统。长期以来,PID的三个参数都是专业人员凭经验调整,往往寻不到最优,造成控制系统性能欠佳,以致生产资源的浪费,这迫切要求人们寻求PID参数的自动调整技术。遗传算法(GA)是一种借鉴生物界自然选择和自然遗传学机理上的迭代自适应概率性全局并行搜索算法,它是智能优化算法的重要内容。本文提出了一种基于GA的PID参数调整方法。遗传算法模仿生物进化的步骤,在优化过程中引入了选择,交叉,变异等算子,选择是从父代种群中将适应度较高的个体选择出来,以优化种群;交叉是从种群中随机地抽取一对个体,并随机地选择多位进行交叉,生成新样本,达到增大搜索空间的目的;变异是为了防止选择和交叉丢失重要的遗传信息,它对个体按位进行操作,以提高GA的搜索效率和全局搜索能力。通过适应度函数来确定寻优方向,与其他一些常规整定方法相比,遗传算法比较简便,整定精度较高。本文用GA对PID控制器的参数进行了优化调整,并选取典型的二阶系统模型进行了仿真,实验结果表明该方法的有效性,也表明遗传算法是一种简单高效的寻优算法,与传统的寻优方法相比明显地改善了控制系统的动态性能。
关键词:遗传算法,PID控制器,参数调整
3
上海大学毕业设计(论文)
ABSTRACT
PID control technology has developed for nearly eighty years.It played an important role in industrial production ,especially the positive system with exact mathematical model because it is highly simple,robust and reliable. For a long time,the three parameters of PID controller depend on professionals' experience, which can't help to obtain the best answer and lead to the wasting of resources. This is always urging people to search a technology that help PID controller get the best parameters automatically. genetic algorithm is a kind of natural selection from biological genetics and natural mechanism of the iterative adaptive probabilistic global search algorithm. In this paper, a method of tuning PID controller parameters based on genetic algorithm is introduced. Genetic algorithms imitate the steps of biological evolution, in the optimization process of the introduction of selection, crossover and mutation operators, etc., choose from the parent population will adapt to a higher degree of individual choice in order to optimize the population; cross randomly from the population to collect a pair of individuals, and a number of randomly selected cross, generate new samples, to achieve the purpose of increasing search space; variation is to prevent the loss of choice and cross-important genetic information, carried out by its individual operations, in order to enhance GA's search efficiency and global search ability. Through the fitness function to determine the optimal direction, and setting a number of other conventional methods, genetic algorithm is simple, accurate tuning. In this paper, genetic algorithm is used to tune the PID controller parameters, and a classic system model is selected to be simulated, experimental results show that the method to tune PID controller parameters is effective ,and also shows that the genetic algorithm is a simple and efficient optimization algorithm.Comparing to the traditional optimization methods,GA significantly improved the control system dynamic performance.
Keywords: genetic algorithm, PID controller, parameter tuning, GA
4
上海大学毕业设计(论文)
第一章 绪论
1.1课题研究背景
PID调节器是最早发展起来的控制策略之一,因为它所涉及的设计算法和控制结构都是简单的,并且十分适用于工程应用背景,此外PID控制方案并不要求精确的受控对象的数学模型,且采用PID控制的控制效果一般是比较令人满意的,所以在工业实际应用中,PID调节器是应用最为广泛的一种控制策略,也是历史最久、生命力最强的基本控制方式。调查结果表明在当今使用的控制方式中,PID型占84.5%,优化PID型占6.8%,现代控制型占有1.5%,手动控制型6.6%,人工智能(AI)型占0. 6%。如果把PID型和优化PID型二者加起来则占90%以上,这说明PID控制方式占绝大多数,如果把手动控制型再与上述两种加在一起,则占97. 5%,这说明古典控制占绝大多数。就连科学技术高度发达的日本,PID控制的使用率也高达84.%。这是由于理论分析及实际运行经验已经证明了PID调节器对于相当多的工业过程能够起到较为满足的控制效果。它结构简单、适用面广、鲁棒性强、参数易于调整、在实际中容易被理解和实现、在长期应用中已积累了丰富的经验。特别在工业过程中,由于控制对象的精确数学模型难以建立,系统的参数又经常发生变化,运用现代控制理论分析综合要耗费很大的代价进行模型辨识,但往往不能达到预期的效果,所以不论常规调节仪表还是数字智能仪表都广泛采用这种调节方式。正是PID控制算法具有以上多种优点,所以这种算法仍将在现场控制中居于主导地位。
随着现代控制理论的建立和不断发展完善,对过程控制提出了新的方法和思路,同日寸也由于生产工艺不断地改进提高,对过程控制也提出了高要求。科研人员在不断探索新方法的同时,也对传统的PID控制的改进做了大量的研究。因为PID控制有其固有的优点,使得PID控制在今后仍会大量使用,如何进一步提高PID控制算法的能力或者依据新的现代控制理论来设计PID控制算法是一个非常吸引人的课题。科研人员在这一领域做的工作主要有以下两方面:
①PID参数自整定。由于受控对象存在着大量不可知因素,如随机扰动、
5