Disclosure of Invention
In order to at least solve the technical problems in the background art, the invention provides a manipulator operation control method, a manipulator operation control system, electronic equipment and a computer storage medium.
The first aspect of the invention provides a manipulator operation control method, which comprises the following steps:
classifying and clustering the position points in the first track to obtain a first type track and a second type track;
curve optimization is carried out on the first type of track based on a coulomb scattering principle, and a second track is generated according to the optimized first type of track and the optimized second type of track;
and generating a CNC G code set according to the second track and the coulomb deceleration principle, and controlling the operation of the manipulator according to the CNC G code set.
Further, the classifying and clustering the position points in the first track to obtain a first type track and a second type track includes:
performing discrete processing on the first track according to a first interval to obtain a plurality of position points;
taking a starting point/end point as an outgoing end, sequentially connecting the position points, calculating the deviation angle between the current position point and the connecting line, and judging the current position point as a first type position point if the deviation angle is greater than or equal to a preset threshold value; otherwise, judging the current position point as a second type position point;
clustering all the adjacent first type position points and the adjacent second type position points respectively to obtain the first type track and the second type track.
Further, the curve optimization of the first type of trajectories based on the coulomb scattering principle includes:
and calculating deflection angles of the first type of track and the first type of track or the second type of track which are adjacent in advance, and performing curve optimization on the first type of track according to the deflection angles, the coulomb scattering characteristics and the starting point of the first type of track to obtain a third type of track.
Further, the generating a second track according to the optimized first track and the second track includes:
and connecting the third type of track and the second type of track according to the original position relationship to obtain the second track.
Further, the generating a CNC G-code set according to the second trajectory and coulomb deceleration principle comprises:
setting a first target speed for each of the second type of trajectories, and calculating a second target speed of the third type of trajectories according to the first target speed and a coulomb deceleration principle;
and generating the CNC G code set according to each first target speed and the second target speed.
Further, the coulomb deceleration principle comprises:
if it isThen set V res =V K ;
If it isThen set V res According to said->Values follow coulomb curve from V K Reduce to V K *(1-C0 factor);
In the method, in the process of the invention,c0factor is a deceleration factor value, and C0factor ε [0.0,1.0]I.e., C0factor is between 0% and 100%.
Further, the generating the CNC G code set according to each of the first target speed and the second target speed includes:
calculating a horizontal deviation angle of each second type track in the second tracks, and correcting the first target speed according to the horizontal deviation angle to obtain a third target speed;
and generating the CNC G code set according to the first target speed and/or the third target speed and the second target speed.
The second aspect of the invention provides a manipulator operation control system, which comprises a track generation module, a track optimization module and a track conversion and execution module, wherein,
the track generation module is used for classifying and clustering all the position points in the first track to obtain a first type track and a second type track;
the track optimization module is used for performing curve optimization on the first type of track based on the coulomb scattering principle, and generating a second track according to the optimized first type of track and the optimized second type of track;
the track conversion and execution module is used for generating a CNC G code set according to the second track and the coulomb deceleration principle, and controlling the manipulator to operate according to the CNC G code set.
A third aspect of the present invention provides an electronic device comprising: a memory storing executable program code; a processor coupled to the memory; the processor invokes the executable program code stored in the memory to perform the method of any one of the preceding claims.
A fourth aspect of the invention provides a computer storage medium having stored thereon a computer program which, when executed by a processor, performs a method as claimed in any one of the preceding claims.
According to the scheme, the received initial first track is decomposed into the position points, and then the position points are classified and clustered, so that a first type track (a direction-changing track section) and a second type track (a straight track section) can be obtained. For the linear track section, the manipulator can run at a constant speed according to a conventional control method; and for the turning track section, a coulomb deceleration algorithm is adopted to carry out curve optimization so as to smooth the turning track section, the manipulator can avoid decelerating to zero when running to the section and pass through the turning track section at the highest speed possible, and thus, the running speed of the manipulator between the starting point and the ending point can be improved.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be described in further detail below with reference to the accompanying drawings, and it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
The terminology used in the embodiments of the application is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the examples and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise, the "plurality" generally includes at least two.
It should be understood that the term "and/or" as used herein is merely one relationship describing the association of the associated objects, meaning that there may be three relationships, e.g., a and/or B, may represent: a exists alone, A and B exist together, and B exists alone. In addition, the character "/" herein generally indicates that the front and rear associated objects are an "or" relationship.
It should be understood that although the terms first, second, third, etc. may be used in embodiments of the present application to describe … …, these … … should not be limited to these terms. These terms are only used to distinguish … …. For example, the first … … may also be referred to as the second … …, and similarly the second … … may also be referred to as the first … …, without departing from the scope of embodiments of the present application.
The words "if", as used herein, may be interpreted as "at … …" or "at … …" or "in response to a determination" or "in response to a detection", depending on the context. Similarly, the phrase "if determined" or "if detected (stated condition or event)" may be interpreted as "when determined" or "in response to determination" or "when detected (stated condition or event)" or "in response to detection (stated condition or event), depending on the context.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a product or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such product or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a commodity or system comprising such elements.
Preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
Referring to fig. 1, fig. 1 is a flow chart of a method for controlling operation of a manipulator according to an embodiment of the invention. As shown in fig. 1, a method for controlling operation of a manipulator according to an embodiment of the present invention includes the following steps:
s1, classifying and clustering all the position points in a first track to obtain a first type track and a second type track;
s2, curve optimization is carried out on the first type of track based on the coulomb scattering principle, and a second track is generated according to the optimized first type of track and the optimized second type of track;
and S3, generating a CNC G code set according to the second track and the coulomb deceleration principle, and controlling the manipulator to operate according to the CNC G code set.
In the embodiment of the invention, the control mode adopted by the groove type cleaning machine in the existing photovoltaic equipment has little difference between the layout and principle of hardware parts, most of the control modes adopt a servo motor with position feedback to accurately control the position, the aim of rapidly transferring materials is achieved through the relative movement between two shafts in a mechanical mode, and a manipulator performs basket taking (related to hooking action) and discharging (related to unhooking action) through the point-to-point mechanical operation. However, as described in the background art, the existing mechanical arm control method has various drawbacks, and fast and stable material transfer is an important factor for ensuring the quality of the product. Therefore, how to take the least time to complete the transfer and the least shake to reduce the basket failure is a technical problem to be solved.
Aiming at the technical problems, the method decomposes the received initial first track into the position points, and classifies and clusters the position points, so that the first type track (turning track section) and the second type track (straight track section) can be obtained. For the linear track section, the manipulator can run at a constant speed according to a conventional control method; and for the turning track section, a coulomb deceleration algorithm is adopted to carry out curve optimization so as to smooth the turning track section, the manipulator can avoid decelerating to zero when running to the section and pass through the turning track section at the highest speed possible, and thus, the running speed of the manipulator between the starting point and the ending point can be improved.
CNC, computer number control, is a direct numerical control, a processing technique widely used in the manufacturing industry at present, and is also a mark of the manufacturing industry at present. The invention applies CNC G code to the wool making cleaning equipment, thus fully utilizing the high speed stability, safety and reliability of CNC G code, having the advantages of continuous action, accurate positioning and real-time feedback compared with the traditional control, and acting under the same running mechanism and running speed, the invention can save more than 30 percent of time, and the mechanical shaking gap compensation can reduce 50 percent of mechanical shaking.
It should be noted that the operation control scheme of the present invention may be applied to a control module of a specific wool making cleaning apparatus, and may also be applied to a server, where the server may be adapted to perform one-to-many control on a plurality of robots of the wool making cleaning apparatus. The control module may be a special processing device, a computer, a mobile phone, a tablet computer, a wearable device, a virtual reality device, etc. with a data processor, and the data processor may be a central processing unit (Central Processing Unit, CPU), other general purpose processors, digital signal processors (Digital Signal Processor, DSP), application specific integrated circuits (Application Specific Integrated Circuit, ASIC), field programmable gate arrays (Field-Programmable Gate Array, FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The server may be an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, or a cloud server providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks (Content Delivery Network, CDN), basic cloud computing services such as big data and artificial intelligence platforms, and the like.
Further, as shown in fig. 2, in step S1, classifying and clustering each position point in the first track to obtain a first type track and a second type track, including:
s11, performing discrete processing on the first track according to the first interval to obtain a plurality of position points.
S12, taking a starting point/end point as an outgoing end, sequentially connecting all the position points, calculating the deviation angle between the current position point and the connecting line, and judging that the current position point is a first type position point if the deviation angle is larger than or equal to a preset threshold value; otherwise, the current position point is judged to be the second type position point.
S13, clustering all adjacent first-class position points and second-class position points respectively to obtain first-class tracks and second-class tracks.
In the embodiment of the invention, after an initial first track is discretized into a position point set, calculating the deviation angle of each position point sequentially by taking one end of the track as a starting point, and when the deviation angle of a connecting line formed by the current position point and a previous position point exceeds a preset threshold value, indicating that the position point belongs to a direction-changing track section, or else, belongs to a straight track section. And then clustering and connecting adjacent position points to obtain a first type track and a second type track.
The linear track section of the initial track may be a non-horizontal line, which may cause a deviation angle between adjacent position points, and the position point is easy to be misjudged as a direction-changing track section. In view of this, the present invention determines the attribute of the position point by calculating the deviation angle between the position point and the previous continuous, and avoids the erroneous determination problem in the case of non-horizontal line.
Further, as shown in fig. 3, in step S2, curve optimization is performed on the first type of trajectories based on the coulomb scattering principle, including:
s21, calculating deflection angles of the first type of track and the first type of track or the second type of track which are adjacent in advance, and performing curve optimization on the first type of track according to the deflection angles, the coulomb scattering characteristics and the starting point of the first type of track to obtain a third type of track.
In the present embodiment, coulomb deceleration is a dynamic process resembling coulomb scattering. Coulomb scattering is to assume that the angle θ between the incident direction and the scattering direction of the charged particles. Coulomb scattering is characterized by an angular distribution of scattering particles inversely proportional to sin4 (θ/2), i.e., scattering particles are concentrated in a forward small angle region.
The track section connected with the first type track, namely the direction-changing track section, by utilizing the coulomb is the direction-changing track section or the straight track sectionCalculating the included angle of the two tracks in the tangential direction of the turning point, namely the deflection angleAnd determining a plurality of scattering curves according to the coulomb scattering characteristics, and screening out a proper scattering curve from the scattering curves to serve as an optimized curve between the starting points.
It should be noted that the first type of track may be an independent direction-changing track segment; the first type of track can also be formed by dividing a small track from each linear track section by taking the inflection point as the center, wherein the length of the divided small track can be positively correlated with the length of each linear track section.
S22, connecting the third type of track and the second type of track according to the original position relation to obtain a second track.
In the embodiment of the invention, after curve optimization is performed on the first type of track, namely the turning track section, the first type of track is replaced in situ by using the third type of track obtained after optimization, and then the third type of track and the second type of track are connected according to a preset position relationship to obtain the second track.
Further, as shown in fig. 4, in step S3, generating a CNC G code set according to the second trajectory and the coulomb deceleration principle includes:
s31, setting a first target speed for each second type track in the second tracks, and calculating a second target speed of a third type track according to the first target speed and the coulomb deceleration principle.
S32, generating a CNC G code set according to the first target speed and the second target speed.
In the embodiment of the invention, after the running tracks are determined, the running speeds on the tracks are determined. Specifically, a first target speed (which can be preset manually/automatically according to a certain rule) is set for the second type of track, i.e. the linear track section, and the first target speed is the feeding speed V of the third type of track K The set speed V after deceleration can be determined by considering the coulomb deceleration principle res I.e. the second target speed. Obviously, the second target speed is actually a series of speed sets determined according to the coulomb deceleration principle, and of course, the first target speed may also be a set of several preset speeds.
Further, the coulomb deceleration principle includes:
if it isThen set V res =V K ;
If it isThen set V res According to->Values follow coulomb curve from V K Reduce to V K *(1-C0 factor);
In the method, in the process of the invention,c0factor is a deceleration factor value, and C0factor ε [0.0,1.0]I.e., C0factor is between 0% and 100%.
In the embodiment of the invention, the coulomb deceleration is characterized in that: once the deflection angle reaches the level where deceleration is required, the speed drops significantly. If the deflection angle continues to increase to 30 ° -170 ° it runs at a very low speed, the drop is very slow, over 170 ° the reverse direction, and begins to drop rapidly to 0. For example, can be provided withC0 factor=1.0, representing deflection angle +.>Does not decelerate within 15 DEG, but does not decelerate in the opposite direction (i.e.)>) At this point, the speed will decrease by 100%, i.e. the speed will drop to zero.
Further, as shown in fig. 5, in step S32, generating a CNC G code set according to each of the first target speed and the second target speed includes:
s321, calculating horizontal deviation angles of the second type tracks in the second tracks, and correcting the first target speed according to the horizontal deviation angles to obtain a third target speed.
S322, generating a CNC G code set according to the first target speed and/or the third target speed and the second target speed.
In the embodiment of the present invention, as described above, the straight track section may be a non-horizontal line, and although the non-horizontal line is set to be the first target speed, under the influence of gravity, the speed of the manipulator when reaching the end of the straight track section may deviate (smaller on an ascending slope and larger on a descending slope), and the deviation amplitude is influenced by the magnitude of the horizontal deviation angle and the length of the straight track section. Although the deviation amplitude may be small, for equipment with extremely high precision requirements, such as a wool making cleaning equipment, jitter may still be caused, and the quality of products is affected.
Therefore, the horizontal deviation angle of the straight track section, namely the second type track, is calculated, the correction coefficient is calculated according to the horizontal deviation angle, and the first target speed is corrected to obtain the third target speed, so that the deviation between the manipulator and the original first target speed is smaller in actual operation. Wherein the correction factor is positively correlated with the magnitude of the horizontal deviation angle. I.e. the larger the horizontal deviation angle, the larger the correction coefficient.
The correction coefficient in the present invention is specifically determined based on the positive and negative of the horizontal deviation angle. For example, if the horizontal deviation angle is positive, the straight track section is described as ascending, and the correction coefficient is larger than 1, namely the first target speed is properly increased; if the horizontal deviation angle is negative, the straight track section is described as a downhill slope, and the correction coefficient is smaller than 1, namely the first target speed is properly adjusted down.
In addition, a further improvement scheme is provided:
if the junction of the first type track and the first type track adjacent to the first type track is an inflection point with discontinuous speed, the inflection point is smoothed by using a Betz curve.
In this modification, for the case where two diversion track segments are adjacent, the junction may be an inflection point of discontinuous speed, and the manipulator may generate impact when the inflection point operates, unless the feed speed is reduced to 0 at the inflection point, but this reduces the operation speed. To cope with this problem, in order to smoothly pass through an inflection point at a defined speed, the present invention performs smoothing processing on the inflection point using a betz curve, slightly adjusts a set trajectory to ensure that the speed is continuous over the entire trajectory section, and the speed is more adapted to the optimized trajectory curve.
Referring to fig. 6, fig. 6 is a schematic structural diagram of a manipulator operation control system according to an embodiment of the present invention. As shown in fig. 6, a manipulator motion control system according to an embodiment of the present invention includes a track generation module 101, a track optimization module 102, and a track conversion and execution module 103.
The track generation module 101 is configured to classify and cluster each position point in the first track to obtain a first type track and a second type track; the track optimization module 102 is used for performing curve optimization on the first type of track based on the coulomb scattering principle, and generating a second track according to the optimized first type of track and the optimized second type of track; the track conversion and execution module 103 is used for generating a CNC G code set according to the second track and the coulomb deceleration principle, and controlling the manipulator to operate according to the CNC G code set.
For specific functions of a manipulator operation control system in this embodiment, referring to the first embodiment, since the system in this embodiment adopts all the technical solutions of the foregoing embodiments, at least the beneficial effects brought by the technical solutions of the foregoing embodiments are provided, and will not be described in detail herein.
Referring to fig. 7, fig. 7 is a schematic diagram of an electronic device according to an embodiment of the present invention, including: a memory storing executable program code; a processor coupled to the memory; the processor invokes executable program code stored in the memory to perform the method as in any of the previous embodiments.
The embodiment of the invention also discloses a computer storage medium, wherein a computer program is stored on the storage medium, and the computer program is executed by a processor to execute the method according to any of the previous embodiments.
Embodiments of the present disclosure may be embodied in a software product stored on a storage medium, including one or more instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of a method according to embodiments of the present disclosure. And the aforementioned storage medium may be a non-transitory storage medium including: a plurality of media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or a transitory storage medium.
The above description and the drawings illustrate embodiments of the disclosure sufficiently to enable those skilled in the art to practice them. Other embodiments may involve structural, logical, electrical, process, and other changes. The embodiments represent only possible variations. Individual components and functions are optional unless explicitly required, and the sequence of operations may vary. Portions and features of some embodiments may be included in, or substituted for, those of others. Moreover, the terminology used in the present application is for the purpose of describing embodiments only and is not intended to limit the claims. As used in the description of the embodiments and the claims, the singular forms "a," "an," and "the" (the) are intended to include the plural forms as well, unless the context clearly indicates otherwise. Similarly, the term "and/or" as used in this application is meant to encompass any and all possible combinations of one or more of the associated listed. Furthermore, when used in this application, the terms "comprises," "comprising," and/or "includes," and variations thereof, mean that the stated features, integers, steps, operations, elements, and/or components are present, but that the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof is not precluded. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of other like elements in a process, method or apparatus comprising such elements. In this context, each embodiment may be described with emphasis on the differences from the other embodiments, and the same similar parts between the various embodiments may be referred to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method sections disclosed in the embodiments, the description of the method sections may be referred to for relevance.
Those of skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware, or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. The skilled artisan may use different methods for each particular application to achieve the described functionality, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. It will be clearly understood by those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
In the embodiments disclosed herein, the disclosed methods, articles of manufacture (including but not limited to devices, apparatuses, etc.) may be practiced in other ways. For example, the apparatus embodiments described above are merely illustrative, and for example, the division of the units may be merely a logical function division, and there may be additional divisions when actually implemented, for example, multiple units or components may be combined or integrated into another system, or some features may be omitted, or not performed. In addition, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, device or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form. The units described as separate units may or may not be physically separate, and units shown as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to implement the present embodiment. In addition, each functional unit in the embodiments of the present disclosure may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit.
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. In the description corresponding to the flowcharts and block diagrams in the figures, operations or steps corresponding to different blocks may also occur in different orders than that disclosed in the description, and sometimes no specific order exists between different operations or steps. For example, two consecutive operations or steps may actually be performed substantially in parallel, they may sometimes be performed in reverse order, which may be dependent on the functions involved. Each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.