Application Background
In traditional equipment, when a robotic arm retrieves lithium batteries from a tray, it typically uses sensors to detect the presence of batteries. If a battery is detected, the robotic arm descends to the designated retrieval position to collect it; otherwise, it waits for a signal from the next sensor, and this cycle repeats. This process impacts production efficiency and capacity when the material tray is not full or is empty.
Meanwhile, when lithium batteries are being processed into the next step of "marking," the robotic arm cannot predict whether the lithium batteries picked up will be placed neatly at the marking station on the production line. Usually, it is necessary to manually straighten the position of the lithium batteries using a fixture before marking. Otherwise, the markings on the lithium batteries will be tilted after marking, which will not meet the quality standards.
To address the problems encountered by lithium battery manufacturers, Zheng Motion Technology provides an effective machine vision-based lithium battery loading and positioning system. This system takes a visual photograph of the material tray each time it is changed, and then uses image processing technology to locate and identify the position of each lithium battery sample on the tray. The identified positions of all lithium batteries in the tray are then sorted, and a robotic arm is guided to pick them up one by one.
With vision-guided assistance, the robotic arm can skip empty spaces on the material tray, thus avoiding unnecessary movement. Simultaneously, the robotic arm's loading coordinates are provided by the vision system, which assists the robotic arm in completing the loading, processing, and positioning processes while simultaneously handling material picking, simplifying the project's debugging procedures.
The visual inspection solution based on positive motion technology has the characteristics of fast inspection speed, high reliability and high production efficiency. It has good applicability in machine vision loading, processing and positioning in various industries, and also has a wide range of market application scenarios.
In the last lesson, we discussed the application case of color recognition, positioning, and sorting in machine vision solutions. In this lesson, we will share with you how to implement the function of lithium battery feeding and processing positioning.
Instructional Videos
01. Detection Principle
(I) Testing Requirements
The system matches and locates the current position of the lithium battery, outputs its coordinates to the robotic arm for grasping, and finally marks it.
(II) Software Algorithm
First, we use matching modeling to learn the shape template of the lithium battery, and then use the position result of the shape template as the reference position. Next, we perform nine-point calibration to convert our pixel coordinates into the world coordinate system. Finally, we display the position information of the lithium battery located by matching after calibration.
02. Software Implementation
1. Open ZDevelop software: Create a new project named "Color Recognition and Sorting.zpj" → Create a new "HMI" file → Create a new "main.bas" file (for writing the interface response function) → Create a new "global_variable.bas" file (for storing global variables and enabling HMI to run tasks automatically) → Create a new "InitLocator.bas" file (for initializing measurement parameters) → Create a new "draw.bas" file (for updating and drawing ROI data) → Create a new "camera.bas" file (for implementing camera acquisition function) → Add the files to the project.
2. Design the HM main interface.
3. Associate HMI main interface control variables.
4. The main function implemented by the code in this course is to extract the coordinates of nine Mark points and then perform coordinate system transformation.
(1) Obtain the coordinates of the points on the solid circle calibration plate.
ZV_CALGETSCAPTS (Parameter 1: Input calibration board single-channel image, Parameter 2: Calculated point coordinates, matrix type N rows 2 columns, Parameter 3: Threshold for extracting circles, Parameter 4: Circle polarity, 0-black, 1-white, Parameter 5: Minimum pixel area range for searching circles, Parameter 6: Maximum pixel area range for searching circles)
(2) Calculate the mapping point pair between pixel coordinates and world coordinates ZV_CALGETPTSMAP (parameter 1: input pixel coordinates, input matrix, parameter 2: sorted pixel coordinates, output matrix, parameter 3: sorted world coordinates, output matrix, parameter 4: actual distance between two adjacent Mark points) (3) Perform calibration ZV_CALCAM (parameter 1: pixel coordinates, parameter 2: world coordinates, parameter 3: generated calibration coefficients, output parameters, parameter 4: image width when pixel coordinates are obtained, parameter 5: image height when pixel coordinates are obtained, parameter 6: camera calibration type) (4) Calculate the calibration error ZV_CALERROR (parameter 1: calibration coefficients, parameter 2: pixel coordinates, parameter 3: world coordinates, parameter 4: TABLE index, output parameters, calibration error, in order of average error, minimum error, maximum error) (5) Coordinate transformation ZV_CALTRANSW (parameter 1: calibration coefficients, parameter 2: pixel coordinate x, parameter 3: pixel coordinate y, parameter 4: TABLE index, output parameters, in order of world coordinate x, world coordinate y)
Full code and sample image download address
▼
03 Operation Demonstration
(I) Operating Procedures
To check the running effect: Download the project to the controller → Use local image → Single acquisition → Click Match Modeling (to learn shape templates) → Click Coordinate Marker (to calibrate mark points) → Click Use Calibration (to convert the image coordinates of the sample to world coordinates) → Click Single Execution (to view the current sample detection results) → Click Continuous Run (to view the continuous run effect) → End.
(II) Effect Demonstration
That concludes our presentation on the application example of the Zhengdong Technology Machine Vision Motion Control All-in-One Machine: Lithium Battery Feeding and Positioning System.
For more exciting content, please follow the "Zheng Motion Assistant" WeChat official account. For related development environment and example code, please contact Zheng Motion's technical sales engineer: 400-089-8936.
This article is original content from Zheng Motion Technology. We welcome everyone to reprint it for mutual learning and to jointly improve China's intelligent manufacturing level. Copyright belongs to Zheng Motion Technology. Please indicate the source if you reprint this article.