1 Introduction
As an important piece of equipment on railway lines, the condition of turnouts directly affects the safety of train operation. By monitoring the operating current of the turnout machine, the operating status of the turnout can be effectively analyzed, providing a basis for equipment maintenance and repair, so as to ensure the integrity of the equipment and the safety of train operation.
The switch machine is the driving device for railway turnouts, and its operating current directly reflects the turnout's operating resistance. Therefore, by collecting and analyzing the operating current during switch machine operation, the working status of the turnout can be understood, and potential equipment failures can be detected in a timely manner. Condition-based maintenance of turnouts reduces the impact of maintenance on train operation and extends the service life of the equipment. In particular, timely alarms are issued when turnout malfunctions occur, allowing for prompt fault location and improving the speed and quality of maintenance, thus playing a crucial role in ensuring the safe operation of trains.
Since the acquired analog and digital signals are all returned from the track site, the monitoring system has high requirements for reliability and resistance to strong electrical impulses and lightning protection. Using an Omron programmable logic controller (PLC) as the data acquisition unit for the track switch machine's operating current monitoring system not only ensures high system reliability, but its standard ladder logic programming language also improves the system's maintainability and scalability.
2 System Design
The system is designed based on the Omron CS1 series PLC. The structure of the switch machine operating current monitoring system is shown in Figure 1. In the system, the PLC's DI module collects the switching signals related to the switch machine's operation. The switch machine operating current is collected via a current acquisition box. Typically, a station has dozens (turnout) switch machines, and large stations may have hundreds. The current signals from every eight switch machines are connected to a signal switching circuit. The output of the switching circuit is connected to the PLC's AD conversion module; that is, every eight switch machine current signals form a group, occupying one AD conversion channel. The switching circuit is controlled by the PLC's I/O module. The PLC's CPU module preprocesses and temporarily stores the collected current data, then transmits the data to the host computer. Finally, the host computer analyzes, manages, displays, and alarms the data.
Figure 1 Schematic diagram of the monitoring system structure
2.1 Data Acquisition of Switch Machine Operating Current
Figure 2 Data Acquisition Flowchart
The acquisition of the switch machine's operating current as a random event is an interrupt-type acquisition process. The switch machine's operation is controlled by a starting relay, and the status of the starting relay is acquired via I/O ports. The acquired data is analyzed to determine the number of the operating switch machine at that moment and how many switches are operating simultaneously. When a switch machine operates, the corresponding I/O port control signal switching circuit of the PLC immediately and continuously acquires its current data. Figure 2 shows the flowchart of the switch machine operating current acquisition process. Since each group consists of 8 switch machines, the acquisition process can be divided into the following cases:
(1) One switch machine operates: At this time, it is only necessary to store the collected data of each time into the corresponding unit of the data area of the switch machine. Since the PLC's AD conversion cycle is relatively long, each conversion requires 10ms. Therefore, each data represents the current during that time period. Thus, each data not only represents the magnitude of the current, but also contains the corresponding time characteristics.
(2) Operation of two switch machines: When the current of two switch machines is collected simultaneously, the corresponding collection cycle is doubled. In order to ensure the time characteristics of the data, the data collected each time is stored in two units at the same time. As shown in Figure 3.
Figure 3 Data storage diagram
(3) Operation of three switch machines: Similar to the above situation, the data collected each time is stored in three units at the same time.
(4) Four switch machines operating: If the operating current of four switch machines is collected at the same time, the collection period will exceed the relevant regulations. Therefore, when grouping switch machines, this has been taken into consideration. The probability of four machines operating at the same time in the same group is very low. However, if four machines operate, the last switch machine to operate will be shielded in the program. That is, even if the other three switch machines finish operating during this operation, making the number of machines operating at the same time less than four, the machine will not be collected in order to ensure the integrity of the process data.
2.2 Data Fitting
When more than one switch machine is in operation, the current data includes duplicate entries. If these duplicate entries are not fitted, the current curve plotted by the host computer will have a mosaic effect. Therefore, it is necessary to fit the duplicate entries. Due to the limited functions provided by the PLC, the program can only perform linear fitting on the data. Taking the data with n=3 as an example, since three data points need to be entered in the acquisition cycle: dn1, dn2, and dn3, where dn-1 is the data before dn1 and dn+1 is the data after dn3, the following three cases are discussed:
(1) dn1 is the actual collected data, and dn2 and dn3 are the data that are repeatedly filled in;
If no linear fitting is performed, then:
dn1=dn2=dn3;
If a linear fit is performed, then:
dn2 = dn1 + (dn1 - dn-1);
dn3 = (dn2 + dn+1)/2;
(2) dn2 is the actual collected data, while dn1 and dn3 are the data that were repeatedly entered;
If a linear fit is performed, then:
dn1 = (dn2 + dn-1) / 2;
dn3 = (dn2 + dn+1)/2;
(3) dn3 is the actual collected data, while dn1 and dn2 are duplicate data;
If a linear fit is performed, then:
dn2 = dn3 + (dn3 - dn+1);
dn1 = (dn2 + dn3) / 2;
Since linear fitting should be based on actual collected data as much as possible, the data should be located only when it is most convenient to do so during the acquisition process. This means that the relevant data should be corrected by the PLC during the acquisition of the switch machine's operating current. When the host computer program analyzes the switch machine data, it focuses on analyzing the average value of the continuous current and the duration of the operation. Therefore, the purpose of the correction is to make the relevant curves appear smoother.
2.3 Management of Data Buffers
According to relevant regulations of the Ministry of Railways, there are strict provisions regarding the duration and cycle of current acquisition for switch machines. To accurately describe the entire process of current change during operation, the current is limited to 30ms. Typically, the operation of a single-acting switch takes about 4 seconds, and the operation of a double-acting switch takes about 8 seconds. Therefore, the current data for one switch machine operation is 400 words for a single-acting switch and 800 words for a double-acting switch. On the other hand, a medium-sized station has approximately 40 switches, and a large station has over 100 switches. If a dedicated data buffer were reserved for each switch machine (400 words for a single-acting switch and 800 words for a double-acting switch), tens of kilobytes of data registers would be required. Clearly, a typical PLC cannot provide such a large capacity, and it is also unnecessary, because the number of switch operations is limited; at most, only a few switches in the same station will operate simultaneously. Therefore, a common data buffer is set up in the program. The buffer adopts a ring structure and consists of 10 sub-buffers (the number of sub-buffers can be adjusted according to the size of the station). Each sub-buffer occupies 400 words. One sub-buffer is used when a single turnout is activated, and two sub-buffers are used when a double turnout is activated. The sub-buffer structure is shown in Figure 4.
Figure 4 Sub-buffer structure
in:
r1 — Flag word, where each bit is defined as follows:
d15 – Data transmission flag: “1” indicates that the data is valid and has not yet been transmitted to the host computer, so it cannot be overwritten; “0” indicates that the data has been transmitted to the host computer and can be overwritten.
d14 — Turnout type flag, "0" indicates a single-action turnout, and this sub-buffer includes 400 words; "1" indicates a double-action turnout, and this sub-buffer includes 800 words; it defines the starting address of the next sub-buffer and provides a data length flag when transmitting data to the host computer.
d13 — The “fixed-reverse” position indicator of the turnout, i.e., the position of the turnout; “0” indicates “fixed” and “1” indicates “reverse”.
d11-d0 — Define the switch machine number.
r2 — Switch machine start time;
r3 — Switch machine operation end time;
r4 — The starting address for current data.
3PLC internal clock design
Because the start and end times of the switch machine's operating current need to be marked during acquisition, with a time accuracy requirement of 0.1 seconds, in order to analyze the duration of the operation and the relative time of each switch machine (turnout) operation, the internal time provided by Omron's CS1 series is shown in Figure 5. Clearly, the internal time data does not include millisecond data. Therefore, a millisecond time unit is designed in the program; that is, a data unit counts 10ms pulses, and the carry (change) of the "seconds" (referred to as "seconds") in the internal time data is used to synchronize the millisecond time unit data—clearing it to zero. Considering that there may be an error between the 10ms pulse and the accuracy of the "seconds" in the internal time, if the 10ms pulse is slower than the "seconds," but faster than the "seconds," the millisecond time will return to zero before the "seconds" carry, causing time confusion. Therefore, when counting the 10ms pulse to 99, the counting should stop until the "seconds" carry signal is cleared and the counting restarts. The error at this point has no impact on the data analysis results. The year, month, day, hour, minute, and second in the internal time are written into the relevant units of the PLC by the host computer when the PLC communicates with the host computer after the system starts.
Figure 5 Internal Time
4. Conclusion
The system has performed well since its commissioning. Due to the use of a PLC as the data acquisition unit, the system structure is simple and reliable, and it leverages the advantages of PLCs in resisting strong electrical shocks such as lightning strikes. Furthermore, the application of the methods described in this paper in the programming compensates for some limitations of the PLC, allowing the system to fully function. Figure 6 shows the operating current curve of a double-acting turnout switch machine.