Disclosure of Invention
In order to solve the problems existing in the aspect of measuring the service life of the conventional relay, the invention provides a method for counting and measuring the service life of the relay, which comprises the following steps of:
step 1, initializing, namely setting detection marks of L relay switch groups to be in a detection state, clearing 0 by a service life counter, and sending a clear 0 signal to enable all L action count values to be clear 0;
Step 2, controlling the L relay switch groups to act once, and simultaneously counting the action times of the L relay switch groups respectively to obtain L action count values; the service life counter counts by adding 1;
Step 3, reading current L action count values;
Step 4, judging whether the relay switch groups with the detection marks in the detection state are invalid one by one; setting the detection mark which is judged as the failure relay switch group at this time to be in a stop detection state, and simultaneously taking the count value of the current life counter as the life value of the relay switch group which is judged as the failure at this time;
and 5, if the detection marks of the L relay switch groups still have the detection state, returning to the step 2, otherwise, stopping detection.
Judging whether the relay switch group with the detection mark in the detection state is invalid or not, wherein the method is that if the error between the controlled on-off times of the relay switch group to be judged and the action counting value is less than E, the relay switch group is not invalid, otherwise, the relay switch group is invalid; e is an integer greater than or equal to 1 and less than or equal to M/2, and M is the maximum count value of the action count values. The method for judging whether the error between the controlled on-off times of the relay to be judged and the action counting value of the relay to be judged is smaller than E is that the counting value of the current service life counter is subjected to modulus operation on M to obtain a remainder Q; and when the action counting value of the relay to be judged at the time is read to be K, when one of | K-Q | < E, or | K- (Q-M) | < E, or | K- (Q + M) | < E is satisfied, the error between the controlled on-off times of the relay to be judged and the action counting value is smaller than E.
Judging whether the relay switch group with the detection mark in the detection state is invalid or not, wherein the method is that if the current action counting value and the previous action counting value of the relay switch group to be judged are not in the increment 1 relation, the relay switch group is invalid, otherwise, the relay switch group is not invalid; the method comprises the steps that if the current action counting value and the previous action counting value of the relay switch group to be judged are not in the increasing 1 relation for S times continuously, the relay switch group is invalid, otherwise, the relay switch group is not invalid; and S is an integer greater than or equal to 2.
Judging whether the relay switch group with the detection mark in the detection state is invalid or not, wherein the method also or alternatively judges that the relay switch group is invalid if the current action counting value and the previous action counting value which are accumulated for W times by the relay switch group to be judged are not in a relationship of increasing 1, otherwise, the relay switch group is not invalid; and W is an integer greater than or equal to 2.
The action times of the L relay switch groups are respectively counted to obtain L action counting values, and the L action counting values are realized by L switch group action counting units with the same structure and composition; the switch group action counting unit comprises a pulse generating circuit, an RS trigger and a three-state output counting circuit; the pulse generating circuit outputs a first initial pulse and a second initial pulse generated by the action of the relay switch group; the RS trigger converts the input first initial pulse and the second initial pulse into a counting pulse after the edge jitter interference pulse is filtered; the tri-state output counting circuit counts the counting pulse and outputs an action counting value. The relay switch group consists of a relay normally open switch and a relay normally closed switch in the same relay; the level change of the first initial pulse is consistent with the action change of a normally open switch in the relay switch group, and the level change of the second initial pulse is consistent with the action change of a normally closed switch in the relay switch group; when the normally open switch and the normally closed switch in the relay switch group are in all off states, the states of the first initial pulse and the second initial pulse output by the pulse generating circuit are both invalid signal input states of the RS trigger. The maximum count value of the switch group operation counting unit is M.
The relay life counting and measuring method is realized by a relay life counting and measuring device comprising a controller unit and a relay driving unit; the L relay switch groups are controlled to act once, and the controller unit sends a relay driving signal to the relay driving unit to realize the control.
The action count values of the L switch group action count units are all output in a three-state buffer mode; the tri-state buffer output ports of all the switch group action counting units are all connected in parallel to the counting data input port of the controller unit; the controller unit sends out gating control signals to enable the three-state buffer output ports of the switch group action counting units one by one, and corresponding action counting values are read in from the counting data input port.
The relay life counting and measuring device also comprises a gating control unit; the controller unit sends an address coding signal of the switch group action counting unit to the gating control unit, and the gating control unit decodes the address coding signal of the switch group action counting unit to obtain a gating control signal.
The invention has the beneficial effects that: the relay service life measurement is carried out in a mode that a normally open switch and a normally closed switch in the same relay form a switch group, and the service lives of a plurality of relay switch groups in a plurality of relays can be detected at the same time; the RS trigger is adopted to automatically filter the edge jitter interference in the electric pulse generated by the action of the relay switch group, so that the accuracy of the detection of the service life of the relay is ensured; the mode that a plurality of counters are arranged outside the controller unit and count the action times of the relay switch group respectively is adopted, and the number of the relay switch groups for detecting the service life of the relay is not limited by the number of the counters inside the controller unit.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The relay life counting and measuring method is realized by a relay life counting and measuring device comprising a controller unit, L switch group action counting units, a human-computer interface unit and a relay driving unit. The human-computer interface unit is electrically connected to the controller unit and used for sending out a detection command and displaying the service life of the L relay switch groups; the controller unit is electrically connected to the relay driving unit and sends a relay driving signal to the relay driving unit to control the actions of the L relay switch groups; the L switch group action counting units respectively count the action times of the L relays to obtain L action counting values; the switch group action counting unit is electrically connected to the controller unit, and the controller unit respectively reads in action counting values of the L switch group action counting units. When the L value is larger, the action count values of the L switch group action count units are all output in a three-state buffer mode; the tri-state buffer output ports of all the switch group action counting units are all connected in parallel to the counting data input port of the controller unit; the controller unit sends out gating control signals to enable the three-state buffer output ports of the switch group action counting units one by one, and corresponding action counting values are read in from the counting data input port; the controller unit sends out a zero clearing signal to clear 0 the action count value of the L switch group action count units. The relay life counting and measuring device can further comprise a gating control unit which is electrically connected to the controller unit; the controller unit sends an address coding signal of the switch group action counting unit to the gating control unit, the gating control unit decodes the address coding signal of the switch group action counting unit to obtain a gating control signal, and a tri-state buffer output port of the switch group action counting unit corresponding to the address coding signal of the switch group action counting unit is enabled. The 1 relay switch group refers to a switch group consisting of 1 relay normally-open switch and 1 relay normally-closed switch in the same relay; the L relay switch groups can be all in the same relay or respectively in a plurality of relays, and the number of the relay switch groups in each relay can be the same or different.
fig. 1 is a block diagram of an embodiment of a relay life counting and measuring device when L is 4, and includes a controller unit 10, a 1# switch group operation counting unit 11, a 2# switch group operation counting unit 12, a 3# switch group operation counting unit 13, a 4# switch group operation counting unit 14, a human-machine interface unit 15, a gate control unit 16, and a relay driving unit 17, and can simultaneously count and measure the lives of 4 relay switch groups.
The human-machine interface unit 15 communicates with the controller unit 10 through an interface I/O1 of the controller unit 10, and is used for detecting issuance of commands, parameter modification, display of the service life of each relay switch group, and the like; the controller unit 10 sends a relay driving signal to the relay driving unit 17 through the output port OUT2 to control the actions of the relay switch groups from 1# to 4 #; a 1# switch group action counting unit 11, a 2# switch group action counting unit 12, a 3# switch group action counting unit 13 and a 4# switch group action counting unit 14 respectively carry out electric pulse generation, filtering and action frequency counting on 4 relay switch groups; the controller unit 10 sends an address coding signal of a switch group action counting unit to be gated to the gating control unit 16 through an output port OUT1, the gating control unit 16 decodes the address coding signal of the switch group action counting unit to obtain gating control signals CS1, CS2, CS3 and CS4, and respectively controls action counting values CV1, CV2, CV3 and CV4 of the 1# switch group action counting unit 11, the 2# switch group action counting unit 12, the 3# switch group action counting unit 13 and the 4# switch group action counting unit to be sent to the controller unit 10 through an input port IN1, wherein the IN1 is a counting data input port of the controller unit; controller section 10 sends clear 0 signal CLR to # 1 switch group operation counting section 11, # 2 switch group operation counting section 12, # 3 switch group operation counting section 13, and # 4 switch group operation counting section 14 through output port OUT 3; when the clear 0 signal CLR is valid, the action count values of the 4 switch group action count units are all cleared by 0.
Fig. 2 is a block diagram of an embodiment of a 1# switch group action counting unit. In fig. 2, the 1# pulse generating circuit 100 outputs a first initial pulse P11 and a second initial pulse P12 generated by the operation of the 1# relay switch group; the RS flip-flop 101 converts the input first initial pulse P11 and the second initial pulse P12 into a counting pulse P13 after the edge jitter interference pulse is filtered; the tri-state output counting circuit 102 counts the counting pulse P13, is controlled by a gating control signal CS1, and outputs an action counting value CV1 of the 1# relay switch group; the tri-state output counter circuit 102 is simultaneously controlled by the clear 0 signal CLR, and when the clear 0 signal CLR is active, the action count value in the tri-state output counter circuit 103 is cleared by 0.
FIG. 3 shows an embodiment of a 1# pulse generating circuit. The 1# relay switch group comprises a normally open switch KA1-1 and a normally closed switch KA 1-2; the KA1-1 is connected in series with the load resistor R11 and then connected in parallel to the direct current power supply + VCC1 and the common ground GND; the resistor R13 and the resistor R14 form a voltage dividing circuit, voltage on the load resistor R11 is divided, and a first initial pulse P11 generated by the on-off of a normally open switch KA1-1 in a 1# relay switch group is output; the diode VD1 plays a role in unidirectional conduction protection, and the diode TVS1 plays a role in amplitude limiting and reverse protection. The KA1-2 is connected in series with the load resistor R12 and then connected in parallel to the power supply + VCC1 and the common ground GND; the resistor R13 and the resistor R14 form a voltage dividing circuit, voltage on the load resistor R12 is divided, and a second initial pulse P12 generated by the on-off of a normally closed switch KA1-2 in a 1# relay switch group is output; the diode VD2 plays a role in unidirectional conduction protection, and the diode TVS2 plays a role in amplitude limiting and reverse protection. The diodes TVS1 and TVS2 are selected from zener diodes or TVS transistors. The sizes of the load resistors R11 and R12 are changed, so that the sizes of resistive direct current load currents of the normally open switch KA1-1 and the normally closed switch KA1-2 in the relay switch group to be detected can be adjusted. The voltage division ratio of the 2 voltage division circuits needs to be comprehensively considered according to the size of the power supply + VCC1 and the allowable high-level and low-level ranges of P11 and P12.
When the load of the relay switch group to be detected needs to be supplied with power by an alternating current power supply, in the embodiment of the 1# pulse generating circuit in fig. 3, the direct current power supply + VCC1 and GND can be replaced by alternating current power supplies AC1 and AC2, and the positive half wave is set when the potential of the AC1 is higher than that of the AC 2. When the normally open switch KA1-1 is switched on, the first initial pulse P11 outputs a pulse wave with the period of 20ms and the duty ratio of less than 50%; when the normally-open switch is switched off KA1-1, the first initial pulse P11 outputs a low level; when the normally closed switch KA1-2 is switched on, the second initial pulse P12 outputs a pulse wave with the period of 20ms and the duty ratio of less than 50%; when the normally closed switch KA1-2 is opened, the second initial pulse P12 outputs a low level; when the 1# relay switch group is operated to switch the switching state, jitter pulses with variable widths and intervals may be generated at the beginning and end of a pulse wave with a period of 20ms and a duty ratio of less than 50%. Similarly, the sizes of the load resistors R11 and R12 can be changed, so that the sizes of the resistive alternating current load currents of the normally open switch KA1-1 and the normally closed switch KA1-2 in the relay switch group to be detected can be adjusted. The voltage division ratio of the 2 voltage division circuits needs to be comprehensively considered according to the peak sizes of the alternating current power supplies AC1 and AC2, and the allowable high-level and low-level ranges of P11 and P12. The load resistors R11 and R12 may be inductive or capacitive loads.
Fig. 4 is an RS flip-flop embodiment. In fig. 4, the nor gates FO1 and FO2 constitute an RS flip-flop, the first start pulse P11 is a set signal of the RS flip-flop, and the second start pulse P12 is a reset signal of the RS flip-flop, both of which are active high. When a normally open switch KA1-1 in the 1# relay switch group is opened and a normally closed switch KA1-2 is closed, P11 is at a low level, and a counting pulse P13 output from FO2 is set to be 0 by the high level or positive pulse of P12; when a normally open switch KA1-1 and a normally closed switch KA1-2 in the 1# relay switch group are closed, P12 is at a low level, and counting pulses P13 are set to be 1 by the high level or positive pulse of P11; when a normally open switch and a normally closed switch in the relay switch group act, the normally open switch and the normally closed switch are both opened and then closed, when a 1# relay switch group acts in a power-on action or a power-off action process of a relay coil, the normally open switch KA1-1 and the normally closed switch KA1-2 are in a completely disconnected state for a short time, at the moment, P11 and P12 are both in a low level, and the state of a counting pulse P13 is maintained; when the normally open switch is switched from off to on, the normally closed switch is already switched off, the reset signal is invalid, and even if a shaking pulse exists when the normally open switch is switched from off to on, the shaking pulse is a valid set signal, and P13 is set to be 1; similarly, when the normally closed switch is turned on from off, the normally open switch is already turned off and the set signal is not asserted, and when the normally closed switch is turned on from off, even if there is a dither pulse, the dither pulse is an asserted reset signal and sets P13 to 0. In fig. 4, the output terminal of the nor gate FO2 is the non-inverting output terminal of the RS flip-flop; the count pulse P13 may also be output from the inverting output of the RS flip-flop, i.e., the output of the or gate FO 1.
The RS flip-flop can also adopt other forms of RS flip-flops than fig. 4, and the pulse generating circuit can also adopt other forms of circuits than fig. 3. Because the first initial pulse and the second initial pulse output by the pulse generating circuit are used as input signals of the RS trigger, and the RS trigger does not allow the input set signal and the input reset signal to be simultaneously effective, the principle of the pulse generating circuit for generating the first initial pulse and the second initial pulse is as follows: when the normally open switch and the normally closed switch of the relay switch group are in all off states in the process of power-on action or power-off action of the relay coil, the states of the first initial pulse and the second initial pulse output by the pulse generating circuit are both invalid signal input states of the RS trigger. For example, when the set signal and the reset signal input by the RS flip-flop are both high level and effective, when the normally open switch and the normally closed switch in the relay switch group are all open, the first initial pulse and the second initial pulse are both low level; when the set signal and the reset signal input by the RS trigger are both effective in low level, when the normally open switch and the normally closed switch in the relay switch group are both disconnected, the first initial pulse and the second initial pulse are both high level.
Fig. 5 is a tri-state output counting circuit embodiment. Fig. 5(a) shows tristate output counting circuit embodiment 1, which is composed of counter FC1 and not gate FN1, and FC1 is 8-bit binary counter 74HC590 with tristate output. The count permission end CCKEN of the FC1 inputs 0, and the clear 0 control end CCLR is a clear 0 signal CLR input end of the tri-state output counting circuit; when the clear 0 signal CLR is active low, that is, the clear 0 signal CLR output by the controller unit is low, the action count value in the counter FC1 is cleared 0; when the clear 0 signal CLR output from the controller unit is at a high level, the FC1 operates in an up-count state, the count pulse P13 is directly connected to the count pulse input CCK of the FC1, and the FC1 counts by 1 at the rising edge of the count pulse P13 to obtain an operation count value. The count pulse P13 is connected to the FC1 data latch RCK through the not gate FN1, and the content of the counter inside the FC1 is latched to the output latch at the falling edge of the count pulse P13. When the gate control signal CS1 is connected to the output enable control terminal G of the FC1 and CS1 is low, the FC1 outputs the operation count value CV1 in the output latch from Q7 to Q0; when CS1 is at high level, Q7-Q0 of FC1 are in high-impedance state. The tri-state output counter circuit embodiment 1 outputs an operation count value of an 8-bit binary count value.
Fig. 5(b) shows tristate output counting circuit embodiment 2, which is composed of counter FC2 and tristate buffer FB1, FC2 is 4-bit binary counter 74HC161, FB1 is tristate buffer 74HC 244. Count control ends CTP and CTR of FC2 and a count control end LD are connected to 1, and a clear 0 control end CR is a clear 0 signal CLR input end of the tri-state output counting circuit; when the clear 0 signal CLR is active low, that is, the clear 0 signal CLR output by the controller unit is low, the action count value in the counter FC2 is cleared 0; when the clear 0 signal CLR outputted from the controller unit is at a high level, the FC2 operates in an up-count state, the count pulse P13 is directly connected to the count pulse input CP of the FC2, and the FC2 counts by 1 at the rising edge of the count pulse P13 to obtain an operation count value. The 4-bit data input terminals A3-A0 of the tristate buffer FB1 are respectively connected to the 4-bit count value output terminals Q3-Q0 of the counter FC2, the gating control signal CS1 is connected to the output enable control terminal 1G of the FB1, and when the CS1 is at a low level, the FB1 outputs the action count value CV1 output by the counter FC2 from Y3-Y0; when CS1 is at high level, Y3-Y0 of FB1 are in high-impedance state. The action count value output by the tri-state output counting circuit embodiment 2 is a 4-bit binary count value.
In the embodiment of the relay service life counting and measuring device when L is 4, the 2# switch group action counting unit, the 3# switch group action counting unit and the 4# switch group action counting unit adopt the same circuit composition and structure as the 1# switch group action counting unit, namely all the switch group action counting units comprise a pulse generating circuit, an RS trigger and a three-state output counting circuit; the composition and structure of all the pulse generating circuit, RS trigger and tri-state output counting circuit are the same.
fig. 6 is a relay drive unit embodiment. Fig. 6(a) is an embodiment of a relay coil powered by a dc power supply, and includes a transistor VT, a freewheeling diode VD, and a base resistor R61; the coil of the relay to be detected is connected in parallel with the nodes A1 and A2, and the direct current power supply of the coil of the relay is + V. Assuming that 4 relay switch groups in the embodiment of fig. 1 are included in 2 relays, only 2 relay coils J1, J2 are connected in parallel in fig. 6 (a). When a relay driving signal C1 sent by the controller unit is in a high level, all relay coils connected in parallel on the nodes A1 and A2 are electrified; when the relay driving signal C1 sent by the controller unit is in a low level, all the relay coils connected in parallel on the nodes A1 and A2 lose power; when the relay driving signal C1 sent by the controller unit changes one pulse period, the relay switch group in all the relays with the coils connected in parallel at the nodes A1 and A2 acts once. When the number of the relay coils is large and the transistor VT in fig. 6(a) is not fully driven, the same or similar driving circuit may be added to expand the driving capability.
fig. 6(b) is an embodiment of a relay coil powered by an ac power supply, and is composed of a current-driven solid-state relay SSR1, a voltage dependent resistor RU1, and a current limiting resistor R62; the coil of the relay to be detected is connected in parallel with the nodes B1 and B2, and the alternating current power supply of the coil of the relay is AC 0; + VCC is the current driven power supply of the SSR 1. Assuming that 4 relay switch groups in the embodiment of fig. 1 are included in 2 relays, only 2 relay coils J3, J4 are connected in parallel in fig. 6 (b). When a relay driving signal C2 sent by the controller unit is in a low level, all relay coils connected in parallel on the nodes B1 and B2 are electrified; when a relay driving signal C2 sent by the controller unit is in a high level, all relay coils connected in parallel on the nodes B1 and B2 lose power; when the relay driving signal C2 sent by the controller unit changes by one pulse period, the relay switch group in all the relays with the coils connected in parallel at the nodes B1 and B2 acts once. When the number of the relay coils is large and the solid-state relay SSR1 in fig. 6(b) is not enough to be driven completely, the same or similar driving circuit can be added to expand the driving capability.
When the relay coil using the dc power supply and the relay coil using the ac power supply exist in the relay in which the L relay switch groups are located, the circuits of fig. 6(a) and 6(b) can be used to perform classified driving. The relay drive unit may also employ other circuits as desired.
The human-computer interface unit preferably uses a touch screen and adopts RS485 or RS232 to communicate with the controller unit. The man-machine interface unit can also be optionally composed of a key circuit and a liquid crystal display.
the action count values of all the switch group action count units are output in a three-state buffer mode; all the tri-state buffer output ports of all the switch group action counting units are connected in parallel to the counting data input port of the controller unit, the controller unit sends out gating control signals to enable the tri-state buffer output ports of all the switch group action counting units respectively, and action count values output by the enabled tri-state buffer output ports are read in from the counting data input port. The action counting value in the embodiment 1 of the tri-state output counting circuit is 8-bit binary data, and the tri-state buffer output port of the switch group action counting unit and the counting data input port of the controller unit are 8-bit parallel ports; in embodiment 2 of the tri-state output counting circuit, the action count value is 4-bit binary data, and the tri-state buffer output port of the switch group action counting unit and the counting data input port of the controller unit are both 4-bit parallel ports. When the L value is small and the number of bits of the action counting value is small, the action counting value of the switch group action counting unit can be output without adopting a three-state buffer mode, and the action counting value output port of each switch group action counting unit is directly connected to different parallel ports of the controller unit; for example, when L is 4 and the operation count value is a 4-bit binary value, the operation count value output ports of the 4 switch group operation count units are directly connected to different parallel ports of the controller unit, and only 16-bit I/O port lines, i.e., 2 8-bit input ports, in total need to be consumed by the controller unit.
The controller unit sends out gating control signals through the gating control unit. The gating control unit is a decoder circuit and decodes the address coding signal of the switch group action counting unit sent by the controller unit to obtain a gating control signal. In the embodiment of fig. 1, the address code signals of the switch group operation counting units corresponding to the 1# switch group operation counting unit 11, the 2# switch group operation counting unit 12, the 3# switch group operation counting unit 13 and the 4# switch group operation counting unit are binary 00, 01, 10 and 11 respectively, and the decoded outputs are CS1, CS2, CS3 and CS 4; the controller unit enables CS1, CS2, CS3, and CS4 one by one, enables the tri-state buffer output port of each switch group operation count unit, and reads IN the corresponding operation count value from the count data input port IN 1. The decoder circuit of the gate control unit in the embodiment can select 74HC139, or 74HC138, or adopt gate circuit composition. When the value of L is large, the decoder circuit can adopt a plurality of pieces of 74HC139, or a multistage cascade circuit formed by 74HC138 and the like, or a plurality of gates. When the value of L is small, the gate control unit may be omitted, and the controller unit may directly send the gate control signals to the switch group operation counting units through the output port, for example, in the embodiment of fig. 1, the gate control signals CS1, CS2, CS3, and CS4 may be directly sent by the controller unit 10, and the gate control unit is not required.
The controller unit is used for controlling the whole relay life counting and measuring device and realizing the relay life counting and measuring method. The controller unit is preferably formed by using a single chip microcomputer as a core, and the core of the controller unit can also be ARM, or DSP, or a programmable controller. The method for measuring the service life count of the relay comprises the following steps:
step 1, initializing, namely setting detection marks of L relay switch groups to be in a detection state, clearing 0 by a service life counter, and sending a clear 0 signal to enable all L action count values to be clear 0;
Step 2, controlling the L relay switch groups to act once, and simultaneously counting the action times of the L relay switch groups respectively to obtain L action count values; the service life counter counts by adding 1;
step 3, reading current L action count values;
Step 4, judging whether the relay switch groups with the detection marks in the detection state are invalid one by one; setting the detection mark which is judged as the failure relay switch group at this time to be in a stop detection state, and simultaneously taking the count value of the current life counter as the life value of the relay switch group which is judged as the failure at this time;
and 5, if the detection marks of the L relay switch groups still have the detection state, returning to the step 2, otherwise, stopping detection.
the one-time on/off control of the L relay switch groups means that the controller unit sends a signal to operate the relay switch groups once through the relay driving unit, for example, the relay driving signal C1 sent by the controller unit in fig. 6(a) changes by one pulse cycle, or the relay driving signal C2 sent by the controller unit in fig. 6(b) changes by one pulse cycle. The service life counter is a software counter in the controller unit, the controller unit sends a signal for enabling the L relay switch groups to act once, and the count value of the service life counter is increased by 1. And meanwhile, the on-off times of the L relays are respectively counted to obtain L action count values, and the L action count values are respectively counted by L switch group action counting units outside the controller unit.
And judging whether the relay switch group with the detection mark in the detection state fails, wherein the method is that if the error between the controlled on-off times of the relay switch group to be judged and the action counting value is less than E, the relay switch group does not fail, otherwise, the relay switch group fails. The specific judgment method is that the count value of the current life counter is subjected to modulus operation on M to obtain a remainder Q; if the read action count value of the relay switch set to be judged at the time is K, when one of | K-Q | < E, or | K- (Q-M) | < E, or | K- (Q + M) | < E is satisfied, the error between the number of times the relay switch set to be judged is controlled to be turned on and off and the action count value is smaller than E. The action counting value adopts a cyclic counting mode, and after reaching the maximum value M of the three-state output counting circuit, 1 is added, and the overflow is changed into 0; taking the 4-bit binary operation count value outputted by the tri-state output counting circuit embodiment 2 as an example, the maximum count value M is 1111, and the next operation count value is 0; in the judgment expression, comparing K with Q-M, the influence of smaller K value plus counting overflow and larger Q value is counteracted; comparing K with Q + M offsets the effect of larger K value and smaller Q value modulo M. Because E is an integer which is more than or equal to 1 and less than or equal to M/2, after the error E is determined, the maximum count value of the action count value must be more than 2 times of E; for example, if E is determined to be 3, the maximum count value of the action count value must be greater than 6, and at this time, both the decimal BCD counter and the binary counter with more than 3 bits satisfy the requirement. And in the current L read action count values, the controller unit does not judge and process the action count value of the relay with the detection mark in the stop detection state.
Whether the relay switch group with the detection mark in the detection state is invalid or not can be judged, and the following method can also be adopted: when the current action counting value and the previous action counting value of the relay switch group are not in the increment 1 relation to be judged, the relay switch group is invalid, otherwise, the relay switch group is not invalid; or, when the current action counting value and the previous action counting value of the relay switch group to be judged for S times are not in the increasing 1 relation, the relay switch group is invalid, otherwise, the relay switch group is not invalid; and S is an integer greater than or equal to 2. Because the action counting value adopts a cyclic counting mode, the action counting value is overflowed to be 0 after reaching the maximum value of the three-state output counting circuit and then 1 is added; taking the 4-bit binary on-off count value output by the tri-state output counting circuit embodiment 2 as an example, the maximum value is 1111, and the next on-off count value satisfying the 1-increasing relationship is 0.
Whether the relay switch group with the detection mark in the detection state is invalid or not can be judged, and the following method can be adopted: when the current action counting value and the previous action counting value which are accumulated to reach W times by the relay switch group are not in the increment 1 relation, the relay switch group is invalid, otherwise, the relay switch group is not invalid; and W is an integer greater than or equal to 2.
the controller unit and the human-computer interface unit can adjust and display NO and NC duty ratios (namely, setting the proportion of pull-in time and release time) of the relay switch group, select a failure judgment mode, set and display failure judgment parameters, set and display action cycles of the relay switch group and the like according to needs. The relay life counting and measuring device can also be additionally provided with a temperature monitoring unit to monitor the temperature of the relay in the test process.
except for the technical features described in the specification, the method is the conventional technology which is mastered by a person skilled in the art. For example, the controller of the controller unit is selected, and the related peripheral control circuits are designed and programmed to realize the functions thereof; selecting or designing a gating control unit circuit to meet the requirement of decoding gating; selecting or designing a drive circuit of the relay drive unit to meet the requirement of controlling the L relay switch groups; selecting the composition and circuit structure of the human-computer interface unit, and connecting the human-computer interface unit with the controller unit to realize corresponding functions; and the like, are conventional techniques known to those skilled in the art.