CN210351192U - Device for accurately timing by utilizing RS232 serial port - Google Patents

Device for accurately timing by utilizing RS232 serial port Download PDF

Info

Publication number
CN210351192U
CN210351192U CN201921519416.9U CN201921519416U CN210351192U CN 210351192 U CN210351192 U CN 210351192U CN 201921519416 U CN201921519416 U CN 201921519416U CN 210351192 U CN210351192 U CN 210351192U
Authority
CN
China
Prior art keywords
time
secondary monitoring
pin
monitoring device
serial port
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
Application number
CN201921519416.9U
Other languages
Chinese (zh)
Inventor
程加强
赵小凤
罗培城
毛敏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Chengdu Fuhe Power Automation Complete Equipment Co ltd
Original Assignee
Chengdu Fuhe Power Automation Complete Equipment Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Chengdu Fuhe Power Automation Complete Equipment Co ltd filed Critical Chengdu Fuhe Power Automation Complete Equipment Co ltd
Priority to CN201921519416.9U priority Critical patent/CN210351192U/en
Application granted granted Critical
Publication of CN210351192U publication Critical patent/CN210351192U/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Remote Monitoring And Control Of Power-Distribution Networks (AREA)

Abstract

The utility model discloses an utilize device of accurate time tick of RS232 serial ports, including time service device and secondary monitoring device, the TXD pin of time service device is connected the RXD pin of secondary monitoring device RS232 interface, the RXD pin of time service device is connected the TXD pin of secondary monitoring device RS232 interface, the PPS pin of time service device is connected the DCD (carrier wave monitoring) pin of secondary monitoring device RS232 interface. The utility model discloses under the condition that does not increase hardware cost and interface, can utilize original device hardware serial ports to realize accurate to the time.

Description

