Sensor starting method and system, electronic equipment and storage medium
Through automated sensor startup and configuration methods in the robot controller, the problems of manual configuration complexity and adaptation range limitations in the prior art are solved, and a higher level of automation and lower maintenance costs are achieved.
Patent Information
- Application Number
- CN202411695454.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-22
- Publication Date
- 2025-03-18
AI Technical Summary
In actual applications, existing six-dimensional torque sensors need to manually configure communication methods and parameters, resulting in increased usage complexity, limited adaptation range, and may lead to errors in force control functions and increase maintenance costs.
Provide a sensor startup method, which automatically obtains the communication type and preset startup parameters of the sensor through the robot controller, querys the target configuration parameters from the pre-created database, automatically configures the sensor communication parameters and makes startup attempts until the maximum number of attempts is achieved.
The sensor startup and configuration process is simplified, manual intervention is reduced, the robot can adapt to the sensor, reduce maintenance costs, and improve system stability and reliability.
Smart Images

Figure CN119644833A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication technology, and in particular to a sensor activation method, system, electronic device and storage medium. Background Art
[0002] As a high-precision force and torque measurement tool, the six-dimensional force and torque sensor is widely used in robotics, aerospace, automotive electronics, medical equipment and other fields. Especially in the field of robotics, the six-dimensional torque sensor is usually installed at the end of the robotic arm, and communicates with the controller through the input and output interface (IO interface) at the end, or is directly connected to the control cabinet through the network port, so as to provide the robot with external force conditions, thereby enhancing the robot's "tactile perception" ability and improving the robot's intelligence level.
[0003] At present, there are many types of six-dimensional torque sensors, and different types of sensors can support multiple communication methods, such as UDP, TCP / IP and RS485. Although the existing six-dimensional torque sensors are quite mature in function, in actual applications, users still need to manually configure the communication method and communication parameters according to the brand and model of the sensor to start the sensor. Due to the large differences in communication parameters of sensors of different brands and models, the above manual operation method not only increases the complexity of use, but also limits the adaptation range of the robot. In addition, if the sensor fails to start normally, it may cause errors in force control related functions, thereby increasing the maintenance cost of the robot. Summary of the invention
[0004] The purpose of the present application is to provide a sensor startup method, system, electronic device and storage medium to address the deficiencies in the above-mentioned prior art, so as to solve the problem that the manual operation method in the prior art not only increases the complexity of use, but also limits the adaptation range of the robot, and also causes errors in force control related functions, thereby increasing the maintenance cost of the robot.
[0005] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0006] In a first aspect, an embodiment of the present application provides a sensor activation method, which is applied to a robot controller, and the method includes:
[0007] In response to the robot arm being powered on, the communication type of the sensor installed at the end of the robot arm is obtained, and the preset start number and the preset start interval are obtained, wherein the preset start number is used to indicate the maximum number of attempts to configure the communication parameters of the sensor and start the sensor, and the preset start interval is used to indicate the interval between two adjacent configurations of the communication parameters of the sensor and the start of the sensor;
[0008] Based on the communication type, the target configuration parameters of the sensor are queried from a pre-created database according to the preset number of startup times and the preset startup interval time, and the communication parameters of the sensor are configured according to the target configuration parameters, and the sensor is started, wherein the database is pre-stored in the robot controller, and the database includes multiple communication types and at least one configuration parameter corresponding to each communication type.
[0009] As a possible implementation manner, based on the communication type, querying the target configuration parameters of the sensor from a pre-created database according to the preset startup number and the preset startup interval, configuring the communication parameters of the sensor according to the target configuration parameters, and starting the sensor, includes:
[0010] According to the communication type, querying the target configuration parameter corresponding to the communication type from the database;
[0011] configuring the communication parameters of the sensor according to the target configuration parameters and starting the sensor;
[0012] Based on a preset self-check strategy, determining whether the sensor is successfully started;
[0013] If the startup fails, wait for the preset startup interval time, reconfigure the communication parameters of the sensor and start the sensor, and execute the process in a loop until the maximum number of attempts to configure the communication parameters of the sensor and start the sensor reaches the preset startup number.
[0014] As a possible implementation manner, determining whether the sensor is successfully started based on a preset self-check strategy includes:
[0015] Sending a data transmission instruction to the sensor so that the sensor sends test data to the robotic arm;
[0016] Collecting data transmission information, and determining the data transmission rate and communication delay based on the data transmission information, wherein the data transmission information includes: sampling duration, number of data bits, data transmission start time when the sensor sends the test data to the manipulator, and time when the manipulator receives the test data;
[0017] Based on the data transmission rate and the communication delay, the communication quality is determined, and it is determined whether the sensor is successfully started according to the communication quality.
[0018] As a possible implementation manner, determining the communication quality based on the data transmission rate and the communication delay includes:
[0019] Determine the communication delay threshold according to the sampling period of the robot controller;
[0020] If the communication delay is less than the communication delay threshold, and the data transmission rate is greater than a first preset value, it is determined that the communication quality is qualified.
[0021] As a possible implementation, the sensor includes a torque sensor, and determining whether the sensor is successfully started based on a preset self-check strategy includes:
[0022] monitoring torque data of the torque sensor and determining data quality of the torque data;
[0023] Whether the torque sensor is successfully started is determined according to the data quality of the torque data.
[0024] As a possible implementation manner, determining the data quality of the torque data includes:
[0025] Acquire first force information of the torque sensor, where the first force information includes force values in multiple force directions;
[0026] The data quality of the torque data is determined according to the force values in each of the force directions and the preset force thresholds corresponding to each of the force directions.
[0027] As a possible implementation manner, determining the data quality of the torque data includes:
[0028] Acquire second force information of the torque sensor, where the second force information includes force mean square error in multiple force directions;
[0029] The data quality of the torque data is determined according to the mean square error of the forces in each of the force directions and a preset mean square error threshold of the forces corresponding to each of the force directions.
[0030] As a possible implementation manner, the method further includes:
[0031] Determining a communication rate adjustment amount according to a communication mode between the sensor and the robotic arm;
[0032] According to the communication rate adjustment amount, the communication rate between the sensor and the mechanical arm is reduced to obtain an adjusted communication rate.
[0033] As a possible implementation manner, determining the communication rate adjustment amount according to the communication mode between the sensor and the mechanical arm includes:
[0034] Determine communication rate fallback information according to the communication mode between the sensor and the robotic arm, wherein the communication rate fallback information includes: a reference communication rate, a minimum communication rate, a preset proportional coefficient, and a preset function power value;
[0035] The communication rate adjustment amount is determined according to a preset communication rate backoff function and the communication rate backoff information, wherein the preset communication rate backoff function is used to indicate an association relationship between the communication rate adjustment amount and the communication rate backoff information.
[0036] In a second aspect, an embodiment of the present application provides a sensor activation system, the system comprising: a robotic arm, a sensor, and a robot controller, the sensor being mounted at the end of the robotic arm;
[0037] The robot controller is used to execute the steps of the sensor startup method described in any one of the first aspects above.
[0038] In a third aspect, an embodiment of the present application provides an electronic device, comprising: a processor, a storage medium and a bus, wherein the storage medium stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the storage medium through the bus, and the processor executes the machine-readable instructions to perform the steps of the sensor startup method as described in any one of the first aspects above.
[0039] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the sensor startup method as described in any one of the above-mentioned first aspects are executed.
[0040] According to the sensor startup method, system, electronic device and storage medium of the embodiment of the present application, in response to the power-on of the mechanical arm, the communication type of the sensor installed at the end of the mechanical arm is obtained, and the preset startup number and the preset startup interval are obtained. Based on the communication type, the target configuration parameters of the sensor are queried from the pre-created database according to the preset startup number and the preset startup interval, and the communication parameters of the sensor are configured according to the target configuration parameters, and the sensor is started. According to the embodiment of the present application, when the mechanical arm is powered on, the robot controller automatically initializes and prepares to configure and start the sensor communication, detects the sensor installed at the end of the mechanical arm and obtains the communication type of the sensor, and obtains the pre-configured preset startup number and the preset startup time interval, queries the target configuration parameters of the sensor from the pre-created database based on the communication type, automatically configures the communication parameters of the sensor according to the target configuration parameters, and starts the sensor according to the preset startup number and startup time interval, and checks the status of the sensor after each startup to determine whether the sensor is successfully started, and then determines whether the communication between the mechanical arm and the sensor is successful. The present application reduces manual intervention and simplifies the operation process through automated configuration and startup strategies, and greatly expands the adaptation range of the robot by automatically identifying different types of sensors and performing corresponding configurations according to their communication types. In addition, by setting multiple startup attempts and interval times, it is possible to better cope with various problems that may arise during the sensor startup process, detect and handle sensor failures in a timely manner, and reduce downtime and maintenance costs caused by sensor problems. BRIEF DESCRIPTION OF THE DRAWINGS
[0041] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0042] Figure 1 A schematic diagram of the architecture of a sensor startup system provided in an embodiment of the present application is shown;
[0043] Figure 2 A schematic diagram of a flow chart of a sensor startup method provided in an embodiment of the present application is shown;
[0044] Figure 3 A schematic diagram of a flow chart of another sensor startup method provided in an embodiment of the present application is shown;
[0045] Figure 4 A flow chart of a communication rate adjustment method provided in an embodiment of the present application is shown;
[0046] Figure 5 A schematic diagram of a flow chart of a sensor communication and startup method provided in an embodiment of the present application is shown;
[0047] Figure 6 A schematic structural diagram of an electronic device provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0048] To make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the drawings in the present application only serve the purpose of explanation and description and are not used to limit the scope of protection of the present application. In addition, it should be understood that the schematic drawings are not drawn in real proportion. The flowchart used in this application shows the operations implemented according to some embodiments of the present application. It should be understood that the operations of the flowchart can be implemented out of sequence, and the steps without logical context can be reversed in order or implemented simultaneously. In addition, those skilled in the art can add one or more other operations to the flowchart under the guidance of the content of the present application, or remove one or more operations from the flowchart.
[0049] In addition, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various configurations. Therefore, the following detailed description of the embodiments of the present application provided in the drawings is not intended to limit the scope of the application claimed for protection, but merely represents the selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present application.
[0050] In order to enable those skilled in the art to use the contents of this application, the following implementation is provided in conjunction with a specific application scenario, "Adaptive communication configuration and startup strategy of a six-dimensional torque sensor based on a robotic arm". For those skilled in the art, the general principles defined herein can be applied to other embodiments and application scenarios without departing from the spirit and scope of this application. Although this application is mainly described around the sensor startup method, it should be understood that this is only an exemplary embodiment.
[0051] It should be noted that the term "comprising" will be used in the embodiments of the present application to indicate the existence of the features declared thereafter, but does not exclude the addition of other features.
[0052] Figure 1 FIG. 1 is a schematic diagram showing the architecture of a sensor activation system provided by an embodiment of the present application. Figure 1As shown, the sensor activation system includes a robotic arm, a sensor installed at the end of the robotic arm, and a robot controller, and the robot controller can be connected to the robotic arm and the sensor in communication to achieve control of the robotic arm and the sensor. The sensor can be a torque sensor, such as a six-dimensional torque sensor, and the robot controller can use a control cabinet as a carrier to control the robotic arm body and various components on the robotic arm, and process various input and output interfaces and communication functions.
[0053] Optionally, in an embodiment of the present application, a pre-created parameter database for communication types of various sensors is stored in the robot controller to implement information management of configuration parameters corresponding to various communication types. During the sensor startup process, the robot controller can search and adapt the target configuration parameters corresponding to the communication type of the sensor installed at the end of the robot arm from the database, and automatically configure the communication parameters of the sensor according to the target configuration parameters, and according to the pre-set sensor startup times and startup interval time, try to configure the communication parameters and turn on the sensor within a fixed startup number, wherein the startup interval time provides the effective time for the sensor configuration, and the startup times limit the timeout time of the sensor startup.
[0054] Based on this, the sensor startup system provided in the embodiment of the present application reduces manual intervention and simplifies the operation process through automatic configuration and startup strategy, performs corresponding communication configuration according to the sensor communication type, and expands the robot adaptation range. In addition, by setting multiple startup attempts and interval time, various problems that may occur during the sensor startup process can be better discovered and handled, reducing downtime and maintenance costs caused by sensor problems.
[0055] The following is combined with the above Figure 1 The contents described in the sensor startup system shown are used to explain in detail the sensor startup method provided in the embodiment of the present application.
[0056] Reference Figure 2 FIG. 1 is a flow chart of a sensor activation method provided in an embodiment of the present application, wherein the execution subject of the method is a robot controller. Figure 2 As shown, the method specifically comprises the following steps:
[0057] S201. In response to the robot arm being powered on, obtain the communication type of the sensor installed at the end of the robot arm, and obtain the preset number of startups and the preset startup interval time.
[0058] Optionally, the preset number of startup times is used to indicate a maximum number of attempts to configure communication parameters of the sensor and to start the sensor, and the preset startup interval is used to indicate an interval between two adjacent configurations of communication parameters of the sensor and startups of the sensor.
[0059] Optionally, the communication type is used to determine how to communicate with the sensor, including but not limited to the following communication protocols: UDP (User Datagram Protocol), TCP / IP (Transmission Control Protocol / Internet Protocol), RS485 (Recommended Standard 485). When the robot arm is powered on, the robot controller starts initialization and prepares to configure and start the sensor. The robot controller detects the sensor installed at the end of the robot arm and obtains the communication type of the sensor to determine how to communicate with the sensor.
[0060] Optionally, the preset number of startup times is used to prevent the robot controller from infinitely looping attempts to configure and start the sensor, ensuring that the sensor startup process is completed within a reasonable time or reporting failure. For example, if the preset number of startup times is 5, the robot controller will try to configure and start the sensor up to 5 times. If the sensor is not successfully started in these 5 attempts, the robot controller will terminate the startup process and report a corresponding error prompt. The preset startup interval time is used to provide sufficient execution time to ensure that each configuration and startup operation can be completed to avoid failures caused by too fast operations. For example, if the preset startup time interval is 10 seconds, the robot controller waits 10 seconds between each attempt to configure and start the sensor to ensure that each configuration and startup operation has enough time to complete to avoid failures caused by insufficient time.
[0061] S202 . Based on the communication type, query the target configuration parameters of the sensor from a pre-created database according to the preset start times and the preset start interval time, configure the communication parameters of the sensor according to the target configuration parameters, and start the sensor.
[0062] Optionally, the database includes multiple communication types and at least one configuration parameter corresponding to each communication type. The present application establishes a parameter database for various communication types in advance, such as creating a Redis database, and establishes a mapping relationship between various communication types and at least one configuration parameter corresponding to various communication types and stores them in the database, so that after determining the communication type of the sensor, the target configuration parameters corresponding to the determined communication type can be directly queried from the database for communication configuration. Taking the above-mentioned communication types including UDP, TCP / IP, and RS485 as an example, the configuration parameters corresponding to the communication type UDP include but are not limited to port number, IP address, etc., the configuration parameters corresponding to the communication type TCP / IP include but are not limited to port number, IP address, timeout period, etc., and the configuration parameters corresponding to the communication type RS485 include but are not limited to baud rate, data bit, stop bit, check bit, etc.
[0063] Optionally, the robot controller queries the target configuration parameters corresponding to the communication type from the pre-created Redis database according to the communication type of the sensor, and automatically configures the communication parameters of the sensor according to the target configuration parameters, such as configuring the port number and IP address for the UDP communication type. On this basis, the robot controller attempts to start the sensor according to the preset number of startups and the preset startup interval time. The number of attempts may be one or more. Specifically, the first attempt is to configure the communication parameters of the sensor and try to start the sensor. If the first attempt fails, wait for the preset startup interval time before making a second attempt, and repeat the above steps until the preset number of startups is reached or the sensor is successfully started.
[0064] Based on this, according to the sensor startup method provided in the embodiment of the present application, when the robot arm is powered on, the robot controller automatically initializes and prepares to configure and start the sensor communication, detects the sensor installed at the end of the robot arm and obtains the communication type of the sensor, and obtains the pre-configured preset startup times and preset startup time intervals, queries the target configuration parameters of the sensor from a pre-created database based on the communication type, automatically configures the communication parameters of the sensor according to the target configuration parameters, and starts the sensor according to the preset startup times and startup time intervals. After each startup, the status of the sensor is checked to determine whether the sensor is successfully started, and then determine whether the communication between the robot arm and the sensor is successful. The present application reduces manual intervention and simplifies the operation process by automating the configuration and startup process, and by automatically identifying different types of sensors and performing corresponding configurations according to their communication types, the robot's adaptation range is greatly expanded. In addition, by setting multiple startup attempts and interval times, it can better cope with various problems that may occur during the sensor startup process, timely discover and handle sensor failures, and reduce downtime and maintenance costs caused by sensor problems.
[0065] Figure 3 FIG. 2 is a flow chart of another sensor activation method provided in an embodiment of the present application. Figure 3 As shown, the method specifically comprises the following steps:
[0066] S301. According to the communication type, query the target configuration parameters corresponding to the communication type from the database.
[0067] For example, in the database, the communication type and the configuration parameters corresponding to the communication type can be stored in the form of a table structure, so as to more intuitively display the mapping relationship between the communication type and the configuration parameters. On this basis, the query statement is used to insert the target configuration parameters corresponding to the communication type from the table structure stored in the database.
[0068] S302: Configure the communication parameters of the sensor according to the target configuration parameters and start the sensor.
[0069] Exemplarily, according to the communication type of the sensor, a corresponding physical interface is used to establish a network connection between the sensor and the robot controller, on this basis, the robot controller automatically configures the communication parameters of the sensor according to the target configuration parameters obtained from the database.
[0070] Exemplarily, starting the sensor includes physical starting and software starting. Physical starting refers to powering on the sensor to ensure that the sensor is properly connected to a power source. Software starting refers to restarting the sensor after configuration changes to take effect.
[0071] S303: Determine whether the sensor is started successfully based on a preset self-check strategy.
[0072] Optionally, determining whether the sensor is successfully started is based on a preset self-check strategy to ensure that the sensor functions normally and can transmit data accurately and reliably, thereby verifying whether the sensor can work as expected after startup.
[0073] As a possible implementation, the above step S303 determines whether the sensor is successfully started based on a preset self-check strategy, including:
[0074] Send a data transmission instruction to the sensor so that the sensor sends test data to the robotic arm; collect data transmission information, and determine the data transmission rate and communication delay based on the data transmission information; determine the communication quality based on the data transmission rate and communication delay, and determine whether the sensor is successfully started according to the communication quality.
[0075] Optionally, the data transmission information includes: sampling duration, number of data bits, data transmission start time when the sensor sends test data to the manipulator, and time when the manipulator receives the test data. Among them, the sampling duration is determined according to the sampling start time and sampling end time of the robot controller, which helps to understand the working efficiency of the sensor and the continuity of data transmission. The number of data bits is the total number of test data bits sent by the sensor to the manipulator within the sampling duration, which can reflect the amount of data transmission and the integrity of the data. The data transmission start time when the sensor sends test data to the manipulator refers to the time point when the sensor starts to transmit the test data, which helps to determine the starting time of data transmission for subsequent time analysis. The time when the manipulator receives the test data refers to the time point when the manipulator successfully receives the test data sent by the sensor, which is used to calculate the communication delay and evaluate the real-time performance of data transmission.
[0076] Exemplarily, the data transmission rate may be determined according to the following formula (1):
[0077] R=N / Δt (1)
[0078] Where R represents the data transmission rate, N represents the number of data bits, and Δt represents the sampling duration.
[0079] Exemplarily, the communication delay may be determined according to the following formula (2):
[0080] Δt d =t r -t w (2)
[0081] Among them, Δt d represents the communication delay, t r Indicates the time when the robot arm receives the test data, t w Indicates the data transmission start time when the sensor sends test data to the robot arm.
[0082] Optionally, the communication quality is determined based on the data transmission rate and the communication delay, including: determining a communication delay threshold according to a sampling period of the robot controller; if the communication delay is less than the communication delay threshold and the data transmission rate is greater than a first preset value, the communication quality is determined to be qualified.
[0083] Exemplarily, the first preset value is set to M, for example, and the first preset value M is used as a judgment condition to measure whether the communication rate is qualified. For example, if the data transmission rate is less than the reference value M, the communication rate is determined to be unqualified. The communication delay threshold and the sampling period of the robot controller may be in a multiple relationship. For example, the communication delay threshold is set to 3 sampling periods of the robot controller. If the communication delay is greater than 3 sampling periods of the robot controller, the communication delay is determined to be too large. On this basis, if the communication delay is too large and the communication rate is unqualified, the communication quality is determined to be unqualified. On the contrary, if the communication delay is less than 3 sampling periods of the robot controller and the data transmission rate is greater than the reference value R, the communication rate is determined to be qualified, and then the communication quality is determined to be qualified.
[0084] Based on this, the embodiment of the present application adds a communication detector to detect the effective data transmission rate and communication delay of the communication, so as to detect the stability and reliability of the communication.
[0085] As a possible implementation, the sensor includes a torque sensor, such as a six-dimensional torque sensor. The step S303 determines whether the sensor is successfully started based on a preset self-check strategy, including:
[0086] Monitor the torque data of the torque sensor and determine the data quality of the torque data; determine whether the torque sensor is successfully started based on the data quality of the torque data.
[0087] Optionally, the robot controller monitors the data output of the torque sensor in real time, receives and displays the torque data of the torque sensor in real time, and determines the data quality of the torque data, including checking the integrity, accuracy, stability, response time, etc. of the torque data. Among them, the data integrity is determined by checking whether the torque data is continuous and complete, without missing or abnormal interruption. If the data is missing or interrupted, it may be that the sensor is not working properly or there is a problem with the data transmission. The data accuracy is determined by analyzing whether the value range of the torque data is reasonable and matches the range and accuracy of the sensor, or by comparing historical data or standard values to check whether the current data has abnormal fluctuations or deviations. If the data value is abnormal, it may be that the sensor measurement is inaccurate or subject to external interference. The data stability is determined by observing whether the torque data remains stable over a period of time without frequent fluctuations or mutations. If the data stability is poor, it may be that the sensor is affected by environmental factors or its own stability is insufficient. The response time is determined by testing the response time of the sensor to external torque changes to ensure that the sensor can respond quickly and accurately. If the response time is too long, it may be that the sensor sensitivity is insufficient or there is a delay problem.
[0088] Optionally, determining the data quality of the torque data includes: obtaining first force information of the torque sensor; and determining the data quality of the torque data based on force values in each force direction and a preset force threshold corresponding to each force direction.
[0089] Exemplarily, the first force information includes force values in multiple force directions. For a torque sensor, the force direction generally refers to the three main directions in which the sensor can detect and measure torque, namely the x-axis direction, the Y-axis direction, and the Z-axis direction. These three directions are perpendicular to each other in three-dimensional space and together constitute the measurement space of the torque sensor.
[0090] For example, assume that the force along the x-axis is F x , the force along the Y axis is F y , the force along the Z axis is F z , the corresponding preset force threshold along the x-axis direction is [F xmin , F xmax ], the preset force threshold corresponding to the Y-axis direction is [F ymin , F ymax ], the preset force threshold corresponding to the Z-axis direction is [F zmin , F zmax On this basis, if the force range along the X-axis is F xmin <F x <F xmax , then the data quality of the moment data is qualified, otherwise the moment data exceeds the reasonable range and the data quality is unqualified. If the force range along the Y-axis direction is Fymin <F y <F ymax , then the data quality of the torque data is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified. If the force range along the Z axis is F zmin <F z <F zmax , it is determined that the data quality of the torque data is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified.
[0091] For example, assume that the force value around the x-axis is M x , the force value around the Y axis is M y , the force value around the Z axis is M z , the preset force threshold corresponding to the x-axis direction is [M xmin , M xmax ], the preset force threshold corresponding to the Y-axis direction is [M ymin , M ymax ], the preset force threshold corresponding to the Z-axis direction is [M zmin , M zmax ]. On this basis, if the force range around the x-axis is M xmin <M x <M xmax , then the torque data quality is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified. If the force range around the Y axis is M ymin <M y <M ymax , then the data quality of the torque data is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified. If the force range around the Z axis is M zmin <M z <M zmax , it is determined that the data quality of the torque data is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified.
[0092] Optionally, determining the data quality of the torque data includes: obtaining second force information of the torque sensor; and determining the data quality of the torque data based on the force mean square error in each force direction and a preset force mean square error threshold corresponding to each force direction.
[0093] Exemplarily, the second force information includes the mean square error of the forces in multiple force directions. Assume that the mean square error of the forces along the x-axis is σ x , the mean square error of the force along the Y axis is σ y , the mean square error of the force along the Z axis is σ z , the preset force mean square error threshold corresponding to the x-axis direction is [σ xmin , σ xmax], the preset force mean square error threshold corresponding to the Y-axis direction is [σ ymin , σ ymax ], the preset force mean square error threshold corresponding to the Z-axis direction is [σ zmin , σ zmax ]. On this basis, if the force range along the x-axis is σ xmin <σ x <σ xmax , then the data quality of the moment data is qualified, otherwise the moment data exceeds the reasonable range and the data quality is unqualified. If the force mean square error range along the Y-axis direction is σ ymin <σ y <σ ymax , then the data quality of the moment data is qualified, otherwise the moment data exceeds the reasonable range and the data quality is unqualified. If the force mean square error range along the Z axis is σ zmin <σ z <σ zmax , it is determined that the data quality of the torque data is qualified, otherwise the torque data exceeds the reasonable range and the data quality is unqualified.
[0094] Based on this, the embodiment of the present application adds a sensor data detector. If the force and torque data of the sensor exceed the reference range, or the deviation of the data is too large, the data quality can be determined to be unqualified. In addition, the convolutional neural network model can also be used in the present application. The convolutional neural network model is trained through machine learning algorithms and data from various application scenarios. When detecting sensor data, the trained neural network model is called to perform validity detection on the sensor data, thereby determining whether the data quality of the sensor data is qualified.
[0095] In summary, determining whether the sensor is successfully started through a self-check strategy can not only ensure that the sensor can work normally after startup, but also improve the reliability of the sensor startup system. Quickly locating faults that occur during the startup process of the sensor is crucial to ensuring the stable operation of the sensor in critical applications.
[0096] S304: If the startup fails, wait for a preset startup interval, reconfigure the communication parameters of the sensor and start the sensor, and execute the process in a loop until the maximum number of attempts to configure the communication parameters of the sensor and start the sensor reaches a preset number of startup attempts.
[0097] For example, if the robot controller fails to start the sensor in the first attempt, it will enter the retry mechanism, that is, the robot controller will wait for a preset start interval, then reconfigure the communication parameters of the sensor, and try to start the sensor again. This process will be executed repeatedly until the preset number of starts, that is, the maximum number of attempts, is reached. If the sensor is successfully started within the maximum number of attempts, the process ends. If it still fails, further troubleshooting is required.
[0098] Based on this, a retry mechanism is formulated by setting the preset number of startup times and the preset startup time interval to ensure that the sensor has a certain self-repair ability when facing startup problems, thereby improving the stability and reliability of the sensor startup system.
[0099] Figure 4 The figure shows a flow chart of a communication rate adjustment method provided in an embodiment of the present application. Figure 4 As shown, the method specifically comprises the following steps:
[0100] S401. Determine a communication rate adjustment amount according to a communication method between a sensor and a robotic arm.
[0101] Optionally, communication rate backoff information is determined according to a communication mode between the sensor and the robotic arm; and a communication rate adjustment amount is determined according to a preset communication rate backoff function and the communication rate backoff information.
[0102] Exemplarily, the communication rate fallback information includes: a reference communication rate, a minimum communication rate, a preset proportional coefficient and a preset function power value. The preset communication rate fallback function is used to indicate the correlation between the communication rate adjustment amount and the communication rate fallback information. Among them, the reference communication rate indicates the communication rate used for normal communication between the sensor and the manipulator, which can be set by the robot controller during initialization or proven to be effective in the previous communication process. The minimum communication rate indicates the lowest value to which the communication rate can be adjusted. When the communication rate is reduced to this value due to fallback, it will no longer continue to decrease to avoid complete interruption of communication. The preset proportional coefficient is a coefficient used to adjust the communication rate, which determines the magnitude of the reduction each time the communication rate falls back. The preset function power value is used to control the rate or degree of communication rate fallback in the preset communication rate fallback function. Different power values will cause the communication rate to decrease at different speeds, wherein the communication rate fallback function is used to determine the communication rate adjustment amount.
[0103] Exemplarily, the communication rate backoff function is shown in the following formula (3):
[0104] R=[R ref -λ(R ref -R min )] -k (3)
[0105] Where R represents the communication rate adjustment amount, R ref represents the reference communication rate, R min represents the minimum communication rate, λ represents the preset proportional coefficient, and k represents the preset function power value.
[0106] S402: according to the communication rate adjustment amount, reduce the communication rate between the sensor and the robot arm to obtain an adjusted communication rate.
[0107] Exemplarily, the adjusted communication rate is used for the next self-check strategy after startup. Specifically, after the first attempt to start the sensor, there is an initial communication rate between the sensor and the manipulator. If the first attempt to start the sensor is unsuccessful, before the second attempt to start the sensor, the communication rate adjustment amount is first determined based on the above formula (3), and the initial communication rate is subtracted from the communication rate adjustment amount to obtain the adjusted communication rate, and the communication rate between the sensor and the manipulator is controlled to be reduced to the adjusted communication rate, and then the second attempt to start the sensor is made.
[0108] Based on this, the present application adds a communication rate fallback strategy, which automatically reduces the communication rate to match the on-site communication environment when the communication quality and sensor data are unqualified.
[0109] Figure 5 The flowchart of the sensor communication and startup method provided by the embodiment of the present application is shown. Figure 5 As shown, this application introduces Redis database support to establish a parameter database for various communication types. After the robot arm is equipped with a sensor, the user selects the communication type of the sensor. When the robot arm is powered on, the controller attempts to retrieve the parameters in the database within a fixed number of startups at regular intervals, automatically configures the communication parameters, and starts the sensor. This process provides execution time, and the fixed number of startups ensures the timeout of the sensor startup process. If the sensor communication parameters are configured appropriately, the robot arm and the sensor can transmit data, indicating that the communication is successful. If the sensor still fails to start successfully after a fixed number of startups, the controller will terminate the startup and report an error prompt.
[0110] Furthermore, after the robot and the sensor successfully transmit data, the self-check mechanism is started. First, the default communication transmission rate is used to enter the monitoring stage of the communication rate, communication quality and sensor data quality. If a certain detection data is unqualified, the communication rate is adjusted according to the rate fallback algorithm. After the specified number of adjustments, if the communication quality and sensor data quality are both qualified, the sensor is successfully started, otherwise, the startup process is terminated. In this application, the self-check mechanism can adapt to the communication environment on site, dynamically adjust the communication rate, ensure the stability and reliability of the communication between the robot and the sensor, and also ensure the accuracy of the sensor data.
[0111] Based on this, the adaptive communication configuration and startup strategy of the sensor provided in the embodiment of the present application solves the complexity and limitation problems caused by the traditional manual configuration of sensor communication parameters and manual activation of sensors. By introducing Redis database support, the adaptive communication configuration and startup of the robot arm sensor are realized. The robot controller automatically retrieves and configures the communication parameters of the sensor when powered on, which simplifies the use process. The self-check mechanism after startup can adapt to the on-site communication environment, dynamically adjust the communication rate, and ensure the stability of communication and the accuracy of data. In addition, the present application retains the function of manually configuring and starting the sensor. The user can manually set it when necessary. After the configuration takes effect, it is saved in the system configuration file of the control cabinet for subsequent use. This not only provides a convenient and efficient automatic configuration function, but also retains the flexibility of manual configuration, which is user-friendly for both primary and advanced users.
[0112] The present application embodiment also provides an electronic device 600, such as Figure 6 As shown, it is a schematic diagram of the structure of an electronic device 600 provided in an embodiment of the present application, including: a processor 601, a memory 602, and optionally, a bus 603. The memory 602 stores machine-readable instructions executable by the processor 601. When the electronic device 600 is running, the processor 601 communicates with the memory 602 through the bus 603. When the machine-readable instructions are executed by the processor 601, the method steps in the sensor startup method described in any one of the above items are executed.
[0113] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the method steps in any of the above sensor startup methods are executed.
[0114] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, the specific working process of the system and device described above can refer to the corresponding process in the method embodiment, and will not be repeated in this application. In the several embodiments provided in this application, it should be understood that the disclosed system, device and method can be implemented in other ways. The device embodiments described above are merely schematic. For example, the division of the modules is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, indirect coupling or communication connection of devices or modules, which can be electrical, mechanical or other forms.
[0115] In addition, each functional unit in each embodiment of the present application can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or part of the technical solution that contributes to the prior art or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, RandomAccess Memory), disk or optical disk and other media that can store program code.
[0116] The above are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be covered by the protection scope of the present application.
Claims
1. A sensor startup method, characterized in that: Applied to a robot controller, the method comprises: In response to the robot arm being powered on, the communication type of the sensor installed at the end of the robot arm is obtained, and the preset start number and the preset start interval are obtained, wherein the preset start number is used to indicate the maximum number of attempts to configure the communication parameters of the sensor and start the sensor, and the preset start interval is used to indicate the interval between two adjacent configurations of the communication parameters of the sensor and the start of the sensor; Based on the communication type, the target configuration parameters of the sensor are queried from a pre-created database according to the preset number of startup times and the preset startup interval time, and the communication parameters of the sensor are configured according to the target configuration parameters, and the sensor is started, wherein the database is pre-stored in the robot controller, and the database includes multiple communication types and at least one configuration parameter corresponding to each communication type.
2. The method according to claim 1, characterized in that The method of querying the target configuration parameters of the sensor from a pre-created database according to the preset startup times and the preset startup interval based on the communication type, configuring the communication parameters of the sensor according to the target configuration parameters, and starting the sensor includes: According to the communication type, querying the target configuration parameter corresponding to the communication type from the database; configuring the communication parameters of the sensor according to the target configuration parameters and starting the sensor; Based on a preset self-check strategy, determining whether the sensor is successfully started; If the startup fails, wait for the preset startup interval time, reconfigure the communication parameters of the sensor and start the sensor, and execute the process in a loop until the maximum number of attempts to configure the communication parameters of the sensor and start the sensor reaches the preset startup number.
3. The method according to claim 2, characterized in that The step of determining whether the sensor is successfully started based on a preset self-check strategy includes: Sending a data transmission instruction to the sensor so that the sensor sends test data to the robotic arm; Collecting data transmission information, and determining the data transmission rate and communication delay based on the data transmission information, wherein the data transmission information includes: sampling duration, number of data bits, data transmission start time when the sensor sends the test data to the manipulator, and time when the manipulator receives the test data; Based on the data transmission rate and the communication delay, the communication quality is determined, and it is determined whether the sensor is successfully started according to the communication quality.
4. The method according to claim 3, characterized in that The determining of the communication quality based on the data transmission rate and the communication delay comprises: Determine the communication delay threshold according to the sampling period of the robot controller; If the communication delay is less than the communication delay threshold, and the data transmission rate is greater than a first preset value, it is determined that the communication quality is qualified.
5. The method according to claim 2, characterized in that: The sensor includes a torque sensor, and determining whether the sensor is successfully started based on a preset self-check strategy includes: monitoring torque data of the torque sensor and determining data quality of the torque data; Whether the torque sensor is successfully started is determined according to the data quality of the torque data.
6. The method according to claim 5, characterized in that Determining the data quality of the torque data includes: Acquire first force information of the torque sensor, where the first force information includes force values in multiple force directions; The data quality of the torque data is determined according to the force values in each of the force directions and the preset force thresholds corresponding to each of the force directions.
7. The method according to claim 5, characterized in that Determining the data quality of the torque data includes: Acquire second force information of the torque sensor, where the second force information includes force mean square error in multiple force directions; The data quality of the torque data is determined according to the mean square error of the forces in each of the force directions and a preset mean square error threshold of the forces corresponding to each of the force directions.
8. The method according to claim 3, characterized in that Also includes: Determining a communication rate adjustment amount according to a communication mode between the sensor and the robotic arm; According to the communication rate adjustment amount, the communication rate between the sensor and the mechanical arm is reduced to obtain an adjusted communication rate.
9. The method according to claim 8, characterized in that The step of determining the communication rate adjustment amount according to the communication mode between the sensor and the mechanical arm includes: Determine communication rate fallback information according to the communication mode between the sensor and the robotic arm, wherein the communication rate fallback information includes: a reference communication rate, a minimum communication rate, a preset proportional coefficient, and a preset function power value; The communication rate adjustment amount is determined according to a preset communication rate backoff function and the communication rate backoff information, wherein the preset communication rate backoff function is used to indicate an association relationship between the communication rate adjustment amount and the communication rate backoff information.
10. A sensor activation system, characterized in that: The system comprises: a mechanical arm, a sensor and a robot controller, wherein the sensor is installed at the end of the mechanical arm; The robot controller is used to execute the steps of the sensor activation method according to any one of claims 1 to 9.
11. An electronic device, characterized in that: include: A processor and a memory, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor executes the machine-readable instructions to perform the steps of the sensor startup method according to any one of claims 1 to 9.
12. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the sensor startup method according to any one of claims 1 to 9 are executed.