安徽工程科技学院机电学院毕业设计(论文)I基于单片机的数控直流恒流源的设计摘要恒流源,是一种能够向负载提供恒定电流的电源。恒流源的应用范围非常广泛,并且在许多情况下是必不可少的。它既可以为各种放大电路提供偏流以稳定其静态工作点,又可以作为其有源负载,以提高放大倍数。并且在差动放大电路、脉冲产生电路中得到了广泛应用。本文设计了一种基于单片机控制的数控直流恒流源。该恒流源以AT89S52为控制核心,采用了高共模抑制比低温漂的运算放大器OP07和达林顿管TIP122构成恒流源的主体,配以高精度采样电阻及12位D/A芯片MAX532、16位A/D芯片AD7715,完成了单片机对输出电流的实时检测和实时控制。人机接口采用4×4键盘及LED数码管显示器,控制界面直观、简洁,具有良好的人机交互性能。在软件设计上采用增量式PID控制算法,即数字控制器的输出只是控制量的增量。该系统已基本达到预期的设计目标,具有功能强、性能可靠、体积小、电路简单的特点,可以应用于需要高稳定度的小功率恒流源的领域。关键词:恒流源;PID控制算法;数字控制;单片机姚庆亮:基于单片机的数控直流恒流源的设计IITheDesignOfDcConstant-CurrentSourceControlledBasedOnSCMAbstractTheconstantcurrent,isonekindcanprovidetheconstantcurrenttotheloadthepowersource.Thereforetheconstantcurrentapplicationscopeiswidespread,andinmanysituationsisessential.Itbothmayprovidethebiasforeachkindofamplifyingcircuitbytostabilizeitsstaticoperatingpoint,andmaytakeitsactiveload,enhancestheenlargementfactor.Andinthedifferentialmotionamplifyingcircuit,thepulseproducedintheelectriccircuittoobtainthewidespreadapplication.InthepaperwedesignedaDCconstant-currentpowercontrolledbasedonSCM.ThesystemadoptAT89S52ashardcoreandthemaincircuitofconstant-currentsourceconsistofdarlingtondeviceTIP122andoperationalamplifierOP07whichhashighCMRR(CommonModeRejectionRatio)andlowtemperatureshift.Moreover,weadopt12bitD/AchipMAX532and16bitA/DchipAD7715torealizeareal-timetestandcontroltothecurrentoutputcontrolledbasedonSCM.Thedisplayinterfacewith4×4keyboardtechniqueandLEDenablesoperatortoreadthescreenmoreintuitively.ThispaperadoptincrementalPIDcontrolalgorithminsoftwaredesign,namelytheoutputofdigitalcontrollerisjusttheincrementofcontrolledvariable.Incrementalcontrolisalittleimprovementatalgorithm.However,ithassomeadvantageasfollows:first,accumulatingisnotneededinequation,thedecisionofincrementisjustinvolvedinlastthreesamplingvaluesanditcanobtaingoodcontrolledeffectwithweightedprocessing.Next,thecomputeroutputonlycontrolledincrementeverytime,namelythevariablevalueofpositioncorrespondingoperator.Sotherangeofinfluenceissmallanditwillnotaffecttheproductionprocesswhenthemachinegetoutoforder.Thissystemarmedcomprehensivefunctionalitiesinthefollowingaspects:powersuit,highcredibility,simplecircuitdesign.Itcanbeusedflexiblyinthedomainwhichinademandofhigh-stableconstant-currentsourcewithsmallpower.Keywords:Constant-currentsource;PIDcontrolarithmetic;Digital-control;SCM安徽工程科技学院机电学院毕业设计(论文)III目录引言...................................................................................................................................1第1章绪论.............................................................................................................................21.1恒流源的意义....................................................................................................................21.2恒流源的发展历程............................................................................................................21.3本课题研究现状................................................................................................................31.4论文的研究内容................................................................................................................3第2章系统的总体设计.........................................................................................................42.1恒流源综述.........................................................................................................................42.2总体方案的选取及系统性能.............................................................................................42.3恒流源基本设计原理与实现方法.....................................................................................52.4本章小结............................................................................................................................7第3章系统的硬件设计.........................................................................................................83.1单片机功能介绍................................................................................................................83.2A/D模块设计..................................................................................................................123.3D/A模块设计..................................................................................................................173.5键盘接口电路设计..........................................................................................................193.6显示器接口电路设计......................................................................................................213.7本章小结..........................................................................................................................21第4章系统的软件设计.......................................................................................................224.1控制算法..........................................................................................................................224.2软件流程图......................................................................................................................244.3本章小结.........................................................................