基于单片机的特斯拉计计算
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
内容摘要
特斯拉计是用于测量各种永磁体表面磁场强度及气隙磁场强度的测量仪器,是利用霍尔效应原理制成的测磁工具。目前,在科研和生产中,由于特斯拉计在测量磁场过程中灵敏、适应性强、可靠性高、易微型化而被广泛采用。但由于霍尔探头本身存在的差异性及测量的非线性,而且在使用过程中容易损坏且定标复杂,所以必须设计出一个方案改变这种状况,使特斯拉计的应用更简易,实现自动定标和非线性区的测量。
本文主要从硬件电路和软件结构两方面介绍单片机控制的特斯拉计。硬件系统以AT89C52为核心,主要包括霍尔探头、主控电路、定标电路、信号采集和处理电路、光电隔离电路、频率测量电路、数据存储电路、显示电路、PC机的通讯接口和键盘等。磁场测量主要由霍尔探头、恒流源、不等位电势补偿电路、程控信号放大电路、A/D转换器、D/A转换器组成。定标参数及非线性区数据表格存储在串行存储器X24128中,以供单片机读取,实现定标和非线性区的磁场测量。D/A转换器采用串行16位精度的MAX541,其电压输出用来控制由LM358双运算放大器构成的压控恒流源,为霍尔探头提供工作电流,完成霍尔探头的定标。不等位电势补偿电路采用由两个高精度低漂移运算放大器OP07构成的加减法运算电路,在系统出厂前将不同探头各量程的不等位电势存储在E2PROM中,测量时提供给数字调零电路。程控放大电路采用模拟选择开关,利用电阻网络和一个运算放大器OP07组成,可程控调节不同的放大倍数,实现量程的自动转换功能。A/D转换电路采用±14位串行MAX110实现,将测
量的不同磁场值转换成数字信号送给单片机,完成数据采集。交变磁场的峰值测量电路采用采样保持器LF398组成,通过单片机I/O口P1.2、P2.0、P2.1控制正峰值的采样及保持,P1.3、P2.2、P2.3控制负峰值的采样及保持来实现。频率测量只需对调零后信号进行适当的放大,经过一个过零滞回比较器整形得到方波信号,再通过一个四分频器后,在频率大于5kHz时用计数法,小于5kHz时用测周法,由定时器/计数器T0、T1及外部中断0
INT来实现测量。电路中所有与模拟电路有关的低频接口控制线都采用光电耦合器TLP521进行隔离。显示电路采用8279LED实现,两行分别用于显示主机的实时测量数据磁场值和交变磁场频率值,键盘利用单片机的I/O口直接控制,实现五个按键:定标键、调零键、量程转换键、自动测量键、显示暂停键,按键采用中断方式响应。
关键词:磁场测量;霍尔探头;自动定标;单片机
ABSTRACT
Teslameter is to be used to measure the surface intensity of magnetic field of various permanent-magnets and the intensity of magnetic field of air-gap field. It is a permagnag based on Hall Effect. At present, Teslameter is widely used in research and production for its high sensitiveness,strong adaptability,high stability and easy micromation. But Hall probes are different and their measurement processes are nonlinear Moreover they are brittle and their picketaging processes are complicated. Therefore,to change this situation and make the application of Teslameter simple,it is meaningful to design a scheme to realize automatic picketaging and nonlinearity-area-measurement.
This paper introduces the chip microcomputer Controlled Teslameter by means of hardware and software structures. Hardware system uses the AT89C52 as the core. It mainly includes Hall probe,main control circuit,picketaging circuit,signal acquisition and process circuit,circuit of photoelectricity isolation,circuit of measure frequency,data storage circuit,display circuit,keyboard and communication with PC etc. The measurement circuit of magnetic field is mainly composed by the Hall probe, constant-current source,the non-idiostatic offset circuit,the signal amplification circuit,the D/A and the A/D transducer circuit. The data form of nonlinear region and the picketaging parameter store in serial memory
X24128 for microprocessor fetching to realize picketaging and measuring of nonlinear region. D/A transducer is serial 16-bit DACs MAX541.The voltage controlled constant-current source,which is composed by dual operational amplifiers LM358,is controlled by the voltage-output of the D/A transducer. And it offers working current for picketaging of Hall probe. The non-idiostatic offset circuit is a summing circuit/subtraction circuit. In the process of system initialization,it stores non-idiostatic from every range in E2PROM for digital zeroing. Programmable amplification circuit is composed by option switch, resistance network and an operational amplifier OP07.It can program control different magnification times of measurement,and realize auto-switch of measurement. A/D transducer is realized by±14-bit serial MAX110.It changes the different magnetic field value into a digital signal and communicates chip microcomputer. The peak value measurement circuit of alternating magnetic field adopts sample-and-hold amplifier LF398,through I/O port P1.2,P2.0,P2.1 controls sample and hold of positive peak,and P1.3,P2.2,P2.3 controls negative peak. Frequency measurement by timer/counters T0,T1 and INT0 requires the signal zero adjust,appropriate amplification,shaping by zero passage rotary comparator generate square wave signal,passing a four frequency demultiplier again. If the frequency is greater than 5 kHz counting process measure is used,else periodic time process is used. The display circuit is realized by the IC 1602,,which can sequential show the data of magnetic induction intensity and frequency of