This application is based upon and claims the benefit of priority from Japanese Patent Application No. 2017-040310 filed on Mar. 3, 2017, the contents of which are incorporated herein by reference.
The present invention relates to a communications system and a communication method for a communications system.
Japanese Laid-Open Patent Publication No. 08-116331 discloses that when a terminal device is incapable of normally receiving packets transmitted by a master device, the terminal device transmits a negative response to the master device, and when the negative response is received by the master device, the packets are retransmitted from the master device to the terminal device.
With the technique disclosed in Japanese Laid-Open Patent Publication No. 08-116331, since the master device (transmitting node) retransmits the packets to the terminal device (receiving node) after having waited to receive the negative response, there is a concern that time will be required until the packets can be received normally at the receiving node.
The present invention has been devised in order to solve the aforementioned problem, and has the object of providing a communications system and a communication method for a communications system, which are capable of preventing a delay in reception of packets while the packets are received normally at a receiving node.
A first aspect of the present invention is characterized by a communications system including a transmitting node, and a receiving node connected by a communications circuit to the transmitting node, the communications system being configured to transmit packets from the transmitting node to the receiving node at each of predetermined periods, wherein each of the packets contains at least data and an error detection code, the transmitting node calculates an allowable number of transmissions at which the packets can be transmitted within the predetermined period, and transmits the same packets a plurality of times within the allowable number of transmissions, and the receiving node checks the error detection codes of the received packets, and acquires data of the packets for which no errors are detected.
A second aspect of the present invention is characterized by a communication method for a communications system including a transmitting node, and a receiving node connected by a communications circuit to the transmitting node, the communications system being configured to transmit packets from the transmitting node to the receiving node at each of predetermined periods, wherein each of the packets contains at least data and an error detection code, the communication method including an allowable number of transmissions calculating step of calculating, in the transmitting node, an allowable number of transmissions at which the packets can be transmitted within the predetermined period, a packet transmitting step of transmitting, in the transmitting node, the same packets a plurality of times within the allowable number of transmissions, a packet receiving step of receiving, in the receiving node, the packets transmitted from the transmitting node, an error detection code checking step of checking, in the receiving node, the error detection codes of the received packets, and a data acquisition step of acquiring, in the receiving node, data of the packets for which no errors are detected.
According to the present invention, while packets are received normally at the receiving node, a delay in reception of the packets can be prevented.
The above and other objects, features, and advantages of the present invention will become more apparent from the following description when taken in conjunction with the accompanying drawings, in which preferred embodiments of the present invention are shown by way of illustrative example.
The present invention will be described below through various embodiments of the present invention. The illustrative embodiments are not intended to limit the present invention as defined in the appended claims.
Furthermore, all of the combinations of features discussed in the illustrative embodiments might not be absolutely necessary for achieving the inventive solution.
The CNC 12 is a control device adapted to control a machine tool, an industrial machine, or the like. The amplifiers 14 are servo amplifiers that control the electric power supplied to servomotors of machine tools, industrial machines, etc., in accordance with motor command values transmitted from the CNC 12. The amplifier A 14a, the amplifier B 14b, and the amplifier C 14c control the electric power to be supplied respectively to a servomotor A 18a, a servomotor B 18b, and a servomotor C 18c. Hereinafter, unless distinguished specifically from each other, the servomotor A 18a, the servomotor B 18b, and the servomotor C 18c will be referred to collectively as servomotors 18.
In the communications system 10 according to the present embodiment, packets including motor command values and the like are transmitted from the CNC 12 to each of the amplifier A 14a, the amplifier B 14b, and the amplifier C 14c via the serial communications circuit 16.
The CNC 12 transmits packets to each of the amplifier A 14a, the amplifier B 14b, and the amplifier C 14c at each of regular predetermined periods. Since the packets include the motor command values as described above, and the values of the motor command values vary over time, the contents of the packets transmitted in each of the periods also differ.
For example, in the example shown in
The transmission/reception circuit 22 is constituted by a processor, a memory, and the like, and performs a communication process via the serial communications circuit 16. More specifically, the transmission/reception circuit 22 generates packets including data such as motor command values and the like designated by the processing unit 20 in accordance with a predetermined communications protocol, and performs a transmission process to cause the generated packets to flow to the serial communications circuit 16. Further, the transmission/reception circuit 22 performs a reception process of extracting data from the packets received via the serial communications circuit 16, and transmitting the data to the processing unit 20. The storage unit 24 is a semiconductor memory or the like, and stores an NC program and the like which is executed in the processing unit 20.
In step S2, the number of transmissions of packets addressed to each of the amplifiers 14 is set. The transmission/reception circuit 22 calculates an allowable number of transmissions at which the packets can be transmitted within one period. In the example shown in
Moreover, for example, when the allowable number of transmissions of packets is seven, and the number of transmissions of packets addressed to each of the amplifiers 14 cannot be set to the same number of times, then the number of transmissions of packets addressed to each of the amplifiers 14 may be set appropriately, for example, the number of transmissions of packets addressed to the amplifier A 14a connected at the farthest position from the CNC 12 may be set to three times, and the number of transmissions of packets addressed to each of the amplifier B 14b and the amplifier C 14c may be set to two times, or the like.
In step S3, the packets are transmitted in the order of the packets addressed to the amplifier A 14a, the packets addressed to the amplifier B 14b, and the packets addressed to the amplifier C 14c. The processes of the aforementioned steps S1 to S3 are performed at each of regular predetermined intervals.
The transmission/reception circuit 40 is constituted by a processor, a memory, and the like, and performs a communication process via the serial communications circuit 16. More specifically, the transmission/reception circuit 40 generates packets including data in accordance with a predetermined communications protocol, and performs a transmission process to cause the generated packets to flow to the serial communications circuit 16. Further, the transmission/reception circuit 40 performs a reception process of extracting data from the packets received via the serial communications circuit 16, and transmitting the data to the motor control circuit 42. The motor control circuits 42 supply electric power to the servomotors 18 based on the motor command values transmitted thereto from the transmission/reception circuits 40.
In step S12, the error detection code of the footer part of the received packet is confirmed, and it is determined whether a code error of the packet has been detected. If a code error is detected, the process proceeds to step S15, and if a code error is not detected, the process proceeds to step S13.
In step S13, data such as motor command values are acquired from the data part of the packet, and the acquired data is transmitted to the motor control circuits 42. Following step S11, in step S14, the received packet is passed through without modification, and the packet is transferred to another one of the amplifiers 14. Following step S12, in step S15, the received packet is discarded.
For example, in the case that a code error has occurred in “packet A-1” during the period that the “packet A-1” is transmitted to the amplifier A 14a via the serial communications circuit 16, the amplifier A 14a discards the “packet A-1”. Therefore, a missing portion will occur in the data to be received by the amplifier A 14a. In the event that a missing portion occurs in the data, then in the amplifier A 14a, a process such as one to complete the data missing from the data received before and after the missing portion is performed, however, in this case, there is a concern that the control accuracy of the servomotor 18a will be deteriorated. Further, depending on the content of the missing data, there may be a need for the amplifiers 14 to stop driving the servomotors 18 and to transmit an abnormality occurrence signal to the CNC 12, whereupon the CNC 12 controls a non-illustrated notification unit, whereby a notification is issued to the operator to the effect that such an abnormality has occurred.
In the case that a code error has occurred in “Packet A-1”, although it might be considered to transmit an error detection signal from the amplifier A 14a to the CNC 12, and for the “packet A-1” to be retransmitted from the CNC 12, even if the packet is retransmitted in this manner, the control of the servomotor 18a is delayed, and deterioration in the control accuracy of the servomotor 18a cannot be avoided.
Thus, according to the present embodiment, in the CNC 12, the allowable number of transmissions that packets can be transmitted within the regular predetermined period during which packets are transmitted is calculated, and the same packets are transmitted a plurality of times with respect to each of the amplifiers 14 within the allowable number of transmissions. Owing to this feature, redundancy of the communication data of the serial communications circuit 16 can be enhanced, the reliability of communications can be improved, and a delay in communications can be prevented.
Although the configuration per se of the CNC 12 is the same as in the first embodiment, the transmission process performed in the transmission/reception circuit 22 differs from that of the first embodiment.
In step S23, the number of transmissions of packets addressed to the amplifiers 14 that have replied with the error detection signal is set. The transmission/reception circuit 22 calculates an allowable number of transmissions at which the packets can be transmitted within one period. In the example shown in
In step S24, the packets are transmitted in the order of the packets addressed to the amplifier A 14a, the packets addressed to the amplifier B 14b, and the packets addressed to the amplifier C 14c. In the example of
The configuration per se of the amplifiers 14 is the same as in the first embodiment, however, the reception process performed in the transmission/reception circuits 40 differs from that of the first embodiment.
In step S32, the error detection code of the footer part of the received packet is confirmed, and it is determined whether a code error of the packet has been detected. If a code error is detected, the process proceeds to step S35, and if a code error is not detected, the process proceeds to step S33.
In step S33, data such as motor command values are acquired from the data part of the packet, and the acquired data is transmitted to the motor control circuits 42. In step S34, the received packet is passed through without modification, and the packet is transferred to another one of the amplifiers 14. In step S35, the received packet is discarded. In step S36, an error detection signal is transmitted in reply to the CNC 12.
According to the present embodiment, when the CNC 12 has received an error detection signal from an amplifier 14, the CNC 12 transmits the same packet to the amplifier 14 that has replied with the error detection signal a plurality of times within the same period. Since code errors for the packets are frequently generated in the serial communications circuit 16, code errors tend to occur in a packet of the same destination as the packet containing code errors. By transmitting only packets of the same destination as packets including code errors in the past, a plurality of times, it becomes possible to increase, within one period, the number of times that packets are transmitted for destinations which are likely to have code errors occurring therein. Owing to this feature, the reliability and stability of communications of the serial communications circuit 16 can be enhanced.
Furthermore, because the CNC 12 increases only the number of transmissions of packets addressed to amplifiers 14 that have replied with the error detection signal, the number of packets transmitted by the CNC 12 can be reduced as a whole. Owing to this feature, congestion of communications in the serial communications circuit 16 can be suppressed.
Although the configuration per se of the CNC 12 is the same as in the first embodiment, the transmission process performed in the transmission/reception circuit 22 differs from that of the first embodiment.
In step S43, the number of transmissions of packets addressed to the amplifiers 14 that have transmitted the error prediction signal is set. The transmission/reception circuit 22 calculates an allowable number of transmissions at which the packets can be transmitted within one period. In the example shown in
In step S44, the packets are transmitted in the order of the packets addressed to the amplifier A 14a, the packets addressed to the amplifier B 14b, and the packets addressed to the amplifier C 14c. In the example of
The error prediction detection unit 46 detects a situation in which there is a concern that a code error may be included in packets received by the amplifiers 14. More specifically, the error prediction detection unit 46 detects whether or not there is an indication (hereinafter referred to as an error prediction) that the magnitude of an amplitude of the signal received by the amplifiers 14 is less than or equal to a predetermined amplitude, that an amplitude of noise within the amplifiers 14 is greater than or equal to a predetermined amplitude, that a temperature within the amplifiers 14 is greater than or equal to a predetermined temperature, or that a vibration of the amplifiers 14 is greater than or equal to a predetermined amplitude. When an error prediction is detected, the error prediction detection unit 46 commands the transmission/reception circuits 40 to transmit an error prediction signal to the CNC 12.
In step S53, the destination of the header part of the received packet is confirmed, and it is determined whether or not the destination of the packet is its own (i.e., is the destination of itself). If the destination is its own, the process proceeds to step S54, and if the destination is other than its own, the process proceeds to step S56.
In step S54, the error detection code of the footer part of the received packet is confirmed, and it is determined whether a code error of the packet has been detected. If a code error is detected, the process proceeds to step S57, and if a code error is not detected, the process proceeds to step S55.
In step S55, data such as motor command values are acquired from the data part of the packet, and the acquired data is transmitted to the motor control circuits 42. In step S56, the received packet is passed through without modification, and the packet is transferred to another one of the amplifiers 14. In step S57, the received packet is discarded.
According to the present embodiment, when the CNC 12 has received an error prediction signal from the amplifiers 14, the CNC 12 transmits the same packets to the amplifiers 14 that have transmitted the error prediction signal, a plurality of times within the same period. There is a tendency for code errors to occur in the packets received by the amplifiers 14 that have detected the error prediction. By transmitting only those packets, which are addressed to amplifiers 14 that have detected the error prediction, a plurality of times, it becomes possible to increase within one period the number of times that packets are transmitted for destinations which are likely to have code errors occurring therein. Further, the packets can be transmitted a plurality of times prior to a code error occurring in the packets. Owing to this feature, the reliability and stability of communications of the serial communications circuit 16 can be enhanced.
Furthermore, because the CNC 12 increases only the number of transmissions of packets addressed to amplifiers 14 that have transmitted the error prediction signal, the number of packets transmitted by the CNC 12 can be reduced as a whole. Owing to this feature, congestion of communications in the serial communications circuit 16 can be suppressed.
Although the present invention has been described with reference to particular embodiments, the technical scope of the present invention is not limited to the scope defined by the above embodiments. It goes without saying that various modifications or improvements are capable of being added to the above embodiments. It is clear from the scope of the claims that other modes to which such modifications or improvements have been added can be included within the technical scope of the present invention.
According to the above embodiments, a method of setting the number of transmissions of packets to be transmitted from the CNC 12 to the amplifiers 14 has been described. However, the number of transmissions may also be set for packets to be transmitted from the amplifiers 14 to the CNC 12, or from one amplifier 14 to another amplifier 14.
The technical concept that can be grasped from the above embodiments will be described below.
The communications system (10) includes a transmitting node (12), and a receiving node (14) connected by a communications circuit to the transmitting node (12), the communications system (10) being configured to transmit packets from the transmitting node (12) to the receiving node (14) at each of predetermined periods, wherein each of the packets comprises at least data and an error detection code, the transmitting node (12) calculates an allowable number of transmissions at which the packets can be transmitted within the predetermined period, and transmits the same packets a plurality of times within the allowable number of transmissions, and the receiving node (14) checks the error detection codes of the received packets, and acquires data of the packets for which no errors are detected. Owing to this feature, redundancy of the communication data of the communications circuit (16) can be enhanced, the reliability of communications can be improved, and a delay in communications can be prevented.
In the above-described communications system (10), a plurality of the receiving nodes (14) may be provided, and the transmitting node (12) transmits, by the same communications circuit (16) and within the same period, different packets to the respective receiving nodes (14), and transmits the packets, which are to be transmitted to the respective receiving nodes (14), a plurality of times within the allowable number of transmissions. Owing to this feature, redundancy of the communication data of the communications circuit (16) can be enhanced, and the reliability of communications can be improved.
In the above-described communications system (10), the receiving node (14) may check the error detection codes of the received packets, and when an error is detected, may transmit an error detection signal to the transmitting node (12). When the transmitting node (12) receives the error detection signal transmitted by the receiving node (14), then in a following period and thereafter, the transmitting node (12) may transmit the same packets a plurality of times to the receiving node (14) that has transmitted the error detection signal. Owing to this feature, within the limited bandwidth of the communications circuit (16), it is possible to increase the number of transmissions of packets only when a code error occurs, congestion in the communications circuit (16) can be suppressed, and stability of communications of the communications circuit (16) can be enhanced.
In the above-described communications system (10), a plurality of the receiving nodes (14) may be provided, and the transmitting node (12) transmits, by the same communications circuit (16) and within the same period, different packets to the respective receiving nodes (14), and transmits the packets, which are to be transmitted to one of the receiving nodes (14) that has transmitted the error detection signal, a plurality of times within the allowable number of transmissions. Owing to this feature, it is possible to increase, within one period, the number of transmissions of packets for destinations which are likely to have code errors occurring therein, and the reliability of communications of the communications circuit (16) can be improved.
In the above-described communications system (10), the receiving node (14) may transmit an error prediction signal to the transmitting node if the magnitude of an amplitude of a received signal is less than or equal to a predetermined amplitude, if an amplitude of noise within the receiving node (14) is greater than or equal to a predetermined amplitude, if a temperature within the receiving node (14) is greater than or equal to a predetermined temperature, or if a vibration of the receiving node (14) is greater than or equal to a predetermined amplitude. When the transmitting node (12) receives the error prediction signal transmitted by the receiving node (14), then in a following period and thereafter, the transmitting node (12) may transmit the packets to be transmitted to the receiving node (14) a plurality of times. Owing to this feature, within the limited bandwidth of the communications circuit (16), it is possible to increase the number of transmissions of packets only when there is a concern of a code error occurring therein, congestion in the communications circuit (16) can be suppressed, and stability of communications of the communications circuit (16) can be enhanced.
In the above-described communications system (10), a plurality of the receiving nodes (14) may be provided, and the transmitting node (12) transmits, by the same communications circuit (16) and within the same period, different packets to the respective receiving nodes (14), and transmits the packets, which are to be transmitted to one of the receiving nodes (14) that has transmitted the error prediction signal, a plurality of times within the allowable number of transmissions. Owing to this feature, it is possible to increase, within one period, the number of transmissions of packets for destinations which are likely to have code errors occurring therein, and the reliability of communications of the communications circuit (16) can be improved.
Number | Date | Country | Kind |
---|---|---|---|
2017-040310 | Mar 2017 | JP | national |