Device for accurately timing by utilizing RS232 serial port
Technical Field
The utility model belongs to the technical field of electric power system, a time service technique is related to, concretely relates to utilize device of accurate time tick of RS232 serial ports.
Background
With the increasing requirement of secondary monitoring devices of transformer substations on time precision, especially the higher requirement of devices such as wave recorders, measurement and control, protection and PMU (synchrophasor measurement devices) on time precision, the time signals output by GPS or Beidou time service devices are prompted to output higher-precision time service signals, the current GPS/Beidou time service devices output time service signals in the modes of PTP (high precision time synchronization protocol), B codes, pulses (time, minute, second), NTP (SNTP), serial ports and the like, the microsecond-level precision time service signals comprise PTP and B codes, the millisecond-level precision time service signals comprise NTP (network time protocol) or SNTP (simple network time protocol), serial ports and the combination time of serial ports and second pulses can also achieve microsecond-level precision time service, the current transformer substation monitoring devices largely use B codes (optical and electrical) time service, other time service modes are poor in time service precision, or the requirement on device hardware is high and the cost is increased, and some older monitoring devices only support serial port time synchronization.
At present, the secondary monitoring device of the transformer substation adopts the following 2 modes frequently through an RS232-C serial port pair:
firstly, the RS232-C serial port is adopted for time synchronization, and the time synchronization of the secondary monitoring device is realized by accessing the serial port on the GPS (or Beidou) time service device. The time synchronization can only be accurate to seconds, the time synchronization capability does not exist for milliseconds and microseconds, the time synchronization error is less than or equal to +/-1 s, and the time synchronization precision cannot meet the requirement of accurate time synchronization. Secondly, RS232-C serial ports and second pulse combination are adopted for time synchronization; the time synchronization of the secondary monitoring device is realized by connecting a serial port + second pulse on the GPS (or Beidou) time service device. The requirement of time setting precision can be met, but some secondary monitoring devices cannot access pulse per second without pulse interfaces and cannot finish precise time setting, so the application range is limited.
SUMMERY OF THE UTILITY MODEL
For solving present electric power system transformer substation secondary monitoring device serial ports to the time error big, can't satisfy the requirement of time precision, especially some old secondary monitoring devices only support the serial ports to the time, under the condition that does not increase hardware cost and interface, the utility model discloses an utilize accurate method and the device to the time of RS232 serial ports.
The utility model discloses an utilize device of accurate time tick of RS232 serial ports, including time service device and secondary monitoring device, the TXD pin of time service device is connected the RXD pin of secondary monitoring device RS232 interface, the RXD pin of time service device is connected the TXD pin of secondary monitoring device RS232 interface, the PPS pin of time service device is connected the DCD pin of secondary monitoring device RS232 interface.
Specifically, the timing device is a GPS or Beidou timing device.
Specifically, the secondary monitoring device is provided with a large time register above a system second level and a system microsecond counter.
Specifically, the secondary monitoring device is a fault recorder, a signal protection substation, a measurement and control device or a telecontrol device and the like.
Adopt method and device of accurate time tick of utilizing RS232 serial ports can provide the accurate time tick of serial ports, under the condition that does not increase hardware cost and interface, utilizes original device hardware serial ports to realize accurate time tick, has characteristics such as precision height, compatibility are good, the reliability is high, the real-time is good, practical range is wide, satisfies the accurate requirement of time tick of power secondary monitoring devices such as transformer substation, power plant.
Drawings
Fig. 1 is a schematic diagram of a specific embodiment of the device for accurate time synchronization by using RS232 serial ports.
Detailed Description
The following provides a more detailed description of the present invention.
Utilize device of accurate to time of RS232 serial ports, it includes time service device and secondary monitoring device, the TXD pin of time service device is connected the RXD pin of secondary monitoring device RS232 interface, the RXD pin of time service device is connected the TXD pin of secondary monitoring device RS232 interface, the PPS pin of time service device is connected the DCD (carrier wave monitoring) pin of secondary monitoring device RS232 interface.
The DCD (carrier monitoring) pin is a carrier detection pin of an RS 2329-core serial port, and the level change of the pin can trigger the interruption of the serial port controller, so that accurate microsecond time of the system is obtained.
The time service device outputs a serial port signal to an RXD pin of an RS232 interface of the secondary monitoring device through the TXD pin, and the secondary monitoring device reads time information of year, month, day, minute and second contained in the serial port information after responding to the serial port signal and corrects the time information of a system of the secondary monitoring device above the second level.
The time service device outputs a serial port signal to a DCD pin of an RS232 interface of the secondary monitoring device through the PPS pin, and the secondary monitoring device reads sub-second-level time information contained in the serial port information after responding to the serial port signal and corrects the sub-second-level time information of the self system.
After receiving the serial port time information, the RXD of the secondary monitoring device can send a response to the RXD pin of the time service device through the TXD pin of the secondary monitoring device, so that the time service device knows that the time information is successfully received.
After receiving the signal of the time service device, the time correction using the signal is the prior art in the field, and is not described herein again.
The secondary monitoring device is auxiliary equipment for protecting, monitoring, measuring and operating and controlling primary equipment such as a main transformer and auxiliary equipment thereof in a transformer substation, such as a fault recorder, a letter protection substation, a measurement and control device or a telecontrol device and the like.
The utility model discloses also can adopt more accurate time setting method, can include following step:
s1, the time service device outputs a serial port signal to an RXD pin of an RS232 interface of the secondary monitoring device,
s2, after the secondary monitoring device responds to the interruption of the serial port, the software reads the year, month, day, hour, minute and second time information contained in the serial port information and the large time information above the second level of the time synchronization system;
the serial port signal contains time information of year, month, day, hour, minute and second level, and the secondary monitoring device reads the information of the large time of year, month, day, hour, minute and second level contained in the serial port signal and the information of the large time of system second level or above by responding to the interruption of the serial port.
After receiving the serial port time information, the RXD of the secondary monitoring device can send a response to the RXD pin of the time service device through the TXD pin of the secondary monitoring device, so that the time service device knows that the time information is successfully received.
The time synchronization of the big time information above the second level refers to the time synchronization of the big time information above the second level of the secondary monitoring device system receiving the information through the year, month, day, hour, minute and second level of the big time information in the time service device serial port transmission signal. The large time of second level or more after time synchronization can be stored in a register of second level or more of the system.
Setting the time of triggering interruption by the rising edge of the second pulse signal as the starting point of microsecond time zero time, reading the microsecond-level time calculation time deviation of the system, correcting the serial port signal to contain time information of year, month, day, minute and second level by using the step value calculated by the PID algorithm to the step value of the microsecond time counter on the basis of the microsecond time deviation, and reading the time information of the big time information of the year, month, day, minute and second level or more contained in the serial port signal by responding to the serial port interruption by the secondary monitoring device.
After receiving the serial port time information, the RXD of the secondary monitoring device can send a response to the RXD pin of the time service device through the TXD pin of the secondary monitoring device, so that the time service device knows that the time information is successfully received.
The time synchronization of the big time information above the second level refers to the time synchronization of the big time information above the second level of the secondary monitoring device system receiving the information through the year, month, day, hour, minute and second level of the big time information in the time service device serial port transmission signal. The large time of second level or more after time synchronization can be stored in a register of second level or more of the system.
Setting the moment of triggering interruption by the secondary monitoring device according to the rising edge of the second pulse signal as a microsecond time zero moment starting point, and immediately reading a system time value when the rising edge arrives, wherein the system time value comprises 2 integer numbers of second and microsecond, the microsecond number is 0 theoretically, and the microsecond time value is compared with 0.5S due to an error, wherein the microsecond time value is more than or equal to 0.5S and is considered as a negative deviation, and Xn (time deviation) = microsecond time value-1000000 at the moment; a positive deviation is considered when less than 0.5mS, when Xn (time deviation) = microsecond time value-0; and calculating to obtain the magnitude and the direction of the microsecond time deviation value, and storing the microsecond time deviation value into a buffer cache. And then, on the basis of the system time deviation, correcting the microsecond time counter step value of the system by calculating the step value through a PID algorithm.
In order to avoid the clock signal from oscillating repeatedly due to excessive correction, the algorithm used in the correction in step S3 is a PID algorithm, a step value is adjusted by calculating a microsecond counter of the system using a proportional, integral, and derivative algorithm, and a microsecond-level time error is continuously reduced in each sampling period, instead of directly correcting according to the calculated time error.
P represents the ratio: control currently, proportional control is the simplest control method. The output of the controller is proportional to the input error signal. There is a Steady-state error in the system output when there is only proportional control (Steady-Steady).
I denotes the integral: control in the past, the output of the controller was proportional to the integral of the input error signal. For an automatic control System, if there is a Steady-state Error after entering a Steady state, the control System is called as a System with a Steady-state Error or a System with a difference Error for short. To eliminate steady state errors, an "integral term" must be introduced into the controller. The integral term integrates the error over time, increasing with time. Thus, even if the error is small, the integral term increases with time, which drives the output of the controller to increase, further reducing the steady state error until it equals zero. Therefore, the proportional Plus Integral (PI) controller can enable the system to have no steady-state error after the system enters the steady state.
D represents the differential: in the future of control, the output of the controller is in a direct proportion relation with the differential of the input error signal (namely the change rate of the error), and increasing the differential time is beneficial to accelerating the response speed of the system, so that the overshoot of the system is reduced, the stability is increased, but the suppression capability of the system to disturbance is weakened. The differential control has a look-ahead and predictive characteristic.
In 1 second of each sampling period, according to a PID algorithm, in each sampling period, according to the PID algorithm, according to the current real-time deviation Xn, the integral time error Xy is Xn + X (n-1) + … + X (n-k) (n =1, 2, 3 …), and the differential time error Xz is Xn-X (n-1), the system microsecond counter is comprehensively calculated to adjust the step length value y, y = AXn + BXy + DXz until the real-time deviation Xn measured in S3 is less than the error tolerance C;
in the formula y = AXn + BXy + DXz, the calculated result y represents the adjustment value of the step value of the system microsecond counter in each period, the three terms on the right side of the equal sign represent three elements of the proportion P, the integral I and the differential D of the system adjustment respectively, Xn represents the current error, the adjustment of the weight coefficient A represents error proportion control, Xy represents the sum of the accumulated time deviations of k continuous periods and represents the static error of the system, and Xz represents the difference of the time deviations of the latest 2 periods and reflects the future trend of the error.
The purpose of the adjustment is to make Xn smaller than the error tolerance C in a period as short as possible, and to avoid oscillation caused by overshoot, the values of the weighting coefficients a, B, D follow the above principle, for example, if the overshoot is found to be too large, the value of a can be properly reduced, and if the constant error disappears slowly, the value of B can be properly increased; and D value can be reduced properly if the error is unstable after adjustment. Since Xy is the sum of the time deviations accumulated over k consecutive periods, k typically takes a value of 5-10 periods.
The default step value Y of the microsecond counter is 1, the error tolerance C =20 microseconds, and Y is calculated once per second by adopting a PID algorithm, namely according to sampling of a second pulse period. Yn = Y (n-1) + Y, Yn being the calculator step value per microsecond, i.e. the counter unit.
The microsecond calculator step value Yn = Y (n-1) + Y in each period, and the microsecond time of the system continuously changes to the direction of zero real-time error by continuously adjusting Yn until the real-time error Xn is measured to be smaller than the error tolerance C in S3.
Yn is a microsecond counter step value, and error tolerance C is a self-set parameter. Because the operating system has uncertainty in responding to the interrupt time triggered by the rising edge of the second pulse, setting the error tolerance C =20 microseconds as an acceptable error.
The system time of the secondary monitoring device is calculated based on the microsecond counter value of the system, if the microsecond counter value is 1000000, the counter step value =1uS, and the time value =1000000 × 1=1000000uS =1000mS = 1S; if the change count step value =0.9995 uS, the time value =1000000 × 0.9995=999500uS =999.5mS =0.9995S, i.e. the system time is advanced in the next cycle after the step size is reduced; and conversely, similarly, the system time is delayed in the next period after the step length is increased, so that the system timing unit basis can be changed by changing the step length value of the system counter, and the system time of the secondary monitoring device including the large time of more than second and the small time of microsecond is changed.
In step S4, the secondary monitoring device corrects the step value of the system microsecond time counter according to the information about the system second or higher large time when the time is synchronized in steps S2 and S3, thereby performing the overall time synchronization of the system time of the device.
Adopt method and device of accurate time tick of utilizing RS232 serial ports can provide the accurate time tick of serial ports, under the condition that does not increase hardware cost and interface, utilizes original device hardware serial ports to realize accurate time tick, has characteristics such as precision height, compatibility are good, the reliability is high, the real-time is good, practical range is wide, satisfies the accurate requirement of time tick of power secondary monitoring devices such as transformer substation, power plant.
In the foregoing, the preferred embodiments of the present invention, if not obviously contradictory or based on a certain preferred embodiment, can be combined and used by any superposition, the specific parameters in the embodiments and examples are only for clearly expressing the utility model verification process of the utility model, and are not used for limiting the patent protection scope of the present invention, the patent protection scope of the present invention is still based on the claims, and all the equivalent structural changes made by the contents of the specification and the drawings of the present invention should be included in the protection scope of the present invention.

