CN108322291B - Multi-axis servo operation data monitoring method based on serial bus - Google Patents
Multi-axis servo operation data monitoring method based on serial bus Download PDFInfo
- Publication number
- CN108322291B CN108322291B CN201810118864.1A CN201810118864A CN108322291B CN 108322291 B CN108322291 B CN 108322291B CN 201810118864 A CN201810118864 A CN 201810118864A CN 108322291 B CN108322291 B CN 108322291B
- Authority
- CN
- China
- Prior art keywords
- data
- station
- frame
- sampling
- slave
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/38—Information transfer, e.g. on bus
- G06F13/42—Bus transfer protocol, e.g. handshake; Synchronisation
- G06F13/4282—Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/0001—Systems modifying transmission characteristics according to link quality, e.g. power backoff
- H04L1/0006—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format
- H04L1/0007—Systems modifying transmission characteristics according to link quality, e.g. power backoff by adapting the transmission format by modifying the frame length
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L1/00—Arrangements for detecting or preventing errors in the information received
- H04L1/004—Arrangements for detecting or preventing errors in the information received by using forward error control
- H04L1/0056—Systems characterized by the type of code used
- H04L1/0061—Error detection codes
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L5/00—Arrangements affording multiple use of the transmission path
- H04L5/003—Arrangements for allocating sub-channels of the transmission path
- H04L5/0078—Timing of allocation
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
- H04L67/025—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP] for remote control or remote monitoring of applications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/12—Protocols specially adapted for proprietary or special-purpose networking environments, e.g. medical networks, sensor networks, networks in vehicles or remote metering networks
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/06—Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Theoretical Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Quality & Reliability (AREA)
- General Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- Health & Medical Sciences (AREA)
- Computing Systems (AREA)
- General Health & Medical Sciences (AREA)
- Medical Informatics (AREA)
- Selective Calling Equipment (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention provides a multi-axis servo operation data monitoring method based on a serial bus, wherein a data acquisition device comprises a master station for processing data and servo slave stations positioned in the same local area network, and the method comprises the following steps: (1) data sampling configuration: the master station firstly sends a command of a data configuration frame to the slave stations in a broadcast mode, so that the slave stations complete data sampling configuration and receive response frames of all the slave stations; (2) and (3) transmission of sampling data: the master station sequentially sends a command of a data request frame to each slave station and sequentially acquires sampling data of each slave station; (3) and (3) processing master station data: and the master station sorts and analyzes the sampled data of all the target slave stations, and processes and displays all the data. The invention is based on the serial bus technology, has low cost, can simultaneously acquire and analyze the operation data of a plurality of servo systems in the local area network, can monitor the data with higher precision in the servo systems, and is convenient for users to debug and improve on site.
Description
Technical Field
The invention relates to a data acquisition method of a servo system, in particular to a multi-axis servo operation data monitoring method based on a serial bus.
Background
Generally, industrial automation equipment consists of a plurality of sets of servo systems, and normal operation of the equipment is completed under the cooperative work of the plurality of sets of servo mechanisms. The servo systems respectively operate according to respective control instructions, and the performance of the whole equipment is directly determined by the control characteristics of the servo systems. In order to improve the performance and key indexes of the equipment, the operation data of each servo needs to be monitored and compared simultaneously in the process of debugging the equipment, so that a method for acquiring, displaying, comparing and analyzing multi-axis servo data is needed.
Disclosure of Invention
The invention provides a multi-axis servo operation data monitoring method based on a serial bus, which solves the problem of data acquisition of a plurality of sets of servo systems and adopts the following technical scheme:
a multi-axis servo operation data monitoring method based on a serial bus comprises a data acquisition device and a data processing device, wherein the data acquisition device comprises a main station for processing data and servo slave stations positioned in the same local area network, and the data acquisition process comprises the following steps:
(1) data sampling configuration: the master station firstly sends a command of a data configuration frame to the slave stations in a broadcast mode, so that the slave stations complete data sampling configuration and receive response frames of all the slave stations;
(2) and (3) transmission of sampling data: the master station sequentially sends a command of a data request frame to each slave station and sequentially acquires sampling data of each slave station;
(3) and (3) processing master station data: and the master station sorts and analyzes the sampled data of all the target slave stations, and processes and displays all the data.
The data sampling configuration in the step (1) comprises the following steps:
1) the master station sends a data configuration command to all slave station servo drivers in the local area network in a broadcast mode;
2) after receiving the data configuration frame of the master station, the slave station servo driver firstly checks the station number, and if the station number is 0xFF, the station number indicates that the frame is a broadcast frame of the master station, and the slave station is required to respond;
3) checking the function code, if the function code is 0x41, indicating that the frame is a data acquisition configuration frame sent by the master station, and otherwise, performing error response processing on the function code to the master station;
4) shielding the bit pairing, wherein the pairing is successful, the received data configuration frame needs to be further processed, and otherwise, the frame is discarded and is not responded;
5) determining the length of a frame according to the number of slave stations in a data configuration frame sent by a master station, calculating a Cyclic Redundancy Check (CRC) value according to the length of the frame, comparing the calculated CRC value with the CRC value in the data frame, if the calculated CRC value is the same as the CRC value in the data frame, further processing the data frame, and if the calculated CRC value is different from the CRC value in the data frame, performing check error response processing on the master station;
6) if the CRC value is checked to be correct, extracting a trigger option value Byte5 of the data configuration frame, and further extracting a trigger mode, a trigger edge and a trigger axis parameter;
7) extracting the trigger values of Byte 6-Byte 9 of the data configuration frame;
8) extracting trigger delay values of Byte 10-Byte 11 of the data configuration frame, when the trigger mode is triggered by a condition, calculating response delay time by the slave station according to the trigger delay values, and starting data sampling when the delay time is up;
9) extracting a response delay value Byte12 of the data configuration frame, wherein the value takes ms as a unit, each slave station calculates response delay time according to the station number of the slave station, and the determination of the value is related to the baud rate;
10) extracting a sampling interval value Byte13 of the data configuration frame, and performing data sampling from the slave station according to the specification of the sampling interval;
11) extracting a timestamp value Byte14 of the data configuration frame, wherein the value is automatically generated by the master station, the slave station fills the value into a response Byte of a response message after receiving the data configuration frame, and the system determines the validity of the slave station response frame according to the timestamp;
12) and extracting a sampling item from the slave station, and sampling data according to the sampling item.
In the data sampling configuration in the step (1), after the master station sends the data sampling configuration frame to each slave station in the local area network, each slave station sends a response message to the master station in sequence according to the station number of the master station, and the master station judges whether each slave station correctly receives the data configuration frame according to the response message; and if the slave station in the target slave station sequence does not reply the response message or replies an error response message, the master station continues to independently configure the slave station.
Further, in step 2), the station numbers of the master station and each slave station should be manually set in advance.
Further, in step 3), the function code of the data configuration frame is 0x41, the function code of the data configuration response frame is 0x41, and the function code of the data configuration exception response frame is 0x 51; the function code of the data request frame is 0x42, the function code of the data request response frame is 0x42, and the function code of the data request exception response frame is 0x 52.
Further, in step 4), when the mask bit pairs are formed, the mask bit is 2 bytes, 8 bits are one byte, and 16bits are formed in total, so that 16 slave station servos are determined; setting bit0 to 1 indicates that the station 1# is a data acquisition object, setting bit1 to 1 indicates that the station 2# is a data acquisition object …, setting bit15 to 1 indicates that the station 16# is a data acquisition object, and so on; and each slave station checks whether the corresponding shielding position is 1 or not according to the own station number, and if the corresponding shielding position is 1, the slave station is listed as a data acquisition object.
The transmission of the sampling data in the step (2) comprises the following steps:
1) after the master station confirms that all target slave stations are successfully configured, the master station starts to sequentially send data request frames from the slave station with the minimum station number;
2) the slave station transmits data to the master station after receiving the data request frame sent by the master station, and follows a 'one-question one-answer' mechanism;
3) after the slave station with the minimum station number transmits all the sampling data, the master station starts to transmit a data request frame to the slave station with the secondary station number, and the slave station starts to transmit the sampling data to the master station as before;
4) and by analogy, after the master station receives all the sampling data of all the target slave stations, the transmission process of the sampling data is finished, and after all the slave stations transmit all the data, the master station processes and displays all the data transmitted by the slave stations.
The longest length of a data configuration frame sent by the master station is 49 bytes, the length of a data configuration response frame of the slave station is 5 bytes, and the length of a data configuration abnormal response frame of the slave station is 6 bytes; the length of a data request frame sent by the master station is 6 bytes, the length of a data request response frame of the slave station is 8 bytes, and the length of a data request abnormal response frame of the slave station is 7 bytes.
The command of the data configuration frame comprises two trigger modes of automatic triggering and conditional triggering, wherein the automatic triggering is that the slave station immediately starts to perform data configuration and sampling after receiving the data configuration frame sent by the master station, and the judgment of the data triggering condition is required; and the condition triggering is that the slave station monitors whether the value of the current triggered item meets a triggering set value or not according to the triggering condition in the data configuration frame, if so, sampling is started, if not, the slave station waits for the sampling condition to be satisfied and then sampling is carried out, and otherwise, the slave station waits for the next time.
When the system is automatically triggered, data acquisition is immediately started according to data sampling intervals until 2048 caches are fully stored, and then a data request frame sent by a master station is ready to be received;
when the condition is triggered, firstly, the sampled data are stored in a cache, whether the triggering condition is met or not is judged according to the current data value of the triggering item, if the triggering condition is not met, the data value is stored in the cache periodically until the triggering condition is met, and if the triggering condition is met, the sampled value meeting the sampling condition, the data of previous 1024 sampling points and the data of next 1024 sampling points are reserved, and 2048 data points are counted.
The invention is based on the serial bus (RS232/RS485) technology, the cost is low, and the operation data of a plurality of servo systems in the local area network can be collected and analyzed at the same time; by adopting a specific protocol and a corresponding method, the minimum sampling period is 125us, so that data with higher precision in a servo system can be monitored; the method supports data sampling of at most 16 servo slave stations, and basically covers most occasions of servo equipment; meanwhile, the serial bus technology is widely applied in various domestic industrial fields at present, and is convenient for users to debug and improve on site.
Drawings
Fig. 1 is a schematic flow diagram of a data configuration frame received from a station;
fig. 2 is a schematic flow chart of a primary station transmitting a data request frame;
fig. 3 is a schematic diagram comparing two kinds of sampling data at the time of triggering.
Detailed Description
The invention is based on a mechanism of 'asking for one answer without asking for one answer', and a main station (or an upper computer) actively sends out commands which comprise 'data configuration frames' and 'data request frames'. According to the principle of 'configuration first and request later', a main station sends a broadcast configuration frame to a local area network, each slave station starts configuration after receiving the configuration frame sent by the main station, the slave stations send 'data configuration response frames' to the main station in sequence according to the station numbers of the slave stations after the configuration process is finished, and the main station sends 'data request frames' to each slave station in sequence after receiving the response frames of all the slave stations.
The data acquisition process mainly comprises the following steps:
1. data sampling configuration-the master station performs uniform configuration on the servo of the target slave station in the local area network.
2. After sampling data transmission-data configuration is completed, the master station respectively initiates data request frames to each slave station device, and after all data of one slave station device are transmitted, the master station initiates data request frames to a second slave station device, and so on.
3. And (3) processing data of the master station, namely the master station sorts and analyzes the sampled data of all target slave stations, performs basic processing (including filtering, mean processing, curve fitting and the like) on all data, displays the data and allows a client to store, import, export, view and sort the data.
The data sampling configuration is shown in fig. 1 and comprises the following steps:
1. the master station sends data configuration commands to all slave station servo drivers in the local area network in a broadcast mode.
2. After receiving the data configuration frame of the master station, the slave station servo driver firstly checks the station number, and if the station number is 0xFF, the station number indicates that the frame is a broadcast frame of the master station, and the slave station responds. The station numbers of the master station and each slave station need to be manually set in advance.
3. If the function code is 0x41, the frame is the data acquisition configuration frame sent by the master station. Otherwise, the error response processing of the work performance code is carried out to the master station.
Wherein, the function code of the data configuration frame is 0x41, the function code of the data configuration response frame is 0x41, and the function code of the data configuration exception response frame is 0x 51; the function code of the data request frame is 0x42, the function code of the data request response frame is 0x42, and the function code of the data request exception response frame is 0x 52.
4. And (3) masking bit pairing, wherein 1 in bit0 indicates that the station # 1 is a data acquisition object, 1 in bit1 indicates that the station # 2 is a data acquisition object …, 1 in bit15 indicates that the station # 16 is a data acquisition object, and the like. Each slave station checks whether the corresponding shielding position is 1 according to the station number of the slave station, if the corresponding shielding position is 1, the slave station is listed as a data acquisition object, the pairing is successful, the received data configuration frame needs to be further processed, and otherwise, the frame is discarded and no response is given.
The mask bit is 2 bytes (8 bits are one byte), and the number of the mask bits is 16bits, so that the servo of 16 slave stations can be determined at most.
5. Directly extracting the number of the slave stations of Byte15, determining the length of the data configuration frame according to the number of the slave stations, calculating a Cyclic Redundancy Check (CRC) value according to the length of the frame, comparing the calculated CRC value with the CRC value in the data frame, if the CRC values are the same, further processing the data frame, and if the CRC values are different, performing check error response processing on the master station.
The primary purpose of this step is that the slave station determines the length of the frame, i.e. determines the position of the CRC in the data configuration frame, according to the number of the slave stations in the data configuration frame sent by the master station, and the slave station calculates the CRC value by itself and then compares the CRC value with the CRC value in the data configuration frame to determine whether the data configuration frame is correct.
Wherein, the length of the whole frame is determined by different values of the field of the number of the secondary stations in the data configuration frame. The slave station needs to clearly know the length of the data configuration frame sent by the master station, so that the position of the CRC in the data configuration frame can be known, and then the CRC can be compared with the CRC value calculated by the slave station, and whether the frame is available or not is determined.
6. If the CRC value is checked to be correct, the Byte5 trigger option value is extracted, and parameters such as a trigger mode, a trigger edge, a trigger axis and the like are further extracted.
7. Extracting the trigger values of Byte 6-Byte 9.
8. And extracting trigger delay values of Byte 10-Byte 11, and when the trigger mode is triggered under the condition, the slave station calculates the response delay time according to the trigger delay values, and starts data sampling when the delay time is up.
9. Extracting Byte12 response delay, wherein the value is ms as a unit, each slave station calculates response delay time according to its own station number, for example, the response delay value is 10(ms), then the 1# slave station starts to send a response message to the master station 10ms after receiving the data configuration frame of the master station, the 2# slave station starts to send a response message to the master station 20ms after receiving the data configuration frame of the master station, and so on. The purpose of the mechanism is to make the response messages of each slave station staggered on the bus without conflict. The determination of this value is related to the baud rate.
10. The Byte13 sampling interval is extracted, and the slave station samples data according to the specification of the sampling interval.
11. And extracting a Byte14 timestamp, wherein the value is automatically generated by the master station, the slave station fills the value into a response Byte of the response message after receiving the data configuration frame, and the system determines the validity of the slave station response frame according to the timestamp.
12. And extracting a sampling item, and sampling the data by the slave station according to the sampling item.
The maximum length (16 slave axes) of the data configuration frame transmitted by the master station is 49 bytes, and the frame format is shown in the following table 1:
table 1:
the mask bits in table 1 are 16bits, i.e. a maximum of 16 slave servo stations can be determined.
The slave station has a data configuration response frame length of 5 bytes, and the frame format is shown in table 2:
table 2:
the length of the data configuration abnormal response frame of the slave station is 6 bytes, and the frame format is shown in table 3:
table 3:
after the master station sends the data sampling configuration frame to the local area network, each slave station sends a response message to the master station in sequence according to the station number of the master station, and the master station judges whether each slave station correctly receives the data configuration frame according to the response message. And if the slave station in the target slave station sequence does not reply the response message or replies an error response message, the master station continues to independently configure the slave station.
The transmission of sampled data is shown in fig. 2 and comprises the following steps:
and after the master station confirms that all target slave stations are successfully configured, the slave stations with the minimum station number sequentially transmit data request frames, and the slave stations transmit data to the master station after receiving the data request frames transmitted by the master station. The master station transmits a frame and the slave station replies to a frame, following a "question-and-answer" mechanism. After the slave station with the minimum station number transmits all the sampling data, the master station starts to transmit a data request frame to the slave station with the secondary station number, and the slave station starts to transmit the sampling data to the master station as described above. The whole process is analogized in the same way, after the master station receives all the sampling data of all the target slave stations, the transmission process of the sampling data is finished, and after all the slave stations transmit all the data, the master station processes and displays all the data transmitted by the slave stations. The length of the data request frame sent by the master station is 6 bytes, and the frame format is shown in table 4:
table 4:
the slave station has a data request response frame length of 8 bytes, and the frame format is shown in table 5:
table 5:
the length of the data request exception response frame of the slave station is 7 bytes, and the frame format is shown in table 6:
table 6:
further, when the slave station receives the data configuration frame of the master station, it monitors whether the data configuration frame is an automatic trigger or a conditional trigger.
The automatic triggering is that the slave station starts to configure and sample data immediately after receiving a data configuration frame sent by the master station, and the judgment of a data triggering condition is required. This function is generally similar to that of commonly used oscilloscopes.
And the condition triggering is that the slave station monitors whether the value of the current triggered item meets a triggering set value or not according to the triggering condition in the data configuration frame, if so, sampling is started, if not, the slave station waits for the sampling condition to be satisfied and then sampling is carried out, and otherwise, the slave station waits for the next time.
And the trigger items of the condition triggering each slave station must be the same! | A
If the trigger is automatic, data acquisition is started immediately according to the data sampling interval until 2048 buffers are full, and then a data request frame sent by the master station is ready to be received.
If the trigger condition is satisfied, the sampled data are stored into the cache, and the data sampling is started according to whether the current data value of the trigger item satisfies the trigger condition (rising edge: current value > trigger set value, falling edge: current value < trigger set value, or the following condition can be shown, the rising edge: current value is larger than the trigger value, the data sampling is started, the falling edge: current value is smaller than the trigger value, the data sampling is started), if not, the data value is stored into the cache periodically until the trigger condition is satisfied. If the trigger condition is met, the sampling value meeting the sampling condition, the data of the previous 1024 sampling points and the data of the next 1024 sampling points are reserved, and 2048 data points are calculated. The specific schematic diagram is shown in fig. 3.
The master station is operative to allow a user to save, import/export, scale up/down, filter/average, multi-curve contrast, etc. data.
The innovation point of the invention is divided into two parts:
1. the slave station servo drive adopts a cache mechanism with a certain depth (the cache depth is 2048, actually the length of an array, and the type of the array is signed 16-bit number), and the slave station drive automatically and temporarily stores the operation data in an internal cache according to the configuration information of the master station. And finally, the master station initiates a data request frame to the slave station servo drive, and the slave station driver reports the data to the master station equipment in a 'question-and-answer' mode. The mechanism can simultaneously acquire operating data of hundreds of microseconds of a plurality of servo systems even if a bus technology with lower transmission speed, such as a serial bus, is adopted.
The invention has the advantages that:
1. based on the serial bus, the cost is low.
2. The method supports simultaneous sampling of 16-axis servo data to the maximum extent, and is suitable for most equipment and industrial occasions.
3. Accurate data can be monitored with a minimum sampling period of 125us and a low baud rate by adopting a specific algorithm. 125us is the main interrupt period of our servo driver, and we can sample data in each interrupt period at the shortest.
Claims (9)
1. A multi-axis servo operation data monitoring method based on a serial bus is characterized in that: the data acquisition device comprises a master station for processing data and servo slave stations positioned in the same local area network, and the data acquisition process comprises the following steps:
(1) data sampling configuration: the master station firstly sends a command of a data configuration frame to the slave stations in a broadcast mode, so that the slave stations complete data sampling configuration and receive response frames of all the slave stations;
(2) and (3) transmission of sampling data: the master station sequentially sends a command of a data request frame to each slave station and sequentially acquires sampling data of each slave station;
(3) and (3) processing master station data: the master station sorts and analyzes the sampled data of all the target slave stations, and processes and displays all the data;
the data sampling configuration in the step (1) comprises the following steps:
1) the master station sends a data configuration command to all slave station servo drivers in the local area network in a broadcast mode;
2) after receiving the data configuration frame of the master station, the slave station servo driver firstly checks the station number, and if the station number is 0xFF, the station number indicates that the frame is a broadcast frame of the master station, and the slave station is required to respond;
3) checking the function code, if the function code is 0x41, indicating that the frame is a data acquisition configuration frame sent by the master station, and otherwise, performing error response processing on the function code to the master station;
4) shielding the bit pairing, wherein the pairing is successful, the received data configuration frame needs to be further processed, and otherwise, the frame is discarded and is not responded;
5) determining the length of a frame according to the number of slave stations in a data configuration frame sent by a master station, calculating a Cyclic Redundancy Check (CRC) value according to the length of the frame, comparing the calculated CRC value with the CRC value in the data frame, if the calculated CRC value is the same as the CRC value in the data frame, further processing the data frame, and if the calculated CRC value is different from the CRC value in the data frame, performing check error response processing on the master station;
6) if the CRC value is checked to be correct, extracting a trigger option value Byte5 of the data configuration frame, and further extracting a trigger mode, a trigger edge and a trigger axis parameter;
7) extracting the trigger values of Byte 6-Byte 9 of the data configuration frame;
8) extracting trigger delay values of Byte 10-Byte 11 of the data configuration frame, when the trigger mode is triggered by a condition, calculating response delay time by the slave station according to the trigger delay values, and starting data sampling when the delay time is up;
9) extracting a response delay value Byte12 of the data configuration frame, wherein the value takes ms as a unit, each slave station calculates response delay time according to the station number of the slave station, and the determination of the value is related to the baud rate;
10) extracting a sampling interval value Byte13 of the data configuration frame, and performing data sampling from the slave station according to the specification of the sampling interval;
11) extracting a timestamp value Byte14 of the data configuration frame, wherein the value is automatically generated by the master station, the slave station fills the value into a response Byte of a response message after receiving the data configuration frame, and the system determines the validity of the slave station response frame according to the timestamp;
12) and extracting a sampling item from the slave station, and sampling data according to the sampling item.
2. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: in the data sampling configuration in the step (1), after the master station sends the data sampling configuration frame to each slave station in the local area network, each slave station sends a response message to the master station in sequence according to the station number of the master station, and the master station judges whether each slave station correctly receives the data configuration frame according to the response message; and if the slave station in the target slave station sequence does not reply the response message or replies an error response message, the master station continues to independently configure the slave station.
3. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: in the step 2), the station numbers of the master station and each slave station should be manually set in advance.
4. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: in step 3), the function code of the data configuration frame is 0x41, the function code of the data configuration response frame is 0x41, and the function code of the data configuration exception response frame is 0x 51; the function code of the data request frame is 0x42, the function code of the data request response frame is 0x42, and the function code of the data request exception response frame is 0x 52.
5. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: in the step 4), when the mask bit is paired, the mask bit is 2 bytes, 8 bits are one byte, and 16bits are total, so that 16 slave station servos are determined; setting bit0 to 1 indicates that the station 1# is a data acquisition object, setting bit1 to 1 indicates that the station 2# is a data acquisition object …, setting bit15 to 1 indicates that the station 16# is a data acquisition object, and so on; and each slave station checks whether the corresponding shielding position is 1 or not according to the own station number, and if the corresponding shielding position is 1, the slave station is listed as a data acquisition object.
6. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: the transmission of the sampling data in the step (2) comprises the following steps:
1) after the master station confirms that all target slave stations are successfully configured, the master station starts to sequentially send data request frames from the slave station with the minimum station number;
2) the slave station transmits data to the master station after receiving the data request frame sent by the master station, and follows a 'one-question one-answer' mechanism;
3) after the slave station with the minimum station number transmits all the sampling data, the master station starts to transmit a data request frame to the slave station with the secondary station number, and the slave station starts to transmit the sampling data to the master station as before;
4) and by analogy, after the master station receives all the sampling data of all the target slave stations, the transmission process of the sampling data is finished, and after all the slave stations transmit all the data, the master station processes and displays all the data transmitted by the slave stations.
7. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: the longest length of a data configuration frame sent by the master station is 49 bytes, the length of a data configuration response frame of the slave station is 5 bytes, and the length of a data configuration abnormal response frame of the slave station is 6 bytes; the length of a data request frame sent by the master station is 6 bytes, the length of a data request response frame of the slave station is 8 bytes, and the length of a data request abnormal response frame of the slave station is 7 bytes.
8. The serial bus based multi-axis servo operation data monitoring method according to claim 1, wherein: the command of the data configuration frame comprises two trigger modes of automatic triggering and conditional triggering, wherein the automatic triggering is that the slave station immediately starts to perform data configuration and sampling after receiving the data configuration frame sent by the master station, and the judgment of the data triggering condition is required; and the condition triggering is that the slave station monitors whether the value of the current triggered item meets a triggering set value or not according to the triggering condition in the data configuration frame, if so, sampling is started, if not, the slave station waits for the sampling condition to be satisfied and then sampling is carried out, and otherwise, the slave station waits for the next time.
9. The serial bus based multi-axis servo operation data monitoring method of claim 8, wherein: when the system is automatically triggered, data acquisition is immediately started according to data sampling intervals until 2048 caches are fully stored, and then a data request frame sent by a master station is ready to be received;
when the condition is triggered, firstly, the sampled data are stored in a cache, whether the triggering condition is met or not is judged according to the current data value of the triggering item, if the triggering condition is not met, the data value is stored in the cache periodically until the triggering condition is met, and if the triggering condition is met, the sampled value meeting the sampling condition, the data of previous 1024 sampling points and the data of next 1024 sampling points are reserved, and 2048 data points are counted.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810118864.1A CN108322291B (en) | 2018-02-06 | 2018-02-06 | Multi-axis servo operation data monitoring method based on serial bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201810118864.1A CN108322291B (en) | 2018-02-06 | 2018-02-06 | Multi-axis servo operation data monitoring method based on serial bus |
Publications (2)
Publication Number | Publication Date |
---|---|
CN108322291A CN108322291A (en) | 2018-07-24 |
CN108322291B true CN108322291B (en) | 2021-03-02 |
Family
ID=62903576
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201810118864.1A Active CN108322291B (en) | 2018-02-06 | 2018-02-06 | Multi-axis servo operation data monitoring method based on serial bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN108322291B (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109600258B (en) * | 2018-12-10 | 2022-02-22 | 英赛克科技(北京)有限公司 | Industrial protocol message recording device and method |
CN110213074B (en) * | 2019-03-07 | 2022-03-11 | 腾讯科技(深圳)有限公司 | Distributed protocol exception construction method, system and device |
CN110166952B (en) * | 2019-05-23 | 2021-04-09 | 西安电子科技大学 | Wireless sensor network data acquisition method and system based on broadcast synchronization |
CN111447253B (en) * | 2020-02-28 | 2021-06-25 | 清华大学 | Buffer management method, system, device and storage medium |
CN114800492A (en) * | 2022-04-11 | 2022-07-29 | 深圳市大族机器人有限公司 | Method, system, computer device and storage medium for controlling slave station terminal |
Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998059466A1 (en) * | 1997-06-24 | 1998-12-30 | Phoenix Contact Gmbh & Co. | Coupling arrangement for a master-slave bus system |
CN102332971A (en) * | 2010-07-14 | 2012-01-25 | 沈阳高精数控技术有限公司 | Field-bus full duplex reliable communication method for numerical control system |
CN102957598A (en) * | 2011-08-16 | 2013-03-06 | 上海协同科技股份有限公司 | Automatic data acquisition method of electric system |
CN103809547A (en) * | 2012-11-14 | 2014-05-21 | 沈阳高精数控技术有限公司 | Control system and method of servo driver field bus interface |
CN106850176A (en) * | 2016-11-23 | 2017-06-13 | 西安昆仑工业(集团)有限责任公司 | Cannon distributed data Master-slave parallel harvester and method |
-
2018
- 2018-02-06 CN CN201810118864.1A patent/CN108322291B/en active Active
Patent Citations (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO1998059466A1 (en) * | 1997-06-24 | 1998-12-30 | Phoenix Contact Gmbh & Co. | Coupling arrangement for a master-slave bus system |
CN102332971A (en) * | 2010-07-14 | 2012-01-25 | 沈阳高精数控技术有限公司 | Field-bus full duplex reliable communication method for numerical control system |
CN102957598A (en) * | 2011-08-16 | 2013-03-06 | 上海协同科技股份有限公司 | Automatic data acquisition method of electric system |
CN103809547A (en) * | 2012-11-14 | 2014-05-21 | 沈阳高精数控技术有限公司 | Control system and method of servo driver field bus interface |
CN106850176A (en) * | 2016-11-23 | 2017-06-13 | 西安昆仑工业(集团)有限责任公司 | Cannon distributed data Master-slave parallel harvester and method |
Non-Patent Citations (1)
Title |
---|
《基于片上网络资源节点的通信协议研究》;李彦民等;《太原理工大学学报》;20120331;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN108322291A (en) | 2018-07-24 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108322291B (en) | Multi-axis servo operation data monitoring method based on serial bus | |
CN107544463B (en) | Automatic test method and test device for diagnosis function of vehicle controller | |
CN112235326A (en) | Internet of things equipment data analysis method and device and electronic equipment | |
CN109725572A (en) | A kind of multisensor accurate clock synchronization system and method | |
CN1929412B (en) | Apparatus and method for dynamically debugging a multi-node network | |
CN104506376A (en) | Multichannel redundant CAN (Controller Area Network) bus test system with frame start sensitive synchronous trigger function | |
CN113776794A (en) | Fault diagnosis method, device and system for embedded edge computing | |
CN111106990B (en) | Self-diagnosis method for loop of underwater multi-channel signal acquisition and transmission array system | |
CN113568960A (en) | Real-time analysis method and system for data of Internet of things and computer readable storage medium | |
CN110535972B (en) | Centralized control and communication system, equipment and readable storage medium for platform gas detection equipment | |
CN110989509B (en) | Automatic control method and device for production line, terminal equipment and storage medium | |
CN115265982A (en) | Sampling control method of multi-module data acquisition unit and multi-module data acquisition unit | |
CN111002328A (en) | Wheeled robot checking system and method | |
CN114326590A (en) | Machine tool data acquisition and sharing device and acquisition method thereof | |
CN113032320A (en) | Asynchronous serial port communication baud rate self-adaption method | |
CN115086384B (en) | Remote control test method, device, equipment and storage medium | |
CN103368786A (en) | Method and device for testing controller local area network bus data | |
CN114740425A (en) | Bluetooth positioning method and system fusing path planning information | |
CN103048634A (en) | Power instrument detecting method | |
CN106685380A (en) | Accurate obtaining processing method of switching value rising edge signal of control system | |
CN111487920A (en) | Data acquisition and processing system | |
CN112597081A (en) | UART software implementation method based on low-voltage Internet of things sensing terminal | |
CN114310898B (en) | Robot arm synchronous control system and control method | |
CN101197807A (en) | Intelligent communication server | |
CN218068136U (en) | Motor current waveform acquisition and analysis system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |