Illuminating light source control method and system for metal additive manufacturing
By combining multi-angle light source illumination with a deep learning model, the brightness of the light source is dynamically adjusted, solving the problem of difficult defect detection caused by single-angle illumination in metal additive manufacturing. This achieves efficient defect identification and illumination optimization, improving monitoring effectiveness and system intelligence.
Patent Information
- Application Number
- CN202511392871.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-27
- Publication Date
- 2025-11-14
AI Technical Summary
In existing metal additive manufacturing (SLM) processes, the single-angle lighting method makes it difficult to detect minute defects on the powder bed surface, especially low-contrast defects, which are easily missed or misjudged, affecting the quality monitoring effect.
Images are acquired using multi-angle light source illumination, and a deep learning network image analysis model is constructed. By using current regulation and light intensity regulation models, the brightness of the light source is dynamically adjusted to optimize the illumination configuration, and a closed-loop feedback system is established.
It improves the accuracy and robustness of defect identification, achieves adaptive optimization of illumination configuration, and enhances the image monitoring effect and the real-time performance and reliability of process monitoring in metal additive manufacturing.
Smart Images

Figure CN120940664A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of additive manufacturing technology, and in particular to a method and system for controlling lighting sources in metal additive manufacturing. Background Technology
[0002] SLM (Synthetic Molding Machine) is a major technology in additive manufacturing of metal materials. This technology uses a laser as an energy source and scans the metal powder bed layer by layer according to the path planned in the 3D CAD slicing model. The scanned metal powder melts and solidifies to achieve a metallurgical bonding effect, and finally obtains the metal part designed in the model. In the metal additive manufacturing SLM process, online monitoring of the powder laying and melting process is of great significance for timely detection and correction of manufacturing defects. Existing SLM equipment is usually equipped with industrial cameras and lighting devices to monitor the powder bed.
[0003] CN118876421B discloses an additive manufacturing apparatus and method based on machine vision. The apparatus includes a molding film, a molding base, an image acquisition device, a first light source for providing illumination light, a second light source for providing curing light, a third light source for providing guide light, and a control device. An interval for filling printing material can be formed between the molding film and the molding base. The illumination light and guide light are insensitive wavelengths to the printing material. During the additive manufacturing process, the guide light can be combined with the curing light. The guide light is configured to carry a target pattern of the layer to be molded and project it onto the molding base. The image acquisition device is configured to acquire a first image including the target pattern and the molding layer based on the illumination light and the guide light. The control device is configured to control the molding base to move until the molding layer and the target pattern projected by the guide light are aligned, based on the first image and preset alignment information.
[0004] Currently, single-light source illumination is generally used in metal additive manufacturing (SLM) processes, with a camera capturing images of the powder bed surface. However, single-angle illumination has limitations. For minute defects on the powder bed surface, the single illumination direction and lack of shadow contrast can cause them to blend with the background brightness, leading to missed detections or misjudgments by the detection algorithm. Low-contrast defects are particularly difficult to capture, affecting the quality monitoring effect. Summary of the Invention
[0005] In view of this, the present invention proposes a method and system for controlling lighting sources in metal additive manufacturing, which can perform real-time online detection of the illumination during the printing process and adjust the light source based on the online detection results, thereby improving the accuracy of defect monitoring.
[0006] The technical solution of this invention is implemented as follows: Firstly, this invention provides a method for controlling an illumination source in metal additive manufacturing, comprising the steps of: S1. After each layer of powder is laid or printed, the powder bed or part surface is irradiated from different directions and images are collected to obtain an image training set. S2. Construct an image analysis model based on a deep learning network, input the image training set into the model for iterative training, and output the image's defect information, illumination score vector, and defect region mask. S3. Construct a current adjustment model, compare each value of the illumination score vector with the score threshold, use the current adjustment model to calculate the current increase, and adjust the driving current of the light source in the direction below the score threshold. S4. Construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. Obtain the area ratio of the reflective region based on the defect area mask. If the area ratio of the reflective region exceeds the ratio threshold, use the light intensity adjustment model to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and use the diagonal compensation lighting adjustment model to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and output the final light source intensity.
[0007] Based on the above technical solutions, preferably, step S1 includes the following sub-steps: S11, A light source is installed above the forming chamber of the SLM equipment. The light source includes a ring light source and multiple LED flashlights, which are evenly distributed around the ring light source. S12, after each layer of powder is laid, the ring light source is turned off, and multiple LED flashlights are sequentially controlled to flash individually to illuminate the powder bed surface. An industrial camera is used to capture images to obtain images of the powder bed surface corresponding to different lighting directions. S13, laser sintering of the powder bed, after completing the laser scanning printing action, control the ring light source to turn on, irradiate the surface of the printed part, and obtain the printed image of the part; S14. Construct an image training set, which includes several image subsets. Store the powder bed surface images or part printing images corresponding to different lighting directions into the corresponding image subsets, and associate them with the corresponding light source information, powder information and shooting information to obtain the data-filled image training set.
[0008] Based on the above technical solutions, preferably, the light source information includes the position and light intensity of the LED flash and the brightness of the ring light source, the powder information includes the type of powder material, and the shooting information includes the shooting angle and height of the industrial camera.
[0009] Based on the above technical solutions, preferably, the image analysis model constructed based on a deep learning network in step S2 includes: an input layer, an image segmentation layer, a location encoding layer, a Transformer module, and a multi-task branch module, wherein... The input layer receives a single-channel grayscale image. The output of the input layer is connected to the input of the image segmentation layer. The image segmentation layer divides the image into multiple image blocks and obtains a fixed dimension through linear projection. The output of the image segmentation layer is connected to the input of the position encoding layer, and the output of the position encoding layer is connected to the input of the Transformer module. The position encoding layer uses a combination of relative position encoding and fixed dimensions before inputting it into the Transformer module for feature extraction. The output of the Transformer module is connected to the input of the multi-task module, which includes a classification branch, a segmentation branch, and a regression branch. The classification branch is used to output the defect type contained in each image, the segmentation branch is used to output the binary mask of the defect region, and the regression branch is used to output the illumination score information.
[0010] Based on the above technical solution, preferably, step S2 further includes a sub-step: S21, acquire the image training set, label the defect regions in each image, output including rectangular boxes and pixel-level segmentation masks, and simultaneously record the defect categories; S22, obtain the local average brightness and contrast change of each image, generate brightness unevenness labels, reflective area annotations and hot area annotations, which are used to train the regression task of illumination evaluation and obtain a standard image training set. S23, Construct an image analysis model. Based on the cross-entropy loss value, mean square error loss value, and BCE-Dice joint loss value, construct a comprehensive loss function. The cross-entropy loss value is used for defect classification, the mean square error loss value is used for illumination evaluation regression, and the BCE-Dice joint loss value is used for mask segmentation optimization. S24, input the standard image training set into the image analysis model for iterative training, using the AdamW optimizer, with an initial learning rate set to... The learning rate is dynamically adjusted using the CosineAnnealing strategy to train the final image analysis model. The image analysis model outputs image defect information, illumination score information, and defect region masks.
[0011] Based on the above technical solutions, preferably, the defect information of the image includes categories such as holes, accumulations, cracks and scratches; the illumination scoring vector includes brightness scoring values for each illumination direction; the brightness scoring values for each illumination direction are obtained by comprehensive weighted calculation based on the pixel grayscale mean, grayscale variance and contrast intensity of the image in the corresponding illumination direction; the defect region mask includes a binary mask image.
[0012] Based on the above technical solutions, preferably, step S3 includes the following sub-steps: S31, preset the scoring threshold, and obtain the illumination score value in the direction of brightness less than the scoring threshold; S32, Construct a current regulation model, and calculate the current increase based on the difference between the illumination score value in the direction of brightness less than the scoring threshold and the scoring threshold, the brightness regulation sensitivity coefficient, and the standard current; S33 adds the standard current to the current amplification to obtain the lighting output drive current, and adjusts the lighting intensity of the LED light source in the corresponding direction according to the lighting output drive current.
[0013] Based on the above technical solutions, preferably, step S4 includes the following sub-steps: S41, preset the proportion threshold, and obtain the total area of reflective regions with a pixel value of 1 in the binary mask image; S42, calculate the proportion of the reflective area based on the ratio of the total area of the reflective area to the total area of the image; S43, if the area ratio of the reflective region exceeds the ratio threshold, the PWM duty cycle of the LED light source corresponding to the reflective region is obtained, and a light intensity adjustment model is constructed. Based on the proportion of the reflective region exceeding the threshold, the PWM duty cycle of the corresponding LED light source is adjusted down according to the corresponding adjustment coefficient. S44, obtain the PWM duty cycle of the LED light source in the diagonal direction, and construct a diagonal compensation lighting adjustment model. Based on the PWM duty cycle of the LED light source in the diagonal direction and the PWM duty cycle of the corresponding LED light source is reduced, calculate the PWM duty cycle of the LED light source after compensation in the diagonal direction based on the diagonal compensation lighting adjustment model. S45 adjusts the light source intensity based on the reduced PWM duty cycle of the corresponding LED light source and the compensated PWM duty cycle of the LED light source in the diagonal direction, and outputs the final intensity of multiple LED light sources.
[0014] Secondly, the present invention also provides a lighting source control system for metal additive manufacturing, implemented using a lighting source control method for metal additive manufacturing, the system comprising: The acquisition module is used to irradiate the powder bed or part surface from different directions and acquire images after each layer of powder is laid or printed to obtain an image training set. The training module is used to build an image analysis model based on a deep learning network. It inputs the image training set into the model for iterative training and outputs the image's defect information, illumination score vector, and defect region mask. The first adjustment module is used to construct a current adjustment model, compare each value of the illumination score vector with the score threshold, calculate the current increase using the current adjustment model, and adjust the driving current of the light source in the direction below the score threshold. The second adjustment module is used to construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. It obtains the area ratio of the reflective area based on the defect area mask. If the area ratio of the reflective area exceeds the ratio threshold, the light intensity adjustment model is used to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and the diagonal compensation lighting adjustment model is used to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and outputs the final light source intensity.
[0015] Thirdly, the present invention also provides a computer-readable storage medium storing a program for a lighting source control method for metal additive manufacturing, wherein the program, when executed, implements a lighting source control method for metal additive manufacturing.
[0016] The lighting source control method and system for metal additive manufacturing of the present invention have the following advantages over the prior art: (1) By collecting images of illumination from multiple angle light sources, an image analysis model is constructed to analyze them, and the brightness data of the light source is controlled and adjusted based on the analysis results to establish a closed-loop feedback system for dynamic illumination adjustment. This not only improves the accuracy and robustness of defect identification, but also realizes the adaptive optimization of illumination configuration, adapts to various metal powder materials and complex working conditions, and greatly enhances the image monitoring effect in the metal additive manufacturing process. (2) By constructing an image analysis model, multi-task modeling of defect classification, region segmentation and image illumination evaluation is realized, which not only improves the comprehensiveness and accuracy of powder bed defect detection, but also provides intelligent and data-driven adjustment basis for the lighting system, and enhances the real-time performance and reliability of process monitoring. (3) Based on the analysis results output by the image analysis model, the brightness intensity of the corresponding light source is dynamically adjusted by the current adjustment model, the light intensity adjustment model and the diagonal compensation lighting adjustment model. This effectively eliminates shadows and overexposed areas, improves the overall brightness balance of the image and the recognizability of key feature areas, and provides more stable input conditions for subsequent image analysis. Attached Figure Description
[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0018] Figure 1 This is a flowchart of the lighting source control method for metal additive manufacturing according to the present invention; Figure 2This is a schematic diagram of the light source structure of the lighting source control method for metal additive manufacturing according to the present invention; Figure 3 A schematic diagram of a powder bed defect detection image taken using a multi-directional LED flash lamp for the illumination source control method of the present invention for metal additive manufacturing: Figure 4 A schematic diagram showing the uniform illumination of the formed part by a ring light source in the illumination source control method for metal additive manufacturing according to the present invention: Figure 5 This is a schematic diagram of the image analysis model structure of the lighting source control method for metal additive manufacturing according to the present invention. Detailed Implementation
[0019] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the scope of protection of the present invention.
[0020] like Figure 1-5 As shown, in a first aspect, the present invention provides a method for controlling an illumination source in metal additive manufacturing, comprising the steps of: S1. After each layer of powder is laid or printed, the powder bed or part surface is irradiated from different directions and images are collected to obtain an image training set.
[0021] Step S1 includes the following sub-steps: S11, A light source is installed above the forming chamber of the SLM equipment. The light source includes a ring light source and multiple LED flashlights, which are evenly distributed around the ring light source. S12, after each layer of powder is laid, the ring light source is turned off, and multiple LED flashlights are sequentially controlled to flash individually to illuminate the powder bed surface. An industrial camera is used to capture images to obtain images of the powder bed surface corresponding to different lighting directions. S13, laser sintering of the powder bed, after completing the laser scanning printing action, control the ring light source to turn on, irradiate the surface of the printed part, and obtain the printed image of the part; S14. Construct an image training set, which includes several image subsets. Store the powder bed surface images or part printing images corresponding to different lighting directions into the corresponding image subsets, and associate them with the corresponding light source information, powder information and shooting information to obtain the data-filled image training set.
[0022] As a specific embodiment, there are four LED flashlights. The ring light source is set above the forming chamber of the additive manufacturing equipment to provide uniform illumination for the entire powder bed area. The four LED flashlights are evenly distributed around the perimeter of the ring light source to achieve multi-directional directional illumination during the additive manufacturing process. After each layer of powder is laid, the light source control module controls the ring light source to turn off and controls the flashlights to flash individually in sequence. At the same time, it controls the industrial camera to capture images to obtain powder bed surface images corresponding to different lighting directions. The ring light source includes multiple light source units, which are arranged circumferentially outside the area covered by the field of view of the industrial camera. The center point of the ring light source coincides with the shooting center point of the industrial camera, forming an array light source. Each light source unit can output different light intensity based on its different viewing angle and position relative to the industrial camera.
[0023] It should be noted that the specific model of the industrial camera is HIKROBOTMV-CS050-60GM, which supports single-channel grayscale image acquisition with a resolution of 2448×2048.
[0024] The light source information includes the position and intensity of the LED flash and the brightness of the ring light source; the powder information includes the type of powder material; and the shooting information includes the shooting angle and height of the industrial camera.
[0025] S2. Construct an image analysis model based on a deep learning network, input the image training set into the model for iterative training, and output the image's defect information, illumination score vector, and defect region mask.
[0026] It should be noted that the model uses the ViT structure to build the image analysis model, and the network can be flexibly selected according to actual needs and target detection tasks. After being trained on a large-scale defect dataset, the model can automatically identify a variety of typical defects, including holes, piles, cracks, scratches, etc. At the same time, it comprehensively evaluates the brightness distribution, contrast and local reflection of the overall image and generates a lighting score vector. The image analysis model outputs information such as whether there are defects on the powder bed and the surface of the printed part, the type and location of the defects, and the overall and local illumination uniformity and brightness distribution of the current image; providing data support for subsequent light source control; based on the defect distribution and illumination evaluation results output by the deep learning model, the brightness, angle, and focal length of each flash lamp and ring light source are automatically adjusted in combination with the light source control; for example, when the model detects a local area with minor defects but insufficient brightness, the control module will increase the brightness of the corresponding flash lamp in that area to make the target area more uniformly exposed and the details clearer; if a reflective area is detected, the local illumination intensity will be reduced or the light source direction will be changed to reduce highlight interference.
[0027] In this embodiment, with each iteration of light source parameter adjustment and image acquisition, the system continuously utilizes a deep learning model to perform a new round of defect detection and illumination analysis, forming a closed-loop adaptive feedback control. This not only improves the comprehensiveness and accuracy of defect detection but also effectively ensures the balance of brightness and contrast in imaging, significantly reducing detection errors caused by poor illumination. Ultimately, this provides a solid data foundation for efficient monitoring of the additive manufacturing process and subsequent intelligent quality analysis.
[0028] Specifically, in step S2 of this embodiment, the image analysis model constructed based on a deep learning network includes: an input layer, an image segmentation layer, a location encoding layer, a Transformer module, and a multi-task branching module. The input layer is used to receive a single-channel grayscale image. The output of the input layer is connected to the input of the image partitioning layer. The image partitioning layer divides the image into multiple image blocks and obtains a fixed dimension through linear projection. Let the input image be X∈R 512×512×1 It is divided into 1024 patches, each patch being: X p ∈R 16 ×16×1 p=1,2,...,1024, X is the input grayscale image, X p Patch for a single image; Linear mapping to block vector: T p =We·Flatten(X p )+b e ,T p ∈R 768 W e ,b e T is a learnable parameter. p It is a block vector; The output of the image segmentation layer is connected to the input of the position encoding layer, and the output of the position encoding layer is connected to the input of the Transformer module. The position encoding layer uses a combination of relative position encoding and fixed dimensions before inputting it into the Transformer module for feature extraction. Each Encoder layer consists of a multi-head self-attention network and a feedforward neural network. The formula for calculating multi-head self-attention is: MHSA(Q,K,V)=Concat(head1,...,head) 12 W O ; A single attention head is defined as: head i =Softmax( Vi; The feedforward neural network is defined as: FFN(x) = GELU(xW1 + b1)W2 + b2; Among them, W O W1, W2, b1, b2 are learnable parameters; The output of the Transformer module is connected to the input of the multi-task module, which includes a classification branch, a segmentation branch, and a regression branch. The classification branch is used to output the defect type contained in each image, the segmentation branch is used to output the binary mask of the defect region, and the regression branch is used to output the illumination score information.
[0029] Among them, the output of the classification branch is: Y class =Softmax(W c ·h+b c ); Split branch output: Y seg =Sigmoid(F Decoder (h)); Regression branch output: Y reg =W r ·h+b r ; In the formula, h represents the output feature of the Transformer, and W... c ,b c W r ,b r For fully connected layer parameters, F Decoder A decoder network for segmentation masks.
[0030] It should be noted that the model adopts a modified standard ViT structure. The input is a single-channel grayscale image with a uniform size of 512×512. The image is divided into 16×16 patches, and 1024 tokens are generated for each image. The tokens are combined with relative position encodings and then input into the TransformerEncoder module. The model has a total of 12 stacked encoder layers, each configured with a 12-head multi-head self-attention mechanism. At the output, the model sets up a multi-task branch structure. The classification branch is activated through fully connected layers and Softmax, and outputs the main defect types of the image. The segmentation branch is activated through a decoder structure and Sigmoid, and outputs a binary mask of the defect region. The segmentation branch outputs the image brightness distribution vector through fully connected layers to assist in the adjustment of illumination intensity.
[0031] Step S2 in this embodiment further includes a sub-step: S21, acquire the image training set, label the defect regions in each image, output including rectangular boxes and pixel-level segmentation masks, and simultaneously record the defect categories; S22, obtain the local average brightness and contrast change of each image, generate brightness unevenness labels, reflective area annotations and hot area annotations, which are used to train the regression task of illumination evaluation and obtain a standard image training set. It should be noted that data annotation was completed through the CVAT platform, with technicians manually annotating defect areas in each image. The output included bounding boxes and pixel-level segmentation masks, and defect categories were recorded simultaneously. Illumination evaluation, on the other hand, analyzed the local brightness mean and contrast changes of the image, and an auxiliary script automatically generated brightness unevenness labels, reflective area annotations, and hotspot annotations for training the regression task of illumination evaluation. Finally, each sample record was organized in a multimodal JSON structure, containing information such as image path, defect label, segmentation mask path, and brightness score vector, supporting multi-task training input.
[0032] S23, Construct an image analysis model. Based on the cross-entropy loss value, mean square error loss value, and BCE-Dice joint loss value, construct a comprehensive loss function. The cross-entropy loss value is used for defect classification, the mean square error loss value is used for illumination evaluation regression, and the BCE-Dice joint loss value is used for mask segmentation optimization. S24, input the standard image training set into the image analysis model for iterative training, using the AdamW optimizer, with an initial learning rate set to... The learning rate is dynamically adjusted using the CosineAnnealing strategy to train the final image analysis model. The image analysis model outputs image defect information, illumination score information, and defect region masks.
[0033] The expression for the comprehensive loss function is: L total =L cls +λ1L reg +λ2L reg Among them, L cls Cross-entropy loss is used for defect classification; L reg Mean squared error loss, used for luminance score regression; L reg The BCE-Dice joint loss is used for mask segmentation optimization; the hyperparameters are set to λ1=1.0 and λ2=0.5.
[0034] During the analysis, the system receives image input from an industrial camera. After processing by the ViT model, it outputs defect location, category information, mask image, and brightness heatmap analysis results. Based on the output results, the brightness, on / off status, and focal length of the four LED flashlights and the ring light source are finely adjusted to enhance shadow areas, suppress reflections, or improve defect boundary contrast. All model output results are automatically written back to the log for source tracing and model retraining. The system supports an incremental learning mechanism. When there is a deviation between the model prediction and the actual image quality parameters, the sample can be automatically added to the retraining data pool to achieve self-learning closed-loop feedback.
[0035] This embodiment achieves multi-task modeling of defect classification, region segmentation, and image illumination assessment by constructing an image analysis model. This not only improves the comprehensiveness and accuracy of powder bed defect detection, but also provides intelligent, data-driven adjustment basis for the lighting system, significantly enhancing the real-time performance and reliability of process monitoring in SLM additive manufacturing.
[0036] In this embodiment, the image defect information includes categories such as holes, accumulations, cracks, and scratches. The illumination scoring vector includes brightness scoring values for each illumination direction. The brightness scoring values for each illumination direction are calculated by comprehensively weighting the pixel grayscale mean, grayscale variance, and contrast intensity of the image in the corresponding illumination direction. The defect region mask includes a binary mask image.
[0037] It should be noted that the model outputs a defect saliency heatmap with a resolution of 64×64. Each element in the heatmap has a value between 0 and 1, representing the degree of defect saliency in the corresponding area. Areas with values below 0.3 indicate poor visibility of defect identification. When the model finds that more than 50 consecutive pixels in a certain area have saliency values below 0.3, and the defect category corresponding to that area is determined to be accumulation or collapse, the model judges that the area has insufficient lighting and obvious occlusion.
[0038] The light score vector expression is as follows: L=w1×Mean+w2×Variance+w3×Contrast; In the formula, L is the brightness score, and w1, w2, and w3 are all weight parameters, which are set according to the brightness evaluation sensitivity of the specific application scenario.
[0039] The brightness score vector automatically analyzes local regions of the image through an auxiliary script, calculates the mean gray level, gray level variance, and contrast intensity of each region, and comprehensively weights these features according to preset or experimentally determined weight coefficients to obtain the brightness score value of each region. The scores of multiple regions are summarized to form the brightness score vector of the entire image, with the expression: S=[SLU,SRU,SRD,SLD], where SLU represents the brightness score value of the upper left LED flash, SRU represents the brightness score value of the upper right LED flash, SRD represents the brightness score value of the lower right LED flash, and SLD represents the brightness score value of the lower left LED flash.
[0040] The defect region mask includes a binary mask image. When the model detects a significant bright reflective area in the image, i.e., a specular reflection mask, it will be used for fine-tuning the lighting. The specular reflection mask is a 512×512 pixel binary image, where pixels with a value of 1 represent significant reflective areas. When the model determines that the area of the bright reflective area in the mask exceeds 5% of the total image area, this threshold has been experimentally determined to effectively avoid large-area reflective interference. The model will then further determine the spatial location of the reflective area and its corresponding light source direction.
[0041] S3. Construct a current adjustment model, compare each value of the illumination score vector with the score threshold, use the current adjustment model to calculate the current increase, and adjust the driving current of the light source in the direction below the score threshold. Step S3 includes the following sub-steps: S31, preset the scoring threshold, and obtain the illumination score value in the direction of brightness less than the scoring threshold, wherein the scoring threshold is the effective illumination threshold of 0.7 verified by experiments; S32, Construct a current regulation model, and calculate the current increase based on the difference between the illumination score value in the direction of brightness less than the scoring threshold and the scoring threshold, the brightness regulation sensitivity coefficient, and the standard current; It should be noted that for each light source direction i, if the illumination score is lower than the score threshold, the required current increase is calculated, expressed as follows: ΔI i =k1×(S thr -S i )×I std In the formula, S i For the illumination score in the i-th direction, S thr I is the scoring threshold. std The standard LED light source driving current, ΔI i Let k1 be the current increase required in the i-th direction, and k1 be the brightness adjustment sensitivity coefficient, which determines the sensitivity of converting the score difference into current increase. S33 adds the standard current to the current amplification to obtain the lighting output drive current, and adjusts the lighting intensity of the LED light source in the corresponding direction according to the lighting output drive current.
[0042] It should be noted that the lighting output drive current is calculated based on the current increase and the standard LED drive current, and the expression is as follows: I adj , i =I std +ΔI i In the formula, I adj , i Let be the lighting output drive current of the i-th LED light source, where the current increase of the i-th LED light source cannot exceed the maximum allowable current.
[0043] S4. Construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. Obtain the area ratio of the reflective region based on the defect area mask. If the area ratio of the reflective region exceeds the ratio threshold, use the light intensity adjustment model to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and use the diagonal compensation lighting adjustment model to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and output the final light source intensity.
[0044] In this embodiment, step S4 includes the following sub-steps: S41, preset the proportion threshold, and obtain the total area of reflective regions with a pixel value of 1 in the binary mask image; S42, calculate the proportion of the reflective area based on the ratio of the total area of the reflective area to the total area of the image; S43, if the area ratio of the reflective region exceeds the threshold, obtain the PWM duty cycle of the LED light source corresponding to the reflective region location, and construct a light intensity adjustment model. Based on the proportion of the reflective region exceeding the threshold, calculate and reduce the PWM duty cycle of the corresponding LED light source according to the corresponding adjustment coefficient. The expression is: PWM new =PWM init -k2(SS th ) In the formula, PWM new The adjusted PWM duty cycle, PWM init This represents the PWM duty cycle of the LED light source corresponding to the location of the reflective area, with a default value of 0.6. S is the area percentage of the currently detected reflective area. th k1 is the percentage threshold, and k2 is the adjustment coefficient; S44, obtain the PWM duty cycle of the diagonal LED light source and construct a diagonal compensation lighting adjustment model. Based on the PWM duty cycle of the diagonal LED light source and the reduction of the corresponding LED light source's PWM duty cycle, calculate the compensated PWM duty cycle of the diagonal LED light source using the diagonal compensation lighting adjustment model. The calculation expression is: PWM diag =PWM init +α(PWM init -PWM new ) In the formula, PWM diag α represents the PWM duty cycle of the diagonal LED flash, and α is the diagonal compensation coefficient. S45 adjusts the light source intensity based on the reduced PWM duty cycle of the corresponding LED light source and the compensated PWM duty cycle of the LED light source in the diagonal direction, and outputs the final intensity of multiple LED light sources.
[0045] In addition, the ring light source is adjusted according to a fixed compensation ratio to output the final intensity of multiple LED light sources and the brightness of the ring light source. The next round of image acquisition is illuminated according to the final intensity of multiple LED light sources and the brightness of the ring light source output in the previous round. The next round of image acquisition is input into the image analysis model for analysis and detection. If it is determined that there is no insufficient lighting in the photo and the area of the reflective region is lower than the proportion threshold, the ring light source adjustment is stopped, thus realizing closed-loop control of adjustment feedback detection.
[0046] This embodiment achieves multi-angle adjustable illumination of the powder bed and printed part surface through a combination of four flashlights and a ring light source. It can dynamically adjust the light source brightness and illumination angle according to the different material reflection characteristics and camera shooting angle, effectively eliminating shadows and overexposed areas, improving the overall brightness uniformity of the image and the recognizability of key feature areas, providing more stable input conditions for subsequent image analysis. Furthermore, the constructed image analysis model can identify powder bed defects, achieving high-precision multi-category defect detection under complex lighting and working conditions. The model, combined with an illumination feedback mechanism, further improves the stability of defect detection under uneven brightness or local reflection interference, effectively reducing false positive and false negative rates. Simultaneously, it implements a closed-loop mechanism that feeds back visual recognition results to the lighting system control. After each image acquisition, the system can automatically adjust the light source configuration based on the model analysis results, realizing an iterative optimization process of "image – recognition – dimming – re-recognition," possessing self-learning capabilities. This significantly improves the level of automated monitoring in the SLM additive manufacturing process, reduces the need for manual intervention, and enhances the system's robustness and intelligence.
[0047] In addition, the system automatically records the correspondence between each "lighting configuration - image effect - model judgment" to build a dynamic feedback database. When similar powder types, printing parameters, or image distribution characteristics appear later, the model can quickly call up the optimal historical lighting scheme, forming an empirical strategy transfer. At the same time, this feedback mechanism can also serve as a data source for incremental model learning, used to periodically optimize model performance and improve its adaptability to new working conditions and new materials.
[0048] By constructing an image analysis model to analyze images and controlling and adjusting the parameters of the light source to establish a closed-loop feedback system for dynamic illumination adjustment, not only can the accuracy and robustness of defect identification be improved, but also adaptive optimization of illumination configuration can be achieved, adapting to various metal powder materials and complex working conditions, greatly enhancing the image monitoring capability and system intelligence level in the metal additive manufacturing process.
[0049] Secondly, the present invention also provides a lighting source control system for metal additive manufacturing, implemented using a lighting source control method for metal additive manufacturing, the system comprising: The acquisition module is used to irradiate the powder bed or part surface from different directions and acquire images after each layer of powder is laid or printed to obtain an image training set. The training module is used to build an image analysis model based on a deep learning network. It inputs the image training set into the model for iterative training and outputs the image's defect information, illumination score vector, and defect region mask. The first adjustment module is used to construct a current adjustment model, compare each value of the illumination score vector with the score threshold, calculate the current increase using the current adjustment model, and adjust the driving current of the light source in the direction below the score threshold. The second adjustment module is used to construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. It obtains the area ratio of the reflective area based on the defect area mask. If the area ratio of the reflective area exceeds the ratio threshold, the light intensity adjustment model is used to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and the diagonal compensation lighting adjustment model is used to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and outputs the final light source intensity.
[0050] It should be noted that this system corresponds to the above-mentioned lighting source control method for metal additive manufacturing. All implementation methods in the above method embodiments are applicable to the embodiments of this system and can achieve the same technical effect.
[0051] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.
[0052] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working process of the system and modules described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0053] In the embodiments provided by this invention, it should be understood that the disclosed systems and methods can be implemented in other ways. For example, the device embodiments described above are merely illustrative. For instance, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0054] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0055] In addition, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.
[0056] If the aforementioned functions are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, ROM, RAM, magnetic disks, or optical disks.
[0057] Furthermore, it should be noted that in the system and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent solutions of the present invention. Moreover, the steps performing the above series of processes can naturally be executed in the order described, but are not necessarily required to be executed in chronological order; some steps can be executed in parallel or independently of each other. Those skilled in the art will understand that all or any step or component of the method and apparatus of the present invention can be implemented in any computing device (including processors, storage media, etc.) or network of computing devices, in hardware, firmware, software, or a combination thereof. This is something that those skilled in the art can achieve by using their basic programming skills after reading the description of the present invention.
[0058] Therefore, the object of the present invention can also be achieved by running a program or a set of programs on any computing system. The computing system can be a known general-purpose system. Therefore, the object of the present invention can also be achieved simply by providing a program product containing program code implementing the method or apparatus. That is, such a program product also constitutes the present invention, and the storage medium storing such a program product also constitutes the present invention. Obviously, the storage medium can be any known storage medium or any storage medium developed in the future. It should also be noted that in the apparatus and method of the present invention, it is obvious that the components or steps can be decomposed and / or recombined. These decompositions and / or recombinations should be considered equivalent to the present invention. Furthermore, the steps performing the above series of processes can naturally be performed in the order described, but are not necessarily required to be performed in chronological order. Some steps can be performed in parallel or independently of each other.
[0059] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.
Claims
1. A method for controlling an illumination source in metal additive manufacturing, characterized in that, Including the following steps: S1. After each layer of powder is laid or printed, the powder bed or part surface is irradiated from different directions and images are collected to obtain an image training set. S2. Construct an image analysis model based on a deep learning network, input the image training set into the model for iterative training, and output the image's defect information, illumination score vector, and defect region mask. S3. Construct a current adjustment model, compare each value of the illumination score vector with the score threshold, use the current adjustment model to calculate the current increase, and adjust the driving current of the light source in the direction below the score threshold. S4. Construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. Obtain the area ratio of the reflective region based on the defect area mask. If the area ratio of the reflective region exceeds the ratio threshold, use the light intensity adjustment model to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and use the diagonal compensation lighting adjustment model to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and output the final light source intensity.
2. The lighting source control method for metal additive manufacturing as described in claim 1, characterized in that, Step S1 includes the following sub-steps: S11, A light source is installed above the forming chamber of the SLM equipment. The light source includes a ring light source and multiple LED flashlights, which are evenly distributed around the ring light source. S12, after each layer of powder is laid, the ring light source is turned off, and multiple LED flashlights are sequentially controlled to flash individually to illuminate the powder bed surface. An industrial camera is used to capture images to obtain images of the powder bed surface corresponding to different lighting directions. S13, laser sintering of the powder bed, after completing the laser scanning printing action, control the ring light source to turn on, irradiate the surface of the printed part, and obtain the printed image of the part; S14. Construct an image training set, which includes several image subsets. Store the powder bed surface images or part printing images corresponding to different lighting directions into the corresponding image subsets, and associate them with the corresponding light source information, powder information and shooting information to obtain the data-filled image training set.
3. The lighting source control method for metal additive manufacturing as described in claim 2, characterized in that: The light source information includes the position and intensity of the LED flash and the brightness of the ring light source; the powder information includes the type of powder material; and the shooting information includes the shooting angle and height of the industrial camera.
4. The lighting source control method for metal additive manufacturing as described in claim 2, characterized in that, The image analysis model constructed based on a deep learning network in step S2 includes: an input layer, an image segmentation layer, a location encoding layer, a Transformer module, and a multi-task branch module. The input layer receives a single-channel grayscale image. The output of the input layer is connected to the input of the image segmentation layer. The image segmentation layer divides the image into multiple image blocks and obtains a fixed dimension through linear projection. The output of the image segmentation layer is connected to the input of the position encoding layer, and the output of the position encoding layer is connected to the input of the Transformer module. The position encoding layer uses a combination of relative position encoding and fixed dimensions before inputting it into the Transformer module for feature extraction. The output of the Transformer module is connected to the input of the multi-task module, which includes a classification branch, a segmentation branch, and a regression branch. The classification branch is used to output the defect type contained in each image, the segmentation branch is used to output the binary mask of the defect region, and the regression branch is used to output the illumination score information.
5. The lighting source control method for metal additive manufacturing as described in claim 2, characterized in that: Step S2 further includes a sub-step: S21, acquire the image training set, label the defect regions in each image, output including rectangular boxes and pixel-level segmentation masks, and simultaneously record the defect categories; S22, obtain the local average brightness and contrast change of each image, generate brightness unevenness labels, reflective area annotations and hot area annotations, which are used to train the regression task of illumination evaluation and obtain a standard image training set. S23, Construct an image analysis model. Based on the cross-entropy loss value, mean square error loss value, and BCE-Dice joint loss value, construct a comprehensive loss function. The cross-entropy loss value is used for defect classification, the mean square error loss value is used for illumination evaluation regression, and the BCE-Dice joint loss value is used for mask segmentation optimization. S24, input the standard image training set into the image analysis model for iterative training, using the AdamW optimizer, with an initial learning rate set to... The learning rate is dynamically adjusted using the CosineAnnealing strategy to train the final image analysis model. The image analysis model outputs image defect information, illumination score information, and defect region masks.
6. The lighting source control method for metal additive manufacturing as described in claim 5, characterized in that: The image defect information includes categories such as holes, build-ups, cracks, and scratches. The illumination scoring vector includes brightness scoring values for each illumination direction. The brightness scoring values for each illumination direction are calculated by comprehensively weighting the pixel grayscale mean, grayscale variance, and contrast intensity of the image in the corresponding illumination direction. The defect region mask includes a binary mask image.
7. The method for controlling an illumination source for metal additive manufacturing as described in claim 6, characterized in that: Step S3 includes the following sub-steps: S31, preset the scoring threshold, and obtain the illumination score value in the direction of brightness less than the scoring threshold; S32, Construct a current regulation model, and calculate the current increase based on the difference between the illumination score value in the direction of brightness less than the scoring threshold and the scoring threshold, the brightness regulation sensitivity coefficient, and the standard current; S33 adds the standard current to the current amplification to obtain the lighting output drive current, and adjusts the lighting intensity of the LED light source in the corresponding direction according to the lighting output drive current.
8. The method for controlling an illumination source for metal additive manufacturing as described in claim 7, characterized in that: Step S4 includes the following sub-steps: S41, preset the proportion threshold, and obtain the total area of reflective regions with a pixel value of 1 in the binary mask image; S42, calculate the proportion of the reflective area based on the ratio of the total area of the reflective area to the total area of the image; S43, if the area ratio of the reflective region exceeds the ratio threshold, the PWM duty cycle of the LED light source corresponding to the reflective region is obtained, and a light intensity adjustment model is constructed. Based on the proportion of the reflective region exceeding the threshold, the PWM duty cycle of the corresponding LED light source is adjusted down according to the corresponding adjustment coefficient. S44, obtain the PWM duty cycle of the LED light source in the diagonal direction, and construct a diagonal compensation lighting adjustment model. Based on the PWM duty cycle of the LED light source in the diagonal direction and the PWM duty cycle of the corresponding LED light source is reduced, calculate the PWM duty cycle of the LED light source after compensation in the diagonal direction based on the diagonal compensation lighting adjustment model. S45 adjusts the light source intensity based on the reduced PWM duty cycle of the corresponding LED light source and the compensated PWM duty cycle of the LED light source in the diagonal direction, and outputs the final intensity of multiple LED light sources.
9. A lighting source control system for metal additive manufacturing, implemented using the lighting source control method for metal additive manufacturing as described in any one of claims 1-8, characterized in that, The system includes: The acquisition module is used to irradiate the powder bed or part surface from different directions and acquire images after each layer of powder is laid or printed to obtain an image training set. The training module is used to build an image analysis model based on a deep learning network. It inputs the image training set into the model for iterative training and outputs the image's defect information, illumination score vector, and defect region mask. The first adjustment module is used to construct a current adjustment model, compare each value of the illumination score vector with the score threshold, calculate the current increase using the current adjustment model, and adjust the driving current of the light source in the direction below the score threshold. The second adjustment module is used to construct a light intensity adjustment model and a diagonal compensation lighting adjustment model. It obtains the area ratio of the reflective area based on the defect area mask. If the area ratio of the reflective area exceeds the ratio threshold, the light intensity adjustment model is used to adjust and reduce the PWM duty cycle of the LED in the reflective direction, and the diagonal compensation lighting adjustment model is used to adjust and increase the PWM duty cycle of the LED light source in the diagonal direction, and outputs the final light source intensity.
10. A computer-readable storage medium, characterized in that, The storage medium stores a lighting source control method program for metal additive manufacturing, which, when executed, implements a lighting source control method for metal additive manufacturing as claimed in any one of claims 1 to 8.
Citation Information
Patent Citations
Additive manufacturing device and method based on machine vision
CN118876421B