CN106444606B - Incremental electronic coded odometer device based on PLC technology and its application - Google Patents
Incremental electronic coded odometer device based on PLC technology and its application Download PDFInfo
- Publication number
- CN106444606B CN106444606B CN201610864075.3A CN201610864075A CN106444606B CN 106444606 B CN106444606 B CN 106444606B CN 201610864075 A CN201610864075 A CN 201610864075A CN 106444606 B CN106444606 B CN 106444606B
- Authority
- CN
- China
- Prior art keywords
- module
- pulse
- value
- plc
- incremental
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/056—Programming the PLC
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B2219/00—Program-control systems
- G05B2219/10—Plc systems
- G05B2219/13—Plc programming
- G05B2219/13018—Conversion ladder diagram to decision system, machine code, language
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02P—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
- Y02P90/00—Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
- Y02P90/02—Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Recording Measured Values (AREA)
- Arrangements For Transmission Of Measured Signals (AREA)
Abstract
本发明涉及一种基于PLC技术的增量式电子编码里程计装置及其应用,该装置安装在有轨电车上,所述的里程计装置分别与有轨电车的车轮转速传感器、速度反馈电压传感器和车载控制器连接,所述的里程计装置包括增量编码器模块、AD转换模块、PLC模块、增量式脉冲发生器模块,所述的PLC模块分别与增量编码器模块、AD转换模块、增量式脉冲发生器模块连接,所述的增量编码器模块与车轮转速传感器连接,所述的AD转换模块与速度反馈电压传感器连接,所述的增量式脉冲发生器模块与车载控制器连接。与现有技术相比,本发明具有可扩展性大大增强等优点。
The invention relates to an incremental electronic coded odometer device based on PLC technology and its application. The device is installed on a tram, and the odometer device is connected with the wheel speed sensor and the speed feedback voltage sensor of the tram respectively. Connect with vehicle-mounted controller, described odometer device comprises incremental encoder module, AD conversion module, PLC module, incremental pulse generator module, and described PLC module is connected with incremental encoder module, AD conversion module respectively , the incremental pulse generator module is connected, the incremental encoder module is connected with the wheel speed sensor, the AD conversion module is connected with the speed feedback voltage sensor, and the incremental pulse generator module is connected with the vehicle control device connection. Compared with the prior art, the present invention has the advantages of greatly enhanced scalability and the like.
Description
技术领域technical field
本发明涉及一种增量式电子编码里程计,尤其是涉及一种基于PLC技术的增量式电子编码里程计装置及其应用。The invention relates to an incremental electronic coding odometer, in particular to an incremental electronic coding odometer device based on PLC technology and its application.
背景技术Background technique
有轨电车信号系统中列车的车载控制系统(OBS)是及其重要的,有轨电车列车车载功能包括了有轨电车的ATP列车自动防护和DAC列车辅助驾驶,而无论是ATP功能或者是DAC功能,都是依赖于列车的测速和定位信息,分别需要用到里程计测速和信标定位。其中,目前的列车里程计基本都被国外公司所垄断,存在技术不透明、价格昂贵、使用不够灵活、设备损耗高、可扩展性差等缺点。因而在实际使用中,一种里程计难以匹配到所有类型的车辆上,且在实际安装使用中需要不断的调整和修正。The on-board control system (OBS) of the train in the tram signal system is extremely important. The on-board functions of the tram train include the ATP train automatic protection of the tram and the DAC train assisted driving, regardless of whether it is the ATP function or the DAC. The functions are all dependent on the speed measurement and positioning information of the train, and the odometer speed measurement and beacon positioning are required respectively. Among them, the current train odometers are basically monopolized by foreign companies, which have disadvantages such as opaque technology, high price, inflexible use, high equipment loss, and poor scalability. Therefore, in actual use, it is difficult to match one odometer to all types of vehicles, and constant adjustment and correction are required in actual installation and use.
在现实使用中,由于种种原因,国内外对编码里程计的研究与开发在技术上还存在以下一些问题:In actual use, due to various reasons, there are still some technical problems in the research and development of coded odometer at home and abroad:
1)可扩展性:随着轨道交通需求的不断增大,不同路况和线路的复杂度也越来越高,因此列车对编码里程计的需求也在不断提高,传统的霍尔型编码里程计和光电型编码里程计难以适应多种不同的场景。1) Scalability: As the demand for rail transit continues to increase, the complexity of different road conditions and lines is also increasing. Therefore, the demand for coded odometers in trains is also increasing. The traditional Hall-type coded odometer And photoelectric coded odometers are difficult to adapt to many different scenarios.
2)通用性:目前的轨道交通分为国家铁路,城市轨道交通,有轨电车三个方面,列车的型号和款式多种多样,列车对编码里程计的接口需求也不断增长,提供通用的电子编码里程计十分必要。2) Versatility: The current rail transit is divided into three aspects: national railway, urban rail transit, and tram. Coding the odometry is necessary.
3)损耗性:传统编码里程计都有机械件的转动和摩擦,在日积月累的列车运行中,机械件会发生磨损和腐蚀的情况,不光会影响到机械件的寿命,并且会进一步影响到编码里程计的精度和准度。3) Loss: The traditional coded odometer has the rotation and friction of mechanical parts. During the accumulated train operation, the mechanical parts will be worn and corroded, which will not only affect the life of the mechanical parts, but also further affect the code. Accuracy and accuracy of the odometer.
4)可追溯性:传统的编码里程计当发生故障时,很难检测到故障发生原因和时间,必须用专用的里程计测试单元,检测效果也不是十分理想。4) Traceability: When a traditional coded odometer fails, it is difficult to detect the cause and time of the failure, and a dedicated odometer test unit must be used, and the detection effect is not very satisfactory.
5)增量性转换和记录:传统的编码里程计只能对速度做出采集,没有位移记录和速度转换功能。5) Incremental conversion and recording: traditional coded odometers can only collect speed, without displacement recording and speed conversion functions.
发明内容Contents of the invention
本发明的目的就是为了克服上述现有技术存在的缺陷而提供一种基于PLC技术的增量式电子编码里程计装置及其应用,在汲取了现有国外编码里程计技术不足的经验基础上,设计通用的PLC型增量型电子编码里程计,可以为有轨电车速度和定位信息的采集提供稳定可靠的数据来源,并对有轨电车车载信号系统提供可靠的技术支撑和方便的研究平台,因此具有十分重要的意义。The purpose of the present invention is exactly to provide a kind of incremental electronic coded odometer device and its application based on PLC technology in order to overcome the defective that above-mentioned prior art exists, on the basis of drawing on the insufficient experience of existing foreign coded odometer technology, Design a general-purpose PLC-type incremental electronic coded odometer, which can provide a stable and reliable data source for the collection of tram speed and positioning information, and provide reliable technical support and a convenient research platform for the tram signal system. Therefore it is of great significance.
本发明的目的可以通过以下技术方案来实现:The purpose of the present invention can be achieved through the following technical solutions:
一种基于PLC技术的增量式电子编码里程计装置,该装置安装在有轨电车上,所述的里程计装置分别与有轨电车的车轮转速传感器、速度反馈电压传感器和车载控制器连接,所述的里程计装置包括增量编码器模块、AD转换模块、PLC模块、增量式脉冲发生器模块,所述的PLC模块分别与增量编码器模块、AD转换模块、增量式脉冲发生器模块连接,所述的增量编码器模块与车轮转速传感器连接,所述的AD转换模块与速度反馈电压传感器连接,所述的增量式脉冲发生器模块与车载控制器连接。An incremental electronically coded odometer device based on PLC technology, the device is installed on a tram, and the odometer device is respectively connected with a wheel speed sensor, a speed feedback voltage sensor and an on-board controller of the tram, The odometer device comprises an incremental encoder module, an AD conversion module, a PLC module, and an incremental pulse generator module, and the described PLC module is connected with the incremental encoder module, the AD conversion module, and the incremental pulse generator respectively. The incremental encoder module is connected with the wheel speed sensor, the AD conversion module is connected with the speed feedback voltage sensor, and the incremental pulse generator module is connected with the vehicle controller.
所述的增量编码器模块为三通道增量式编码器,该编码器设有三路信号输出,分别为:A脉冲、B脉冲和Z脉冲,其中A脉冲在前,B脉冲在后,A与B脉冲相差90度,每圈发出一个Z脉冲,作为参考机械零位;轴端看编码器顺时针旋转为正转,即A脉冲超前B脉冲为90°,反之逆时针旋转为反转,即B脉冲超前A脉冲为90°。The incremental encoder module is a three-channel incremental encoder, and the encoder is provided with three signal outputs, namely: A pulse, B pulse and Z pulse, wherein the A pulse is in the front, the B pulse is in the back, and the A pulse is in the rear. There is a 90-degree difference from the B pulse, and a Z pulse is sent out per revolution as a reference mechanical zero position; the encoder rotates clockwise when viewed from the shaft end, that is, the A pulse is 90° ahead of the B pulse, and vice versa, the counterclockwise rotation is reverse rotation. That is, the B pulse leads the A pulse by 90°.
所述的AD转换模块设有四个输入通道和32个缓存器,其中四个输入通道用于将接收模拟信号并将其转换成数字量,32个缓存器分配定义如下:The AD conversion module is provided with four input channels and 32 registers, wherein four input channels are used to receive analog signals and convert them into digital quantities, and the allocation of 32 registers is defined as follows:
0#:通道初始化,缺省值H0000;0#: channel initialization, the default value is H0000;
1#---4#:通道1---通道4的平均采样数,用于得到平均结果;1#---4#: the average sampling number of
5#---8#:通道1---通道4采样数的平均输入值,即根据#1---#4规定的平均采样次数,得出所有采样的平均值;5#---8#: The average input value of the sampling number of
9#---12#:通道1---通道4读入的当前值;9#---12#: the current value read from
13#,14#:保留,不做定义;13#, 14#: reserved, not defined;
15#:选择A/D转换速度,设为0则选择正常速度;设为1则选择高速(15ms/通道);15#: Select A/D conversion speed, set to 0 to select normal speed; set to 1 to select high speed (15ms/channel);
16#---19#:保留,不做定义;16#---19#: reserved, not defined;
20#:复位到缺省值和预设,缺省值为0;20#: reset to the default value and preset, the default value is 0;
21#:禁止调整偏移、增益值;21#: It is forbidden to adjust the offset and gain values;
22#:偏移,增益调整;22#: offset, gain adjustment;
23#:偏移值,缺省值为0;23#: offset value, the default value is 0;
24#:增益值,缺省值为5000;24#: Gain value, the default value is 5000;
25#---28#:保留,不做定义;25#---28#: reserved, not defined;
29#:错误状态;29#: error state;
30#:识别码K2010;30#: identification code K2010;
31#:禁用。31#: disable.
所述的PLC模块包括CPU模块,该CPU模块包括以下功能:定时中断采集、模拟量输入采集和脉冲控制输出。The PLC module includes a CPU module, and the CPU module includes the following functions: timing interrupt collection, analog input collection and pulse control output.
所述的模拟量输入采集包括采样处理和平均处理;The analog input acquisition includes sampling processing and averaging processing;
所述的采用处理具体为:按CPU模块的每个扫描对模拟输入进行A/D转换,每次都进行数字输出,并将值存储到数字输出值、数字运算值及模拟输入值监视中;The adopting process is specifically: A/D conversion is performed on the analog input according to each scan of the CPU module, digital output is performed each time, and the value is stored in the digital output value, digital operation value and analog input value monitoring;
所述的平均处理具体为:按每个通道对数字输出值进行平均处理,并将平均值存储到设定寄存器中。The average processing specifically includes: performing average processing on the digital output value for each channel, and storing the average value in the setting register.
所述的平均处理设有三种,分别为:There are three types of average processing, which are:
时间平均:按照设置时间进行A/D转换,对合计值进行平均,并存储到数字输出值、数字运算值及模拟输入值监视中;设置时间内的处理次数因扫描时间而异,其中处理次数=设置时间/扫描时间;Time averaging: A/D conversion is performed according to the set time, the total value is averaged, and stored in the digital output value, digital operation value, and analog input value monitor; the number of processing within the set time varies with the scan time, and the number of processing = setting time/scanning time;
次数平均:以次数指定A/D转换值的平均处理,对除最大值和最小值以外的平均值进行数字输出,并存储到数字输出值、数字运算值及模拟输入值监视中;基于次数平均的平均值被存储到数字输出值、数字运算值及模拟输入值监视中的时间,因扫描时间而异;处理时间=设置次数×扫描时间;Count average: specify the average processing of the A/D conversion value by the number of times, digitally output the average value other than the maximum value and the minimum value, and store it in the digital output value, digital operation value, and analog input value monitor; based on the count average The time for the average value of the value to be stored in the digital output value, digital operation value and analog input value monitoring varies with the scan time; processing time = setting times × scan time;
移动平均:指定A/D转换值的移位平均处理的次数,对该平均值进行数字输出,并存储到数字输出值、数字运算值及模拟输入值监视中。Moving average: Specify the number of shift average processing times for the A/D conversion value, digitally output the average value, and store it in the digital output value, digital operation value, and analog input value monitor.
所述的脉冲控制输出具体为:首先设置输出端口号以及参数,设置脉冲输出的模式,选择PULSE/SIGN模式后进行脉冲输出。The pulse control output specifically includes: firstly, set the output port number and parameters, set the pulse output mode, and perform pulse output after selecting the PULSE/SIGN mode.
一种基于PLC技术的增量式电子编码里程计装置的应用,包括以下步骤:An application of an incremental electronic coded odometer device based on PLC technology, comprising the following steps:
1)当PLC模块上电后,进入PLC模块内部自检阶段,包括PLC模块检查CPU模块的硬件是否正常,以及复位监视定时器;1) When the PLC module is powered on, it enters the internal self-test stage of the PLC module, including the PLC module checking whether the hardware of the CPU module is normal, and resetting the monitoring timer;
2)PLC模块初始化,即PLC模块加载梯形图程序,初始化所有定时器和寄存器;2) PLC module initialization, that is, the PLC module loads the ladder diagram program, and initializes all timers and registers;
3)当列车运行启动后,增量式编码器模块对列车车轮转速进行跟踪采集,并按照实际的转速和位移信息,对PLC模块的CPU模块内寄存器写入速度和位移信息;3) After the train starts running, the incremental encoder module tracks and collects the speed of the train wheel, and writes the speed and displacement information to the register in the CPU module of the PLC module according to the actual speed and displacement information;
4)当列车运行启动后,如果列车有速度电压输出,则AD转换模块对速度电压进行采集,并对PLC模块的CPU模块内寄存器写入速度和位移信息;4) After the train operation starts, if the train has a speed voltage output, the AD conversion module collects the speed voltage, and writes speed and displacement information to the register in the CPU module of the PLC module;
5)PLC模块处理阶段,按先上后下以及先左后右的步序,对梯形图程序进行逐句扫描并根据采样到输入映像寄存器中的结果进行逻辑运算,运算结果再存入有关映像寄存器中;5) In the processing stage of the PLC module, the ladder diagram program is scanned sentence by sentence according to the steps of first up and then down and first left and then right, and logical operations are performed according to the results sampled into the input image register, and the operation results are stored in the relevant image in the register;
6)PLC模块的CPU模块根据程序指令,把单位时间内采集到的转动周数和速度模拟量电压根据PLC指令转换为速度脉冲信息;6) According to the program instructions, the CPU module of the PLC module converts the number of rotation cycles and speed analog voltage collected per unit time into speed pulse information according to the PLC instructions;
7)PLC分配新的寄存器,写入脉冲数结果,并通过增量式脉冲发生器模块,对外发送脉冲信号;7) The PLC allocates new registers, writes the pulse number results, and sends pulse signals externally through the incremental pulse generator module;
8)定期对外发送单位时间内的脉冲数结果,表示单位时间内位移增量信息。8) Regularly send out the result of the number of pulses per unit time, indicating the displacement increment information per unit time.
与现有技术相比,本发明通过采用PLC技术,该电子编码里程计可以完全满足轨道交通信号系统的速度、位置采集的需求,所具备的优点和特点如下:Compared with the prior art, the present invention adopts PLC technology, and the electronic coding odometer can fully meet the requirements of the speed and position acquisition of the rail transit signal system, and has the advantages and characteristics as follows:
1)可扩展性大大增强:PLC型增量型编码里程计,组成的基本单元为PLC模块,故可以扩展增加不同功能的其他模块,如串口模块、网络模块、各类IO模块等,可以方便适应未来列车对里程计方面更多的需求;1) The scalability is greatly enhanced: the PLC incremental coded odometer, the basic unit is the PLC module, so it can be expanded to add other modules with different functions, such as serial port modules, network modules, various IO modules, etc., which can be convenient To adapt to the more demands of future trains on odometer;
2)良好的通用性:由于基本单元采用的是工业控制领域通用的PLC,因此适用范围广,在轨道交通方面可以通用应用于不同的车型,如有轨单车、地铁、高铁、城际铁路等;2) Good versatility: Since the basic unit adopts the common PLC in the field of industrial control, it has a wide range of applications, and can be applied to different types of vehicles in rail transportation, such as rail bicycles, subways, high-speed rails, intercity railways, etc. ;
3)低损耗性:电子编码里程计基本上没有物理转动和摩擦,PLC本身的平均寿命也为20年,因此磨损损耗非常低,寿命长,降低了使用成本;3) Low loss: the electronic coded odometer basically has no physical rotation and friction, and the average life of the PLC itself is 20 years, so the wear loss is very low, the life is long, and the use cost is reduced;
4)可追溯性:PLC可对所有处理的数据进行记录,因此当列车速度采集发生故障时,通过PLC日志记录可对发生的问题做追查;4) Traceability: PLC can record all the processed data, so when the train speed acquisition fails, the problem can be traced through the PLC log record;
5)增量性转换和记录:PLC增量型电子编码里程计可对发生的脉冲做累加计算和记录,可直接转换为位移增量信息对外发送,可减少轨道交通中定位信标的数量;5) Incremental conversion and recording: PLC incremental electronic coded odometer can accumulate and record the generated pulses, which can be directly converted into displacement incremental information and sent to the outside world, which can reduce the number of positioning beacons in rail transit;
6)安装维护便捷:PLC在工控领域安装方便,PLC型电子里程计不需要改变列车的传动机械机构即可方便安装使用。6) Easy installation and maintenance: PLC is easy to install in the field of industrial control, and the PLC-type electronic odometer can be easily installed and used without changing the transmission mechanism of the train.
附图说明Description of drawings
图1为本发明的结构示意图;Fig. 1 is a structural representation of the present invention;
图2为本发明的工作流程图;Fig. 2 is a work flow chart of the present invention;
图3为PLC的梯形图;Fig. 3 is the ladder diagram of PLC;
图4为PULSE/SIGN模式的脉冲输出信号图。Figure 4 is a pulse output signal diagram of PULSE/SIGN mode.
具体实施方式Detailed ways
下面结合附图和具体实施例对本发明进行详细说明。本实施例以本发明技术方案为前提进行实施,给出了详细的实施方式和具体的操作过程,但本发明的保护范围不限于下述的实施例。The present invention will be described in detail below in conjunction with the accompanying drawings and specific embodiments. This embodiment is carried out on the premise of the technical solution of the present invention, and detailed implementation and specific operation process are given, but the protection scope of the present invention is not limited to the following embodiments.
如图1所示,一种基于PLC技术的增量式电子编码里程计装置,该装置安装在有轨电车上,所述的里程计装置分别与有轨电车的车轮转速传感器6、速度反馈电压传感器7和车载控制器5连接,所述的里程计装置包括增量编码器模块1、AD转换模块2、PLC模块3、增量式脉冲发生器模块4,所述的PLC模块3分别与增量编码器模块1、AD转换模块2、增量式脉冲发生器模块4连接,所述的增量编码器模块1与车轮转速传感器6连接,所述的AD转换模块2与速度反馈电压传感器7连接,所述的增量式脉冲发生器模块4与车载控制器5连接。As shown in Figure 1, a kind of incremental electronic coding odometer device based on PLC technology, the device is installed on the tram, and the described odometer device is connected with the wheel speed sensor 6 and the speed feedback voltage of the tram respectively. Sensor 7 is connected with vehicle-mounted
具体内容如下:The specific content is as follows:
1)增量型编码器的应用与开发:所选用的增量型编码器有三路信号输出:A脉冲、B脉冲和Z脉冲,采用TTL电平,A脉冲在前,B脉冲在后,A,B脉冲相差90度,每圈发出一个Z脉冲,可作为参考机械零位。利用A超前B或B超前A进行判向,增量型编码器定义为轴端看编码器顺时针旋转为正转,A超前B为90°,反之逆时针旋转为反转B超前A为90°;1) Application and development of incremental encoder: The selected incremental encoder has three signal outputs: A pulse, B pulse and Z pulse, using TTL level, A pulse is in front, B pulse is in the back, A , The difference between the B pulses is 90 degrees, and a Z pulse is sent out every circle, which can be used as a reference mechanical zero position. Use A ahead of B or B ahead of A to judge the direction. Incremental encoders are defined as clockwise rotation of the encoder when viewed from the shaft end, and A is 90° ahead of B, and vice versa. °;
2)PLC AD模拟量转换模块的应用与开发:选用的速度电压模拟值范围是-10V到10VDC(分辨率:5mV),对于AD模块的32个缓冲存储器(0~31)分配定义如下:2) Application and development of PLC AD analog conversion module: the range of selected speed voltage analog value is -10V to 10VDC (resolution: 5mV), and the allocation definition of 32 buffer memories (0~31) of AD module is as follows:
0#:通道初始化,缺省值H00000#: channel initialization, default value H0000
1#---4#:通道1---通道4的平均采样数(1---4096),用于得到平均结果。缺省值高设为8(正常速度),高速操作可选择1.1#---4#: The average sampling number of
5#---8#:通道1---通道4采样数的平均输入值,即根据#1---#4规定的平均采样次数,得出所有采样的平均值。5#---8#: The average input value of
9#---12#:通道1---通道4读入的当前值。9#---12#: The current value read from
13#,14#:保留,不做定义。13#, 14#: reserved, not defined.
15#:选择A/D转换速度,设为0(缺省值)则选择正常速度(15ms/通道);设为1则选择高速(15ms/通道)。15#: Select A/D conversion speed, set to 0 (default) to select normal speed (15ms/channel); set to 1 to select high speed (15ms/channel).
16#---19#:保留,不做定义。16#---19#: reserved, not defined.
20#:复位到缺省值和预设,缺省值为0。20#: Reset to the default value and preset, the default value is 0.
21#:禁止调整偏移、增益值。缺省值为(0,1)允许状态。21#: It is forbidden to adjust the offset and gain values. The default is (0, 1) to allow the state.
22#:偏移,增益调整。22#: offset, gain adjustment.
23#:偏移值,缺省值为0。23#: offset value, the default value is 0.
24#:增益值,缺省值为5000。24#: Gain value, the default value is 5000.
25#---28#:保留,不做定义。25#---28#: reserved, not defined.
29#:错误状态。29#: Error status.
30#:识别码K2010。30#: identification code K2010.
31#:禁用。31#: disable.
3)CPU模块的编程与开发:PLC程序要满足三个需求点:即定时中断采集、模拟量输入采集和脉冲控制输出。PLC的梯形图程序如图3所示:3) Programming and development of CPU module: The PLC program must meet three requirements: namely, timing interrupt acquisition, analog input acquisition and pulse control output. The ladder diagram program of PLC is shown in Figure 3:
4)定时中断采集:设置定时中断I28的中断触发时间为100ms,这种方法可以保证循环读取模拟输入端的值;4) Timing interrupt acquisition: set the interrupt trigger time of timing interrupt I28 to 100ms, this method can ensure that the value of the analog input terminal is read cyclically;
5)PLC模拟量输入:即A/D转换,转换的方式有采样处理和平均处理两种方法:5) PLC analog input: that is, A/D conversion, the conversion method has two methods: sampling processing and averaging processing:
采样处理:按CPU模块的每个扫描对模拟输入进行A/D转换,每次都进行数字输出并将值存储到数字输出值、数字运算值及模拟输入值监视。Sampling processing: A/D conversion is performed on the analog input for each scan of the CPU module, digital output is performed every time and the value is stored in the digital output value, digital operation value, and analog input value monitoring.
平均处理:按每个通道对数字输出值进行平均处理,并将平均值存储到特殊寄存器中。平均处理有以下3种:Averaging processing: The digital output value is averaged for each channel, and the average value is stored in a special register. There are three types of average processing:
时间平均:按照设置时间进行A/D转换,对合计值进行平均,并存储到数字输出值、数字运算值及模拟输入值监视中。设置时间内的处理次数因扫描时间而异。处理次数=设置时间/扫描时间;Time averaging: A/D conversion is performed according to the set time, the total value is averaged, and stored in the digital output value, digital operation value, and analog input value monitor. The number of processing times within the setting time varies depending on the scan time. Processing times = setting time/scanning time;
次数平均:以次数指定A/D转换值的平均处理,对除最大值和最小值以外的平均值进行数字输出,并存储到数字输出值、数字运算值及模拟输入值监视中。基于次数平均的平均值被存储到数字输出值、数字运算值及模拟输入值监视中的时间,因扫描时间而异。处理时间=设置次数×扫描时间;Count averaging: Averaging processing of A/D conversion values is specified by counting times, and the average values other than the maximum value and minimum value are digitally output, and stored in digital output value, digital operation value, and analog input value monitor. The time at which the average value based on the count average is stored in the digital output value, digital operation value, and analog input value monitor varies depending on the scan time. Processing time = setting times × scanning time;
移动平均:可以指定A/D转换值的移位平均处理的次数,对该平均值进行数字输出,并存储到数字输出值、数字运算值及模拟输入值监视中。Moving average: It is possible to specify the number of shift average processing of the A/D conversion value, digitally output the average value, and store it in the digital output value, digital operation value, and analog input value monitor.
6)脉冲输出控制:在模拟量处理模块完成A/D转换,将模拟量转换成数字量以后,再使用定位模块生成脉冲输出。首先需要设置输出端口号以及相关参数,设置脉冲输出的模式,这里我们选择PULSE/SIGN模式,如图4所示:6) Pulse output control: After the analog quantity processing module completes the A/D conversion and converts the analog quantity into a digital quantity, the positioning module is used to generate pulse output. First, you need to set the output port number and related parameters, and set the pulse output mode. Here we choose the PULSE/SIGN mode, as shown in Figure 4:
如图2所示,本发明的工作流程包括以下步骤:As shown in Figure 2, the workflow of the present invention comprises the following steps:
1)当PLC上电后,进入PLC内部自检阶段,在此阶段,PLC检查CPU模块的硬件是否正常,复位监视定时器,以及完成一些其他内部工作;1) When the PLC is powered on, it enters the PLC internal self-inspection stage. At this stage, the PLC checks whether the hardware of the CPU module is normal, resets the watchdog timer, and completes some other internal work;
2)PLC程序初始化阶段,即PLC加载梯形图程序,初始化所有定时器和寄存器;2) PLC program initialization stage, that is, the PLC loads the ladder diagram program and initializes all timers and registers;
3)当列车运行启动后,增量式编码器对列车车轮转速进行跟踪采集,并按照实际的转速和位移信息,对PLC的CPU模块内寄存器写入速度和位移信息;3) When the train starts running, the incremental encoder tracks and collects the train wheel speed, and writes the speed and displacement information into the registers of the CPU module of the PLC according to the actual speed and displacement information;
4)当列车运行启动后,如果列车有速度电压输出,则PLC模拟量采集模块对速度电压进行采集,并对PLC的CPU模块内寄存器写入速度和位移信息;4) After the train operation starts, if the train has a speed voltage output, the PLC analog acquisition module collects the speed voltage, and writes speed and displacement information to the register in the CPU module of the PLC;
5)PLC程序处理阶段,按先上后下,先左后右的步序,对梯形图程序进行逐句扫描并根据采样到输入映像寄存器中的结果进行逻辑运算,运算结果再存入有关映像寄存器中;5) In the PLC program processing stage, according to the steps of first up, then down, first left, then right, scan the ladder diagram program sentence by sentence and perform logical operations according to the results sampled into the input image register, and then store the operation results into the relevant image in the register;
6)PLC的CPU模块根据程序指令,把单位时间内采集到的转动周数和速度模拟量电压根据PLC指令转换为速度脉冲信息;6) According to the program instructions, the CPU module of the PLC converts the number of rotation cycles and the speed analog voltage collected per unit time into speed pulse information according to the PLC instructions;
7)PLC分配新的寄存器,写入脉冲数结果,并通过脉冲发送模块,对外发送脉冲信号;7) The PLC allocates a new register, writes the result of the pulse number, and sends the pulse signal to the outside through the pulse sending module;
8)定期对外发送单位时间内的脉冲数结果,表示单位时间内位移增量信息。8) Regularly send out the result of the number of pulses per unit time, indicating the displacement increment information per unit time.
如图1所示,一种基于PLC技术的增量式电子编码里程计装置,该装置具体包括增量编码器模块、AD转换模块、PLC模块、增量式脉冲发生器模块。As shown in Figure 1, an incremental electronic coded odometer device based on PLC technology specifically includes an incremental encoder module, an AD conversion module, a PLC module, and an incremental pulse generator module.
对各模块进行阐述:Explanation of each module:
1、增量式编码器:1. Incremental encoder:
增量式编码器是一种采用光电等方法将轴的机械转角转换为数字信号输出的精密传感器,工作原理如下:随转轴一起转动的脉冲码盘上有均匀刻制的光栅,在码盘上均匀地分布着若干个透光区段和遮光区段。增量式编码器没有固定的起始零点,输出的是与转角的增量成正比的脉冲,需要用计数器来计脉冲数。每转过一个透光区时,就发出一个脉冲信号,计数器当前值加1,计数结果对应于转角的增量。Incremental encoder is a precision sensor that converts the mechanical rotation angle of the shaft into digital signal output by means of photoelectricity and other methods. Several light-transmitting sections and light-shielding sections are evenly distributed. The incremental encoder has no fixed initial zero point, and the output is a pulse proportional to the increment of the rotation angle, and a counter is needed to count the number of pulses. Every time a light-transmitting area is rotated, a pulse signal is sent, the current value of the counter is increased by 1, and the counting result corresponds to the increment of the rotation angle.
所选用的三通道增量式编码器内部除了有双通道增量式编码器的两对光电耦合器外,在脉冲码盘的另外一个通道有1个透光段,每转1圈,输出1个脉冲,该脉冲称为Z相零位脉冲,用做系统清零信号,或坐标的原点,以减少测量的积累误差。如果编码器输出脉冲的周期大于PLC的扫描循环时间的两倍,通过在B相脉冲的上升沿判断A相脉冲信号的0、1状态,可以判断编码器旋转的方向。In addition to the two pairs of photocouplers of the dual-channel incremental encoder inside the selected three-channel incremental encoder, there is a light-transmitting section in the other channel of the pulse code disc, which outputs 1 for each revolution. A pulse, which is called the Z-phase zero pulse, is used as the system zero clearing signal, or the origin of the coordinates, to reduce the cumulative error of measurement. If the period of the encoder output pulse is greater than twice the scan cycle time of the PLC, by judging the 0 and 1 states of the A-phase pulse signal on the rising edge of the B-phase pulse, the direction of the encoder rotation can be judged.
2、AD转换模块:2. AD conversion module:
FX2N-4AD模拟特殊模块有四个输入通道。输入通道接收模拟信号并将其转换成数字量,这称为A/D转换。FX2N-4AD最大分辨率是12位。基于电压或电流的输入/输出的选择通过用户配线来完成,可选用的模拟值范围是-10V到10VDC(分辨率5mV),并且/或者4到20mA,-20到20mA(分辨率:20μA).FX2N-4AD和FX2N主单元之间通过缓冲存储器交换数据,FX2N-4AD共有32个缓冲存储器(每个16位).FX2N-4AD占用FX2N扩展总路线的8个点.这8点可以分配成输入或输出.FX2N-4AD消耗FX2N主单元成有源扩展单元5V电源糟30mA的电流。The FX2N-4AD analog special module has four input channels. The input channel receives an analog signal and converts it into a digital quantity, which is called A/D conversion. The maximum resolution of FX2N-4AD is 12 bits. The selection of input/output based on voltage or current is done through user wiring, and the available analog value ranges are -10V to 10VDC (resolution 5mV), and/or 4 to 20mA, -20 to 20mA (resolution: 20μA ). FX2N-4AD and FX2N main unit exchange data through buffer memories. FX2N-4AD has a total of 32 buffer memories (16 bits each). FX2N-4AD occupies 8 points of the FX2N expansion bus line. These 8 points can be allocated as Input or output. The FX2N-4AD consumes 30mA from the 5V power supply of the FX2N main unit and active expansion unit.
3、PLC的CPU模块:3. CPU module of PLC:
CPU由控制器、运算器和寄存器组成。这些电路集成在一个芯片上。CPU通过地址总线、数据总线与I/O接口电路相连接。The CPU consists of a controller, arithmetic unit and registers. These circuits are integrated on one chip. The CPU is connected with the I/O interface circuit through the address bus and the data bus.
CPU模块用于存储和执行PLC梯形图程序,按照用户的梯形图指令进行运算和执行。当从编程器输入的程序存入到用户程序存储器中,然后CPU根据系统所赋予的功能(系统程序存储器的解释编译程序),把用户程序翻译成PLC内部所认可的用户编译程序。输入状态和输入信息从输入接口输进,CPU将之存入工作数据存储器中或输入映象寄存器。然后由CPU把数据和程序有机地结合在一起。把结果存入输出映象寄存器或工作数据存储器中,然后输出到输出接口、控制外部驱动器。The CPU module is used to store and execute the PLC ladder diagram program, and perform calculation and execution according to the user's ladder diagram instructions. When the program input from the programmer is stored in the user program memory, then the CPU translates the user program into a user compiled program recognized by the PLC according to the function given by the system (interpretation and compilation of the system program memory). The input state and input information are input from the input interface, and the CPU stores them in the working data memory or the input image register. Then the data and the program are organically combined by the CPU. Store the result in the output image register or working data memory, and then output to the output interface to control the external driver.
4、脉冲发生器模块:4. Pulse generator module:
利用PLC的晶体管IO高频输出,外加一路电源以产生数字脉冲波形。在PLC的第一个扫描周期,M1常闭触点闭合,所以M1线圈能得电;第二个扫描周期,因在上一个扫描周期Ml线圈已得电,所以M1的常闭触点断开,因此使M1线圈失电。因此,Ml线圈得电时间为一个扫描周期。M1线圈不断连续地得电、失电,其常开触点也随之不断连续地闭合、断开,就产生了脉宽为一个扫描周期的连续脉冲信号输出,可适用于与有轨电车车载速度信号的采集。Use the high-frequency output of the transistor IO of the PLC, and add a power supply to generate a digital pulse waveform. In the first scan cycle of the PLC, the M1 normally closed contact is closed, so the M1 coil can be energized; in the second scan cycle, because the M1 coil has been energized in the previous scan cycle, the normally closed contact of M1 is disconnected , thus de-energizing the M1 coil. Therefore, the electrification time of the Ml coil is one scan cycle. The M1 coil is continuously energized and de-energized, and its normally open contacts are also continuously closed and disconnected, which produces a continuous pulse signal output with a pulse width of one scanning period, which is suitable for use with trams. Acquisition of speed signals.
以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到各种等效的修改或替换,这些修改或替换都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以权利要求的保护范围为准。The above is only a specific embodiment of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of various equivalents within the technical scope disclosed in the present invention. Modifications or replacements shall all fall within the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims (8)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610864075.3A CN106444606B (en) | 2016-09-29 | 2016-09-29 | Incremental electronic coded odometer device based on PLC technology and its application |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610864075.3A CN106444606B (en) | 2016-09-29 | 2016-09-29 | Incremental electronic coded odometer device based on PLC technology and its application |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106444606A CN106444606A (en) | 2017-02-22 |
CN106444606B true CN106444606B (en) | 2023-05-09 |
Family
ID=58171239
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610864075.3A Active CN106444606B (en) | 2016-09-29 | 2016-09-29 | Incremental electronic coded odometer device based on PLC technology and its application |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106444606B (en) |
Families Citing this family (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107728563B (en) * | 2017-09-29 | 2024-06-04 | 卡斯柯信号有限公司 | A filament alarm detection device and method based on PLC technology |
CN110299046B (en) * | 2019-07-26 | 2024-08-20 | 卡斯柯信号有限公司 | Method and device for realizing control simulation system of rail transit full-automatic unmanned train |
CN111274753B (en) * | 2020-03-04 | 2024-09-10 | 卡斯柯信号有限公司 | Analog simulation device and method for track traffic coded odometer and beacon |
CN115880883B (en) * | 2023-01-29 | 2023-06-09 | 上海海栎创科技股份有限公司 | System and method for selectively transmitting control signals between systems |
CN116430420A (en) * | 2023-03-09 | 2023-07-14 | 高德软件有限公司 | Mileage signal generating device, method, vehicle positioning system and program product |
CN117249760A (en) * | 2023-08-30 | 2023-12-19 | 西南交通大学 | High-precision detection device and method for seam separation between layers of high-speed railway ballastless track and seam separation positioning method |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0778007A (en) * | 1993-06-30 | 1995-03-20 | Mitsubishi Electric Corp | Analog signal processor for programmable controller |
CN102200541A (en) * | 2010-03-24 | 2011-09-28 | 中国科学院自动化研究所 | Method and device for measuring rotating speed of motor |
CN102570959A (en) * | 2011-12-31 | 2012-07-11 | 南京理工大学 | Control system and control method for low-voltage high-current permanent magnet synchronous motors |
CN103674024A (en) * | 2013-11-28 | 2014-03-26 | 卡斯柯信号有限公司 | Combined train positioning system based on Doppler radar and coded milemeter |
CN206133276U (en) * | 2016-09-29 | 2017-04-26 | 卡斯柯信号有限公司 | Increment formula electronic code odometer device based on PLC technique |
-
2016
- 2016-09-29 CN CN201610864075.3A patent/CN106444606B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH0778007A (en) * | 1993-06-30 | 1995-03-20 | Mitsubishi Electric Corp | Analog signal processor for programmable controller |
CN102200541A (en) * | 2010-03-24 | 2011-09-28 | 中国科学院自动化研究所 | Method and device for measuring rotating speed of motor |
CN102570959A (en) * | 2011-12-31 | 2012-07-11 | 南京理工大学 | Control system and control method for low-voltage high-current permanent magnet synchronous motors |
CN103674024A (en) * | 2013-11-28 | 2014-03-26 | 卡斯柯信号有限公司 | Combined train positioning system based on Doppler radar and coded milemeter |
CN206133276U (en) * | 2016-09-29 | 2017-04-26 | 卡斯柯信号有限公司 | Increment formula electronic code odometer device based on PLC technique |
Non-Patent Citations (1)
Title |
---|
任先贞 ; 裴东兴 ; 沈大伟 ; 常宽 ; .基于编码器的汽车测速传感器二次仪表设计.电子科学技术.2016,(02),全文. * |
Also Published As
Publication number | Publication date |
---|---|
CN106444606A (en) | 2017-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106444606B (en) | Incremental electronic coded odometer device based on PLC technology and its application | |
US5687103A (en) | Position measuring device | |
US20090278711A1 (en) | Sensor Arrangement for the Precise Detection of Relative Movements Between An Encoder and A Sensor | |
CN208783117U (en) | A kind of small rail car positioning system | |
CN109655055B (en) | A positioning method and device for a rail inspection robot | |
CN110806193A (en) | Subway Tunnel Deformation Detection System | |
CN103223956B (en) | The abort situation robot scaling equipment of a kind of online steel rail fracture vehicle-carrying monitoring and calibrating method | |
CN108318028B (en) | Design method of navigation system core processing circuit | |
CN107449376B (en) | Real-time steering wheel corner acquisition system | |
CN118960534B (en) | A position detection system and method for a magnetic suspension magnetic pole array linear displacement ruler | |
CN206133276U (en) | Increment formula electronic code odometer device based on PLC technique | |
CN104677386A (en) | Multiturn rotary encoder | |
CN106773897A (en) | A kind of method that absolute encoder signal is converted to incremental encoder signal | |
JP2001183173A (en) | Measured value transmitter and method of measuring position of sensor head | |
US6501069B2 (en) | Optoelectronic angle of rotation sensor having a code disk with redundant digital coding | |
CN202038325U (en) | High-precision train positioning system based on radio frequency technology | |
CN105371869B (en) | A kind of turntable calibrating installation control system | |
CN102042840B (en) | Two-channel Gray code magnetic coding device | |
CN105444790A (en) | Linear long-distance absolute value position optical encoder | |
CN208126200U (en) | An intelligent terminal and its grayscale tracking sensing module and grayscale sensor | |
CN206583466U (en) | High speed and super precision machine tool chief axis magnetic induction absolute value encoder and its measurement gear | |
CN111856064A (en) | An intelligent speed sensing device | |
CN103604440A (en) | High precision odometer | |
US5663557A (en) | Multiple rotating absolute encoder capable of accurately latching absolute address data with data on number of rotations | |
RU2107946C1 (en) | Device which measures operating characteristics of vehicles |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |