旋转编码开关(Rotary Encoder switch)-使用说明及程序
- 格式:doc
- 大小:278.50 KB
- 文档页数:7
Table Of Contents:Introduction 1Hardware Description 1Compatible Hardware 1Pin Descriptions 3Example Hardware Connection for Arduino 3Example Code for Arduino 3Adjusting LED Current and Brightness 3Diffusing the LEDs 4Setting the LED Sequence 4_________________________________________IntroductionSince rotary encoders have no start or end point, knobs without a position indicator are typically used – as opposed to potentiometers, where an indicator knob is suitable. Many applications require a visual representation of how a rotary encoder is reacting to user input as well as the control’s current position. The Rotary Encoder LED Ring offers a solution with a ring of 16 LEDs that surround the encoder. The designer may implement any desired sequence on the LEDs by communicating with the onboard series-to-parallel constant current shift register._________________________________________Hardware DescriptionThe Rotary Encoder LED Ring has two separate sections: a rotary encoder breakout and a collection of LEDs controlled by a shift register. A microcontroller can be used to obtain encoder data and set LED data.A rotary encoder may be mounted to the printed circuit board in two separate ways. The PCB has (1) mounting-tab holes and soldering positions for a rotary encoder as well as (2) a hole for the encoder shaft: the encoder may be soldered to the PCB or fitted through the shaft hole. Compatible rotary encoders are described below in the‘Compatible Hardware’ section.The PCB has 15 LEDs in a 270˚ arc and one LED at the bottom of the arc; they are interfaced with a Texas Instruments TLC5925 16-bit shift register. The interface uses a standard Serial-Data/Clock/Latch-Enable 3 wire connection that is further described with timing diagram in the TLC5925 datasheet:/lit/ds/symlink/tlc5925.pdf.A thru-hole resistor can be used to increase the brightness of the LEDs and is described further in the ‘Adjusting LED Current and Brightness’ section.Please see the ‘Pin Descriptions’ section for more information about the 10 available connections._________________________________________Compatible HardwareThe Rotary Encoder LED Ring is compatible with any microcontroller with at least 2 input lines (for the rotary encoder) and 3 output lines (for the serial interface) available.It can accept knobs up to 3/4-inch diameter without covering the LEDs. Image 1 shows how a 3/4" knob appears on a shaft-mounted encoder._________________________________________DIMENSIONS:MM(INCHES)Pin DescriptionsPin Description Section GND Ground, zero voltage referencePowerVCC 3 to 5.5 Volts (Yellow, Green, Red LED models)** BLUE LED model requires 3.6 to 5.5 Volts **ENCA Rotary Encoder A TerminalRotaryEncoderENCB Rotary Encoder B TerminalSWTCH Rotary Encoder SwitchSDI Serial Data InputTLC5925CLK ClockLE Latch EnableOE (Active Low) Output Enable; tie to ground for constant operationSDO Serial Data Output – for daisy chaining units_________________________________________Example Hardware Connection for Arduino:The following is an example of how the Rotary Encoder LED Ring might be connected to an Arduino. The example code listed below follows this set of connections.Image 2: Connections to an Arduino Table 2: List of pin connections to an Arduino_________________________________________Example Code for Arduino:Three examples of how the Rotary Encoder LED Ring might be used can be found in the Arduino example code available at: /products/rotary-encoder-led-ringIf an Arduino is not the desired target device, the example code gives enough detail to outline the procedures necessary to implement an interface on other programmable devices._________________________________________Adjusting LED Current and Brightness:Rotary Encoder LEDRing PinArduino PinGND GNDVCC 5VENCA 8 (Digital)ENCB 9 (Digital)SWTCH 10 (Digital)SDI 2 (Digital)CLK 3 (Digital)LE 4 (Digital)OE (Active Low) GNDSDO Not connectedThe Rotary Encoder LED Ring ships with dim LEDs so the end user may increase the brightness to a levelappropriate for the application. The current to each of the 16 LEDs is constant and is set per the TLC5925datasheet. A surface mount 22k Ω resistor is provided and a parallel thru-hole resistor may be added to increasethe brightness by lowering the resistance. Please reference Equation 1 and Figure 2 to set the current output to theLEDs. Using a parallel resistance calculator like /calculator-paralresist.htm orEquation 2 can help determine what resistor value to use for the thru-hole resistor. With the surface mount 22k Ωresistor, the output current is set to about 1mA. Adding a 1k Ω resistor thru-hole will increase the LED brightness to their highest setting. A potentiometer or voltage controlled resistor may also be used to adjust the brightness on the fly. Care must be taken to not increase the current beyond the capability of the LEDs (20mA to 30mA max).Equation 1: Current Output to Each LEDFigure 2: Relationship between I OUT and R EXTImage Credit: Texas Instruments TLC5925 DatasheetEquation 2: Parallel Resistance Total (Surface Mount and Thru-Hole)_________________________________________Diffusing the LEDs:Some applications may require LEDs that have more uniform lighting or appear more as an indicator than a light source. Sanding the clear lens of the LEDs, roughening it up to create a diffused lens can accomplish this. 400 grit sand paper or similar works well._________________________________________Setting the LED Sequence:There are primarily two methods to create an LED sequence to be outputted to the shift register. The first, andeasiest, is to create a sequence of ‘images’ that will be stepped through as the encoder is rotated. The second is to use bitwise operations (AND, OR, XOR) to build and modify the ‘image’ that is currently on the LEDs. This method is how the example code turns on the bottom LED while not changing the current image otherwise.I OUT =1.21VR ext ×18APPLICATION INFORMATION g Principles Current OutputCurrent 0510152025303540455001000150020002500300035004000R ext –8I O U T –m AW play applications,TLC5925provides nearly no current variations from channel to channel and from IC e I OUT 45mA,the maximum current skew between channels is less than ±5%and between ICs is 6%.ets I OUT based on the external resistor R ext .Users can follow the below formulas to calculate the ut current I OUT,target in the saturation region:(1.21V /R ext )!18,where R ext is the external resistance connected between R-EXT and GND.the default current is approximately 26mA at 840 and 13mA at 1680 .The default relationship on between I OUT,target and R ext is shown in Figure 5.Figure5.Default Relationship Curve Between IOUT,target and R ext After Power UpR ext =R 1×R 2R 1+R 2As an example, the image to output that will turn on one additional LED each step looks like: 0000000000000001 (hex 0x01)0000000000000011 (hex 0x03)0000000000000111 (hex 0x07)and so on. This sequence can be written directly to the shift register.If the same output was created using XOR or OR, the sequence would look like:0000000000000001 (hex 0x01)0000000000000010 (hex 0x02)0000000000000100 (hex 0x04)and so on. An image would be OR’ed with the previous image and the result would be the same as the first example.For details about using bitwise operations, please see the Arduino Reference:/en/Reference/BitwiseAndUsing the map() function, it is possible to scale the speed of the LED output sequence relative to the encoder rotation. For example, when rotating the rotary encoder one full revolution, one additional LED is turned on. See the Arduino Reference: /en/Reference/Map。
ERD6 SERIESMINIATURE SIZE □7×3 ROTARY SELECTOR SWITCH■FEATURESz Outer dimension 7.2mm square, 3.0mm high on board.z Positions and switch code can be identified.z Pin-out compatible with most of current equivalents.z Gold plated contact area ensures reliable electric continuity for micro current.z Surface mounting type can be supplied in embossed taping for automatic packing. z Easy position setting with wide switching angle and high digit visibility.z All plastics are UL 94V-0 grade fire retardant.z RoHS compliant.■APPLICATIONSz Address switching applicationsz Data storage devicesz Computer and peripheralsz Instrumentation■SPECIFICATIONS1.ELECTRICALz Contact rating Max. switching load 100mA, 5VDC Min. switching load 10μA, 5VDCz Contact resistance (initial) 100mΩ Max.z Insulation resistance 100MΩ Min. at 100VDCz Dielectric strength 250VAC rms. at 60 seconds 2.MECHANICAL and ENVIRONMENTALz Temperature rating operation -25℃ to +85℃storage -40℃ to +85℃z Operation force 510gf-cm Max.z Operation life 10,000 detents Min.z Vibration 10Hz-50Hz-10Hz for 6Hrs.z Solderability After flux 245±5℃ for 5±1 secondsz Resistance to soldering heat solder bath 260±5℃ for 5±1 seconds solder reflow Peak temperature 260℃ Max.3.SOLDERING PROCESSz Solder iron Max. 2 sec/350℃z Reflow soldering heat forSMT & THR type (reference only)■PART NUMBERING SYSTEMZ: RoHS CompliantERD6: Miniature size (7.2×7.2mm²) Rotary Selector Switch■CONSTRUCTION■OPTIONS1.Special marking available■PACKING1.PACKING METHOD■QUICK SELECTION GUIDESIZE POSITIONS CIRCUITTYPESETTINGPOSITIONPINOUTSHAPE OF TERMINALPARTNUMBER 7×7 41 POLE4 CONTACTSTOPSETTING3:3THR WITH ROW SPACING 7.62mm ERD604XSZSMT WITH GULL WING ERD604XMZSMT WITH GULL WING IN T&R ERD604XDZSMT WITH J-HOOK ERD604XCZSMT WITH J-HOOK IN T&R ERD604XEZ Through hole reflow (THR) Gull wing (SMT) J-Hook (SMT)■DIMENSIONS AND CIRCUITRY。
旋转编码开关(Rotary Encoder switch)这种旋转编码开关(Rotary Encoder switch),一个使用3脚的,后面一个使用5脚的,大家可能对这种玩意都不是很了解,但涉及到有调整的地方,这个玩意使用真是很爽,我弄了2个,研究了一下,供大家参考~5脚的ALPS:具有左转,右转,按下三个功能。
4、5脚是中间按下去的开关接线 1 2 3脚一般是中间2脚接地,1、3脚上拉电阻后,当左转、右转旋纽时,在1、3脚就有脉冲信号输出了。
着这是标准资料:在单片机编程时,左转和右转的判别是难点,用示波器观察这种开关左转和右转时两个输出脚的信号有个相位差,见下图:由此可见,如果输出1为高电平时,输出2出现一个高电平,这时开关就是向顺时针旋转; 当输出1 为高电平,输出2出现一个低电平,这时就一定是逆时针方向旋转.所以,在单片机编程时只需要判断当输出1为高电平时,输出2当时的状态就可以判断出是左旋转或是右旋转了。
还有另外一种3脚的,除了不带按钮开关外,和上面是一样的使用。
参考:#include "reg51.h"#define uint unsigned intsbit CodingsWitch_A=P1_1;sbit CodingsWitch_B=P1_2;uint CodingsWitchPolling()//{static Uchar Aold,Bold; //定义了两个变量用来储蓄上一次调用此方法是编码开关两引脚的电平static Uchar st; //定义了一个变量用来储蓄以前是否出现了两个引脚都为高电平的状态uint tmp = 0;if(CodingsWitch_A&&CodingsWitch_B)st = 1; //if(st) //如果st为1执行下面的步骤 {if(CodingsWitch_A==0&&CodingsWitch_B==0) //如果当前编码开关的两个引脚都为底电平执行下面的步骤{if(Bold) //为高说明编码开关在向加大的方向转{st = 0;tmp++; //}if(Aold) //为高说明编码开关在向减小的方向转{st = 0;tmp--; //设返回值}}}Aold = CodingsWitch_A; //Bold = CodingsWitch_B; //储return tmp; //}//编码器计数程序void encoder_cnt(void){uchar temp;temp = PIND; //取端口D管脚信号couch_clr = (temp & 0x08); //取编码器清零信号if(couch_clr != false) //有编码器清零信号{couch_num = 0; //水平床码清零}else{if(encoder_cnt_en == false) //编码器计数模块没有启动{pr_couch_ba = temp &0x03; //取编码器A、B相电平信号}else{couch_ba = temp & 0x03; //取编码器A、B相电平信号if(pr_couch_ba == 0x00){if(co uch_ba == 0x01){couch_num++; //水平床码加1}elseif(couch_ba == 0x10){couch_num--; //水平床码减1}}else if(pr_couch_ba ==0x01){if(co uch_ba == 0x11){couch_num++; //水平床码加1}elseif(couch_ba == 0x00){ couch_num--; //水平床码减1}}else if(pr_couch_ba == 0x10){if(co uch_ba == 0x00){couch_num++; //水平床码加1}else if(couch_ba == 0x11){couch_num--; //水平床码减1}}else if(pr_couch_ba == 0x11){if(co uch_ba == 0x10){couch_num++; //水平床码加1}else if(couch_ba == 0x01){couch_num--; //水平床码减1}}}pr_couch_ba = couch_ba;}}编码器及其计数模块原理飘扬的旋转编码器的检测程序(MCS51)//旋转编码器检测程序,A/B信号分别接在了INT0和INT1上//程序作者:BG4UVR//2005年1月15用KEIL编译、硬件测试通过//注意:编码器的信号,程序未做消抖处理。
旋转编码器旋转编码器是由光栅盘(又叫分度码盘)和光电检测装置(又叫接收器)组成。
光栅盘是在一定直径的圆板上等分地开通若干个长方形孔。
由于光栅盘与电机同轴,电机旋转时,光栅盘与电机同速旋转,发光二极管垂直照射光栅盘,把光栅盘图像投射到由光敏元件构成的光电检测装置(接收器)上,光栅盘转动所产生的光变化经转换后以相应的脉冲信号的变化输出。
编码器码盘的材料有玻璃、金属、塑料等。
玻璃码盘是在玻璃上沉积很薄的刻线,其热稳定性好,精度高。
金属码盘直接以通和不通刻线,不易碎,但由于金属有一定的厚度,精度就有限制,其热稳定性也比玻璃的差一个数量级。
塑料码盘成本低廉,但精度、热稳定性、寿命均要差一些。
编码器以信号原理来分,有增量式编码器(SPC)和绝对式编码器(APC),顾名思义,绝对式编码器可以记录编码器在一个绝对坐标系上的位置,而增量式编码器可以输出编码器从预定义的起始位置发生的增量变化。
增量式编码器需要使用额外的电子设备(通常是PLC、计数器或变频器)以进行脉冲计数,并将脉冲数据转换为速度或运动数据,而绝对式编码器可产生能够识别绝对位置的数字信号。
综上所述,增量式编码器通常更适用于低性能的简单应用,而绝对式编码器则是更为复杂的关键应用的最佳选择--这些应用具有更高的速度和位置控制要求。
输出类型取决于具体应用。
一:增量式旋转编码器工作原理增量式旋转编码器通过两个光敏接收管来转化角度码盘的时序和相位关系,得到角度码盘角度位移量的增加(正方向)或减少(负方向)。
增量式旋转编码器的工作原理如下图所示。
图中A、B两点的间距为S2,分别对应两个光敏接收管,角度码盘的光栅间距分别为S0和S1。
当角度码盘匀速转动时,可知输出波形图中的S0:S1:S2比值与实际图的S0:S1:S2比值相同,同理,当角度码盘变速转动时,输出波形图中的S0:S1:S2比值与实际图的S0:S1:S2比值仍相同。
通过输出波形图可知每个运动周期的时序为:我们把当前的A、B输出值保存起来,与下一个到来的A、B输出值做比较,就可以得出角度码盘转动的方向,如果光栅格S0等于S1时,也就是S0和S1弧度夹角相同,且S2等于S0的1/2,那么可得到此次角度码盘运动位移角度为S0弧度夹角的1/2,再除以所用的时间,就得到此次角度码盘运动的角速度。
旋转编码器使用方法使用方法一:修改驱动程序旋转编码器属于精密仪器,在其使用过程中需通过程序发出指令,才能起到特定的作用,而根据不同环境下的需求,需要设定不同的驱动程序,所以说决定编码器使用效果怎么样,修改合适的驱动程序是非常重要的。
通常情况下只要直接修改reg文件,同时注册一个表文件,利用添加的方式改写动态链接,在确定动态链接已经修改好的情况下,需要将其添加到内核中;使用方法二:硬件接口连接驱动程序修改好之后,下面就是硬件接口连接操作,在连接中,通常有A和B两个集电极输出接口,为确保线路衔接性,需要在3.3V 上的电阻上进行操作,将A和B两个接口分别插到CPU上。
在硬件接口连接成功之后,以防万一,须做好测试工作检查电压输出端高低压数值是否正确,比如在按下按钮之后,如果P2端口输出值是高电平的话,说明连接正确;使用方法三:流接口驱动程序的编写流接口驱动程序的编写是为下面的中断服务程序做准备,具体编写步骤是创建线程实现变量值的记录,同时记录在线路中断的情况下,各端口的数值是否还是高电平;使用方法四:中断服务程序的编写终端服务程序编写主要是起到编码器线路保护作用。
通过对CPU 的I/O接口进行初始化工作,在此基础上编写中断服务程序。
旋转编码器使用说明1. 确定检测对象,测速、测距、测角位移还是计数等。
2.仅用于动态过程还是包含静态位置或状态。
3.确认是择增量型旋转编码器还是绝对型旋转编码器。
4.确定对象的运动范围。
5.确认是选择单圈绝对型旋转编码器还是多圈绝对型旋转编码器。
6.确定对象的最高速度或频率。
7.确定对象的精度要求。
8.确定选择旋转编码器的应用参数。
9. 使用环境,注意旋转编码器的接口方式和保护等级。
一、编码器(编码开关)原理及使用方法
旋转编码器、数码电位器、Rotary Encoder。
它具有左转,右转功能,有的旋转编码开关还有按下功能。
使用方法:EC11型编码开关为例:
三只脚:123脚一般是中间2脚接地,1、3脚上拉电阻后,当左转、右转旋转时,在1、3脚就有脉冲信号输出了。
两只脚:按压开关,按下时导通,回复时断开。
二、在单片机编程时,左转和右转的判别是难点,用示波器观察这种开关左转和右转时
两个输出脚的信号有个相位差.由此可见,如果输出1为高电平时,输出2出现一
个高电平,这时开关就是向顺时针旋转;当输出1为高电平,输出2出现一个低
电平,这时就一定是逆时针方向旋转。
所以,在单片机编程时只需要判断当输
出1为高电平时,输出2当时的状态就可以判断出是左旋转或是右旋转了。
台達旋轉式編碼器使用說明台达旋转式编码器使用说明DELTA ROTARY OPTICAL ENCODER INSTRUCTION SHEET(繁體版)輸出訊號之電路將編碼器連接至接收端前,請先根據下表確認輸出訊號種類。
1.線路連接表ES/EH/ET 系列 將屏蔽線(裸線)連接到應用設備之接地端,以使其有更高品質的輸出訊號。
AS/AH 系列 (AXX-XXCXXXXX,AXX-XXVXXXXX)線材顏色功能線材顏色功能紅Vcc 藍24黑0V 紫25棕20灰26橘21白27黃22粉紅28綠23淡藍29MH4/MT4 系列CS7 系列2.輸出型式ES/EH/ET 系列Vcc0VoutputVcc0V0VVccoutput電壓輸出開集極差動推挽AS/AH 系列 (AXX-XXCXXXXX,AXX-XXVXXXXX)Vcc0Voutput電壓輸出開集極MH4/MT4/CS7系列Vcc0V差動(简体版)输出信号之电路将编码器连接至接收端前,请先根据下表确认输出信号种类。
1.线路连接表ES/EH/ET 系列 将屏蔽线(裸线)连接到应用设备之接地端,以使其有更高品质的输出信号。
AS/AH 系列 (AXX-XXCXXXXX,AXX-XXVXXXXX) 线材颜色 功能 线材颜色 功能红 Vcc 蓝 24 黑 0V 紫25 棕 20灰 26 橘 21白 27 黄 22粉红 28 绿 23淡蓝 29MH4/MT4 系列CS7 系列2. 输出形式 ES/EH/ET 系列Vcc0VoutputVcc0V0VVccoutput電壓輸出開集極差動推挽AS/AH 系列 (AXX-XXCXXXXX,AXX-XXVXXXXX)Vcc0Voutput電壓輸出開集極MH4/MT4/CS7系列Vcc0V差動(English Version)CIRCUIT OF OUTPUT SIGNALSBefore connecting the encoder wirings to the receiver, please identify the type of the output signal with the specification. 1. Connection Table ES/EH/ET SeriesConnect the shield wire (bare wire) with the grounding end of equipment for better performance.AS/AH Series (AXX-XXCXXXXX,AXX-XXVXXXXX) Wire ColorFunctionWire ColorFunction Red Vcc Blue 24Black 0V Purple 25 Brown 20Gray 26 Orange 21 White 27 Yellow 22 Pink28Green 23Light Blue29MH4/MT4 SeriesCS7 Series2. Output Circuit ES/EH/ET SeriesVcc0V outputVcc0V 0VVccoutputVoltage OutputOpen-Collector Line Driver Push-PullAS/AH Series (AXX-XXCXXXXX,AXX-XXVXXXXX)Vcc0VoutputVoltage OutputOpen-CollectorMH4/MT4/CS7SeriesVcc0VLine Driver***************************************。
旋转编码开关(Rotary Encoder switch)-使用说明及程序具有左转,右转,按下三个功能。
4、5 脚是中间按下去的开关接线 1 2 3 脚一般是中间2 脚接地,1、3 脚上拉电阻后,当左转、右转旋纽时,在1、3 脚就有脉冲信号输出了。
着这是标准资料:在单片机编程时,左转和右转的判别是难点,用示波器观察这种开关左转和右转时两个输出脚的信号有个相位差,见下图:由此可见,如果输出1 为高电平时,输出2 出现一个高电平,这时开关就是向顺时针旋转; 当输出1 为高电平,输出2 出现一个低电平,这时就一定是逆时针方向旋转.所以,在单片机编程时只需要判断当输出1 为高电平时,输出2 当时的状态就可以判断出是左旋转或是右旋转了。
还有另外一种3 脚的,除了不带按钮开关外,和上面是一样的使用。
参考:#include "reg51.h"#define uint unsigned intsbit CodingsWitch_A=P1_1;sbit CodingsWitch_B=P1_2;uint CodingsWitchPolling()//{static Uchar Aold,Bold; //定义了两个变量用来储蓄上一次调用此方法是编码开关两引脚的电平static Uchar st; //定义了一个变量用来储蓄以前是否出现了两个引脚都为高电平的状态uint tmp = 0;if(CodingsWitch_A&&CodingsWitch_B)st = 1; //if(st) //如果st 为1 执行下面的步骤{if(CodingsWitch_A==0&&CodingsWitch_B==0) //如果当前编码开关的两个引脚都为底电平执行下面的步骤{if(Bold) //为高说明编码开关在向加大的方向转{st = 0;tmp++; //}if(Aold) //为高说明编码开关在向减小的方向转{st = 0;tmp--; //设返回值}}}Aold = CodingsWitch_A; //Bold = CodingsWitch_B; //储return tmp; //}//编码器计数程序void encoder_cnt(void){uchar temp;temp = PIND; //取端口D 管脚信号couch_clr = (temp & 0x08); //取编码器清零信号if(couch_clr != false) //有编码器清零信号{couch_num = 0; //水平床码清零}else{if(encoder_cnt_en == false) //编码器计数模块没有启动{pr_couch_ba = temp & 0x03; //取编码器A、B 相电平信号}else{couch_ba = temp & 0x03; //取编码器A、B 相电平信号if(pr_couch_ba == 0x00){if(couch_ba == 0x01){couch_num++; //水平床码加1}else if(couch_ba == 0x10){couch_num--; //水平床码减1}}else if(pr_couch_ba == 0x01){if(couch_ba == 0x11){couch_num++; //水平床码加1}else if(couch_ba == 0x00){couch_num--; //水平床码减1}}else if(pr_couch_ba == 0x10){if(couch_ba == 0x00){couch_num++; //水平床码加1}else if(couch_ba == 0x11){couch_num--; //水平床码减1}}else if(pr_couch_ba == 0x11){if(couch_ba == 0x10){couch_num++; //水平床码加1}else if(couch_ba == 0x01){couch_num--; //水平床码减1}}}pr_couch_ba = couch_ba;}}编码器及其计数模块原理飘扬的旋转编码器的检测程序(MCS51)//旋转编码器检测程序,A/B信号分别接在了INT0和INT1上//程序作者:BG4UVR//2005 年1 月15 用KEIL编译、硬件测试通过//注意:编码器的信号,程序未做消抖处理。
ROTARYENCOERCONNECTIONS编码器型号说明随着自动化设备的普及,编码器在机械生产中起到了很大的作用,在机电及自动化系统中,编码器在自动控制及自动测量等领域得到了广泛的应用,编码器以其高精度、高分辨率和高可靠性而被广泛用于各种自动化领域,测量电机的转速、设备运行位置和行程的检测等都是编码器的实际应用所涵盖的接下来润鑫编码器带大家全面了解一下型号怎么看。
以网上搜索的这款编码器型号为例来详细说明型号详解A:RE是编码器大的代号,厂家的命名规则不同前面代号也有所不同林积为取RE则是旋转编码器rotaryencoder英文首字母。
B:外观关键尺寸大小11则为某一个面的尺寸11mm左右。
C:03是薄型底座带开关产品,还有如00厚型底座不带开关、01厚型底座带开关产品等等。
D:轴套的形状代号,l则为3.5mm长度无螺纹轴套,还有7mm、5mm、10mm有无螺纹等等这些信息。
E∶支架代号,C支架代表安装方式为插件方式,支架脚的宽度为2.0mm支架脚总跨度为13.2mm,还有宽2.5mm跨度12.9跟贴片支架脚等等。
F:代表底盖有无定位柱,1代表无柱子。
还有2代表有两个定位柱、3代表有两个大的定位柱等等。
G:端子脚类型,HO1代表立式插件脚。
还有V01跟其他参数如端子脚数量,端子脚形状,端子脚跨度。
H:内部流水号,代表的信息在后面括号里体现。
I:脉冲数量,代表的是产品的脉冲信息,不同类型的编码器脉冲数量有不同如:9脉冲、12脉冲、15脉冲、20脉冲、24脉冲等等。
J::脉冲输出的方向,代表脉冲是通过正旋转还是反旋转输出,P代表顺时针旋转,T代表逆时针旋转。
K:定位数量,代表这旋转一周有多少个定位点也就是档位感,这里的定位数量跟脉冲数量必须成1:1或者2:1的比例出现。
L:轴芯形状,A代表D字形半轴,K代表梅花齿拉花轴等等。
M:代表轴芯材质,A代表铝合金材,B代表锌合金材,C代表铜材质,D代表不锈钢材质,L代表塑胶材质等等。
编码器:
应用
旋转编码器是用来测量数据的,当编码器旋转式通过电子拦截获得数据,然后管理员传到下一运输注意
不要丢下旋转编码器和避免摇晃。
编码器包括光学系统并运用光学原理。
用原始包装,运用不正当的包装,可能导致编码器毁坏。
存储
存储温度:-30到80保持干燥
安装说明
安装编码器时,避免安装轴时发生摇晃,固定的光学圆盘碰到轴时可能毁坏
不要打开旋转编码器
据菲权威统计,打开或关闭编码器可能导致短路,缸的导线可能剪断,进入的灰尘可能毁坏光不要做任何机械上的更改在编码器上,安全的功能与机械部分更改将不担保
电子试运行
试运行和操作需要专业的人员,
不要做点路上的更改在编码器上,
穿接插头需要必须实实在在的连接。
错误的连接可能导致故障,
管理员传到下一步
进入的灰尘可能毁坏光学系统。
DELTA ROTARY OPTICAL ENCODERINSTRUCTION SHEET (English Version)CIRCUIT OF OUTPUT SIGNALSBefore connecting the encoder wirings to the receiver, please identify the type of the output signal with the specification. 1. Connection Table ES/EH/ET SeriesConnect the shield wire (bare wire) with the grounding end of equipment for better performance.AS/AH Series (AXX-XXCXXXXX, AXX-XXVXXXXX)Wire Color Function Wire Color Function Red Vcc Blue 24Black 0V Purple 25 Brown 20Gray 26 Orange 21 White 27Yellow 22 Pink 28 Green23Light Blue29MH4/MT4 Series2. Output CircuitDELTA ROTARY ENCODER KULLANIMI(Türkçe Version)ÇIKI Ş S ĐNYAL Đ DEVRES ĐEnkoder ba ğlantısı yapılmadan önce a şa ğıdaki tabloya göre çıkış tipi belirlenmelidir. 1. Ba ğlantı Tablosu ES/EH/ET SerisiDaha iyi bir performans için topraklama ucuna shield (aynalı kablo) kullanın.AS/AH Serisi (AXX-XXCXXXXX, AXX-XXVXXXXX)Kablo Rengi Fonksiyon Kablo RengiFonksiyonKırmızı Vcc Mavi 24Siyah 0V Mor 25 Kahve 20Gri 26Turuncu 21 Beyaz 27 Sarı 22 Pembe 28 Ye şil23Açık Mavi292. Çıkış Devresi台達旋轉式編碼器使用說明(繁體版)輸出訊號之電路將編碼器連接至接收端前,請先根據下表確認輸出訊號種類。
旋转编码开关(Rotary Encoder switch)-使用说明及程序
具有左转,右转,按下三个功能。
4、5 脚是中间按下去的开关接线 1 2 3 脚一般是中间2 脚接地,1、3 脚上拉电阻后,当左转、右转旋纽时,在1、3 脚就有脉冲信号输出了。
着这是标准资料:
在单片机编程时,左转和右转的判别是难点,用示波器观察这种开关左转和右转时两个输出
脚的信号有个相位差,见下图:
由此可见,如果输出1 为高电平时,输出2 出现一个高电平,这时开关就是向顺时针旋转; 当输出1 为高电平,输出2 出现一个低电平,这时就一定是逆时针方向旋转.
所以,在单片机编程时只需要判断当输出1 为高电平时,输出2 当时的状态就可以判断出是左
旋转或是右旋转了。
还有另外一种3 脚的,除了不带按钮开关外,和上面是一样的使用。
参考:
#include "reg51.h"
#define uint unsigned int
sbit CodingsWitch_A=P1_1;
sbit CodingsWitch_B=P1_2;
uint CodingsWitchPolling()//
{
static Uchar Aold,Bold; //定义了两个变量用来储蓄上一次调用此方法是编码开关两引
脚的电平
static Uchar st; //定义了一个变量用来储蓄以前是否出现了两个引脚都为高电
平的状态
uint tmp = 0;
if(CodingsWitch_A&&CodingsWitch_B)
st = 1; //
if(st) //如果st 为1 执行下面的步骤
{
if(CodingsWitch_A==0&&CodingsWitch_B==0) //如果当前编码开关的两个引脚
都为底电平执行下面的步骤
{
if(Bold) //为高说明编码开关在向加大的方向转
{
st = 0;
tmp++; //
}
if(Aold) //为高说明编码开关在向减小的方向转
{
st = 0;
tmp--; //设返回值
}
}
}
Aold = CodingsWitch_A; //
Bold = CodingsWitch_B; //储
return tmp; //
}
//编码器计数程序
void encoder_cnt(void)
{
uchar temp;
temp = PIND; //取端口D 管脚信号
couch_clr = (temp & 0x08); //取编码器清零信号if(couch_clr != false) //有编码器清零信号
{
couch_num = 0; //水平床码清零
}
else
{
if(encoder_cnt_en == false) //编码器计数模块没有启动
{
pr_couch_ba = temp & 0x03; //取编码器A、B 相电平信号
}
else
{
couch_ba = temp & 0x03; //取编码器A、B 相电平信号
if(pr_couch_ba == 0x00)
{
if(couch_ba == 0x01)
{
couch_num++; //水平床码加1
}
else if(couch_ba == 0x10)
{
couch_num--; //水平床码减1
}
}
else if(pr_couch_ba == 0x01)
{
if(couch_ba == 0x11)
{
couch_num++; //水平床码加1
}
else if(couch_ba == 0x00)
{
couch_num--; //水平床码减1
}
}
else if(pr_couch_ba == 0x10)
{
if(couch_ba == 0x00)
{
couch_num++; //水平床码加1
}
else if(couch_ba == 0x11)
{
couch_num--; //水平床码减1
}
}
else if(pr_couch_ba == 0x11)
{
if(couch_ba == 0x10)
{
couch_num++; //水平床码加1
}
else if(couch_ba == 0x01)
{
couch_num--; //水平床码减1
}
}
}
pr_couch_ba = couch_ba;
}
}
编码器及其计数模块原理
飘扬的旋转编码器的检测程序(MCS51)
//旋转编码器检测程序,A/B信号分别接在了INT0和INT1上
//程序作者:BG4UVR
//2005 年1 月15 用KEIL编译、硬件测试通过
//注意:编码器的信号,程序未做消抖处理。
测试中,A/B信号上各//接了一只104的瓷片电容,工作很正常。
如果不接电容,请自行编
//写信号消抖程序。
#include <at89x51.h>
sbit led="0xB1";//有一只LED接在了RXD 引脚上,用来指示正反转;
main()
{
EA=1; //总中断允许
EX0=1; //外部中断0允许
IT0=1; //外部中断0为边沿触发方式
while(1);;
}
/*********************
编码器中断函数
入口:无
出口:无
*********************/
void encoder(void) interrupt 0 { //外部中断0
if (INT1){
led=1;
}else{
led=0;
}
}
whimsy 的AVR 程序
//外部中断0,用于编码开关解码,解码图: A 接中断脚(AVR 的PD2),以此为基准,B 用来
判断方向(连到AVR 的PA1), C 接地
//A -|
// | -----|__________|----------|____________
//C -|
//
//B -|
// | ----------|__________|----------|____________
//C -|
// CW ===>>> ROTATION
//外部中断设置(ISC01=0,ISC00=1): INT0 引脚上任意的逻辑电平变化都将引发中断
#pragma interrupt_handler int0_isr:2
void int0_isr(void)
{
//external interupt on INT0
GICR=0; //禁止外部中断
if ((PIND & 0x04)==0) //先判断是高电平产生的中断还是低点平的中断
if ((PINA & 0x02)==0) //再判断B 线上的电平
{
keycounter--;
keydirection="0";
}
else
{
keycounter++;
keydirection="1";
}
else
if ((PINA & 0x02)==0)
{
keycounter++; keydirection="1";
}
else
{
keycounter--;
keydirection=0;
}
GICR=0x40;
}。