Disclosure of Invention
The application aims to overcome the technical problems and provides an automatic stacking method, an automatic stacking device, a terminal and a storage medium.
In a first aspect, the present application provides an automatic stacking method, which adopts the following technical means:
an automatic stacking method is based on an automatic stacking system, the automatic stacking system comprises a mechanical arm and a flexible clamping jaw device at the tail end of the mechanical arm, and the method comprises the following steps:
Acquiring package information of packages to be stacked, and combining the package information with historical stack type data of the automatic stacking system to obtain an optimal stack type matched with the current packages to be stacked;
Performing point cloud segmentation on the stacked wrapped trays through a preset segmentation model to obtain a segmentation result, and calculating tray gaps and generating stacking paths by combining the optimal stack type and a preset path planning algorithm;
the flexible clamping jaw device is controlled to grab the package to be palletized, the grabbing gesture is corrected in real time by combining feedback of a preset torque sensor, and the mechanical arm is controlled to execute palletizing according to the palletizing path;
When the segmentation result of the tray is matched with the optimal stack type, a stacking three-dimensional model is generated, the stacking three-dimensional model is bound with the AGV trolley below the tray, and the AGV trolley is controlled to automatically warehouse.
By adopting the technical scheme, the information of the packages to be stacked can be accurately obtained and matched with the optimal stack type, the gap of the tray is accurately calculated to generate a reasonable stacking path, the flexible clamping jaw device is utilized to grasp the packages and correct the grabbing gesture in real time, the stacking is ensured to be accurate, the three-dimensional stacking model and the AGV trolley are bound and automatically put in storage when the tray segmentation result is matched with the optimal stack type, and the stacking efficiency and the stacking accuracy are improved.
Preferably, the acquiring device acquires package information of packages to be stacked according to a preset acquiring device and generates a unique ID for each package to be stacked, and the history stack type data of the automatic stacking system is combined to match an optimal stack type for the current package to be stacked, and specifically includes the following steps:
The method comprises the steps that package information of packages to be stacked is obtained according to a preset collecting device, the collecting device comprises a code scanning device and a binocular depth camera, the packages to be stacked are scanned according to the code scanning device to obtain face sheet information, package surface materials and package sizes of the packages to be stacked are obtained according to the binocular depth camera, unique IDs of the packages to be stacked are generated according to the face sheet information, and package information is related to the IDs by combining the package surface materials and the package sizes;
determining the position of a tray for stacking the packages to be stacked according to the sheet information, and judging whether the tray is empty or not;
If the tray is empty, acquiring a historical successful stack type of the automatic stacking system from a cloud end according to the material of the surface of the package, and screening the historical successful stack type according to a cosine similarity algorithm to obtain a candidate stack type;
And if the tray is not empty, acquiring the current optimal stack type of the tray from the cloud.
According to the technical scheme, the code scanning device and the binocular depth camera are utilized to comprehensively and accurately acquire the sheet information, the material of the surface of the package and the package size of the package to be stacked, basic data are provided for subsequent processing, the position of the tray can be accurately determined according to the sheet information, whether the tray is empty or not is judged, so that an optimal stack type can be matched in a proper mode according to different conditions, the candidate stack type is selected from the historical successful stack types by utilizing a cosine similarity algorithm for an empty tray, the optimal stack type is determined according to a preset rule and is uploaded to a cloud end, stacking efficiency and rationality are improved, and the optimal stack type can be directly acquired from the cloud end for a non-empty tray, so that time is saved.
Preferably, the method includes the steps of screening the candidate stack types according to a preset optimal stack type matching rule to obtain an optimal stack type, and specifically includes the following steps:
Constructing a reinforcement learning environment comprising a state space, an action space and a reward function, wherein the reward function is calculated according to the feasible path of the package to be stacked, the space score of the candidate stack type and the support score;
Performing quantitative evaluation on the candidate stack types, wherein the quantitative evaluation comprises feasible path quantitative analysis, space score calculation and support score calculation, and obtaining a feasible path score, a space score and a support score;
and training a strategy network according to the PPO reinforcement learning algorithm by combining the state space and the action space, performing iterative optimization, simulating and executing candidate stack types based on the trained strategy network, calculating to obtain a comprehensive rewarding score according to the feasible path of the package to be piled, the space score and the support score, and outputting the candidate stack type with the highest comprehensive rewarding score as an optimal stack type.
By adopting the technical scheme, the reinforcement learning environment comprising the state space, the action space and the rewarding function is constructed, the feasible path of the package to be piled, the space score and the support score of the candidate stack types are comprehensively considered, the suitability of each candidate stack type is more accurately measured, the strategy network is trained according to the PPO reinforcement learning algorithm and is subjected to iterative optimization, the comprehensive rewarding score is calculated after the candidate stack types are simulated and executed, the optimal stack type is output, the screening accuracy and reliability can be effectively improved, and more reasonable stack type selection is provided for subsequent piling.
Preferably, the method includes the steps of performing point cloud segmentation on the trays stacked and wrapped through a preset segmentation model, calculating a tray gap by combining the optimal stack type and a preset path planning algorithm, and generating a stacking path, and specifically includes the following steps:
The method comprises the steps of obtaining tray point cloud data for stacking the packages to be stacked, and dividing package outlines on a tray according to a preset YOLOv dividing model and the tray point cloud data to obtain dividing results, wherein the dividing results comprise available gaps;
performing preliminary screening on available gaps in the segmentation result according to the optimal stack type, and eliminating the available gaps which conflict with the structure of the optimal stack type;
And traversing all available gaps obtained after preliminary screening, calculating the minimum circumscribed rectangle of each gap, screening all the minimum circumscribed rectangles which are not smaller than the wrapping size, summarizing the minimum circumscribed rectangles into a gap candidate set, calculating the space utilization rate and the optimal placement pose of each candidate gap in the gap candidate set, summarizing all the optimal placement poses into a candidate placement pose list, and arranging the candidate placement pose list according to the space utilization rate.
By adopting the technical scheme, the package outline is segmented through the YOLOv segmentation model, package distribution and gap conditions on the tray can be accurately identified, available gaps are initially screened according to the optimal stack type, conflict gaps are eliminated, follow-up stacking is guaranteed to conform to the optimal stack type, the screened available gaps are traversed, minimum external rectangles are calculated, gap candidate sets are summarized, space utilization rate and optimal placement positions are calculated, a candidate placement position list is formed according to the space utilization rate, the space of the tray can be effectively utilized, basis is provided for selecting proper stacking positions, and further stacking efficiency and space utilization rate are improved.
Preferably, the method further comprises the following steps:
acquiring the current pose of the mechanical arm, the candidate gaps and the optimal placement pose of the candidate gaps, constructing a tray geometric model based on the tray point cloud data, and acquiring a working space model carrying an anti-collision area mark;
Generating a plurality of candidate paths meeting preset constraint conditions based on an improved RRT algorithm, wherein the constraint conditions comprise space constraint conditions and acceleration constraint conditions, the space constraint conditions are that the candidate paths do not collide with the tray geometric model or the anti-collision area, and the acceleration constraint conditions are that the corner acceleration of the candidate paths does not exceed a preset threshold value;
And scoring the candidate paths meeting the constraint conditions according to a preset path scoring rule, and taking the candidate paths with the highest scores as stacking paths.
By adopting the technical scheme, the tray geometric model is built based on the tray point cloud data, the working space model carrying the anti-collision area mark is obtained, the stacking environment can be reflected more accurately, the improved RRT algorithm is utilized to generate candidate paths meeting space and acceleration constraint conditions, collision can be avoided, corner acceleration is controlled, running safety and stability are guaranteed, the candidate path with the highest score is selected as the stacking path according to a preset path scoring rule, and the optimal stacking path can be obtained, so that the stacking efficiency and accuracy are improved.
Preferably, the controlling the flexible clamping jaw device to grasp the package to be palletized, combining feedback of a preset torque sensor to correct grasping gesture in real time, controlling the mechanical arm to execute palletizing according to the palletizing path, specifically comprising the following steps:
The method comprises the steps that a preset clamping force parameter is called according to a wrapping material to obtain an initial clamping force, the flexible clamping jaw device comprises clamping jaws and pneumatic tendons for driving the clamping jaws, a torque sensor is pre-installed on the flexible clamping jaw device, and a rotary encoder and an inertia measurement unit are pre-installed on the mechanical arm;
Controlling the pneumatic tendon to drive the clamping jaw to clamp the package to be stacked with the initial clamping force;
Monitoring real-time clamping force through the moment sensor in the process of carrying out stacking by the mechanical arm, and dynamically adjusting the real-time clamping force when detecting that the deformation of the package to be stacked exceeds a preset deformation threshold;
Acquiring a joint angle fed back by the rotary encoder and terminal acceleration acquired by the inertial measurement unit to estimate actual grabbing pose deviation, generating a joint compensation instruction according to the actual grabbing pose deviation and a PID controller, and correcting grabbing pose of the mechanical arm according to the joint compensation instruction;
when the moment sensor detects a preset contact force condition, triggering a clamping jaw release instruction to finish the placement of the packages to be stacked.
By adopting the technical scheme, the grabbing requirements of the packages with different materials can be adapted by determining the initial clamping force according to the materials of the packages, the clamping force can be monitored in real time and dynamically adjusted to prevent the packages from being damaged due to overlarge stress or falling due to insufficient clamping force, the stacking precision can be improved by estimating and correcting the deviation of grabbing positions, and the packages can be accurately placed by releasing the packages when the contact force reaches the condition.
Preferably, after the placement of the package to be palletized is completed, the method further comprises the following steps:
The method comprises the steps of obtaining the placement pose of a current package, calculating the barycenter coordinates of the current package according to the package size, obtaining the barycenter coordinates of the rest packages on the current tray, and calculating the overall barycenter coordinates of all packages on the tray according to the barycenter coordinates of the current package;
Acquiring a stable center coordinate of the tray, calculating a gravity center offset by combining the integral gravity center coordinate, and comparing the gravity center offset with a preset early warning range;
and when the gravity center offset is within the early warning range, executing a gravity center offset control strategy by combining the integral gravity center coordinate and the stable center coordinate.
Through adopting above-mentioned technical scheme, can be after the completion treat pile up neatly parcel place, calculate whole barycentric coordinate and barycentric offset of whole parcel on the tray, contrast this barycentric offset and preset early warning scope, carry out barycentric offset control strategy when the offset falls in the early warning scope, guarantee the stability of parcel pile up neatly on the tray, avoid leading to the parcel to empty scheduling problem because of barycentric offset is too big, and then improve pile up neatly operation's security and reliability.
In a second aspect, the application provides an automatic stacking device, which adopts the following technical means:
An automatic pile up neatly device, based on automatic pile up neatly system, automatic pile up neatly system include the arm with the terminal flexible clamping jaw device of arm includes following module:
The optimal stack type matching module is used for acquiring package information of packages to be stacked, and combining the package information with historical stack type data of the automatic stacking system to match the current packages to be stacked with the optimal stack type;
The stacking path planning module is used for carrying out point cloud segmentation on the trays packaged in a stacking manner through a preset segmentation model to obtain a segmentation result, and calculating the tray gap and generating a stacking path by combining the optimal stack type and a preset path planning algorithm;
The grabbing gesture correction module is used for controlling the flexible clamping jaw device to grab the packages to be palletized, correcting grabbing gestures in real time by combining feedback of a preset torque sensor, and controlling the mechanical arm to execute palletizing according to the palletizing path;
and the automatic warehousing module is used for generating a stacking three-dimensional model when the segmentation result of the tray is matched with the optimal stack type, binding the stacking three-dimensional model with the AGV trolley below the tray, and controlling the AGV trolley to automatically warehouse.
By adopting the technical scheme, the optimal stack type matching module can accurately acquire package information and generate unique IDs for each package, the optimal stack type is matched by combining historical stack type data, the adaptability of package stacking is improved, the stacking path planning module can divide the point cloud of the trays, calculate the gaps of the trays by combining the optimal stack type and the path planning algorithm and generate stacking paths, the space utilization rate is improved, the grabbing gesture correction module corrects the grabbing gesture in real time through feedback of the moment sensor, the accuracy of the stacking process is ensured, the package extrusion deformation is prevented, the automatic warehousing module generates a three-dimensional stacking model and binds with an AGV trolley when the tray dividing result is matched with the optimal stack type, and the automatic warehousing is realized, so that the logistics efficiency is improved.
In a third aspect, the present application provides an intelligent terminal, which adopts the following technical scheme:
An intelligent terminal comprising a memory and a processor, wherein at least one instruction, at least one program, code set or instruction set is stored in the memory, and the at least one instruction, at least one program, code set or instruction set is loaded and executed by the processor to implement the automatic palletizing method as described above.
In a fourth aspect, the present application provides a computer readable storage medium, which adopts the following technical scheme:
A computer readable storage medium having stored therein at least one instruction, at least one program, code set, or instruction set loaded and executed by a processor to implement an automated palletizing method as previously described.
In summary, the application at least comprises the following beneficial effects:
(1) According to the method, the optimal stack type is matched by combining the package information and the historical stack type data, and the stacking scheme can be dynamically adjusted according to the real-time situation, so that the storage space utilization rate is improved;
(2) According to the method, the tray point cloud is segmented through the preset segmentation model, and the optimal stacking path is generated by combining the optimal stacking algorithm and the path planning algorithm, so that collision and damage risks in the stacking process are reduced;
(3) According to the method, the flexible clamping jaw device is used for grabbing the package, the binding force moment sensor is used for feeding back and correcting grabbing gestures in real time, the method can adapt to cargoes of different shapes, sizes and materials, the stacking process has flexibility, the method can adapt to various cargoes, and the grabbing success rate is improved.
Detailed Description
The technical scheme in the embodiment of the invention will be further described in detail below with reference to the accompanying drawings. The embodiments described are only possible technical implementations of the invention, but are not limited thereto, and other embodiments, which can be fully combined with the embodiments of the invention by a person skilled in the art without inventive labour, are also within the scope of protection of the invention.
The application mainly adopts the steps of obtaining package information to match a stack type and planning a path to complete a stacking and warehousing scheme, thereby achieving the effects of improving the adaptability, the space utilization rate and the positioning precision of a stacking system and reducing the failure rate.
The automatic stacking method of the application is based on an automatic stacking system, the automatic stacking system comprises a mechanical arm and a flexible clamping jaw device at the tail end of the mechanical arm, as shown in figure 1, the method comprises the following steps:
S1, acquiring package information of packages to be stacked, and matching the current packages to be stacked with an optimal stack type by combining the package information and historical stack type data of an automatic stacking system, wherein the method specifically comprises the following steps of:
S11, acquiring package information of packages to be stacked according to a preset acquisition device, wherein the acquisition device comprises a code scanning device and a binocular depth camera.
According to the code scanning device, the package to be stacked is scanned to obtain the face sheet information, in the embodiment, the code scanning device is a P2 code scanner, the code scanning device comprises an integrated laser ranging module, and when the package to be stacked enters a detection area, a photoelectric sensor in the system triggers the P2 code scanner to work.
According to binocular depth camera obtain the parcel surface material and the parcel size of waiting pile up neatly parcel, parcel surface material includes carton, braided bag, foam case and hard plastics in this embodiment, and the parcel size includes length (L), width (W), height (H).
And S12, generating a unique ID of the package to be stacked according to the face sheet information, associating package information of the package surface material and package size assembly with the generated ID, and uploading the package information to the cloud.
S13, as shown in fig. 2, determining the position of the tray for stacking the packages to be stacked according to the face sheet information, judging whether the tray for stacking the packages to be stacked is empty, and if the tray is empty, indicating that the current package to be stacked is the first package, so that the optimal stack type matching is needed.
S131, when the tray is empty, acquiring all historical successful stack types of the automatic stacking system from the cloud according to the surface materials of the package, wherein the surface materials of the package matched with the acquired historical successful stack types are the same as the surface materials of the current package.
S132, extracting characteristics of the current package to be palletized, and constructing a package characteristic vector of the package to be palletized, namely;
Wherein, the Is the material code for the material code,The historical average density of the same material package is obtained from the cloud end and is expressed as kg/m3;
In this embodiment, the material code of the carton is 1, the material code of the woven bag is 2, the material code of the foam box is 3, and the material code of the hard plastic is 4.
S133, constructing a history stack type feature vector, namely;
Wherein, the For the average of the lengths of all packages in a history of successful stack i,For the arithmetic average of the width of all packages in the history successful stack i,For the maximum height of an individual package in a history of successful stack i,Is the code of the main material and is used for the processing of the main material,The average density of packages in a historically successful stack i was calculated based on the weight to volume ratio.
S134, screening from the historical successful stack types according to a preset cosine similarity algorithm to obtain candidate stack types;
;
In this embodiment, S >0.75, and the candidate stack types with the top five similarity ranks are calculated according to the cosine similarity algorithm, and in other practical embodiments, the value of S may be adjusted.
S135, screening the candidate stack types according to a preset optimal stack type matching rule to obtain an optimal stack type, and uploading package information and the optimal stack type corresponding to the current package to be stacked to a cloud end.
A reinforcement learning environment is constructed that includes a state space, an action space, and a reward function.
The state space comprises geometric characteristics of candidate stack types, attributes of packages to be stacked and tray space data, wherein the geometric characteristics of the candidate stack types comprise layers of the stack types and package arrangement modes, the attributes of the packages to be stacked comprise sizes, weights and shapes of the packages, and the tray space data comprise shapes and residual space sizes.
The action space is used for selecting one from the candidate stack type sets as a current stacking scheme;
And the reward function calculates the comprehensive reward score according to the feasible path of the package to be piled, the space score of the candidate stack type and the support score.
That is to say,;
Wherein, the 、、The feasible path score, the space score and the support score are respectively,、、The weight coefficients are respectively corresponding weight coefficients, and the weight coefficients can be adjusted.
Then constructing a strategy network (Actor network) and a value network (Critic network) of the PPO algorithm, and randomly initializing network parameters.
And carrying out quantitative evaluation on the candidate stack types, wherein the quantitative evaluation comprises feasible path quantitative analysis, space score calculation and support score calculation, and obtaining a feasible path score, a space score and a support score.
In a specific embodiment, the feasible path quantization analysis comprises the steps of:
For each candidate stack, the shortest collision-free path length of the robotic arm from the starting location to the parcel target placement location is calculated, and the score is mapped according to the path length ratio, and in a specific embodiment, the path length is shortest, for example, 1 score, and the path length is longest, for example, 0 score.
And determining whether the joint angle of the mechanical arm is within a preset safety range when the target placement position executes the action, and if the joint angle is out of the preset safety range, the feasible path score is 0.
Judging whether the flexible clamping jaw device of the mechanical arm collides with a preset package position in the grabbing and placing process, and if collision risk exists, dividing a feasible path into 0.
Normalizing the scores to the [0,1] interval to obtain the final feasible path score.
In a specific embodiment, a score is calculated from the utilization of the pallet space by the candidate stack, space utilization = occupied pallet space volume/total pallet volume, and space utilization is mapped to the [0,1] interval as a space score.
In a specific embodiment, the support score is obtained according to the stability of the candidate stack, wherein the stability comprises the coverage area occupation ratio of the lower part of the package and whether the gravity center projection is in the support surface, and the score is 1 when the requirement is met and 0 when the requirement is not met.
And training a strategy network according to the PPO reinforcement learning algorithm by combining a state space and an action space, and performing iterative optimization.
In a specific embodiment, data sampling is performed based on the current policy network, candidate stack types are selected from the action space, new states, rewards and marks of whether to end are acquired after execution, and state-action-rewards-next state sequence data are recorded.
And updating strategy network parameters through a PPO algorithm according to the sequence data, optimizing and selecting the strategy of the candidate stack type, updating value network parameters according to the sequence data, repeating the data sampling and network updating processes for a plurality of times, and gradually optimizing the iterative strategy network and the value network.
And stopping training after the continuous multi-round iteration rewarding change is smaller than a threshold value or reaches the preset training round number, and obtaining the trained strategy network.
Based on the trained strategy network, simulating and executing the candidate stack types, calculating to obtain a comprehensive rewarding score according to the feasible path, the space score and the support score of the package to be piled, and outputting the candidate stack type with the highest comprehensive rewarding score as the optimal stack type.
And S14, if the tray is not empty, acquiring the optimal stack type of the current tray from the cloud.
If the tray is not empty, namely the current package to be stacked is not the first package, the tray is already matched with the optimal stack type when the first package is placed on the tray, and therefore the optimal stack type matched with the tray can be directly obtained.
S2, carrying out point cloud segmentation on the trays stacked and wrapped through a preset segmentation model, calculating the gaps of the trays and generating a stacking path by combining a preset path planning algorithm, and specifically comprising the following steps:
s21, acquiring tray point cloud data for stacking packages to be stacked through a binocular depth camera, wherein the tray point cloud data comprises stacked packages and gaps. The binocular camera only scans the corresponding area of the tray, so that the calculated amount is reduced.
S22, segmenting the package outline on the tray according to a preset YOLOv segmentation model and tray point cloud data to obtain a segmentation result, wherein the segmentation result comprises available gaps.
And (3) performing expansion operation on the segmentation result, wherein in the embodiment, the expansion operation is to enlarge the gap boundary by 3-5mm, so as to ensure the operation safety margin of the mechanical arm.
Specifically, the segmentation results are a wrapped bounding box and a segmentation mask image.
S23, performing preliminary screening on available gaps in the segmentation result according to the structural characteristics and the arrangement rules of the optimal stack type, and eliminating the available gaps which conflict with the structure of the optimal stack type.
In one embodiment, the determination rule of the structural conflict includes that the geometric size and shape of the available gap do not conform to the arrangement rule of the stack, or that the position of the available gap cannot meet the requirement of the support stability of the stack. For example, if the optimal stack requires packages to be stacked in a transverse direction (long side X-axis), then the minimum bounding rectangle width of the available gaps is less than the package long side dimension, then the optimal stack is considered to be a conflict, if the optimal stack is designed as a pyramid, i.e., the number of lower packages is greater than the number of upper packages, and if a certain available gap is at the edge and cannot be fully supported by the lower packages, then the conflict is considered.
And S24, traversing all available gaps obtained after preliminary screening, calculating the minimum circumscribed rectangle of each gap, screening all the minimum circumscribed rectangles which are not smaller than the package size, and summarizing the minimum circumscribed rectangles into a gap candidate set.
S25, calculating the space utilization rate and the optimal placement pose of each candidate space in the space candidate set, and summarizing all the optimal placement poses into a candidate placement pose list, wherein the candidate placement pose list is arranged according to the space utilization rate from high to low.
S26, acquiring the current pose, the candidate gap and the optimal placement pose of the mechanical arm, constructing a tray geometric model based on tray point cloud data, and acquiring a working space model carrying an anti-collision area mark.
In this embodiment, the anticollision area is mainly a portal frame, and it is required to ensure that the mechanical arm does not strike the portal frame in the moving process, and the working space model carrying the anticollision area mark is the portal frame safety boundary.
And S27, generating a plurality of candidate paths meeting preset constraint conditions based on an improved RRT algorithm.
The constraints include spatial constraints and acceleration constraints;
The space constraint condition is that a candidate path does not collide with a tray geometric model or an anti-collision area, a random tree is generated according to the current pose of the mechanical arm, a spherical area around the optimal placement pose is wrapped, sampling points are randomly generated in a working space, a node closest to the sampling points is selected from the tree, a step delta is expanded from the closest node to the sampling points, a new node is generated, delta can be 80mm in a specific embodiment, whether the pose of the new node collides with a portal frame is checked, and the node is abandoned after collision.
In a specific embodiment, an 80mm safety buffer is provided around the gantry.
The acceleration constraint condition is that the corner acceleration of the candidate path does not exceed a preset threshold.
In a specific implementation mode, three continuous nodes are taken, the joint angle corresponding to each node is determined through a rotary encoder arranged on the mechanical arm, and the change rate of the joint angle is calculated by combining the displacement change and the time interval between the nodes, so that the corner acceleration is obtained.
Comparing the calculated corner acceleration with a preset threshold value, if the acceleration exceeds the threshold value, the mechanical arm moves too fast, the package possibly falls down due to inertia, at the moment, the path node or the path segment is discarded, sampling or path planning is conducted again, and if the acceleration is within the threshold value range, the node or the path segment is reserved.
And (3) carrying out the acceleration calculation and judgment on the complete candidate path segment by segment to ensure that the corner acceleration on the whole path meets the requirement, and if the unsatisfied part exists, carrying out optimization adjustment on the path or directly removing the path.
And S28, scoring the candidate paths meeting the constraint conditions according to a preset path scoring rule, wherein the scoring content comprises a space safety score and an acceleration smoothness score, the space safety score is judged according to the minimum distance between the path and the obstacle, the space safety score is higher when the distance is larger, the acceleration smoothness is judged according to the reciprocal of the maximum corner acceleration of the path, and the acceleration smoothness score is higher when the acceleration is smaller.
And carrying out weighted calculation according to the preset weight coefficients of the space safety score and the acceleration smoothing score to obtain a final score, wherein the weight coefficients are adjustable.
And S29, taking the candidate path with the highest score as a stacking path, and converting the candidate path into a mechanical arm joint angle-time sequence.
S3, controlling the flexible clamping jaw device to grasp the package to be palletized, correcting the grasping gesture in real time by combining feedback of a preset torque sensor, and controlling the mechanical arm to execute palletizing according to a palletizing path, wherein the method specifically comprises the following steps of:
s31, calling preset clamping force parameters according to wrapping materials to obtain initial clamping force, wherein the flexible clamping jaw device comprises clamping jaws and pneumatic tendons for driving the clamping jaws, a torque sensor is pre-installed on the flexible clamping jaw device, and a rotary encoder and an inertia measurement unit are pre-installed on the mechanical arm.
The moment sensor is used for detecting the stress condition of the tail end of the mechanical arm, monitoring the three-dimensional force (Fx, fy, fz) and moment (Mx, my, mz) of the contact point of the clamping jaw and the package in real time, the rotary encoder is used for feeding back the joint angle and reading the real-time angle of each joint of the mechanical arm, and the inertia measurement unit is used for detecting the vibration state of the tail end and collecting the triaxial acceleration and the angular velocity of the mechanical arm.
S32, controlling the pneumatic tendon to drive the clamping jaw to grasp the package to be palletized with initial clamping force.
In this embodiment, the initial clamping force of the woven bag isThe initial clamping force of the foam box isThe initial clamping force of the hard box body is。
S33, monitoring real-time clamping force through a torque sensor in the stacking process of the mechanical armEstimating the deformation quantity of the package to be stacked through the moment change rate, and when the deformation quantity is detected to exceed a preset deformation threshold value, namelyAnd dynamically adjusting the clamping force in real time.
The formula of the dynamic adjustment is as follows,WhereinIs a preset control parameter.
Maintaining rate of pressure change。
S34, acquiring a joint angle fed back by the rotary encoder and terminal acceleration acquired by the inertial measurement unit, and estimating the actual grabbing pose deviation between the actual pose and the target pose through Kalman filtering fusion data.
The actual grasping pose deviation comprises position deviation,,) Angle deviation [ ],,)。
And S35, generating a joint compensation instruction according to the actual grabbing pose deviation and the PID controller, and correcting the grabbing pose of the mechanical arm according to the joint compensation instruction.
In this embodiment, the process of calculating the compensation amount according to the actual capturing pose deviation and the PID controller is to synthesize the control amount according to the PID controller and the preset control parameter, and generate the joint compensation instruction according to the control amount.
In the present embodiment, the control parameters kp=0.8, ki=0.2, kd=0.1.
The joint motor of the mechanical arm receives the joint compensation instruction, adjusts the joint angle and realizes posture correction.
And S36, triggering a clamping jaw release instruction when the moment sensor detects a preset contact force condition, and completing placement of packages to be stacked.
In this embodiment, when the torque sensor detects a Z-axis contact force Fz >5N, the jaw release command is triggered to complete parcel placement, and this embodiment determines that the condition Fz >5N is parcel contact with the tray surface.
S37, acquiring the placement pose of the current package, and calculating the barycenter coordinate of the current package by combining the package size, as shown in fig. 3.
The gravity center coordinate is the coordinate of the gravity center,;
;
The position and posture of the device are (x, y,),To place the rotation angle.
And acquiring the barycenter coordinates of the rest packages on the current tray, and calculating by combining the barycenter coordinates of the current packages to obtain the overall barycenter coordinates of all the packages on the tray, specifically accumulating the barycenter contributions of all the packages.
And acquiring a stable center coordinate of the tray, and calculating a gravity center offset by combining the integral gravity center coordinate, wherein the offset is the Euclidean distance between the integral gravity center coordinate and the stable center coordinate of the tray.
S38, comparing the gravity center offset with a preset early warning range.
In one embodiment, three threshold ranges are provided, including a safety range, an early warning range, and a hazard range, and the center of gravity offset is compared with the three threshold ranges, respectively.
Wherein the gravity center offset is less than or equal to 50mm and belongs to a safety range, package stacking can be continuously carried out, and the package placing state on the tray can be updated in real time;
And when the gravity center offset is within the early warning range, executing a gravity center offset control strategy by combining the integral gravity center coordinate and the stable center coordinate.
The gravity center offset control strategy is to make the subsequent package be placed in the gravity center opposite direction area preferentially, and increase the lateral pressure by 10% -20% according to the clamping force, so as to inhibit the toppling trend.
The gravity center offset is greater than 80mm, the system immediately triggers emergency treatment, the current tray stacking is stopped, and the AGVs under the trays are controlled to be dispatched to the manual rechecking area.
S4, when the segmentation result of the tray is matched with the optimal stack type, a stacking three-dimensional model is generated, the stacking three-dimensional model is bound with the AGV trolley below the tray, and the AGV trolley is controlled to automatically warehouse in, and the method specifically comprises the following steps:
s41, analyzing the segmentation result in real time, and judging whether the package layout in the segmentation result accords with the optimal stack type, specifically, judging whether the available space on the current tray, the package layout and the like accord with the conditions required by the optimal stack type.
For example, it is checked whether the size, shape, position of the available void can place the remaining packages in an optimal stack, whether the position and posture of the placed package meet the specifications of the optimal stack, etc.
If so, the segmentation result is matched with the optimal stack type.
The stacking can be ensured to meet the expectations by analyzing the segmentation result in real time and judging whether the segmentation result is matched with the optimal stacking type.
S42, acquiring package information and placement positions of all packages on the tray, and generating a stacking three-dimensional model of the current tray and all packages through a WebGL engine.
Specifically, the system collects the position coordinates, dimensions, and attitude information of all packages on the current pallet, and the relevant data of the pallet itself, and converts these data into a format suitable for WebGL processing, including converting the spatial coordinate data into three-dimensional vectors, and converting the geometry information of the packages and pallet into polygonal mesh data.
Creating a three-dimensional scene by using a WebGL engine, creating three-dimensional models of the package and the tray according to the converted data, drawing the three-dimensional models into the scene to form a complete stacking three-dimensional model, displaying the stacking state of the current tray in real time, generating the stacking three-dimensional model by using the WebGL engine, and realizing visual display of stacking conditions.
S43, associating identification information for the stacking three-dimensional model, and acquiring information of the AGV below the tray, wherein the information comprises the number, the position, the running state and the like of the AGV.
And establishing a corresponding relation in a system database, binding the identification information with the information of the AGV, so that the system can correspond the stacking three-dimensional model with a specific AGV, and a foundation is provided for subsequent control of the AGV.
Generating navigation information for the AGV trolley according to the package information, wherein the navigation information comprises position coordinates of a target warehouse and a travel path planning instruction, and the AGV trolley automatically travels according to a planned path after receiving the information.
The system controls the AGV trolley to transport the pallet loaded with the piled packages to a target warehouse according to the navigation information, automatic warehousing operation is completed, subsequent cargo management and transportation are facilitated, and logistics efficiency is improved.
Based on the same inventive concept, the embodiment of the application also discloses an automatic stacking device, which is based on an automatic stacking system, wherein the automatic stacking system comprises a mechanical arm and a flexible clamping jaw device at the tail end of the mechanical arm, as shown in fig. 4, and comprises the following modules:
The optimal stack type matching module is used for acquiring package information of packages to be stacked and matching the current packages to be stacked with the optimal stack type by combining the package information with historical stack type data of the automatic stacking system;
The stacking path planning module is used for carrying out point cloud segmentation on the trays packaged in a stacking way through a preset segmentation model to obtain a segmentation result, and calculating the gaps of the trays and generating a stacking path by combining an optimal stack type and a preset path planning algorithm;
The grabbing gesture correction module is used for controlling the flexible clamping jaw device to grab the package to be palletized, correcting the grabbing gesture in real time by combining feedback of a preset torque sensor, and controlling the mechanical arm to execute palletizing according to a palletizing path;
and the automatic warehousing module is used for generating a stacking three-dimensional model when the segmentation result of the tray is matched with the optimal stack type, binding the stacking three-dimensional model with the AGV trolley below the tray, and controlling the AGV trolley to automatically warehouse.
In a specific embodiment, the optimal stack matching module comprises the following units:
The first optimal stack type matching unit is used for acquiring package information of packages to be stacked according to a preset acquisition device, wherein the acquisition device comprises a code scanning device and a binocular depth camera, the packages to be stacked are scanned according to the code scanning device to obtain surface single information, the package surface materials and the package sizes of the packages to be stacked are acquired according to the binocular depth camera, a unique ID of the packages to be stacked is generated according to the surface single information, and package information is formed by integrating the package surface materials and the package sizes into a package information and is related to the ID;
The second optimal stack type matching unit is used for determining the position of the tray for stacking the packages to be stacked according to the face sheet information and judging whether the tray is empty or not;
If the tray is empty, acquiring a historical successful stack type of the automatic stacking system from the cloud according to the material of the surface of the package, and screening the historical successful stack type according to a cosine similarity algorithm to obtain a candidate stack type;
And if the tray is not empty, acquiring the optimal stack type of the current tray from the cloud.
In a specific embodiment, the second optimal stack matching unit comprises the following subunits:
the optimal stack type matching subunit is used for constructing a reinforcement learning environment comprising a state space, an action space and a reward function, and the reward function is calculated according to a feasible path of a package to be stacked, a space score of a candidate stack type and a support score;
Carrying out quantitative evaluation on the candidate stack types, wherein the quantitative evaluation comprises feasible path quantitative analysis, space score calculation and support score calculation, so as to obtain a feasible path score, a space score and a support score;
According to the PPO reinforcement learning algorithm, a strategy network is trained by combining a state space and an action space, iterative optimization is carried out, candidate stack types are simulated and executed based on the trained strategy network, a comprehensive rewarding score is obtained through calculation according to a feasible path, a space score and a support score of a package to be piled, and the candidate stack type with the highest comprehensive rewarding score is output as an optimal stack type.
In a specific embodiment, the palletizing path planning module comprises the following units:
The first stacking path planning unit is used for acquiring tray point cloud data for stacking packages to be stacked, and dividing the package outline on the tray according to a preset YOLOv dividing model and the tray point cloud data to obtain a dividing result, wherein the dividing result comprises available gaps;
the second stacking path planning unit is used for primarily screening available gaps in the division result according to the optimal stack type and eliminating the available gaps which conflict with the structure of the optimal stack type;
The third stacking path planning unit is used for traversing all available gaps obtained after preliminary screening, calculating the minimum circumscribed rectangle of each gap, screening all minimum circumscribed rectangles which are not smaller than the wrapping size, summarizing the minimum circumscribed rectangles into a gap candidate set, calculating the space utilization rate and the optimal placement pose of each candidate gap in the gap candidate set, summarizing all the optimal placement poses into a candidate placement pose list, and arranging the candidate placement pose list according to the space utilization rate.
The fourth stacking path planning unit is used for acquiring the current pose, the candidate gap and the optimal placement pose of the mechanical arm, constructing a tray geometric model based on tray point cloud data and acquiring a working space model carrying an anti-collision area mark;
The fifth stacking path planning unit is used for generating a plurality of candidate paths meeting preset constraint conditions based on an improved RRT (remote radio unit) algorithm, wherein the constraint conditions comprise space constraint conditions and acceleration constraint conditions, the space constraint conditions are that the candidate paths do not collide with a tray geometric model or an anti-collision area, and the acceleration constraint conditions are that the corner acceleration of the candidate paths does not exceed a preset threshold value;
and the sixth stacking path planning unit is used for scoring the candidate paths meeting the constraint conditions according to a preset path scoring rule, and taking the candidate path with the highest score as the stacking path.
In a specific embodiment, the grabbing gesture correction module comprises the following units:
The first grabbing gesture correction unit is used for calling preset clamping force parameters according to the wrapping materials to obtain initial clamping force, the flexible clamping jaw device comprises clamping jaws and pneumatic tendons for driving the clamping jaws, the flexible clamping jaw device is provided with a torque sensor in advance, and the mechanical arm is provided with a rotary encoder and an inertia measurement unit in advance;
The second grabbing gesture correction unit is used for controlling the pneumatic tendon to drive the clamping jaw to grab the package to be palletized with an initial clamping force;
The third grabbing gesture correction unit is used for monitoring real-time clamping force through the torque sensor in the process of carrying out stacking by the mechanical arm, and dynamically adjusting the real-time clamping force when detecting that the deformation of the package to be stacked exceeds a preset deformation threshold;
The fourth grabbing gesture correcting unit is used for acquiring the joint angle fed back by the rotary encoder and the tail end acceleration acquired by the inertial measurement unit to estimate the actual grabbing gesture deviation, generating a joint compensation instruction according to the actual grabbing gesture deviation and the PID controller, and correcting the grabbing gesture of the mechanical arm according to the joint compensation instruction;
And the fifth grabbing gesture correction unit is used for triggering the clamping jaw to release an instruction when the moment sensor detects a preset contact force condition, so as to finish the placement of the packages to be stacked.
In a specific embodiment, an automatic palletizing device further comprises the following modules:
The gravity center offset early warning module is used for acquiring the placement pose of the current package, calculating the gravity center coordinates of the current package in combination with the package size, acquiring the gravity center coordinates of the rest packages on the current tray, and calculating the overall gravity center coordinates of all the packages on the tray in combination with the gravity center coordinates of the current package;
Acquiring a stable center coordinate of the tray, calculating a gravity center offset by combining the integral gravity center coordinate, and comparing the gravity center offset with a preset early warning range;
And when the gravity center offset falls within the early warning range, executing a gravity center offset control strategy by combining the integral gravity center coordinate and the stable gravity center coordinate.
Based on the same inventive concept, the embodiment of the present application further discloses a computer readable storage medium, where at least one instruction, at least one program, a code set, or an instruction set is stored, where at least one instruction, at least one program, a code set, or an instruction set can be loaded and executed by a processor to implement the automatic palletizing method provided by the above method embodiment.
Based on the same inventive concept as above, the embodiments of the present application also disclose a computer readable storage medium, in which at least one instruction, at least one program, a code set, or an instruction set is stored, the at least one instruction, the at least one program, the code set, or the instruction set being loaded and executed by a processor to implement the automatic palletizing method as described above.
Those skilled in the art will appreciate that all or part of the steps of implementing the above embodiments may be implemented by hardware, or may be implemented by a program to instruct related hardware, and the program may be stored in a computer readable storage medium, where the computer readable storage medium includes, for example, a usb disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a magnetic disk, or an optical disk, and other various media in which program codes may be stored.
The foregoing is illustrative of the present application and is not to be construed as limiting thereof, but rather as various modifications, equivalent arrangements, improvements, etc., which fall within the spirit and principles of the present application.