Claims (4)

1. The device for accurately calibrating the time by utilizing the RS232 serial port is characterized by comprising a time service device and a secondary monitoring device, wherein a TXD pin of the time service device is connected with an RXD pin of an RS232 interface of the secondary monitoring device, the RXD pin of the time service device is connected with the TXD pin of the RS232 interface of the secondary monitoring device, and a PPS pin of the time service device is connected with a DCD pin of the RS232 interface of the secondary monitoring device.
2. The device for accurately setting time according to the RS232 serial port of claim 1, wherein the time-giving device is a GPS or Beidou time-giving device.
3. The device for accurate time synchronization by utilizing the RS232 serial port as claimed in claim 1, wherein the secondary monitoring device is provided with a large time register above the system second level and a system microsecond counter.
4. The device for accurate time synchronization by utilizing the RS232 serial port as claimed in claim 1, wherein the secondary monitoring device is a fault recorder, a letter protection substation, a measurement and control device or a telecontrol device and the like.
CN201921519416.9U 2019-09-12 2019-09-12 Device for accurately timing by utilizing RS232 serial port Active CN210351192U (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201921519416.9U CN210351192U (en) 2019-09-12 2019-09-12 Device for accurately timing by utilizing RS232 serial port

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201921519416.9U CN210351192U (en) 2019-09-12 2019-09-12 Device for accurately timing by utilizing RS232 serial port

Publications (1)

Publication Number Publication Date
CN210351192U true CN210351192U (en) 2020-04-17

Family

ID=70177510

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201921519416.9U Active CN210351192U (en) 2019-09-12 2019-09-12 Device for accurately timing by utilizing RS232 serial port

Country Status (1)

Country Link
CN (1) CN210351192U (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110611544A (en) * 2019-09-12 2019-12-24 成都府河电力自动化成套设备有限责任公司 Method and device for accurately timing by utilizing RS232 serial port

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110611544A (en) * 2019-09-12 2019-12-24 成都府河电力自动化成套设备有限责任公司 Method and device for accurately timing by utilizing RS232 serial port

Similar Documents

Publication Publication Date Title
US6611922B2 (en) Power system time synchronization device and method for sequence of event recording
CN102590784B (en) Single-phase intelligent energy meter distributed correction method
CN111585680A (en) High-precision Ethernet time synchronization device
CN102004441B (en) Adaptive crystal oscillator frequency timekeeping method
CN102412957B (en) High-precision synchronous clock adjusting method
CN112003668B (en) Real-time dynamic tracking time synchronization method
CN105676627A (en) Time keeping system primary and standby main clock seamless switching system and method
CN110611544A (en) Method and device for accurately timing by utilizing RS232 serial port
CN210351192U (en) Device for accurately timing by utilizing RS232 serial port
CN111970080B (en) Time synchronization method for master and slave equipment
CN1104818A (en) Synchronization circuit using a high speed digital slip counter
CN111208539A (en) High-precision GNSS simulator time synchronization method
CN111831056A (en) Real-time clock calibration module and method and real-time clock chip
CN103795522A (en) Punctuality compensating circuit and method for pulse per second
CN101350519B (en) Real-time synchronization equipment for protecting optical fibre longitudinal difference
CN109407752B (en) GIS breaker online monitoring system for realizing clock synchronization in RS485 communication
CN114205045B (en) TTE network clock calibration method and system
CN107145061A (en) Defence method of the intelligent Anti-Jamming Technique of satellite time transfer signal in time synchronized
US4583865A (en) Real time clock synchronization
CA2856377C (en) Metrology timekeeping systems and methods
CN112213541B (en) Time keeping method applied to transient recording type fault indicator
CN110824237B (en) Pulse sampling time interval adjusting method and device
CN212364801U (en) RTC calibration circuit of smoke detector MCU
CN110618604B (en) Method and device for improving time keeping precision by using NTP auxiliary source
Ouellette et al. Using a real time digital simulator with phasor measurement unit technology

Legal Events

Date Code Title Description
GR01 Patent grant
GR01 Patent grant