-
系统中温度控制电路的作用是用于接收主控芯片指令,并按要求改变激光器中TEC的功率,其主要由DAC和H桥驱动电路构成。
H桥部分如图 2所示。其中TEC+和TEC-两个引脚连接激光器的TEC两端,TECheat与TECcool连接主控芯片,用于控制温度控制电路在加热状态和制冷状态之间切换。Rsn1是一个1Ω的采样电阻,TECcurrent端输入的是用来控制TEC功率的电流,这个电流由DAC输出经过运算放大器反馈生成,通过此电路可以令主控芯片精确控制TEC的制冷/制热功率。
温度控制系统的模型如图 3所示[15-16]。其中, t表示时间,u(t)表示目标温度,y(t)表示实际温度,e(t)表示实际温度与目标温度的误差值。
激光器的传递函数未知,但可由实际系统测量得出。由经验可得激光器的传递函数是1阶模型,该传递函数在连续s域中由以下方程表示:
$ G\left( s \right) = \frac{K}{{\tau s + 1}} $
(1) 式中, K与τ为参量。对主控芯片编程,令激光器在某一时刻得到一恒定输入,即对激光器模型施加一个阶跃信号。对测得输出曲线进行适当平移后,使用MATLAB的Curve Fitting工具箱中的y=Kexp(x/τ)函数进行拟合从而获得K与τ的具体数值。多次测量拟合取平均即可求得激光器的传递函数。
控制器采用鲁棒性强的增量式数字PID控制,模拟PID算法的公式为:
$ u(t) = {K_{\rm{p}}}\left[ {e(t) + \frac{1}{{{T_{\rm{i}}}}}\int_0^t e (t){\rm{d}}t + {T_{\rm{d}}}\frac{{{\rm{d}}e(t)}}{{{\rm{d}}t}}} \right] $
(2) 式中, Kp为比例系数,Ti为积分时间,Td为微分时间,u(t)是PID控制器的输出信号,因为是数字系统,以T为采样周期,k作为采样序号,将其离散化即令t=kT得:
$ \begin{array}{*{20}{c}} {u(k) = {K_{\rm{P}}}\left\{ {e(k) + \frac{T}{{{T_{\rm{i}}}}}\sum\limits_{j = 0}^k e (j) + } \right.}\\ {\left. {{K_{\rm{P}}}\frac{{{T_{\rm{d}}}}}{T}[e(k) - e(k - 1)]} \right\}} \end{array} $
(3) 因为上式由第2项的累加和增加了运算量,现求每次的增量如下:
$ \begin{array}{*{20}{c}} {\Delta u(k) = u(k) - u(k - 1) = }\\ {{K_{\rm{p}}}\left( {1 + \frac{T}{{{T_{\rm{i}}}}} + \frac{{{T_{\rm{d}}}}}{T}} \right)e(k) - {K_{\rm{p}}}\left( {1 + \frac{{2{T_{\rm{d}}}}}{T}} \right) \times }\\ {e(k - 1) + {K_{\rm{p}}}\frac{{{T_{\rm{d}}}}}{T}e(k - 2) = }\\ {Ae(k) + Be(k - 1) + Ce(k - 2)} \end{array} $
(4) 式中, $A = {K_{\rm{p}}}\left({1 + \frac{T}{{{T_{\rm{i}}}}} + \frac{{{T_{\rm{d}}}}}{T}} \right), B = - {K_{\rm{p}}}\left({1 + \frac{{2{T_{\rm{d}}}}}{T}} \right), C = {K_{\rm{p}}}\frac{{{T_{\rm{d}}}}}{T}$。只要调节这3个参量,PID控制系统的性能就能达到最优。
-
智能粒子群算法是一种有效的全局寻优算法,是KENNEDY和EBERHART在1995年提出,模拟鸟类觅食过程的进化算法,通过个体间的协作与竞争,实现复杂空间中最优解的搜索[17-18]。在粒子群算法中,每一个优化问题的解看作是搜索空间的一只鸟,即“粒子”。算法可描述为:首先在n维可行解空间中,初始化N个随机粒子组成种群X={X1, X2, …, XN},其中每个粒子所在位置Xi={xi, 1, xi, 2, …, xi, n}都为优化问题的一个可行解,此外每个粒子都有一个速度,记作Vi={vi, 1, vi, 2, …, vi, n}。粒子通过速度不断更新自身位置搜索新解,而且粒子会记住自己搜索到的最优解,记作pi, d,以及整个种群经历过的最优解,记作pg, d,每次位置移动后,粒子根据下面两式更新自己的速度。
$ \begin{array}{l} {v_{i, d}}(t + 1) &= &\omega {v_{i, d}}(t) + {\eta _1}{\mathop{\rm rand}\nolimits} ()\left( {{p_{i, d}} - {x_{i, d}}(t)} \right) + \\ &&{\eta _2}{\rm{ rand }}()\left( {{p_{{\rm{g}}, d}} - {x_{i, d}}(t)} \right) \end{array} $
(5) $ {x_{i, d}}(t + 1) = {x_{i, d}}(t) + {v_{i, d}}(t + 1) $
(6) 式中,vi, d(t+1)代表第i个粒子在t+1次迭代中第d维上的速度,ω为惯性权重,η1为个体经验加速常数、η2为社会经验加速常数,rand()为0~1之间的随机数。(5)式中等号右边的第一部分为粒子先前的速度,这个部分维持着算法拓展搜索空间的能力;第二部分是“认知”部分,表示粒子本身的思考;第三部分为“社会”部分,表示粒子间的信息共享与相互合作[19]。算法流程图如图 4所示。
-
将(4)式中PID系统的3个参量看成3位空间的一个矢量解,对应算法中的一个粒子,根据经验确定3个参量的取值范围以及算法中基本参量的设置。算法中判断解的优劣需要一个适应度函数,而对于PID系统,各个性能指标之间往往是互相矛盾的,因此要求所有性能指标达到最优是不现实的。在此采用了控制领域中应用广泛的误差绝对值乘以时间积分(integral of time multiplied absolute error, ITAE)与超调量之和为适应度函数:
$ J = \int_0^\infty t |e(t)|{\rm{d}}t + \sigma M $
(7) 式中, M为系统产生的超调量,σ是权重系数,可以通过调整权重系数优化不同系统性能,增大此系数代表该适应度函数更注重抑制系统的超调量。算法的目标是寻找一组参量使得J的值最小,整体的系统框图如图 5所示。
基于粒子群自整定PID算法的激光器温度控制系统
Laser temperature control system based on particle swarm self-tuning PID algorithm
-
摘要: 为了使激光器能够稳定工作, 设计并实现了一个控制速度快、精度高, 并且可调谐的温度控制系统。该系统使用ATmega328P为处理器, 通过粒子群算法自整定比例-积分-微分(PID)系数, 采用闭环负反馈的PID结构实现对激光器的温度控制。结果表明, 在本系统控制下, 激光器能在15s左右达到目标温度, 且到达目标温度后温度误差约为±0.01℃, 并可保持较长时间, 激光器输出功率波动很小, 方差仅为568.49μW。该系统对蝶形封装激光器的温度可以实现有效的温度控制。Abstract: In order to make a laser work stably, a temperature control system with fast control speed, high precision and tunable performance was designed and implemented. ATmega328P was used as the processor in the system. Self-tuning proportional-integral-differential (PID) coefficients was determined by particle swarm optimization. A closed-loop negative feedback PID structure was used to control the temperature of the laser. The results show that, under the control of this system, the laser can reach the target temperature in about 15s. The temperature error after reaching the target temperature is about (±0.01℃). It can be maintained for a long time. The output power of the laser fluctuates very little. The variance is only 568.49μW. The system can effectively control the temperature of butterfly packaging laser.
-
[1] WANG L J, NING Y Q, QIN L, et al. Development of high power diode laser [J]. Chinese Journal of Luminescence, 2015, 36(1): 1-19(in Chinese). [2] ZHONG Q R, JIANG H M, DAI J K, et al. Development situations of semiconductor laser controllers [J]. Optical Communication Technology, 2016, 40(5):52-54(in Chinese). [3] ZHANG P L, ZHANG L Ch. A semiconductor laser's temperature control system based on PID algorithm[J].Electronic Science & Technology, 2016, 3(5):543-545(in Chinese). [4] WU J, LI Ch J. Design of high precision temperature control system based on TEC[J]. Electronic Design Engineering, 2017, 25(20):75-79(in Chinese). [5] LUO L, HU J Ch, WANG Ch Y, et al. Design of high-precision driving power and temperature control circuit for semiconductor laser [J]. Laser Technology, 2017, 41(2):200-204(in Chinese). [6] HUANG J Q, ZHAI B, HE Q X, et al. A temperature controller for near-infrared semiconductor laser used in gas detection [J]. Acta Photonica Sinica, 2014, 43(6):36-41 (in Chinese). [7] BAO M. Laser temperature control system based on fuzzy theory and neural network [J]. Laser Journal, 2017, 38(10):123-126(in Ch-inese). [8] CHEN Sh G, WANG Ch, ZHU P Y, et al. Simulation of heat exchange temperature control based on fuzzy adaptive PID[J]. Industrial Control Computer, 2017, 30(8):105-106(in Chinese). [9] FANG L H, WEN J G, JIANG Y Ch, et al. Design of a temperature control system for semiconductor laser based on digital filtering [J]. Laser Technology, 2016, 40(5):701-705 (in Chinese). [10] SHAO M C, ZHANG Q Sh. Laser temperature control system based on genetic algorithm optimizing PID[J]. Laser Journal, 2016, 37(4):96-99(in Chinese). [11] HUANG G L, QIN Y Y. Design and realization of temperature control system of laser controlled by PID[J]. Laser Journal, 2016, 37(10):142-145(in Chinese). [12] XIN Q Q, WAN Y, BI W B, et al. Study on modeling and experiment of wavelength temperature characteristic for semiconductor laser[J]. Tool Engineering, 2017, 51(12):115-117(in Chinese). [13] ZUO Sh, HE T, YAO S Y. Temperature control system for semiconductor laser based on fuzzy PID[J]. Laser & Infrared, 2014, 44(1):94-97(in Chinese). [14] XIAO Sh, LU W Y. The design of thesemiconductor laser temperature control system based on PID control[J].Laser Journal, 2015, 36(6):39-42(in Chinese). [15] QIN Sh, GONG Y, YUAN W Q, et al. High precision temperature control for projection lens with long time thermal response constant [J]. Optics and Precision Engineering, 2013, 21(1):108-114(in Chinese). doi: 10.3788/OPE.20132101.0108 [16] WANG X Z, HOU H Y, ZHAI Zh Sh, et al. Mathematical modeling and parameter identification of temperature control systems based on thermoelectric coolers [J]. Laser Technology, 2015, 39(6):789-793(in Chinese). [17] ZHAI Z Y, YE M Y. A coating design method based on particle swarm optimization [J]. Acta Photonica Sinica, 2011, 40(9):1338-1341 (in Chinese). doi: 10.3788/gzxb20114009.1338 [18] ZHAO Zh Zh, HE K, HE H J. PID control parameters tuning based on shuffled frog leaping algorithm [J]. Journal of Heilongjiang Institute of Technology, 2017, 31(6):38-41(in Chinese). [19] WANG X M, WANG H F, YAO N F. Parameter optimization of laser displacement sensor based on particle swarm optimization algorithm [J]. Laser Technology, 2018, 42(2):181-186(in Chin-ese).