Force control robot control method and system based on fuzzy control
Technical Field
The invention belongs to the technical field of robot control, and particularly relates to a force control robot control method and system based on fuzzy control.
Background
The force control robot is a type of force control robot which is characterized in that all data acquired by all sensors are transmitted to a control system, the control system analyzes and processes the data acquired by the sensors, and control signals are generated and transmitted to an executing mechanism to execute corresponding actions. And acquiring related data at a certain execution time from each sensor, carrying out data transmission, carrying out data analysis processing, and finally generating a control signal at a certain time to control the execution mechanism. And for the next execution time, acquiring various data through various sensors and transmitting the data to a control system, and generating a control signal at the time to control the execution mechanism after the control system analyzes and processes the acquired various data. Thus, the force control robot realizes continuous action. Therefore, on the one hand, the execution of the related actions from the data acquisition to the generation of the control signals must be completed in a certain time, that is, after the signals acquired by the sensors in real time pass a certain time, the execution mechanism can execute the corresponding actions, thereby causing the execution time delay. On the other hand, corresponding data analysis and processing are needed to be executed at each moment to execute corresponding actions, so that the execution efficiency of the force control robot is low.
Therefore, how to improve the existing control method of the force control robot, reduce the execution time delay of the force control robot, and improve the execution efficiency of the force control robot is a technical problem to be solved at present.
Disclosure of Invention
The invention aims to provide a control method and a control system of a force control robot based on fuzzy control, which are used for improving the existing control method of the force control robot, reducing the execution time delay of the force control robot and improving the execution efficiency of the force control robot.
In order to solve the technical problems, the invention adopts the following technical scheme:
In a first aspect, a force control robot control method based on fuzzy control is provided, including the following steps:
S1: the method comprises the steps of collecting appearance data of a controlled object in real time through a data collecting module, wherein the appearance data comprise external shapes, sizes and materials, creating a data processing queue based on the collected appearance data of the controlled object, and sequentially transmitting the data to a fuzzy processing module through the data processing queue;
s2: the fuzzy processing module performs fuzzy processing on the appearance data of the controlled object and outputs a control signal through the fuzzy processing module; the signal prediction module predicts the control signal in the expected time period based on the control signal in the specified time period, and creates a control signal queue;
S3: verifying the predicted control signal through the controlled object appearance data acquired by the data acquisition module in real time, judging whether the predicted control signal is abnormal or not, if yes, extracting the corresponding controlled object appearance data, transmitting the corresponding controlled object appearance data to fuzzy processing, outputting the control signal after the fuzzy processing, outputting the control signal to replace the corresponding control signal in the control signal queue based on the fuzzy processing, and if not, executing the step S4;
S4: the control signal queue sequentially transmits control signals to the signal conversion module to convert digital signals into analog signals, and transmits the converted analog signals to the control module, and the control module correspondingly controls an execution mechanism of the force control robot based on the analog signals;
S5: the method comprises the steps that real-time force data acquisition is conducted on execution actions of an execution mechanism, the real-time force data are fed back to a control module through a feedback module, the control module compares the acquired real-time force data with standard force data corresponding to control signals, whether the real-time force data are in an error range or not is judged, if yes, the control module continuously conducts corresponding control on the execution mechanism of the force control robot through subsequent control signals, and if not, step S6 is conducted;
S6: comparing the real-time force data with the standard force data corresponding to the control signal, including the direction and the magnitude of the force, calculating the included angle between the direction of the real-time force data and the direction of the standard force data and the difference between the magnitude of the force of the real-time force data and the magnitude of the force of the standard force data, and carrying out compensation adjustment through the control signal based on the included angle and the difference, so that the included angle and the magnitude of the standard force data corresponding to the real-time force data and the control signal are within an error range.
Preferably, the number of the controlled objects in step S1 is a plurality, the data processing queues are sequentially created based on the plurality of the controlled objects, and the order of data processing in the data processing queues is the processing order of the plurality of the controlled objects.
Preferably, in step S2, the specific process of performing fuzzy processing on the profile data of the controlled object by the fuzzy processing module and outputting the control signal by the fuzzy processing module is as follows:
S21: creating a fuzzy processing database and a fuzzy processing rule base of the appearance data of the controlled object, wherein the fuzzy processing database stores membership vector values of all fuzzy subsets of the input appearance data of the controlled object and the output control variables;
s22: converting the appearance data of the controlled object of the data processing queue into corresponding fuzzy vectors through a fuzzification interface, and solving a fuzzy relation equation on the fuzzy vectors based on a fuzzy processing database and a fuzzy processing rule base;
s23: and obtaining a fuzzy control signal based on the solving result of the fuzzy relation equation.
Preferably, in step S2, the blurring processing module performs blurring processing on the shape data of the controlled object, and performs blurring processing using a two-dimensional blurring controller, where two input variables of the two-dimensional blurring controller are a deviation amount and a deviation variation amount of a size of the controlled object from an input standard value.
Preferably, the specific process of the signal prediction module in step S2 for predicting the control signal in the expected time period based on the control signal in the specified time period is as follows:
Acquiring a control signal in a specified time period, inputting part of the control signal in the specified time period to the signal prediction module to train a model, iteratively updating parameters of the signal prediction module through a gradient descent optimization algorithm, inputting the other part of the control signal in the specified time period to the signal prediction module, outputting the control signal through the signal prediction module to obtain a prediction result, judging whether the prediction result is in an expected range, outputting the control signal in the expected time period if the prediction result is in the expected range, and if the prediction result is not in the expected range, re-optimizing and updating the parameters of the signal prediction module through a particle swarm algorithm.
Preferably, the specific process of iteratively updating the parameters of the signal prediction module by using the gradient descent optimization algorithm is as follows:
Initializing the weight and deviation of the signal prediction module, namely setting a group of weight values and deviation values of the signal prediction module, inputting part of control signals in the specified time period into the signal prediction module for forward propagation to obtain a predicted value of the control signals, calculating errors between the predicted value and a standard value through a loss function, calculating gradients through reverse propagation based on the calculated errors, wherein the gradients are influence relations of the change of the weight and the deviation on a loss function value, updating the weight and the deviation of the signal prediction module through the gradients, updating the weight values and the deviation values, respectively subtracting products of a learning rate and the gradients through the current weight and the current deviation of the signal prediction module, wherein the learning rate is a set parameter, and finally iterating the processes until the preset iteration times are met or the loss function value is smaller than a preset threshold value.
Preferably, in step S3, the specific process of verifying the predicted control signal by the controlled object shape data collected in real time by the data collecting module to determine whether the predicted control signal has an abnormality is as follows:
s31: establishing a mapping relation table between the shape data and the control signal based on the shape data of the historical controlled object and the historical control signal;
S32: and calling a mapping relation table based on the current appearance data, extracting a corresponding control signal in the mapping relation table, comparing the corresponding control signal with the predicted control signal, judging whether the extracted corresponding control signal is in a preset confidence interval range, if so, indicating that the predicted control signal is not abnormal, and if not, indicating that the predicted control signal is abnormal.
Preferably, the specific process of compensating and adjusting by the control signal based on the included angle and the difference in step S6 is as follows:
S61: calculating a first proportion of the included angle to the included angle between the direction of the force of the standard force data and a certain coordinate direction based on the included angle between the direction of the force of the real-time force data and the direction of the force of the standard force data;
S62: performing reverse compensation on a force direction signal in the control signal based on the first ratio, wherein the reverse compensation represents compensation of a direction of the force of the real-time force data relative to a direction of the force of the standard force data;
s63: calculating a second ratio of the difference to the force of the standard force data based on the difference between the force of the real-time force data and the force of the standard force data;
S64: and carrying out reverse compensation on the magnitude signal of the force in the control signal based on the second proportion, wherein the reverse compensation indicates that when the force of the real-time force data is larger than the force of the standard force data, the magnitude signal of the force in the control signal is subjected to the process of adjusting the corresponding proportion, and when the force of the real-time force data is smaller than the force of the standard force data, the magnitude signal of the force in the control signal is subjected to the process of adjusting the corresponding proportion.
The force control robot control system based on fuzzy control is characterized by comprising a data acquisition module, a data processing queue, a fuzzy processing module, a control signal queue, a signal prediction module, a signal inspection module, a signal conversion module, a control module, an execution mechanism and a feedback module, wherein the data acquisition module is connected with the data processing queue, the data processing queue is connected with the fuzzy processing module, the fuzzy processing module is respectively connected with the control signal queue and the signal prediction module, the signal prediction module is connected with the signal inspection module, the control signal queue is connected with the signal conversion module, the signal conversion module is connected with the control module, the control module is connected with the execution mechanism, and the execution mechanism is connected with the feedback module;
The data acquisition module is used for acquiring the appearance data of the controlled object in real time, wherein the appearance data comprises external shapes, sizes and materials; the fuzzy processing module is used for carrying out fuzzy processing on the appearance data of the controlled object and outputting a control signal through the fuzzy processing module; the control module is used for performing action control on the executing mechanism based on the control signal, and performing compensation adjustment through the control signal based on the included angle and the difference value, so that the included angle and the size of the real-time force data and the standard force data corresponding to the control signal are both within an error range; the executing mechanism is used for executing corresponding actions based on the control signals of the control module; the feedback module is used for feeding back the real-time actions executed by the executing mechanism to the control module.
The beneficial effects of the invention include:
The control method and the control system of the force control robot based on fuzzy control provided by the invention are used for collecting the shape data of the controlled object in real time, creating a data processing queue, carrying out fuzzy processing on the shape data of the controlled object, and outputting a control signal through a fuzzy processing module; the signal prediction module predicts the control signal in the expected time period and creates a control signal queue; and verifying the predicted control signal, and judging whether the predicted control signal is abnormal or not. Transmitting control signals to the signal conversion module in sequence to convert digital signals into analog signals, transmitting the analog signals to the control module, and correspondingly controlling the execution mechanism; and feeding the real-time force data back to the control module through the feedback module, comparing the acquired real-time force data with standard force data corresponding to the control signal, and if the real-time force data is not in an error range, comparing the real-time force data with the corresponding standard force data, and carrying out compensation adjustment through the control signal based on the included angle and the difference value.
Firstly, the appearance data of the controlled object is subjected to fuzzy processing through a fuzzy processing module, and a control signal is output through the fuzzy processing module, so that an accurate mathematical model between the appearance data of the controlled object and the control signal in the force control process of the force control robot is not required to be established, on one hand, the control logic of the force control robot is simplified, the control system is simple in structure, easy to realize and maintain, and lower in cost. On the other hand, the control system of the robot has high stability even in the case where the profile data of the controlled object is changed or the external environment is disturbed.
And secondly, the control signal in the expected time period is predicted based on the control signal in the specified time period through the signal prediction module, the fuzzy processing module does not need to carry out fuzzy processing on the appearance data of the controlled object at each moment, the control signal in the specified time can be predicted after the power control robot works for the specified time, and the fuzzy processing process is a long-time stage in the process of the power control robot, so that the time of a control system of the power control robot is greatly reduced through the prediction of the control signal, the execution time delay of the power control robot is reduced, and the execution efficiency of the power control robot is improved.
And thirdly, verifying the predicted control signal by the appearance data of the controlled object acquired in real time, judging whether the predicted control signal is abnormal, further ensuring the accuracy of the predicted control signal, and processing the inaccurate control signal, namely the abnormal control signal, so as to ensure the accuracy of the final control signal received by the control module.
And finally, the real-time force data is fed back to the control module through the feedback module, the control module compares the acquired real-time force data with standard force data corresponding to the control signal, and when the real-time force data is not in an error range, the control module performs signal compensation processing, so that the action precision of the actuating mechanism is further improved.
Drawings
Fig. 1 is a flow chart of a control method of a force control robot based on fuzzy control.
Fig. 2 is a schematic diagram of the architecture of the force control robot control system based on fuzzy control according to the present invention.
Fig. 3 is a schematic flow chart of the compensation adjustment by the control signal based on the included angle and the difference value according to the present invention.
Detailed Description
The invention is further described in detail below with reference to fig. 1 to 3:
Example 1
Referring to fig. 1, a force control robot control method based on fuzzy control includes the following steps:
S1: the method comprises the steps of collecting appearance data of a controlled object in real time through a data collecting module, wherein the appearance data comprise external shapes, sizes and materials, creating a data processing queue based on the collected appearance data of the controlled object, and sequentially transmitting data to a fuzzy processing module through the data processing queue. For a force-controlled robot, which performs a related action, the magnitude and direction of the force applied by the controlled object can be quantified, and the magnitude and direction of the applied force is generally determined based on the external shape, size and material of the controlled object. Therefore, the acquisition module acquires the shape data of the controlled object in real time and transmits the shape data to the fuzzy processing module for subsequent fuzzy processing to generate corresponding control signals.
S2: the fuzzy processing module performs fuzzy processing on the appearance data of the controlled object and outputs a control signal through the fuzzy processing module; the signal prediction module predicts a control signal within a desired time period based on the control signal within a specified time period and creates a control signal queue. The fuzzy processing module is used for carrying out fuzzy processing on the appearance data of the controlled object, and the control signal is output through the fuzzy processing module, so that an accurate mathematical model between the appearance data of the controlled object and the control signal in the force control process of the force control robot is not required to be established, the control logic of the force control robot is simplified, the control system is simpler in structure and easy to realize and maintain, and the cost is lower. Under the condition that the shape data of the controlled object changes or the external environment is interfered, the control system of the robot can still have higher stability. The control signal in the expected time period is predicted based on the control signal in the specified time period through the signal prediction module, the fuzzy processing module does not need to carry out fuzzy processing on the appearance data of the controlled object at each moment, the control signal in the specified time period can be predicted after the force control robot works, and the fuzzy processing process is a stage of longer time spent in the force control robot process, so that the time of a control system of the force control robot is effectively reduced through the prediction of the control signal, the execution time delay of the force control robot is reduced, and the execution efficiency of the force control robot is improved.
S3: and verifying the predicted control signal through the appearance data of the controlled object acquired by the data acquisition module in real time, judging whether the predicted control signal is abnormal, if so, extracting the corresponding appearance data of the controlled object, transmitting the corresponding appearance data to fuzzy processing, outputting the control signal after the fuzzy processing, outputting the control signal based on the fuzzy processing, replacing the corresponding control signal in the control signal queue, and if not, executing the step S4. The prediction control signal is verified by the appearance data of the controlled object collected in real time, whether the prediction control signal is abnormal or not is judged, the accuracy of the prediction control signal is further ensured, the inaccurate control signal, namely the abnormal control signal is processed, and the accuracy of the final control signal received by the control module is ensured.
S4: the control signal queue sequentially transmits control signals to the signal conversion module to convert digital signals into analog signals, and transmits the converted analog signals to the control module, and the control module correspondingly controls an actuating mechanism of the force control robot based on the analog signals. By creating the control signal queue, the control module has better fluency, and the control efficiency of the system is further improved.
S5: and (3) carrying out real-time force data acquisition on the execution action of the execution mechanism, feeding the real-time force data back to the control module through the feedback module, comparing the acquired real-time force data with standard force data corresponding to the control signal by the control module, judging whether the real-time force data is in an error range, if so, continuously carrying out corresponding control on the execution mechanism of the force control robot through the subsequent control signal by the control module, and if not, executing the step (S6).
S6: comparing the real-time force data with the standard force data corresponding to the control signal, including the direction and the magnitude of the force, calculating the included angle between the direction of the real-time force data and the direction of the standard force data and the difference between the magnitude of the force of the real-time force data and the magnitude of the force of the standard force data, and carrying out compensation adjustment through the control signal based on the included angle and the difference, so that the included angle and the magnitude of the standard force data corresponding to the real-time force data and the control signal are within an error range. The real-time force data is fed back to the control module through the feedback module, the control module compares the acquired real-time force data with standard force data corresponding to the control signal, and when the real-time force data is not in an error range, signal compensation processing is carried out through the control module, so that the action precision of the executing mechanism is further improved.
In this embodiment, the number of the controlled objects in step S1 is a plurality, the data processing queues are sequentially created based on the plurality of the controlled objects, and the order of data processing in the data processing queues is the processing order of the plurality of the controlled objects.
Example 2
On the basis of embodiment 1, the specific process of the fuzzy processing module in step S2 for performing fuzzy processing on the profile data of the controlled object and outputting a control signal through the fuzzy processing module is as follows:
S21: creating a fuzzy processing database and a fuzzy processing rule base of the appearance data of the controlled object, wherein the fuzzy processing database stores membership vector values of all fuzzy subsets of the input appearance data of the controlled object and the output control variables. Since the input shape data must be used for controlling the output solution through blurring when blurring is performed, it is actually the input interface of the fuzzy controller that implements the conversion of the true definite quantity input into the fuzzy vector.
S22: based on the appearance data of the controlled object in the data processing queue, the appearance data is converted into corresponding fuzzy vectors through a fuzzification interface, and based on a fuzzy processing database and a fuzzy processing rule base, the fuzzy relation equation is solved for the fuzzy vectors. The fuzzy processing database stores membership vector values of all fuzzy subsets of all input and output variables, namely a set of corresponding values after being discretized by a domain level, and the fuzzy processing database is a membership function if the domain is a continuous domain. In the process of solving the fuzzy relation equation of rule reasoning, corresponding data are provided for the reasoning machine.
S23: and obtaining a fuzzy control signal based on the solving result of the fuzzy relation equation.
In this embodiment, in step S2, the fuzzy processing module performs fuzzy processing on the profile data of the controlled object, and performs fuzzy processing using a two-dimensional fuzzy controller, where two input variables of the two-dimensional fuzzy controller are a deviation amount and a deviation variation amount of the size of the controlled object from an input standard value. The size of the controlled object can be combined with the deviation amount and the deviation variation amount of the input standard value to better reflect the dynamic characteristics, so that the control signal generated by the fuzzy processing module after the fuzzy processing has higher precision.
Example 3
On the basis of embodiment 1 or embodiment 2, the specific procedure of the signal prediction module in step S2 for predicting the control signal in the expected period based on the control signal in the specified period is as follows:
The method comprises the steps of obtaining control signals in a specified time period, inputting part of the control signals in the specified time period to a signal prediction module to train a model, carrying out iterative updating on parameters of the signal prediction module through a gradient descent optimization algorithm, inputting the other part of the control signals in the specified time period to the signal prediction module, outputting control signals through the signal prediction module to obtain a prediction result, judging whether the prediction result is in an expected range, outputting the control signals in the expected time period if the prediction result is in the expected range, and carrying out re-optimization updating on the parameters of the signal prediction module through a particle swarm algorithm if the prediction result is not in the expected range. By training the signal prediction module until the signal prediction module has the prediction accuracy meeting the requirement, the predicted control signal is accurate, and the accuracy of the subsequent execution action is ensured.
In this embodiment, the specific process of iteratively updating the parameters of the signal prediction module by the gradient descent optimization algorithm is as follows:
Initializing the weight and the deviation of a signal prediction module, namely setting a set of weight value and deviation value of the signal prediction module, inputting part of control signals in a specified time period into the signal prediction module for forward propagation to obtain a predicted value of the control signals, calculating the error between the predicted value and a standard value through a loss function, calculating a gradient through reverse propagation based on the calculated error, wherein the gradient is the influence relation of the change of the weight and the deviation on a loss function value, updating the weight and the deviation of the signal prediction module through the gradient, updating the weight value and the deviation value, respectively subtracting the product of a learning rate and the gradient through the current weight and the current deviation of the signal prediction module, wherein the learning rate is a set parameter, and finally iterating the process until the preset iteration times are met or the loss function value is smaller than a preset threshold value. The parameters of the signal prediction module are continuously adjusted to minimize the loss function, so that the prediction of the model is infinitely close to a true value, and the accuracy of the prediction is improved.
In step S3, the specific process of verifying and judging whether the predicted control signal is abnormal by the appearance data of the controlled object collected in real time by the data collecting module is as follows:
s31: establishing a mapping relation table between the shape data and the control signal based on the shape data of the historical controlled object and the historical control signal;
S32: and calling a mapping relation table based on the current appearance data, extracting a corresponding control signal in the mapping relation table, comparing the corresponding control signal with the predicted control signal, judging whether the extracted corresponding control signal is in a preset confidence interval range, if so, indicating that the predicted control signal is not abnormal, and if not, indicating that the predicted control signal is abnormal. The prediction control signal is verified by the appearance data of the controlled object collected in real time, whether the prediction control signal is abnormal or not is judged, the accuracy of the prediction control signal is further ensured, the inaccurate control signal, namely the abnormal control signal is processed, and the accuracy of the final control signal received by the control module is further ensured.
Referring to fig. 3, the specific process of compensation adjustment by the control signal based on the included angle and the difference in step S6 is as follows:
S61: calculating a first proportion of the included angle to the included angle between the direction of the force of the standard force data and a certain coordinate direction based on the included angle between the direction of the force of the real-time force data and the direction of the force of the standard force data;
S62: performing reverse compensation on a force direction signal in the control signal based on the first ratio, wherein the reverse compensation represents compensation of a direction of the force of the real-time force data relative to a direction of the force of the standard force data;
s63: calculating a second ratio of the difference to the force of the standard force data based on the difference between the force of the real-time force data and the force of the standard force data;
S64: and carrying out reverse compensation on the magnitude signal of the force in the control signal based on the second proportion, wherein the reverse compensation indicates that when the force of the real-time force data is larger than the force of the standard force data, the magnitude signal of the force in the control signal is subjected to the process of adjusting the corresponding proportion, and when the force of the real-time force data is smaller than the force of the standard force data, the magnitude signal of the force in the control signal is subjected to the process of adjusting the corresponding proportion. The real-time force data is fed back to the control module through the feedback module, the control module compares the acquired real-time force data with standard force data corresponding to the control signal, and when the real-time force data is not in an error range, signal compensation processing is carried out through the control module, so that the action precision of the executing mechanism is further improved.
Referring to fig. 2, a force control robot control system based on fuzzy control is used for implementing a force control robot control method based on fuzzy control of any one of the above aspects, and is characterized by comprising a data acquisition module, a data processing queue, a fuzzy processing module, a control signal queue, a signal prediction module, a signal inspection module, a signal conversion module, a control module, an execution mechanism and a feedback module, wherein the data acquisition module is connected with the data processing queue, the data processing queue is connected with the fuzzy processing module, the fuzzy processing module is respectively connected with the control signal queue and the signal prediction module, the signal prediction module is connected with the signal inspection module, the control signal queue is connected with the signal conversion module, the signal conversion module is connected with the control module, the control module is connected with the execution mechanism, and the execution mechanism is connected with the feedback module.
The data acquisition module is used for acquiring the appearance data of the controlled object in real time, wherein the appearance data comprises the external shape, the external size and the external material; the fuzzy processing module is used for carrying out fuzzy processing on the appearance data of the controlled object and outputting a control signal through the fuzzy processing module; the control module is used for controlling the action of the executing mechanism based on the control signal, and carrying out compensation adjustment through the control signal based on the included angle and the difference value, so that the included angle and the size of the standard force data corresponding to the real-time force data and the control signal are both within an error range; the execution mechanism is used for executing corresponding actions based on the control signals of the control module; and the feedback module is used for feeding back the real-time actions executed by the executing mechanism to the control module.
In summary, the control method and system for the force control robot based on fuzzy control provided by the invention carry out fuzzy processing on the shape data of the controlled object through the fuzzy processing module, and output the control signal through the fuzzy processing module, so that an accurate mathematical model between the shape data of the controlled object and the control signal in the force control process of the force control robot is not required to be established, the control logic of the force control robot is simplified, the control system is simple in structure, easy to realize and maintain, and lower in cost. The control system of the robot has high stability even in the case of a change in the shape data of the controlled object or an external environment disturbance. The control signal in the expected time period is predicted based on the control signal in the specified time period through the signal prediction module, the fuzzy processing module does not need to carry out fuzzy processing on the appearance data of the controlled object at each moment, the control signal in the specified time period can be predicted after the force control robot works, and the fuzzy processing process is a stage of longer time in the force control robot process, so that the time of a control system of the force control robot is greatly reduced through the prediction of the control signal, the execution time delay of the force control robot is reduced, and the execution efficiency of the force control robot is improved. The prediction control signal is verified by the appearance data of the controlled object collected in real time, whether the prediction control signal is abnormal or not is judged, the accuracy of the prediction control signal is further ensured, the inaccurate control signal, namely the abnormal control signal is processed, and the accuracy of the final control signal received by the control module is ensured. The real-time force data is fed back to the control module through the feedback module, the control module compares the acquired real-time force data with standard force data corresponding to the control signal, and when the real-time force data is not in an error range, signal compensation processing is carried out through the control module, so that the action precision of the executing mechanism is further improved.