资源目录
压缩包内文档预览:(预览前20页/共65页)
编号:27532908
类型:共享资源
大小:25.56MB
格式:ZIP
上传时间:2019-11-28
上传人:遗****
认证信息
个人认证
刘**(实名认证)
湖北
IP属地:湖北
6
积分
- 关 键 词:
-
变压器
智能
功能
系统
毕业设计
论文
资料
- 资源描述:
-
变压器的智能绕线功能系统毕业设计论文资料,变压器,智能,功能,系统,毕业设计,论文,资料
- 内容简介:
-
随着电子电器工业的发展,线圈的需求量越来越大、品种也越来越多,从大型的电力变压器、牵引电机绕组到充电用的微型线圈、节能灯具用线圈,以及各类电子设备都使用线圈。绕线机是用来绕制线圈的设备。在使用的各种绕线机中,有最早的手工绕线,现在大都用机械式的绕线机。机械式绕线机精度较差,线圈需逐匝检验,工作效率较低,劳动强度高,尤其是机械式绕线机由于没有采用自动控制技术,线滚子由于惯性超越运行,散线易划去表面绝缘层,影响产品质量。现在国内绕线机已有了全自动、多功能、自动化产品。从线圈生产的上线、排线、馈线、到线圈绕制下线等,都实现了过程自动化。从绕线机的控制形式上看,从单一的开环控制发展到使用直流伺服系统和交流伺服系统的闭环控制,已经形成了由单轴绕制线圈到多轴同时绕制多个线圈的系列产品。但这些先进的绕线机产品价格很高,对中小型电机制造企业的绕线使用来说,功能有比较大的冗余,价格太高,一旦出现故障自己难以维修,所以针对某中小型电机制造厂使用机械式绕线机的缺点,根据实际生产的要求,研制成本低、功能满足使用要求、简单易学、操作方便的数控绕线机。在我国已生产和使用了多年,改革开放以来,我国元器件厂也引进了许多国外的绕线机。常见的有平行绕线机、环行绕线机及各种特种绕线机等。在绕制细微漆包线时,这些机器都会遇到共同的问题,如无法达到整齐排线,绕线张力无法控制等,特别是绕制01mm 以下的一些音圈、传感器机芯等线圈时,问题尤为突出。针对这种情况,我们研制了这种适用于细微漆包线的绕线机,很好地解决了这个问题,用它绕制的磁电式测振传感器机芯线圈,张力稳定,线圈直流电阻一致性好,排线整齐,外观达到了“镜面”效果变压器、线圈以及其他绕组是电器设备常用的部件,这些部件一般由绕线设备绕制而成。绕线骨架有效长度、绕线线径以及绕线圈数是影响部件电气性能的3个主要技术参数,同时,也是评价绕线设备绕线质量的重要功能指标。由于单片微机的出现和其在实时控制系统应用方面表现出的优异功能,使现代绕线机越来越多地采用单片机作为其控制电路的核心,通过适当设计可以克服上述问题,并能实现人-机对话。本文提出了一种采用AVR单片微机为核心的智能绕线机控制电路。由微机控制的绕线机通常由四部分组成:电源、微机控制电路、定位伺服放大系统和机头。其电源部分由主电源和数控电源组成,以向电机、控制电路和伺服放大系统等提供电能;定位伺服放大系统可采用脉宽调制控制伺服放大器。通过改变直流伺服电动机电枢上的电压控制电动机转速,改变脉冲个数控制电机转过的角度,从而实现准确定位和较大范围调速;本文利用步进电机变细分驱动排线机构、直流电机调速驱动绕头,以单片机作为控制微机开发了新型自动绕线机。该机能在有效长度不同的绕线骨架上,对不同线径的绕线实现定圈数高质量绕排,具有结构简单,变通性强,性能价格比较高等优点。绕制绕组的设备一般都装有计数器,常用的计数器有机械式和电子式计数器。准确快速地计数对保证产品质量和提高工作效率非常重要。在绕组绕制过程中,当绕组匝数达到规定值停机时,由于绕线机转动惯量很大,因而绕线机不会立刻停止转动,即使是采取提前停机的措施也很难正好绕到绕组规定的匝数,还需要进行正转或反转的调整。为此设计了一种绕线机自动计数控制器,能进行绕线机自动起、停控制和正、反转计数。该计数控制器在测试中取得了满意的效果。该装置运用了先进的新型MCU 和显示驱动专用芯片, 使其计数、显示、控制一气呵成,形成了集成度高、运行可靠、操作安全的智能化控制系统。这种简捷、清晰、精锐的系统结构不但可用于绕线机的控制装置,也可改造并使其它机械设备的智能化程度得到提高。1 系统概述1.1 系统功能要求1)用户能够输入产品的参数信息。2)采用PWM控制,无极变速,慢速启动3)自动排线,换向灵敏,到匝自动停车4)绕制线圈最大外径: 120mm5)绕制线圈最大长度: 180mm6)绕制线圈最小长度: 3mm7)绕制线圈线径范围: 0.030.5mm8)计数器范围: 099999圈9)主轴转速: 802500转/分钟10)断线时停车报警 11)液晶屏显示参数 12)能够保存30个产品参数信息 1.2 系统组成经过分析系统功能的要求,可以将各部分功能分别由硬件完成,或硬件与软件共同完成。得出系统的框图如图1.1。图1.1 系统组成在硬件设计时需考虑上面所述的1),2),10),11)点。硬件部分应该包含:主轴电机控制电路,排线电机控制电路,圈数计数电路,排线到位检测电路,键盘输入电路,显示电路,电源电路。此外,硬件电路设计时要考虑数字与模拟间的抗干扰问题,采取有效的抗干扰措施。在软件设计时需考虑上面所述的1)12)各点。软件部分应该实现:键盘按键的捕捉识别,主轴电机的控制,排线电机的控制,数据的显示,参数的存取,圈数计数,断线报警。2 系统设计方案的比较2.1控制器的方案论证与选择 方案一:采用可编程逻辑器件CPLD作为控制器。CPLD可以实现各种复杂的逻辑功能、规模大、密度高、体积小、稳定性高、IO资源丰富、易于进行功能扩展。采用并行的输入输出方式,提高了系统的处理速度,适合作为大规模控制系统的控制核心。但本系统不需要复杂的逻辑功能,对数据的处理速度的要求也不是非常高。且从使用及经济的角度考虑我们放弃了此方案。方案二:采用凌阳公司的16位单片机,它是16位控制器,具有体积小、驱动能力高、集成度高、易扩展、可靠性高、功耗低、结构简单、中断处理能力强等特点。处理速度高,尤其适用于语音处理和识别等领域。但是当凌阳单片机在语音处理和辨识时,由于其占用的CPU资源较多而使得处理其它任务的速度和能力降低。方案三:采用Atmel公司的ATmaga16L单片机作为主控制器。ATmaga16是一个低功耗,高性能的8位单片机,片内含16k空间的可反复擦些100,000次的Flash只读存储器,具有1Kbytes的随机存取数据存储器(RAM),32个IO口,2个8位可编程定时计数器,1个16位可编程定时计数器,四通道PWM,内置8路10 位ADC。且maga系列的单片机可以在线编程、调试,方便地实现程序的下载与整机的调试。从各个角度考虑,方案三的可行性高。2.2直流电机驱动电路的方案论证与选择方案一:使用模拟电路,通过电位器调节电机两端电压进行调速。如图2.1,达林顿管串联在直流电机回路上,通过调节电位器改变电机回路的电流的大小,从而达到控制电机速度的目的。此方案的优点在,电路简单,通过一个电位器就可以达到调节电机速度的目的,但它也存在明显的不足,三极管工作在放大区时在电机回路上将产生一个0.724V的压降,会产生很多的热量,效率很低。方案二:利用PWM控制电机调速。PWM控制是利用微处理器的数字输出来对模拟电路进行控制的一种非常有效的技术,广泛应用在从测量、通信到功率控制与变换的许多领域中。PWM控制技术1的理论基础是:冲量相等而形状不同的窄脉冲加在具有惯性的环节上时,其效果基本相同。PWM对半导体器件的导通和关断进行控制,是输出端得到一系列幅值相等而宽度不相等的脉冲,用这些脉冲来代替正弦波或其他所需要的波形。按一定的规则对各脉冲的宽度进行调制,既可改变逆变电路输出电压的大小,也改变输出频率。如图2.2所示,将方案一中的达林顿管换成场效应管。从场效应管的栅极输入一PWM脉冲,通过调节PWM波的占空比来控制场效应管导通与截止的时间比,从而达到调整电机速度的效果。由于场效应管工作在开关状态,且导通电阻很小,可达10毫欧,所以用此电路的效率很高,但必须有PWM波电路。 图2.1 电机驱动方式1 图2.2 电机驱动方式2比较方案一与方案二,方案二的优势显著,且ATmaga16L单片机集成了PWM波输出,可以通过软件来实现电机速度的调节,所以选择方案二。2.3显示电路的方案论证与选择方案一:采用数码管显示。数码管显示的亮度高,显示效果鲜明,且价格低,软件编程简单,但数码管显示内容单一,只限于显示数字,显示的区域小,硬件连接麻烦。如图2.3。图2.3 数码管显示的效果方案二:采用液晶屏显示。液晶屏显示的内容多,不仅可以显示数字,还可以显示汉字和字母,显示区域也比数码管的大。可以通过编程实现菜单操作,用户操作起来很方便简单。如图2.4。图2.4 液晶显示的效果本系统要显示的数据较多,要存取的数据也多,用液晶显示可以设计成菜单结构,显示内容直观,操作方便,故选择方案二比较合适。3 系统硬件设计3.1单片机电路3.1.1 AVR单片机内部结构AVR单片机2内部资源非常丰富,集成了各种常用的外围设备,如图3.1所示,主要由以下部分组成:l 16K字节擦写寿命 10000 次的系统内可编程Flashl 具有独立锁定位的可选Boot 代码区l 片上Boot 程序实现系统内编程l 可同时读写操作的512字节擦写寿命100000 次的EEPROMl 1K字节的片内SRAMl 可以对锁定位进行编程以实现用户程序的加密l JTAG接口,标准的边界扫描功能支持扩展的片内调试功能l 通过JTAG 接口实现对Flash、EEPROM、熔丝位和锁定位的编程l 两个具有独立预分频器和比较器功能的8 位定时器/ 计数器l 一个具有预分频器、比较功能和捕捉功能的16 位定时器/ 计数器l 具有独立振荡器的实时计数器RTCl 四通道PWMl 8路10 位ADCl 2个具有可编程增益(1x, 10x, 或200x)的差分通道l 面向字节的两线接口IICl 两个可编程的串行USARTl 可工作于主机/ 从机模式的SPI 串行接口l 具有独立片内振荡器的可编程看门狗定时器TWIl 片内模拟比较器l 上电复位以及可编程的掉电检测BODl 片内经过标定的RC 振荡器l 片内/ 片外中断源l 6种睡眠模式: 空闲、ADC 噪声抑制、省电、掉电、Standby 模式l 32 个可编程的I/O 口AVR 内核具有丰富的指令集和32 个通用工作寄存器。所有的寄存器都直接与算逻单元(ALU) 相连接,使得一条指令可以在一个时钟周期内同时访问两个独立的寄存器。这种结构大大提高了代码效率,并且具有比普通的CISC 微控制器最高至10 倍的数据吞吐率。AVR的ATmega16 有如下特点:16K字节的系统内可编程Flash(具有同时读写的能力,即RWW),512 字节EEPROM,1K 字节SRAM,32 个通用I/O 口线,32 个通用工作寄存器,用于边界扫描的JTAG 接口,支持片内调试与编程,三个具有比较模式的灵活的定时器/ 计数器(T/C),片内/外中断,可编程串行USART,有起始条件检测器的通用串行接口,8路10位具有可选差分输入级可编程增益(TQFP 封装) 的ADC ,具有片内振荡器的可编程看门狗定时器,一个SPI 串行端口,以及六个可以通过软件进行选择的省电模式。 工作于空闲模式时CPU 停止工作,而USART、两线接口、A/D 转换器、SRAM、T/C、SPI 端口以及中断系统继续工作;掉电模式时晶体振荡器停止振荡,所有功能除了中断和硬件复位之外都停止工作;在省电模式下,异步定时器继续运行,允许用户保持一个时间基准,而其余功能模块处于休眠状态; ADC 噪声抑制模式时终止CPU 和除了异步定时器与ADC 以外所有I/O 模块的工作,以降低ADC 转换时的开关噪声; Standby 模式下只有晶体或谐振振荡器运行,其余功能模块处于休眠状态,使得器件只消耗极少的电流,同时具有快速启动能力;扩展Standby 模式下则允许振荡器和异步定时器继续工作。是以Atmel 高密度非易失性存储器技术生产的。片内ISP Flash 允许程序存储器通过ISP 串行接口,或者通用编程器进行编程,也可以通过运行于AVR 内核之中的引导程序进行编程。引导程序可以使用任意接口将应用程序下载到应用Flash存储区(Application Flash Memory)。在更新应用Flash存储区时引导Flash区(Boot Flash Memory)的程序继续运行,实现了RWW 操作。 通过将8 位RISC CPU 与系统内可编程的Flash 集成在一个芯片内, ATmega16 成为一个功能强大的单片机,为本系统的应用提供了灵活的解决方案。图3.1 单片机内部结构3.1.2 AVR单片机引脚功能图3.2 AVR单片机引脚功能图3.2是AVR单片机DIP封装的引脚图,以下是各引脚功能说明。VCC 数字电路的电源GND 地端口A(PA7.PA0) 端口A 做为A/D 转换器的模拟输入端。端口A 为8 位双向I/O 口,具有可编程的内部上拉电阻。其输出缓冲器具有对称的驱动特性,可以输出和吸收大电流。作为输入使用时,若内部上拉电阻使能,端口被外部电路拉低时将输出电流。在复位过程中,即使系统时钟还未起振,端口A 处于高阻状态。端口B(PB7.PB0) 端口B 为8 位双向I/O 口,具有可编程的内部上拉电阻。其输出缓冲器具有对称的驱动特性,可以输出和吸收大电流。作为输入使用时,若内部上拉电阻使能,端口被外部电路拉低时将输出电流。在复位过程中,即使系统时钟还未起振,端口B 处于高阻状态。端口B 也可以用做其他不同的特殊功能。端口C(PC7.PC0) 端口C 为8 位双向I/O 口,具有可编程的内部上拉电阻。其输出缓冲器具有对称的驱动特性,可以输出和吸收大电流。作为输入使用时,若内部上拉电阻使能,端口被外部电路拉低时将输出电流。在复位过程中,即使系统时钟还未起振,端口C 处于高阻状态。如果JTAG接口使能,即使复位出现引脚 PC5(TDI)、 PC3(TMS)与 PC2(TCK)的上拉电阻被激活。端口C 也可以用做其他不同的特殊功能。端口D(PD7.PD0) 端口D 为8 位双向I/O 口,具有可编程的内部上拉电阻。其输出缓冲器具有对称的驱动特性,可以输出和吸收大电流。作为输入使用时,若内部上拉电阻使能,则端口被外部电路拉低时将输出电流。在复位过程中,即使系统时钟还未起振,端口D 处于高阻状态。端口D 也可以用做其他不同的特殊功能。RESET 复位输入引脚。持续时间超过最小门限时间的低电平将引起系统复位。门限时间见P36Table 15。持 续时间小于门限间的脉冲不能保证可靠复位。XTAL1 反向振荡放大器与片内时钟操作电路的输入端。XTAL2 反向振荡放大器的输出端。AVCC AVCC是端口A与A/D转换器的电源。不使用ADC时,该引脚应直接与VCC连接。使用ADC时应通过一个低通滤波器与VCC 连接。AREF A/D 的模拟基准输入引脚。3.1.3 AVR单片机最小系统电路 图3.3是AVR单片机最小系统电路图,图中U1是AVR单片机,是整个系统的核心控制单元,R1和C1组成单片机的复位电路,晶振XTAL,和C1,C2是单片机时钟源的辅助电路。AVR单片机的外围电路非常简单,使系统更加的简单,提高可靠性,降低故障率。图3.3 AVR单片机最小系统电路 复位电路是为了保证单片机在正式运行程序之前,将内部各个功能寄存器的状态回复到初始状态,以保证单片机按照程序设计者的意图运行。R1与C1构成RC电路,在系统上电后,单片机复位端电压渐渐升高,当电压升高到复位端RESET门限电压0.9V时,单片机完成复位,在系统断电后,C1通过复位引脚内部电路放电,在下一次上电时又可以进行复位过程。由于刚上电时,电路中的电容,电感的存在,电路电源的稳定需要一定时间才能使单片机正常可靠运行,所以复位时间长对系统的可靠性有利。电路中R1选10k,C1选10uF,复位时间在10MS以上,可以可靠的对单片机进行复位。R1,C1应该靠近单片机,与单片机的连线短些,可以减少因为周围干扰一起的错误复位动作。由参考文献11,124-125可知。使用外部晶振速度快,频率稳定,抗干扰强,适合在周围用电环境复杂,系统可靠性要求高的电路中。晶振XTAL,和C1,C2与单片机内部时钟源电路一起组成8M的时钟频率,供给单片机内部使用,单片机的熔丝配置中应该选择使用外部晶振选项。晶振,校正电容C2,C3,与单片机的连线应该越短越好,且周围不要有大电流回路,尽量不要在晶振底部走线,晶振的金属外壳要与地相连,可以提高时钟电路的稳定性和可靠性。3.1.4 AVR单片机PWM电路为了调节电机速度,设计方案中选择了PWM方式,AVR单片机内部集成了PWM模块,通过编程可以实现PWM的频率和占空比的调整。以下是AVR单片机PWM模块的工作原理。图3.4 PWM产生原理图3.4是PWM占空比调整的原理图。计时器重复地从BOTTOM 计到MAX,然后又从MAX倒退回到BOTTOM。在一般的比较输出模式下,当计时器往MAX计数时若发生了TCNTn与OCRn的匹配,OCn将清零为低电平;而在计时器往BOTTOM计数时若发生了TCNTn与OCRn 的匹配, OCn 将置位为高电平。因此通过设置OCRn的值就可以改变PWM的占空比。PWM的周期可以通过设置TCNTn计数脉冲的频率来调整,如果用系统时钟,则同过选择分频比就可以得到所需的PWM波的频率。PWM周期的选择直接关系到电机控制的性能, PWM频率太低,则电机转动不顺畅,抖动,噪声大,输出力矩不稳定。PWM频率太高,则驱动电机的功率管长期工作在高频开关状态,发热量大,效率低,还容易烧毁。一般选择PWM频率为15KHZ,可兼顾两方面的要求。3.2 电源电路 由于电机需要驱动电路需要24V的工作电压而单片机、液晶显示器、传感器 等工作电压需要5V,所以变压器的24V输出需要经过稳压模块稳定到单片机的工作电压范围。考虑到电机驱动电路必须和单片机分开供电,这样可以避免电机电路对单片机电路的干扰所以采取对单片机单独供电,步进电机和直流电机桥臂共用一个24V电源。系统电源电路原理如图3.5所示。图3.5 系统电源电路原理3.2.1 电源电路的结构 由变压器出来的交流信号经过桥式整流3和电容滤波之后送给LM7805,稳压5V输出,它的输出单独供给单片机。在三端稳压管的输入输出端与地之间连接大容量的滤波电容,使滤掉纹波的效果更好,输出的直流电压更稳定。接小容量高频电容以抑制芯片自激,输出引脚端连接高频电容以减小高频噪声,使单片机工作在一个良好的电源环境中,提高系统稳定性。3.2.2 电源芯片引脚功能电源电路主要运用到7805稳压芯片,输出电压为5V,加散热片时驱动电流可达1A,输出电流200300mA时,7805温度在50度左右,并且有过温切断输出起到保护功能。该系列芯片技术成熟,所需的外围器件少,性价比高,运用的非常广泛,其内部原理图如图3.6。图3.6 7805内部原理图图3.7为7805的引脚图:INPUT 电源输入端,最大可达35VGROUND 电源地OUTPUT +5V输出端图3.7 7805的引脚图步进电机的稳驱动采用专用的驱动电路模块,使用模块电路可以加快产品开发速度,使系统结构简单,稳定,可靠。且单片机只需2个接口就可以完成步进电机的方向和步进控制。所选用的驱动器型号为森创公司的SH-20403,它的主要参数如下:l 10V40V直流供电l H桥双极恒相流驱动l 最大3A的8种输出电流可选l 最大 64细分的7种细分模式可选l 输入信号光电隔离l 标准共阳单脉冲接口l 脱机保持功能3.3 直流电机驱动电路图3.8是直流电机驱动的整体电路,电路主要由场效应管Q1,来驱动电机,D1为二极管,在电路中起到电机电感的放电作用,以保护场效应管不会被高压击穿,R4,R5,红外发射管,红外接收管共同组成数模隔离电路,单片机输出的PWM波从电路中的PWM端口输入,红外发射管将PWM电信号转换为光信号,红外接收管再将光信号转换为电信号,控制场效应管的栅极。这样单片机与电机驱动电路就实现了电隔离,消除了驱动电路对单片机系统的干扰。光电隔离所用的光电管分为线性光电管,和开关式光电管,本系统的主控制器输出的PWM波属于数字信号,所以选用开关式光电管即可。二极管4007是整流型二极管,电流通过能力高达1.5A,满足电路要求。图3.8 直流电机驱动电路3.4 传感器电路 图3.9是圈数检测电路,主要元件是红外对射管,左半部分,电源VCC经电阻R2限流,为红外二极管提供15MA的电流,右侧红外接收管接收到红外光后,导通并将R3的电位拉低,如果在红外发射管与红外接收管之间有物体,则红外接收管接收不到红外光,R3没有电流通过,输出为高电平。在主轴电机上安装一金属挡片,电机每转过一周,经过传感器一次,传感器输出一段高电平,引发单片机中断,进行一次计数。图3.9 圈数检测电路3.5 液晶显示电路图3.10是液晶显示器的工作电路,由于系统要求显示汉字且内容偏多,所以选择内带字库的图形点阵型4OCM12864液晶模块。此模块是12864点阵型液晶显示模块,可显示各种字符及图形,可与CPU接口,具有8位标准数据总线、6条控制线及电源线。其最大工作范围如下:1)逻辑工作电压(Vcc):4.55.5V(12864-3、12864-5可使用3V供电) 2)电源地(GND):0V 3)工作温度(Ta):055(常温) / -2070(宽温) 由于液晶模块内部高度集成,所以外部接口相对简单。其引脚说明如下:图3.10 液晶显示电路4 系统的软件设计软件部分主要完成对键盘的分析及有关数值的显示,控制绕线的启停和步进电机的反向、协调步进电机和主轴电机的运动,检测主轴脉冲发生器脉冲并计数,以及断线和中途停车报警等功能。4.1直流电机控制子程序直流电机控制子程序完成电机的调速工程,其执行流程如图4.1。系统采用PWM方式控制电机运转,通过改变PWM的占空比实现电机调速。AVR单片机输出的PWM分辨率可达256个等级,实现了电机的无级调速。系统开始执行绕线程序时不断查询键盘,若查询到加速键按下,则增加PWM脉冲的占空比,增长周期内场效应管导通的时间,使电机转速提高,当电机速度已达到最大则速度不再增加;反之,减速键按下,则电机速度降低。若按下暂停键,电机逐渐减速,直到停止;重新启动时,自动加速到之前速度。图4.1 直流电机控制流程图4.2键盘子程序键盘程序完成键盘的扫描,除抖动,键码保存的功能,其执行流程如图4.2。单片机向行扫描口输出全为“0”的扫描码,然后从列检测口检测信号,只要有一列信号不为“1”,则表示有键按下,且不为“1”的列即对应为按下的键所在列。然后进行逐行扫描,单片机首先是第1行为“0”,其余各行为“1”,接着进行列检测,若为全“1”,表示不在此行,否则即在此行;然后第2行为“0”,其余各行为“1”,接着进行列检测,若为全“1”,表示不在此行,否则即在此行;这样逐行检测,直到找到按下键所在的行。当各行都 扫描以后仍没有找到,则放弃扫描,认为是键的误动作。对于4X4键盘,因为按键的位置由行号和列号唯一确定,且行列个4位,所以用一个字节来对键值编码是很合适的。由参考文献9,45-46可知。图4.2 键盘识别流程图4.3传感器子程序为了使圈数计数正确及时,不漏计多计,故采用中断方式来进行计数。传感器每输出一个脉冲,单片机就进入中断服务程序,进行计数,并在脉冲过后延时一段时间后退出中断服务,以保证不会应抖动多次进入中断,导致计数错误。若计数值达到目标数,则主轴电机停转,关闭中断。其执行流程如图4.3。图4.3 传感器检测流程图4.4步进电机控制子程序步进电机控制子程序完成电机方向控制,步进控制,步数控制。其执行流程如图19。单片机的PD5,PD6用于和两相步进电机的驱动器接口。其中PD5用于设置步进电机的方向控制,PD6用于对步进电机的转角控制。正常运行时,PD5根据排线方向置高或置低,PD6则输出一定频率,和占空比的方波,频率越高,电机转的越快,但方波的高电平持续时间不能过短,否则会超出驱动器的响应时间,频率也不能大于3KHZ。为避免步进电机发生失步和抖动,特别是在启动,停止,及反转时应注意驱动器的响应时间,在启动时,以低于响应频率的速度运行,然后慢慢加速,加速到一定速度后就可以在此速度下运行,当快要到达指定步数时,就慢慢减速,使其在低于响应频率下运行,直到停止,采用次方法可以使步进电机以最快的速度运行,而且不出现失步的现象。步进电机速度的调整,可通过该变PD6引脚方波的输出频率,在软件中可通过延时很方便的实现某一频率的输出。其控制流程如图4.4。图4.4 步进电机控制流程图4.5显示子程序显示子程序完成往液晶传送显示指令和显示数据的任务,其中128X64液晶的指令集如下:1)清除显示(指令代码为01H) 功能:将DDRAM 填满“20H”(空格),把DDRAM 地址计数器调整为“00H”,重新进入点设定将I/D 设为“1”,光标右移AC 加12)地址归位(02H) 功能:把DDRAM 地址计数器调整为“00H”,光标回原点,该功能不影响显示DDRAM3)点设定(04H/05H/06H/07H) 功能:设定光标移动方向并指定整体显示是否移动。4)显示状态 开/关(08H/0CH/ODH/0EH/0FH) 功能:D=1: 整体显示ON ; D=0: 整体显示OFF. C=1: 光标显示ON ; C=0: 光标显示OFF.B=1: 光标位置反白且闪烁 ; B=0: 光标位置不反白闪烁5)光标或显示移位控制(10H/14H/18H/1CH) 功能:10H/14H:光标左/右移动,AC 减/加1;18H/1CH:整体显示左/右移动,光标跟随移动,AC 值不变6)功能设定(20H/24H/26H/30H/34H/36H) 功能:DL=1: 8-BIT 控制接口 DL=0: 4-BIT 控制接口RE=1: 扩充指令集动作 RE=0: 基本指令集动作7)设定CGRAM 地址(40H-7FH) 功能:设定CGRAM 地址到地址计数器(AC),需确定扩充指令中SR=0(卷动地址或RAM 地址选择)8)设定DDRAM 地址(80H-9FH)功能:设定DDRAM 地址到地址计数器(AC)9)读取忙碌状态(BF)和地址功能:读取忙碌状态(BF)可以确认内部动作是否完成,同时可以读出地址计数器(AC)的值。其执行流程如图4.5。图4.5 显示流程图4.6主程序主程序完成各模块程序的调度,其中绕线程序最关键,其执行流程如图4.6。程序一启动先进行系统初始化,然后调入用户参数,待用户确定后,开始执行绕线程序,主轴电机开始运行,步进电机根据参数的不同协调主轴电机运转,同时液晶屏幕上显示当前的运行情况,包括运行速度和完成情况。图4.6 主程序5 系统调试5.1 硬件调试5.1.1电源电路的调试。接通220V电源,用万用表交流50V档测量变压器的次级线圈,电压表指示11V,电压正常。用万用表直流档测量C4两端的电压,电压表指示12.5V,电压正常。用万用表直流档测量7805输出端的电压,电压表指示5.1V,电压正常。5.1.2直流电机电路的调试。接通电机供电电源,将场效应管的栅极接地,电机不转,再将场效应管的栅极接12V,电机转,用信号发生器输出一方波,峰值为5V,占空比从百分之0逐渐调到百分百,电机速度也逐渐由停止加速到最大速度。结果正常。5.1.3步进电机电路的调试。 接通电机供电电源,将步进电机驱动器的方向控制端接地,用信号发生器输出一频率为1K的TTL电平,步进电机正转,再将方向控制端接+5V,步进电机反转。逐渐调节输出频率,在频率小于3KHZ的前提下,步进电机速度逐渐变快。结果正常。5.1.4传感器电路调试。接通电源,进入绕线程序,用一挡片插入传感器,传感器指示灯变亮,取出挡片,传感器指示灯灭,液晶屏幕上的计数值加一,步进电机转过一个角度,接通直流电机,电机旋转,传感器指示灯闪,闪烁频率与电机转数一样。结果正常。5.1.5液晶电路调试。接通电源,液晶被光灯亮,并显示开机画面,显示内容清晰,对比度高,按键盘的按键,液晶屏幕显示的内容改变为相应的菜单文字。结果正常。5.1.6键盘电路调试。 接通电源,按下相应按键,液晶显示内容转到相应菜单,或在屏幕上显示相应数字,结果正常。5.2 软件调试 连接好全部电路,接通电源,液晶显示开机画面,按任意键,进入主菜单,按上下键,光标选择到“添加型号”,按确定,进入“添加型号”界面,按相应按键,添加完一组参数,并保存。返回上一级菜单,进入“选择型号”菜单,并选择之前添加的型号,确定,系统进入绕线程序,电机转动,开始绕线,液晶显示当前状态,完成后停止。调试结果:软件功能基本正常,但绕线精度还存在微小误差,经过修正后,达到了预期目标。结论以AVR的ATMEGA16 单片机为控制的器绕线机,结构简单,体积减小,控制精确,操作简单,成本显著下降,可靠性显著提高。可用于各种型号线圈的绕制。有比较高的性能价格比。经过各项功能的调试,不断的修正,系统以达到良好效果,各项指标均已达到目标要求,电源电路工作稳定,输出电压正常,发热正常 ;电机驱动正常,电机调速灵敏;传感器响应迅速,计数准确。液晶模块工作正常,显示内容清晰;键盘灵敏,不会发生连击情况。系统的某些指标已超过了设计要求,达到了良好效果。该系统最后通过实际使用,系统稳定,没有出现程序跑乱的现象,符合其最终的标准。致谢语毕业设计是我大学学习生活的最后一项学习任务,是对我大学四年学习的综合考核。而也为了使我的综合素质技能可以有一个很大的提高,这次毕业设计,我选择了张根柱教授所带的这个比较具有实用性的有意思的课题。在为期两个多月的毕业设计过程中,我不仅较为系统的复习了以前学的知识,而且又学习了许多新知识,使我的知识结构更加系统化,也更加完善。同时,也提高了我独立分析问题、解决问题的能力。本次毕业设计能够顺利地完成,首先要感谢我的指导老师张根柱教授。张教授严谨的治学态度,深厚的学术造诣以及忘我的工作精神给我留下了深刻的印象。张教授的严格要求和孜孜不倦的教导是我完成这次毕业设计的重要保证,他给予了我很大的帮助和支持,在课题研究期间,张教授提供了很多指导性的意见,对存在的问题给予细心的分析并提出许多宝贵的意见,使我受益匪浅。在此谨向导师表示衷心的感谢!同时我要感谢给予我帮助和支持的舍友们,感谢在编程和程序调试过程中给我提供帮助的侯丽娟同学,感谢电子工程系的老师为我们做毕业设计提供的各方面的帮助!同时,我要感谢我的母校天津工程师范学院,特别是在我即将踏上工作岗位时,给了我这样一个锻炼、学习的机会,使我加深了对以前知识的理解,拓宽了知识面,也提高了我对所学知识的综合的应用能力。在整个设计制作过程当中,我感觉收获非常大,我获得的不仅是理论上的收获,还有实践中的丰收,同时还有的就是同学们之间的合作精神。在此,祝愿我院日后蓬勃发展,成为一所独具风格的综合性大学。祝愿母校的将来更美好! 最后,我要再一次感谢所有在此期间帮助过我的人,我衷心的祝福你们! 参考文献1 陈国呈.PWM调速技术M.北京:机械工业出版社,1999.113120.2 刘瑞新.赵全利等.单片机原理及应用教程M.北京:机械工业出版社,2003.76833 王川.实用电源技术M.重庆:重庆大学出版社,2004.47624 梅丽风.王艳秋等.单片机原理及接口技术M.北京:清华大学出版社,2004.981145 李广弟.朱月秀等.单片机基础M.北京:北京航空航天大学出版社,2001.62836 徐爱钧.8051单片机实践教程M.北京:电子工业出版社,2001年.1581777 吴金戎.8051单片机实践与应用M.北京:清华大学出版社,2002.2402718 吴国经.单片机应用技术M.北京:中国电力出版社,2004.1832019 马忠梅.单片机的C语言应用程序设计M.北京:北京航空航天大学出版社,2003.10312510 童长飞.C8051F系列单片机开发与C语言编程M.北京:北京航空航天出版社,2005.9213211 吴金戌.沈庆阳,郭庭吉.8051单片机实践与应用M.北京:清华大学出版社,2005.22024312 王志良.电力电子新器件及其应用技术M.北京:国防工业出版社,1995.16317813 集成电路特性代换手册编译组编M.福建科学技术出版社,2001.18820314 吴运昌.模拟集成电路原理与应用M.广东:华南理工大学出版社,2001.19421815 李序葆.赵永健.电力电子器件及其应用M.北京:机械工业出版社,2003.24425616 康华光.邹寿彬.电子技术基础(数字部分)M.北京:高等教育出版社,2003.19221918 吴运昌.模拟集成电路原理与应用M.广东:华南理工大学出版社,2001.8310419 童诗白主编.模拟电子技术基础M.北京:高等教育出版社,1998.302324附录一 原理图附录二 程序#include#include#include#include#include /可以嵌套#includetype.h#define Step_Motor_Turn_Left PORTD|=_BV(6);#define Step_Motor_Turn_right PORTD&=_BV(6);#defineStep_Motor_Run_One_Step PORTD&=_BV(7);_delay_us(200);PORTD|=_BV(7);_delay_us(200);/unsigned char Key_Box(void);void Command_Input(unsigned char Command);void show_point (unsigned char p);void show_erro(unsigned char p); /unsigned char value; /键值unsigned char point; unsigned char ok_n;unsigned char a_n;unsigned int now_n;unsigned int now_w;unsigned int gol_w;unsigned int syt_w;unsigned char save506 _attribute_(section(.eeprom);/SIGNAL(SIG_INTERRUPT1) /外部中断INT1if(a_n=1)a_n=0;now_n+;if(now_nsytle_buffer.n)cli();fin=1;if(dr=0xff)gol_w+=sytle_buffer.d;Step_Motor_Turn_Leftwhile(now_wsyt_w)dr=0;if(dr=0x00) gol_w-=sytle_buffer.d;Step_Motor_Turn_rightwhile(now_wgol_w) now_w-=60; Step_Motor_Run_One_Stepif(gol_w=0)dr=0xff;while(PINA&0x10) Step_Motor_Run_One_StepSIGNAL(SIG_INTERRUPT0) /外部中断INT0if(a_n=0)a_n=1;/int main(void)UCSRB|=(1RXEN);UCSRB|=(1TXEN);UBRRL=51;UCSRC=(1URSEL)|(1UCSZ1)|(13)point=0;show_point(point);if(value=down)point-; if(point3)point=3;show_point(point);if(value=ok)if(point=0)goto select_style;if(point=1)goto add_style;if(point=2)goto check_self;if(point=3)goto informantion;/end主菜单/选择型号菜单select_style:Menu_2(); value=up;while(1)if(value=back)goto m_1;if(value=up)add:point+; eeprom_read_block (&sytle_buffer.code,savepoint,6);if(sytle_buffer.code50)&(point50)point=1;elseshow_code();show_d();show_w();show_n(); if(value=down)dec:point-; eeprom_read_block (&sytle_buffer.code,savepoint,6);if(sytle_buffer.code50)&(point50)point=50;elseshow_code();show_d();show_w();show_n();/工作菜单syt_w=sytle_buffer.w*1000;gol_w=now_w=now_n=0; OCR1AL=V;Menu_1_2(); show_v (); show_n ();show_ok_n (); /显示while(1)value=Key_Box();if(value=back) cli(); OCR1AL=255; goto select_style;if(value=down) if(OCR1AL=7 ) OCR1AL-=7; show_v ();if(value=14) sei(); OCR1AL=70;show_now_n ();/show_ok(); while(1)value=Key_Box();if(value=ok) goto work;if(value=back) goto m_1;/添加型号菜单add_style: Menu_2(); show_point(0); point=0;point+; if(point3)point=0;show_point(point);wan=q=b=s=g=0;/ if(value50)sytle_buffer.code=0; s=g=0; show_erro(0x84);else show_code();/ if(sytle_buffer.d500)sytle_buffer.d=0; b=s=g=0; show_erro(0x94);else show_d();/ if(point=2) sytle_buffer.w=b*100+s*10+g; if(sytle_buffer.w65)sytle_buffer.w=0; b=s=g=0; show_erro(0x8c);else show_w();/ if(point=3) sytle_buffer.n=wan*10000+q*1000+b*100+s*10+g; if(wan6)|(wan=6)&(q4)sytle_buffer.n=0; wan=q=b=s=g=0; show_erro(0x9c);else show_n();if(value=ok)eeprom_write_block (&sytle_buffer.code,savesytle_buffer.code,6); wan=q=b=s=g=0; goto m_1;/自检菜单check_self:Command_Input(0X01); /信息菜单while(1);/main/#include/8MHZ #include#include#include#includetype.h/定义MCU的接口#define RS1 PORTA|=_BV(0);#define RS0 PORTA&=_BV(0);#define RW1 PORTA|=_BV(1);#define RW0 PORTA&=_BV(1);#define EN1 PORTA|=_BV(2);#define EN0 PORTA&=_BV(2);/*extern unsigned char g; /键值extern unsigned char s; /键值extern unsigned char b; /键值extern unsigned char q; /键值extern unsigned char wan; /键值extern unsigned char ok_n;extern unsigned int now_n;/*const unsigned char main_menu PROGMEM=电科张德星绕线机控制器;/const unsigned char menu_1 PROGMEM=选择型号系统自检添加型号产品信息;/const unsigned char menu_1_2 PROGMEM=完成个数完成匝数当前速度目标匝数;/const unsigned char menu_2 PROGMEM=代码架宽线径匝数匝;/const unsigned char menu_3 PROGMEM=主轴电机正常排线电机正常液晶显示正常键盘操作正常;/*写指令*void Command_Input(unsigned char Command)DDRC=0x00;PORTC=0XFF; /端口设置为输入RS0 RW1 EN1 / RW=E=1 RS=0 读状态while(PINC&0x80); / 忙等待RS0 RW0 EN1 / RS=RW=0 E=1 写指令 PORTC=Command; DDRC=0XFF;/ 将指令代码送到总线EN0 / E=0 E下降延将指令代码写入LCDDDRC=0x00;PORTC=0XFF; /端口设置为输入/*写数据*void Data_Input(unsigned char Data) DDRC=0x00;PORTC=0XFF; /端口设置为输入RS0 RW1 EN1 / RW=E=1 RS=0 读状态while(PINC&0x80); / 忙等待RS1 RW0 EN1 / RS=E=1 RW=0 写数据 PORTC=Data;DDRC=0XFF; / 将数据代码送到总线EN0 / E=0 E下降延将数据代码写入LCDDDRC=0x00;PORTC=0XFF; /端口设置为输入/*void Main_Menu(void)p=main_menu;Command_Input(0X80);for(j=0;j64;j+)Data_Input(pgm_read_byte(main_menu+j);Command_Input(0X8a);Data_Input(0);Data_Input(4);Data_Input(0);Data_Input(1);/*void Menu_1(void)unsigned char j;const unsigned char *p;p=menu_1;Command_Input(0X80);for(j=0;j64;j+)Data_Input(pgm_read_byte(p+);/*void Menu_1_2(void)p=menu_1_2;Command_Input(0X80);for(j=0;j64;j+)Data_Input(pgm_read_byte(p+);/*void Menu_2 (void)p=menu_2;Command_Input(0X80);for(j=0;j64;j+)Data_Input(pgm_read_byte(p+);Command_Input(0X97);Data_Input(u);Data_Input(m);Command_Input(0X8f);Data_Input(m);Data_Input(m);/*void Menu_3 (void)unsigned char j,n;const unsigned char *p;n=60;while(n-)_delay_ms(100);Command_Input(0X80);for(j=0;j16;j+)Data_Input(pgm_read_byte(p+);n=60;while(n-)_delay_ms(100);Command_Input(0X90);for(j=0;j16;j+)Data_Input(pgm_read_byte(p+);n=60;while(n-)_delay_ms(100);Command_Input(0X88);for(j=0;j16;j+)Data_Input(pgm_read_byte(p+);n=60;while(n-)_delay_ms(100);Command_Input(0X98);for(j=0;j16;j+)Data_Input(pgm_read_byte(p+);/*void Menu_4 (void)unsigned char j;const unsigned char *p;p=menu_4;Command_Input(0X80);for(j=0;j);if(p=1)Command_Input(0X91); Data_Input();if(p=2)Command_Input(0X89); Data_Input();if(p=3)Command_Input(0X99); Data_Input();/*void show_erro(unsigned char p)Command_Input(p);Data_Input( );Data_Input( );Data_Input( );Data_Input( );Data_Input( );Data_Input( );/*void show_code (void)s=sytle_buffer.code/10;g=sytle_buffer.code%10;Command_Input(0X86);Data_Input(s+0x30);Data_Input(g+0x30);/*void show_d (void)Data_Input( );Data_Input(b+0x30);Data_Input(s+0x30);Data_Input(g+0x30);/*void show_w (void)b=sytle_buffer.w/100; s=sytle_buffer.w%100/10;g=sytle_buffer.w%10;Command_Input(0X8d);Data_Input( );Data_Input(b+0x30);Data_Input(s+0x30);Data_Input(g+0x30);/*void show_n (void)wan=sytle_buffer.n/10000;q=sytle_buffer.n%10000/1000;b=sytle_buffer.n%1000/100; s=sytle_buffer.n%100/10;g=sytle_buffer.n%10;Command_Input(0X9d);Data_Input( );Data_Input(wan+0x30);Data_Input(q+0x30);/*void show_v (void)s=(140-OCR1AL)/70;g=(140-OCR1AL)%70/7;Command_Input(0X97);Data_Input(s+0x30);Data_Input(g+0x30);/*void show_ok_n (void)b=ok_n/100; s=ok_n%100/10;g=ok_n%10;Command_Input(0X86);Data_Input( );Data_Input(b+0x30);Data_Input(s+0x30);Data_Input(g+0x30);/*void show_now_n (void)wan=now_n/10000;q=now_n%10000/1000;b=now_n%1000/100; s=now_n%100/10;g=now_n%10;Command_Input(0X8d);Data_Input( );Data_Input(wan+0x30);Data_Input(q+0x30);Data_Input(b+0x30);Data_Input(s+0x30);Data_Input(g+0x30);/#include/8MHZ #include#include/*struct saveunsigned char code;unsigned int d;unsigned int n;unsigned int w;s50;struct save s50 _attribute_(section(.eeprom);extern struct sytle sytle_buffer;/*void save(void)eeprom_write_block (sytle_buffer,ssytle_buffer.code,6);#include/8MHZ#define Step_Motor_Turn_Left PORTD|=_BV(6);#define Step_Motor_Turn_right PORTD&=_BV(6);#defineStep_Motor_Run_One_Step PORTD&=_BV(7);_delay_us(100);PORTD|=_BV(7);_delay_us(100);void PWM_SET(void) DDRD|=0xE0;TCCR1A|=_BV(WGM10); /8位快速PWMTCCR1A|=_BV(COM1A0)|_BV(COM1A1); /比较匹配时置位 OC1A/OC1B,OC1A/OC1B在TOP OCR1AL=255; /占空比#include/8MHZ #includeunsigned char Key_Box(void)DDRB=0XF0; /PB口高4位设为输出, 低四位设为输入PORTB=0X0F;PORTB=0X0F;/PB口高4位输出0, 低四位设为有上拉电阻key_value+=PINB; /保存键值的低4位while(PINB!=0X0F); /等待按键松开if(key_value=0x7e)return 10;if(key_value=0xbe)return 11;if(key_value=0xde)return 12;if(key_value=0xee)return 13;if(key_value=0x7d)return 1;if(key_value=0xbb)return 5;if(key_value=0xdb)return 6;if(key_value=0xeb)return 15;if(key_value=0x77)return 7;if(key_value=0xb7)return 8;if(key_value=0xd7)return 9;if(key_value=0xe7)return 0;return 0xff;/程序返回键值附录三 英文原文The Design of a Rapid Prototype Platform for ARM Based Embedded SystemHardware prototype is a vital step in the embedded system design. In this paper, we discuss our design of a fast prototyping platform for ARM based embedded systems, providing a low-cost solution to meet the request of flexibility and testability in embedded system prototype development. It also encourages concurrent development of different parts of system hardware as well as module reusing. Though the fast prototyping platform is designed for ARM based embedded system, our idea is general and can be applied to embedded system of other types. I.INTRODUCTIONEmbedded systems are found everywhere, including in cellular telephones, pagers, VCRs, camcorders, thermostats, curbside rental-car check-in devices, automated supermarket stockers, computerized inventory control devices, digital thermometers, telephone answering machines, printers, portable video games, TV set-top boxes - the list goes on. Demand for embedded system is large, and is growing rapidly. In order to deliver correct-the-first-time products with complex system requirements and time-to-market pressure, design verification is vital in the embedded system design process. A possible choice for verification is to simulate the system being designed. If a high-level model for the system is used, simulation is fast but may not be accurate enough, with a low-level model too much time may be required to achieve the desired level of confidence in the quality of the evaluation. Since debugging of real systems has to take into account the behavior of the target system as well as its environment, runtime information is extremely important. Therefore, static analysis with simulation methods is too slow and not sufficient. And simulation cannot reveal deep issues in real physical system. A hardware prototype is a faithful representation of the final design, guarantying its real-time behavior. And it is also the basic tool to find deep bugs in the hardware. For these reasons, it has become a crucial step in the whole design flow. Traditionally, a prototype is designed similarly to the target system with all the connections fixed on the PCB (printed circuit boards).As embedded systems are getting more complex, the needs for thorough testing become increasingly important. Advances in surface-mount packaging and multiple-layer PCB fabrication have resulted in smaller boards and more compact layout, making traditional test methods, e.g., external test probes and bed-of-nails test fixtures, harder to implement. As a result, acquiring signals on boards, which is beneficial to hardware testing and software development, becomes infeasible, and tracking bugs in prototype becomes increasingly difficult. Thus the prototype design has to take account of testability. However, simply adding some test points is not enough. If errors on the prototype are detected, such as misconnections of signals, it could be impossible to correct them on the multiple-layer PCB board with all the components mounted. All these would lead to another round of prototype fabrication, making development time extend and cost increase.Besides testability, it is important to maintain high flexibility during development of the prototype as design specification changes are common. Nowadays complex systems are often not built from scratch but are assembled by reusing previously designed modules or off-the-shelf components such as processors, memories or peripheral circuitry in order to cope with more aggressive time-to-market constraints. Following the top-down design methodology, lots of effort in the design process is spent on decomposing the customers, requirements into proper functional modules and interfacing them to compose the target system.Some previous research works have suggested that FPLDs (field programmable logic device) could be added to the final design to provide flexibility as FPLDs can offer programmable interconnections among their pins and many more advantages. However, extra devices may increase production cost and power dissipation, weakening the market competition power of the target system. To address these problems, there are also suggestions that FPLDs could be used in hardware prototype as an intermediate approach 1-3, whereas this would still bring much additional work to the prototype design. Moreover, modules on the prototype cannot be reused directly. In industry, there have been companies that provide commercial solutions based on FPLDs for rapid prototyping 4. Their products are aimed at SOC (system on a chip) functional verification instead of embedded system design and development.In this paper, we discuss our design of a Rapid Prototyping Platform for ARM based Embedded System, providing a low cost solution to meet the request of flexibility and testability in embedded system prototype development. It also encourages concurrent development of different parts of system hardware as well as module reusing. The rest of the paper is organized as follows. In section 2, we discuss the details of our rapid prototyping platform. Section 3 shows the experimental results, followed by an overall conclusion in section 4.II. THE DESIGN OF A RAPID PROTOTYPING PLATFORMA. OverviewARM based embedded processors are wildly used in embedded systems due to their low-cost, low-power consumption and high performance. An ARM based embedded processor is a highly integrated SOC including an ARM core with a variety of different system peripherals5. Many arm based embedded processors, e.g.6-8, adopt a similar architecture as the one shown in Fig. 1.The integrated memory controller provides an external memory bus interface supporting various memory chips and various operation modes (synchronous, asynchronous, burst modes). It is also possible to connect bus-extended peripheral chips to the memory bus. The on-chip peripherals may include interrupt controller, OS timer, UART, I2C, PWM, AC97, and etc. Some of these peripherals signals are multiplexed with general-purpose digital I/O pins to provide flexibility to user while other on-chip peripherals, e.g. USB host/client, may have dedicated peripheral signal pins. By connecting or extending these pins, user may use these onchip peripherals. When the on-chip peripherals cannot fulfill the requirement of the target system, extra peripheral chips have to be extended.The architecture of an ARM based embedded system is shown in Fig. 2. The whole system is composed of embedded processor, memory devices, and peripheral devices. To enable rapid prototyping, the platform should be capable of quickly assembling parts of the system into a whole through flexible interconnection. Our basic idea is to insert a reconfigurable interconnection module composed by FPLD into the system to provide adjustable connections between signals, and to provide testability as well. To determine where to place this module, we first analyze the architecture of the system.The embedded system shown in Fig. 2 can be divided into two parts. One is the minimal system composed of the embedded processor and memory devices. The other is made up of peripheral devices extended directly from on-chip peripheral interfaces of the embedded processor, and specific peripheral chips and circuits extended by the bus.The minimal system is the core of the embedded system, determining its processing capacity. The embedded processors are now routinely available at clock speeds of up to 400MHz, and will climb still further. The speed of the bus connecting the processor and the memory chips is exceeding 100MHz. As pin-to-pin propagation delay of a FPLD is in the magnitude of a few nanoseconds, inserting such a device will greatly impair the system performance.The peripherals enable the embedded system to communicate and interactive with the circumstance in the real world. In general, peripheral circuits are highly modularized and independent to each other, and there are hardly needs for flexible connections between them.Here we apply a reconfigurable interconnection module to substitute the connections between microcomputer and the peripherals, which enables flexible adjusting of connections to facilitate interfacing extended peripheral circuits and modules. As the speed of the data communication between the peripherals and the processor is much slower than that in the minimal system, the FPLD solution is feasible.Following this idea, we design the Rapid Prototyping Platform as shown in Fig. 3. We define the interface ICB between the platform and the embedded processor core boar that holds the minimal system of the target embedded system. The interface IPB between the platform and peripheral boards that hold extended peripheral circuits and modules is also defined. These enable us to develop different parts of the target embedded system concurrently and to compose them into a prototype rapidly, and encourage module reusing as well. The two interfaces are connected by a reconfigurable interconnect module. There are also some commonly used peripheral modules, e.g. RS232 transceiver module, bus extended Ethernet module, AC97 codec, PCMCIA/CompactFlash Card slot, and etc, on the platform which can be interfaced through the reconfigurable interconnect module to expedite the embedded system development.B. Reconfigurable Interconnect ModuleWith the facility of state-of-arts FPLDs, we design a reconfigure interconnection module to interconnect, monitor and test the bus and I/O signals between the minimal system and peripherals.As the bus accessing obeys specific protocol and has control signals to identify the data direction, the interconnection of the bus can be easily realized by designing a corresponding bus transceiver into the FPLD, whereas the interconnection of the I/Os is more complex. As I/Os are multiplexed with on-chip peripherals signals, there may be I/Os with bi-direction signals, e.g. the signals for on-chip I2C9 interface, or signals for on-chip MMC (Multi Media Card10) interface. The data direction on these pins may alter without an external indication, making it difficult to connect them via a FPLD. One possible solution is to design a complex state machine according to corresponding accessing protocol to control the data transfer direction. In our design we assign specific locations on the ICB and IPB interfaces to these bi-direction signals and use some jumpers to directly connect these signals when needed. The problem is circumvented at the expense of losing some flexibility.The use of FPLD to build the interconnection module not only offers low cost and simple architecture for fast prototyping, but also provides many more advantages. First, interconnections can be changed dynamically through internal logic modification and pin re-assignment to the FPLD. Second, as FPLD is connected with most pins from the embedded processor, it is feasible to detect interconnection problems due to design or physical fabricate fault in the minimal system with BST (Boundary-Scan Test, IEEE Standard 1149.1 specification). Third, it is possible to route the FPLD internal signals and data to the FPLDs I/O pins for quick and easy access without affecting the whole system design and performance. It is even possible to implement an embedded logical analyzer into the FPLD to smooth the progress of the hardware verification and software development.C. Power SupplyPower dissipation has a great impact on system cost and reliability. It is an increasingly important problem in embedded systems designs not only for the portableelectronics industry but in other areas including consumer electronics, industry control, communications, etc. In order to facilitate the design of power supply for the target embedded system, power supply issues have also been considered in the design of the platform.First, the power supplies to the devices on the platform are separated from those to the core board and peripheral expand boards, which makes it more realistic to measure and verify the power dissipation on the platform for the target embedded system. Second, the power supplies for the core board and peripheral expand boards are built on a separate board and connected to the platform through a slot. As a result, it provides flexibility for power system design while speeding up the whole design process.To meet the demand for higher system speed and lower power consumption in data communications and processing, embedded processor vendors use increasingly advanced processing technologies requiring lower core operating voltages, and keep the interface voltage compatible with most low voltage semiconductor devices on market. Consequently, almost every embedded processor requires more than one power supply, such as power supply for internal logic, for PLLs and oscillators, for memory bus interface, and for other I/Os. Further, different embedded processors may have different requirements on power supply, such as different power supply voltage, power-up sequence, and different strategies to adjust the core voltage in different CPU run mode for minimizing power dissipation.A survey of some widely used ARM based embedded processor suggests that most of them need no more than 3 groups of separated power supply, as shown in Table 1. As the peripherals may require different supply voltages for special purpose, such as +5V for powering the USB ports, we divide the power supply from the power supply slot into 4 separated channels, which is connected to both the core board slot and the peripheral board slot. Each channel of power supplies has a “power good” signal to indicate power output status of the channel, and a shutdown signal to shut the power supply of the channel down. And these signals are directly connected to the core board slot to accommodate the embedded processors requirement of power-up sequence. In order to enable dynamic voltage adjusting, some control signals are routed to the power supply board by the reconfigurable interconnect module.III. EXPERIMENTAL RESULTSAs the Rapid Prototyping Platform is still under development, we present an example applied with the same considerations in the Rapid Prototyping Platform. It is an embedded system prototype based on Intel XScale PXA255, which is an ARM based embedded processor. The diagram of the prototype is illustrated in Fig. 5(a). The photo is shown in Fig. 5(b), where a Bluetooth module is connected to the prototype USB port and a CF LAN card is inserted.The FPGA (an Altera Cyclone EP1C6F256) here offers the same function as the reconfigurable interconnection module shown in Fig. 3. Most of the peripheral devices are expanded to the system through the FPGA, and more peripherals can be easily interfaced when needed. As both of the FPGA and PXA255 support the BST, we can detect faults, e.g. short-circuit and open-circuit faults, on the connections between the two devices by chaining their JTAG ports and performing BST. Here, we use an open source software package 11 to perform the BST.The FPGA internal signals can be routed to the debugging LED matrix for easy access, which is helpful in some simple testing and debugging. We also insert an embedded logical analyzer, the SignalTap II embedded logic analyzer 12 provided in Alteras Quartus II software, into the FPGA for handling more complicated situations. With the help of the logical analyzer, we are able to capture and monitor data passing through over a period of time, which expedites the debugging process for the prototype system. Fig. 6 shows the captured data communication between the embedded processor and the USB host module during the initialization process of the Philips ISP1161 USB host chip13. It can be seen clearly from the figure that the embedded processor writes the command code of 0027H to address 01H (the ISP1161s host controller command port) to access the HcChipID register, and reads 6120H (the chips ID) from address 00H (the ISP1161s host controller data port).The power supply module of the prototype system is held on a separate board connected to the system via a socket. We designed two power supply modules for the prototype system (shown in Fig. 7). One is a large module providing fixed output composed with simple but low-efficiency linear regulator (the upside one in the Fig. 7), the other is a compact module, capable of dynamic voltage adjusting, made up of complex high-efficiency switch regulator(the downside one in the Fig. 7). The former module is first used to accommodate the basic power supply requirements during hardware test and relative software development. During the process, the later is developed and refined, and replaced the former one finally. The separation of power supply module from prototype allows refinement of the power supply module without affecting development of other parts of the system.With the help of this flexible prototype, we finished our hardware development and related software development, including boot-loader development, OS (Arm-Linux) transplant, and driver development in about one week.IV. CONCLUSIONIn this paper, we discuss the design of a fast prototyping platform for ARM based embedded systems to accommodate the requirements of flexibility and testability in the prototyping phase of an embedded system development.With the aid of the platform, modules of the target embedded system can be developed simultaneously, and previous modules can be applied to future designs. As a result, develop process is greatly accelerated.Though the fast prototyping platform is designed for ARM based embedded system, our idea is general and can be applied to embedded system of other types. 附录四 中文译文基于ARM的嵌入式系统的速成样机平台设计在嵌入式系统的设计中,硬件模型的设计是非常重要的。在这篇论文中,我们将讨论一种我们自行设计的快速模型平台,这是基于ARM的嵌入式系统的。这是一种低成本的设计方法,并且符合在嵌入式系统模型发展上对于灵活性和易测试性的要求。我们提供的方法同样支持系统硬件模块各个部分的更新和重利用。虽然快速模型平台是为基于ARM的嵌入式系统设计的,但是我们的方法是普遍适用的而且可以被广泛应用于其它各种类型的嵌入式系统。1介绍嵌入式系统的应用非常广泛,例如在手机、寻呼机、录像机、可携式摄像机、自动调温器、路边租用汽车的登记设备、自动售货机、用计算机处理存货清单的控制设备、数字体温计、电话应答机、打印机、便携式视频游戏、机顶盒还可列出很多。对于嵌入式系统的需求是巨大的,同样它的发展也是很快的。为了生产出满足复杂系统要求而且适应市场的正确的、第一手产品,设计的确认工作在整个设计过程中是非常关键的。对于确认,一个可能的选择是模仿已经设计出的系统。但是如果系统要求一个高水平的模型,那么模仿虽然快可就不可能非常准确,因为低水平的模型只能满足一般质量评估的要求。一旦实时系统的调试要考虑进去,目标系统、还有它的环境、及其运行信息就显得特别重要。因此,用模仿的方法来做的静态分析机会让人感觉效率太低。而且模仿不能揭示在实时物理系统方面更深层次的问题。一个硬件样机是最终设计的可考代表,它保证了实时行为。同时它也是发现硬件深层次问题的基础工具。正是由于这些原因,硬件样机设计成为整个设计流程中非常重要的一步。传统上,样机设计的都与它的目标系统的PCB版很相似。随着嵌入式系统变得越来越复杂,对于系统的测试就显得越来越重要。表面设置组件和多层PCB板的发展,导致了更小的板子和更紧凑的版面设计。这就使得传统的测试方法,例如:外部探测器和“钉板”测试装置,很难实现。结果,从板子上获得对硬件测试和软件开发有用的信号变得不可行,而且使在样机上查找错误变得越来越难。因此,样机的设计必须考虑可测试性。然而,简单的加一些测试点是不够的。如果样机上的错误被检测出来,比如信号的错误连接,那么那是不可能在多层且与各种设置都紧密相关的PCB板上纠正的。因为这些都会影响到样机上的其它设置,增加项目开发的时间同时会提高成本。除了可测试性,保持样机在开发过程中的高度灵活性也是非常重要的,因为设计规格是会经常改动的。目前复杂系统常常不是拼凑在一起的,而是会利用先前已经设计的一些模块,像是:处理器、存
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

人人文库网所有资源均是用户自行上传分享,仅供网友学习交流,未经上传用户书面授权,请勿作他用。