NTC热敏电阻温度采集方案
NTC温度采集方案,有详细的算法,包括一些程序,硬件设计等SUNPLUS用热敏电阻做朵用温度月录页系统概要系统说明热敏电阻器1.2.1电阻一温度关系1.3数值处理线性插值软件说明软件说明2档案构成2.3程序说明程序范例DEMO程序使件原理佟使用资源硬件使用资源说明参考文献SUNPLUS用热敏电阻做朵用温度修订记录版本日期编写及修订者编写及惨订说明初版错误校SUNPLUS用热敏电阻做朵用温度系统概要系统说明木应用例实现ⅳrC热敏电阻器对温度的测量。热敏电阻器把温度的变化转换为电阻阻值的变化,再应用相应的测量电路把阻佶的变化转换为电压的变化;SPMC75F2413A内建8路ADC可以把模拟的电压值转换为数字信号,对数值信号进行处理可以得到相应的温度值。热敏电阻器热敏电陧有电阻值随温度升高而升高的正温度系数(3 ositive Tcmpcraturc Coefficient简称PC)热敏电阻和电阻值随温度升高而降低的负温度系数( Negative TemperatureCoefficient简称NTC)热敏电阻。NT~热敏电阻器,是·种以过渡金属氧化物为主要原材料,采用电了陶瓷⊥艺制成的热敏半导体陶瓷组件ε这种组件的电阻值随温度升髙而降低,利用这一特性可制成测温、温度补偿和控温组件,又可以制成功率型组件,抑制电路的浪涌电流。电阻温度特性可以近似地用下式来表示:式中:Rη、R分别表示NTC在温度T(K)和额定额定温度T(K)卜的电阻值,单位2,T、T为温度,单位K(Ts(k)-273.15+T(℃))。B,称作B值,NTc热敏电阻特定的材料常数(Beta)。由于B值同样是随温度而变化的,因此NT热敏电阻的实际特性,只能粗略地用指数关系来描述,所以这种方法只能以一定的精度来描述额定温度或电阻值附近的有限的范围。但是在实际应用中,要求有比较精桷的R-T曲线。要用比较复杂的方法(例如用thesteinhart-Hart方程),或者用表格的形式来给定电阻/温度关系应用例选用NC热敏电阻器CwF2-502F3950,基于精确的R-T曲线,来对温度进行精确的测量。电阻一温度关系如表1-1所示,NC热敏电阻器CwE2-502F3950各温度点的电阻值,即电阻一温度关系表。从提供的电阻一温度关系表中可以看出NTC热敏电阳器CWE2-502E3950的测温范围为[-55℃,125℃],其电阻值的变化范围为[25006292,242.6492]。表1-1电阻一温度关系衣温度℃电阻值Ω温度℃电阻值Q温度℃电阻值Q55250062542374045322523952213575120241219175C4918158018171895-471626844615393345l∠56384∠1377534313029342123231-4111655CSUNPLUS用热敏电阻做朵用温度4010232391042613898621.793295.53688267.43583521.83479043.93374819.23270833.93167074.730635292960184.6-2857030.22754054.72651247.9-25486002446101.6234374422415192139418.82037435.9-1935563.51833795-1732124.463C545.829053.827643.3-1326309.525047.91123854.2-1022724,621655.320642.719683.618774.917913.6417097.116332.915588.4111891.5014230113601.913005.412438.7l1900.111388.210901.310438.39997.74578.41109181113799128436.83133091.73147762.787449.16167150.C4176864.7592.4196332.49206C34.32215847.31225620.89235404,53245197.72255000264810.9274630.014456.93294291.283C4132.69313980.83323835.383696.03343562.193434.53194.1383C81.22392972.92402869412769.24422673.47432581.5442493.17452408.3462326.76472248.38482173.04492100.6502032511963.92521899.441837.4541777,6已1720.2561664.85571611.541560.2591510.746C1463.08611417,14621372.87631330.18641289.C21249.321211.03671174.C91138.44691104.04701070.83711C38.78721007.8273977.9374949,0675921.1776894.22868.1878843.027980795.1781772.4382750.4483729.1784708.685688.786669.4487650.88632.76SUNPLUS用热敏电阻做朵用温度89615.39C91582.0292566.179550.8194535.9495521.5396507.5797∠94.0598480.9499468.23100453.301443.9710243210321.15104410.26105399.69106389.4407379.5103369.85109360.48101,411112.57112334.01325.69114317.62115309.7716302.16117294.76118287.5719280.59120273.8121267.21122260.8123254.512L248.52125242.64数值处理通过表1-1电阻一温度关系表可以很直观的看到电阻的变化范围从242.649到2500629,在-55℃的时候其表现出的电阻值是125℃时所表现的电阻值的1030倍,这幺大的变化范围也为ADC测量带来了困难。测量电路如图1-1所示。如图1-1测量电路如上图所示NTC热敏电阻Rⅴ和测量电阻Rm(精密电阻)组成一个简单的串联分压电路,参考电压VCC Ref经过分压可以得到一个电压值随着温度值变化而变化的数值,这个电压的大小将反映出NTC电阻的人小,从而也就是相应温度值的反映。通过欧姆定律可以得到输出电压值Vadc和NTc电阻值的一个关系表达式:vadVre上+Rm/(Rv+Rm)那幺接下来的数据处理将基于式(1)展开:sPMC75F2413A的ADC为10-Bit的精度,其参考电SUNPLUS用热敏电阻做朵用温度压为5V,因此这里可以选择Vre£=5V。各温度点对应的ADC转换后的数字量可以计算。Dadc = 1024*Adc/5V(2)式(1)、(2)结合可以得到:Dadc 1024*Rm/(Rv+Rm)(3)如果这里取测量电阻Rm选择4.7K9,那幺可以计算出在-55℃时所对应的Dadc=1024*1000/(250062+100C)=4;在125℃时所对应的Dadc=1024*1000/(242.64+10C0)824。根据这样的对应关系对数据进行预处理,得到如下处理结果如表1-2所示:表1tatic const Int16 NTCTAB2[18119,20;21,22,23,24,26,27,29,30,32;34,36,38,40,42,44,47,49,52,55,57,61;64,67,71,74,78,82,86,90,95,99,104,109114120,150,156,161,168,172,180,187,194,201,208,215,22,230,238,247255,264,272,280,291,302,310;319328,338;347,357367,376,384;395,4C5,414r424;434444,453,464,47448,494,502;512,522,531,540,551,560,569,579,586;595,604,613,624,633,642,650;658,666,673,680,688:696,704,712,719,726,733,741;749,755,760,767,774,780,785,791,798,804,811,816,8827,832,837,842;847,851,856;862,868,873,856;860,64,868,872,376;879,883,886;890,893,896,899;902,905,908,911,914;917,919,922;924,927,929,931;934,936,938,940,942,94,946,947,949,951,953,954,956,958,959,961,962;964,965,966,968,969,970,971,973,974};//4.7K当然这也是应用例中所需要的一个很重要的转换表,这一部分是事先制作好的表格,将为接下来的处理提供参考依据。测量电阻Rm的选取是有一定的规律的,在实际的应用中不一定都需要测量全程温度,可以估算岀大致的温度范围。木着提高测量精度的宗旨:如果是应用在测量低温的系统中建议Rπ选择较大的电阻(10KΩ),如果在测量较高温的系统中建议Rn选择较小的电阻(1κΩ)等。线性插值在AEC进行数据采集的过程中不可能每个数值都在整温度所对应的AD数值上,所以如果在两个数据的中间一段就要对其进行进一步的精确定位。这样就必须知道采集到的数据在表1-2中的具体位置,因此要对数据表进行搜索、查找。线性表的查找(也称枍索),可以有比较常见的顺序查找、折半查找及分块查找等方法,分析线性表1-2可以得到折半查找的算法是比较高效的。Eg如果ADC采样的数值为Dade=360,即357
- 2020-12-04下载
- 积分:1
Concepts in Programming Languages.pdf
Concepts in Programming Languages by John Mitchell.一本国外经典教材,看了之后对编程语言更加理解。费了很多劲才找到的。Concepts in Programming LanguagesThis textbook for undergraduate and beginning graduate students explains and examines the central concepts used in modern programminglanguages, such as functions, types, memory management, and controlThe book is unique in its comprehensive presentation and comparisonof major object-oriented programming languages. Separate chapters ex-amine the history of objects, Simula and Smalltalk, and the prominentanguages c++ and JavaThe author presents foundational topics, such as lambda calculus anddenotational semantics, in an easy-to-read, informal style, focusing on themain insights provided by these theories. Advanced topics include concurrency and concurrent object-oriented programming. A chapter on logicprogramming illustrates the importance of specialized programming meth-ods for certain kinds of problemsThis book will give the reader a better understanding of the issuesand trade-offs that arise in programming language design and a betterappreciation of the advantages and pitfalls of the programming languagesthey useJohn C. mitchell is Professor of Computer Science at Stanford University,where he has been a popular teacher for more than a decade. Many of hisformer students are successful in research and private industry. He received his ph D. from mit in 1984 and was a member of technical staff atat&T Bell Laboratories before joining the faculty at Stanford. Over thepast twenty years, Mitchell has been a featured speaker at internationalconferences; has led research projects on a variety of topics, includingprogramming language design and analysis, computer security, and applications of mathematical logic to computer science; and has written morethan 100 research articles. His previous textbook, Foundations for Pro-gramming Languages(MIT Press, 1996), covers lambda calculus, typesystems, logic for program verification, and mathematical semantics ofprogramming languages. Professor Mitchell was a member of the programming language subcommittee of the ACM/ieEE Curriculum 2001standardization effort and the 2002 Program Chair of the aCm principlesof programming languages conferenceCONCEPTS NPROGRAMMINGLANGUAGESJohn c. mitchellStanford UniversityCAMBRIDGEUNIVERSITY PRESSPUBLISHED BY THE PRESS SYNDICATE OF THE UNIVERSITY OF CAMBRIDGEThe Pitt Building, Trumpington Street, Cambridge, United KingdomCAMBRIDGE UNIVERSITY PRESSThe Edinburgh Building, Cambridge CB2 2RU, UK40 West 20th Street, New York, NY 10011-4211 USA477 Williamstown Road, Port Melbourne vic 3207, AustraliaRuiz de alarcon 13, 28014 Madrid, spainDock House, The Waterfront, Cape Town 8001, South Africahttp://www.cambridge.orgo Cambridge university press 2004First published in printed format 2002isBN 0-511-03492-X eBook(adobe readerISBN 0-521-78098-5 hardbackContentsPrefacepage IxPart 1 functions and foundations1 Introduction1.1 Programming Languages1.2 Goals1.3 Programming Language History3561.4 Organization: Concepts and Languages2 Computability2. 1 Partial Functions and computability102.2 Chapter SummaryExercises163 Lisp: Functions, Recursion, and Lists3.1 Lisp History183.2 Good Language design203. 3 Brief Language overview223.4 Innovations in the Design of Lisp253.5 Chapter Summary: Contributions of LispExercises404 Fundamentals484.1 Compilers and syntax484.2 Lambda calculus4.3 Denotational semantics4.4 Functional and Imperative Languages4.5 Chapter SummaryExercisesContentsPart 2 Procedures, Types, Memory Management, and Control5 The algol Family and ML5.1 The Algol Family of Programming Languages5.2 The Development of C5.3 The LCF System and ml5.4 The Ml Programming Language1035.5 Chapter summary121Exercises1226 Type Systems and Type Inference1296.1 Types in Programming1296.2 Type Safety and Type Checking1326.3 Type Inference1356.4 Polymorphism and Overloadin1456.5 Type Declarations and Type Equality1516.6 Chapter Summary155Exercises1567 Scope, Functions, and storage Management1627.1 Block-Structured Languages1627.2 In-Line blocks1657.3 Functions and procedures1707.4 Higher-Order functions1827.5 Chapter summary190Exercises1918 Control in Sequential Languages2048.1 Structured control2048.2 Exceptions2078.3 Continuations2188.4 Functions and evaluation order2238.5 Chapter summary227Exercises8Part 3 Modularity, Abstraction, and object-Oriented Programming9 Data Abstraction and Modularity2359.1 Structured Programming2359.2 Language Support for Abstraction2429.3 Modules9.4 Generic Abstractions2599.5 Chapter Summary269Exercises27110 Concepts in Object-Oriented Languages27710.1 Object-Oriented design27710.2 Four Basic concepts in object-Oriented languages278Contents10.3 Program Structure28810.4 Design Patterns29010.5 Chapter summary29210.6 Looking Forward: Simula, SmalltalkC++Java293Exercises29411 History of objects: Simula and smalltalk30011.1 Origin of Objects in Simula30011.2 Objects in Simula30311.3 Subclasses and Subtypes in Simula30811.4 Development of smalltalk31011.5 Smalltalk Language features31211.6 Smalltalk flexibilit31811.7 Relationship between Subtyping andInheritance2211.8 Chapter SummaryExercises32712 objects and Run-Time Efficiency: C++33712.1 Design goals and Constraints33712.2 Overview of c++34012.3 Classes. Inheritance and Virtual functions34612.4 Subtyping35512.5 Multiple inheritance12.6 Chapter summary366Exercises36713 Portability and Safety: Java38413.1 Java language overview38613.2 Java Classes and Inheritance38913.3 Java Types and Subtyping39613.4 Java System architecture40413.5 Security Features41213.6 Java summary417Exercises420Part 4 Concurrency and Logic Programming14 Concurrent and Distributed Programming43114.1 Basic Concepts in Concurrency43314.2 The actor model44114.3 Concurrent ML14.4 Java concurrency45414.5 Chapter Summary466Exercises469Contents15 The Logic Programming Paradigm and Prolog47515. 1 History of logic Programming15.2 Brief Overview of the logic Programming Paradigm4715. 3 Equations solved by Unification as Atomic Actions15.4 Clauses as Parts of procedure declarations48215.5 Prologs Approach to Programming48615.6 Arithmetic in Prolog49215.7 Control, Ambivalent Syntax, and Meta-Variables49615.8 Assessment of Prolog50515.9 Bibliographic remarks50715.10 Chapter Summary507Appendix a Additional Program Examples509A 1 Procedural and Object-Oriented organization509Glossary521Index525
- 2020-12-09下载
- 积分:1