A method for real-time simulation of a pipe bender
By employing a lightweight simulation model, kinematic modeling, pipe forming modeling, collision interference detection, and a real-time refresh mechanism with bidirectional data coupling, the system addresses the real-time limitations and computational redundancy issues in pipe bending machine simulation technology. This achieves a high-precision online simulation closed loop and supports rapid material deformation detection and 3D rendering.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHENZHEN ARCUCHI TECH CO LTD
- Filing Date
- 2026-01-23
- Publication Date
- 2026-05-01
AI Technical Summary
Existing pipe bending machine simulation technology lacks real-time performance, cannot synchronize with actual machinery, has high computational redundancy, and struggles to balance model accuracy and computational load. It also lacks a hardware-in-the-loop synchronization mechanism, making it difficult to complete the full simulation cycle of material deformation calculation, interference detection, and 3D rendering in a very short time.
By employing lightweight simulation models, kinematic modeling, pipe forming modeling, collision interference detection, bidirectional data coupling and clock alignment, and real-time refresh mechanisms, high-precision real-time simulation of the pipe bending machine's motion and pipe forming process is achieved through incremental solution and on-demand calculation.
It achieves hard real-time, low-latency online simulation closed loop, which can complete the entire simulation cycle of material deformation, interference detection and 3D rendering within a time imperceptible to the human eye, reducing the computational and rendering burden and improving the credibility and usability of simulation results.
Smart Images

Figure CN121578672B_ABST
Abstract
Description
A Real-Time Simulation Method for Pipe Bending Machines Technical Field
[0001] This invention relates to the field of digital simulation technology, specifically to a real-time simulation method for a pipe bending machine. Background Technology
[0002] With the development of Industry 4.0 and intelligent manufacturing, CNC pipe bending machines are widely used in aerospace, automotive manufacturing, shipbuilding and other fields. The pipe bending process involves complex processes such as multi-axis linkage, material plastic deformation, and interference and collisions between molds / fixtures / machine tools. Traditional debugging methods that rely on manual trial and error are prone to material waste, long debugging cycles, and strong dependence on process experience. In order to improve processing efficiency and yield, the industry usually hopes to use digital simulation to predict the processing effect, detect interference and collisions, and optimize process parameters before or during processing.
[0003] Currently, the simulation technologies related to pipe bending machines can be broadly categorized into the following types:
[0004] 1) Offline simulation scheme based on general CAD / CAE software: Static interference checks are performed through 3D model and kinematic simulation, which is usually an offline pre-run; the solution depends on manual triggering or batch processing calculation, and a single simulation can take several seconds to tens of seconds, making it difficult to synchronize with the machine tool movement for real-time rendering, and is more used for static verification before processing.
[0005] 2) Numerical simulation methods based on finite element analysis (FEA): For example, the patent document with publication number CN103792885A solves the position and attitude of the components and simulates the forming process by establishing a kinematic model of the mechanism. However, its solution speed is difficult to meet the requirements of real-time rendering. It usually adopts a non-real-time strategy of "solving first and then displaying / playing back the animation". There is a significant time difference between the simulation and the actual movement of the machine tool, which makes it difficult to support online adjustment and emergency stop prediction.
[0006] 3) Simple 3D preview function integrated into CNC system: mostly geometric preview of machining path, lacking high-fidelity material deformation model and dynamic response; and low refresh rate (for example, there are simple 3D preview functions with refresh rate of less than 5Hz), which is difficult to meet the millisecond-level response required by real-time control system.
[0007] The shortcomings of existing technology:
[0008] 1) Insufficient real-time performance and inability to synchronize with actual machinery: Most existing simulations are offline calculations. After the motion command is input, it takes several seconds to tens of seconds to calculate before generating offline animation. It is difficult to achieve synchronous simulation and dynamic feedback by following the actual movement of the pipe bending machine during the processing.
[0009] 2) Low algorithm efficiency and high computational redundancy: Traditional finite element or geometric solvers often do not perform "incremental / on-demand" computational optimization for pipe bending processes. The common practice is to solve the motion equations of the mechanism and the deformation equations of the material in every simulation, which results in a large amount of computation and high redundancy, making it difficult to support high-frequency refresh.
[0010] 3) There is a technical bias that “offline simulation is necessary to ensure simulation accuracy”: It is generally believed in this field that pipe bending simulation involves complex physical processes such as motion, forming and collision, and the amount of calculation is large. Therefore, offline calculation must be used to ensure simulation accuracy, thus the engineering path of “real-time simulation under the condition of ensuring fidelity” has been ignored for a long time.
[0011] 4) Lack of hardware-in-the-loop / strict synchronization mechanism, resulting in only loose coupling or offline operation: Existing simulation systems and CNC systems are mostly loosely coupled architectures. There is a lack of strict clock synchronization mechanism between sensor data, control commands and simulation status, making it difficult to achieve real-time synchronous simulation and online feedback control during the machining process.
[0012] 5) It is difficult to balance model accuracy and computational load, and accuracy is often sacrificed by "simplifying the model": Due to the high pressure of real-time computing, existing solutions often use relatively simple geometric approximations (such as building a simple cube according to the approximate shape). Although the computational load is reduced, the reliability of interferometric detection and simulation results is significantly reduced, making it difficult to meet the accuracy requirements of industrial applications.
[0013] 6) Difficulty in completing a complete simulation loop within the time window of "human eye delay imperceptible": The pipe bending process needs to complete a complete cycle of material deformation calculation, interference detection and 3D rendering in a very short time. However, existing technologies are unable to complete a complete simulation cycle within the usually required ≤30ms, resulting in screen stuttering, delayed feedback, and inability to support online process adjustment and safety warnings.
[0014] Therefore, existing technologies have shortcomings and need further improvement. Summary of the Invention
[0015] To address the problems existing in the prior art, this invention provides a real-time simulation method for pipe bending machines.
[0016] To achieve the above objectives, the specific solution of the present invention is as follows:
[0017] In this paper, "geometric deviation" refers to the maximum geometric deviation (e.g., maximum point-to-surface distance or critical dimension difference) of the outer surface mesh of the lightweight simulation model used for rendering / collision interference detection relative to the corresponding 3D model in the original design drawings.
[0018] This invention provides a real-time simulation method for a pipe bending machine, characterized by the following steps:
[0019] A) Model customization and lightweighting: Based on the original design drawings of the pipe bending machine, a simulation model of the corresponding model is generated, and the simulation model is lightweighted to reduce the amount of data for real-time rendering and calculation.
[0020] B) Kinematic modeling: Establish kinematic equations for each movable part in the simulation model. The kinematic equations include at least linear motion equations and circular motion equations. Establish parent-child binding relationships for each movable part so that the pose of the child part is obtained by superimposing its own motion and the motion of the parent part.
[0021] C) Pipe forming modeling: Establish a mathematical model of pipe plastic deformation, discretize the pipe model into a surface composed of triangular meshes, and divide the basic shape of the pipe into straight segments and curved segments. By spatial translation and rotation, the basic segments are spliced together to form the target pipe shape. During the pipe bending forming process, the target pipe shape is updated in real time according to the movement of the pipe bending machine and the forming action, and the pipe model is reconstructed or incrementally updated.
[0022] D) Collision Interference Detection: Construct a collision interference detection module to perform secondary collision detection on the interference surface between the pipe model and the simulation model. The secondary collision detection includes pre-detection of bounding volume and fine detection of line segment-triangle intersection to obtain collision interference results.
[0023] E) Two-way data coupling and clock alignment: A two-way data coupling interface is established between the pipe bending machine control module and the real-time simulation module. The control commands and simulation status are clock aligned, and the poses of each movable part in the simulation model are updated in real time according to the axis position and actuator status transmitted by the pipe bending machine control module. This ensures that the poses of each movable part in the simulation model correspond to the actual poses of the pipe bending machine in real time. The pipe forming results and / or collision interference results are fed back to the pipe bending machine control module in real time.
[0024] F) Real-time refresh mechanism: The simulation cycle is executed with a timestamp-driven refresh cycle, and incremental solution and on-demand calculation are used to update only the simulation model components with changing attitude and the pipe model with changing attitude, so as to reduce the end-to-end delay of a single simulation cycle and maintain the target refresh cycle.
[0025] This method achieves high-precision real-time simulation of the pipe bending machine's motion and the pipe forming process through a collaborative design of bidirectional data coupling, adaptive precision allocation, and incremental refresh.
[0026] Furthermore, the model customization and lightweighting includes:
[0027] The original mechanical drawings and their corresponding 3D models are split into independently movable parts; internal structural data is deleted or simplified to retain the outer shell surface, and the surface texture of the model is simplified; the lightweight simulation model is converted into OBJ and MTL formats and loaded into the 3D engine; and the accuracy of the simulation model meets the requirement that the geometric dimension deviation is less than 0.05mm.
[0028] Furthermore, the parent-child binding relationship includes:
[0029] The local coordinate system transformation of the sub-component relative to the parent component is recorded. During real-time calculation, the pose of the parent component is first obtained based on the linear motion equation and the circular motion equation, and then the local coordinate system transformation is superimposed to obtain the pose of the sub-component, thereby realizing the real-time calculation of the composite motion trajectory.
[0030] Furthermore, the tubular forming modeling includes:
[0031] The number of discrete points on the circumference of the bending section is dynamically adjusted according to the target refresh rate threshold (e.g., 30FPS, 60FPS). The number of discrete points on the circumference is controlled within the range of 8-32, which corresponds to 8-32 sides of the polygon of the bending section of the pipe model. This range is used to achieve a dynamic balance between the clarity of the pipe forming and the simulation refresh rate, while ensuring that the calculation accuracy error of the pipe bending arc does not exceed 0.1mm.
[0032] Furthermore, the dynamic adjustment of the number of discrete points on the circumference of the curved segment based on the target refresh frequency threshold is an adaptive adjustment, which includes:
[0033] The computation time of the previous refresh cycle is measured in real time, and the target refresh cycle is used as a constraint. When the computation time is less than 70% of the target cycle, 2-4 circular discrete points are added; when the computation time is more than 90% of the target cycle, 2-4 circular discrete points are reduced. At the same time, the number of line segments of the pipe model participating in collision interference detection is increased or decreased to keep the real-time simulation refresh within the target frame rate range (fluctuation amplitude not exceeding ±5FPS).
[0034] Furthermore, the secondary collision detection includes:
[0035] a) Pre-detection: Set the bounding body for the interference scene as a cuboid bounding body, and determine whether the endpoints of the line segments of the pipe model enter the cuboid bounding body, or whether the line segments intersect with the cuboid bounding body.
[0036] b) Fine detection: After entering the cuboid enclosure, calculate whether the straight line segment of the pipe model intersects with the interference surface of the simulation model; wherein, the interference surface of the simulation model is obtained by discretizing a number of quadrilateral surfaces attached to the surface of the simulation model, and each quadrilateral surface is composed of two triangles.
[0037] Furthermore, the precision detection includes:
[0038] Based on the spatial coordinates of the three vertices of the target triangle, establish the spatial plane equation Ax + By + Cz + D = 0, where A, B, and C are the components of the spatial plane normal vector in the x-axis, y-axis, and z-axis directions, respectively, D is the spatial plane constant term, and x, y, and z are the spatial coordinates of any point on the spatial plane. Based on the spatial coordinates of the two endpoints P0 and P1 of the target line segment, establish the line parametric equation L(t) = P0 + t(P1 - P0), where P0 and P1 are the spatial coordinates of the two endpoints of the target line segment, and t ∈ [0,1] is the line segment parameter. Calculate the intersection point of the line and the plane, and determine whether the parameter t corresponding to the intersection point is located in [0,1] and whether the intersection point is located within the triangular region. If both conditions are met, a collision interference is determined, and the collision determination accuracy can reach 0.02 mm.
[0039] Furthermore, the bidirectional data coupling interface is built using the Industrial Ethernet Profinet protocol, with a data transmission rate ≥100Mbps, including:
[0040] a) Model data interaction interface: The axis position and actuator status of the pipe bending machine control module are transmitted to the real-time simulation module in real time to update the pose of each movable part in the simulation model, so that the pose of each movable part in the simulation model corresponds to the actual pose of the pipe bending machine in real time, and the position correspondence error is ≤0.05mm, and the cylinder status of the simulation model is kept consistent with the cylinder status of the pipe bending machine.
[0041] b) Key data interaction interface for pipe shape attributes: The pipe forming action index, length / arc length, transition arc length, radius, radius increment, and rotation arc are exchanged in real time between the real-time simulation module and the pipe bending machine control module, with a data transmission delay of ≤10ms, so as to achieve accurate prediction of forming results;
[0042] c) Alarm detection interface: The collision interference result is transmitted to the pipe bending machine control module in real time, and the alarm signal response delay is ≤5ms;
[0043] The interface data includes a millisecond-level timestamp to ensure clock alignment between control commands and simulation states, with a time synchronization error of ≤1ms.
[0044] Furthermore, the bidirectional data coupling interface further includes trusted secure coupling and degradation control steps:
[0045] Each data packet transmitted between the pipe bending machine control module and the real-time simulation module carries a timestamp and sequence number, and performs CRC32 integrity verification on the data packets. The collision interference detection module and the calculation process for generating pipe shape attributes are deployed in a Trusted Execution Environment (TEE) and run, outputting proof information containing runtime environment metrics and binding it to the data packets for storage to form a traceable audit chain. When integrity verification fails, proof information verification fails, or timestamp anomalies meet preset trigger conditions, the real-time simulation module enters a security degradation mode, at least maintaining the coarse screening detection and alarm feedback of collision interference warning, and reducing or suspending high-precision mesh updates and 3D rendering refreshes of the pipe model to ensure the reliability and real-time performance of the security warning link.
[0046] Furthermore, the real-time refresh mechanism further includes adaptive precision allocation and predictive rendering compensation steps based on foveation points:
[0047] The real-time simulation module receives gaze point information from the gaze point acquisition module and divides the field of view into a gaze region (within ±15° of the center of the field of view) and a non-gaze region. For the gaze region, a first discrete precision (24-32 discrete points on the circumference of the curved section) is used to generate or update the pipe model, and a first patch density (8-12 triangular patches per square centimeter) is used to perform collision interference detection. For the non-gaze region, a second discrete precision (8-16 discrete points on the circumference of the curved section) is used to generate or update the pipe model, and a second patch density (2-4 triangular patches per square centimeter) is used, which is lower than the first patch density. The number of discrete points on the circumference corresponding to the first discrete precision is greater than the number of discrete points on the circumference corresponding to the second discrete precision. Based on the axis position and its change between the current frame and the previous frame, a linear prediction algorithm is used to predict the component pose and pipe shape parameters corresponding to the next refresh timestamp. The pose update and mesh update are performed in advance according to the prediction results to compensate for transmission and calculation delays (compensation amplitude ≤ 2ms) and stabilize the refresh cycle.
[0048] The technical solution of this invention has the following beneficial effects:
[0049] 1. Achieve hard real-time, low-latency online simulation closed loop: It can complete a complete simulation cycle (typically ≤30ms) including material deformation (pipe forming), interference detection and 3D rendering within a time window where the human eye cannot perceive the delay. In the embodiment, the real-time rendering cycle is less than 20ms and the end-to-end latency is less than 20ms. The screen is smooth and can be synchronized with the machine tool movement.
[0050] 2. While ensuring industrial-grade accuracy, the computational and rendering burden is significantly reduced: The simulation model is derived from the original mechanical drawings and is split, trimmed, and simplified according to independently movable parts. Internal data is deleted, leaving only the outer shell surface and simplifying the texture. While ensuring accuracy (error less than 0.05mm), the model data size is greatly reduced (from 798M to 39M in the example), providing a foundation for real-time simulation.
[0051] 3. The computational load of collision interference detection is significantly reduced and is configurable: A two-stage collision detection mechanism of "coarse screening of bounding bodies and fine inspection of line segments and triangles" is adopted. Pre-detection is first performed in a relatively broad cuboid bounding body. If it does not enter, it exits early. After entering, fine inspection is performed on the intersection of line segments and triangles on the interference surface, thereby controlling the collision interference detection time to less than 5ms. Moreover, the detection accuracy can be configured by the number of interference surfaces and the fit, adapting to different machine models / mold scenarios.
[0052] 4. Achieve virtual-real synchronization and "digital twin-level" credibility: Construct a two-way data coupling interface and align the control commands with the simulation state clock to ensure that the position of the simulation model corresponds strictly with the actual mechanical position and the cylinder state is consistent. Furthermore, the pipe forming results and collision warnings are transmitted back to the control system in real time, achieving millisecond-level response and hardware-in-the-loop synchronization, thereby improving the availability and credibility of the simulation results for on-site machine adjustment and safety control.
[0053] 5. Significantly reduces redundancy in full solution and steadily improves frame rate and real-time performance: The refresh mechanism differs from traditional full solution. It adopts incremental solution (based on the results of the previous frame, trading space for time) and on-demand computation (only updating the model of pose changes), and strictly drives the refresh based on timestamps, without depending on whether the previous computation is completed, ensuring timely refresh; achieving a frame rate of ≥50FPS in the 3D engine.
[0054] 6. Pipe forming simulation can adaptively balance display effect and refresh rate: By controlling the "number of points on the circle / number of polygon sides" of the bending section, the amount of pipe data can be controlled, which can maintain the real-time simulation refresh rate while ensuring the presentation effect, and is suitable for different accuracy requirements and hardware conditions.
[0055] 7. Shorten debugging and verification cycle, reduce specimen scrap rate and support training: With the support of "true virtual-real real-time mapping", the verification of bent pipe samples can be transformed from "actual machine trial production" to "virtual simulation verification". In the example, the verification cycle is shortened from an average of 7 days to an average of 1 hour, and it can be used for offline testing, training and teaching, reducing on-site machine occupation and trial and error costs. Attached Figure Description
[0056] Figure 1 shows the steps for lightweighting the simulation model;
[0057] Figure 2 shows a 3D model rendering of the pipe bending machine;
[0058] Figure 3 is a schematic diagram of the pipe drawing principle;
[0059] Figure 4 shows the interface of the real-time simulation system for the pipe bending machine;
[0060] Figure 5 shows the effect diagram of the pipe material;
[0061] Figure 6 shows the results of the collision interference detection. Detailed Implementation
[0062] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely for explaining the present invention and are not intended to limit the present invention. It should also be noted that, for ease of description, only the parts related to the present invention are shown in the accompanying drawings, and not all of them.
[0063] Referring to Figures 1-6, the present invention provides a real-time simulation method for a pipe bending machine, comprising the following steps:
[0064] A) Model customization and lightweighting: Based on the original design drawings of the pipe bending machine, a simulation model of the corresponding model is generated, and the simulation model is lightweighted to reduce the amount of data for real-time rendering and calculation.
[0065] B) Kinematic modeling: Establish kinematic equations for each movable part in the simulation model. The kinematic equations include at least linear motion equations and circular motion equations. Establish parent-child binding relationships for each movable part so that the pose of the child part is obtained by superimposing its own motion and the motion of the parent part.
[0066] C) Pipe forming modeling: Establish a mathematical model of pipe plastic deformation, discretize the pipe model into a surface composed of triangular meshes, and divide the basic shape of the pipe into straight segments and curved segments. By spatial translation and rotation, the basic segments are spliced together to form the target pipe shape. During the pipe bending forming process, the target pipe shape is updated in real time according to the movement of the pipe bending machine and the forming action, and the pipe model is reconstructed or incrementally updated.
[0067] D) Collision Interference Detection: Construct a collision interference detection module to perform secondary collision detection on the interference surface between the pipe model and the simulation model. The secondary collision detection includes pre-detection of bounding volume and fine detection of line segment-triangle intersection to obtain collision interference results.
[0068] E) Two-way data coupling and clock alignment: A two-way data coupling interface is established between the pipe bending machine control module and the real-time simulation module. The control commands and simulation status are clock aligned, and the poses of each movable part in the simulation model are updated in real time according to the axis position and actuator status transmitted by the pipe bending machine control module. This ensures that the poses of each movable part in the simulation model correspond to the actual poses of the pipe bending machine in real time. The pipe forming results and collision interference results are fed back to the pipe bending machine control module in real time.
[0069] F) Real-time refresh mechanism: The simulation cycle is executed with a timestamp-driven refresh cycle, and incremental solution and on-demand calculation are used to update only the simulation model components with changing attitude and the pipe model with changing attitude, so as to reduce the end-to-end delay of a single simulation cycle and maintain the target refresh cycle.
[0070] This method achieves high-precision real-time simulation of the pipe bending machine's motion and the pipe forming process through a collaborative design of bidirectional data coupling, adaptive precision allocation, and incremental refresh.
[0071] The model customization and lightweighting includes:
[0072] The original mechanical drawings and their corresponding 3D models are split into independently movable parts; internal structural data is deleted or simplified to retain the outer shell surface, and the surface texture of the model is simplified; the lightweight simulation model is converted into OBJ and MTL formats and loaded into the 3D engine; and the accuracy of the simulation model meets the requirement that the geometric dimension deviation is less than 0.05mm.
[0073] The parent-child binding relationship includes:
[0074] The local coordinate system transformation of the sub-component relative to the parent component is recorded. During real-time calculation, the pose of the parent component is first obtained based on the linear motion equation and the circular motion equation, and then the local coordinate system transformation is superimposed to obtain the pose of the sub-component, thereby realizing the real-time calculation of the composite motion trajectory.
[0075] The tubular forming modeling includes:
[0076] The number of discrete points on the circumference of the bending section is dynamically adjusted according to the target refresh rate threshold (e.g., 30FPS, 60FPS). The number of discrete points on the circumference is controlled within the range of 8-32, which corresponds to 8-32 sides of the polygon of the bending section of the pipe model. This range is used to achieve a dynamic balance between the clarity of the pipe forming and the simulation refresh rate, while ensuring that the calculation accuracy error of the pipe bending arc does not exceed 0.1mm.
[0077] The method of dynamically adjusting the number of discrete points on the circumference of the curved section according to the target refresh frequency threshold is called adaptive adjustment, and the adaptive adjustment includes:
[0078] The computation time of the previous refresh cycle is measured in real time, and the target refresh cycle is used as a constraint. When the computation time is less than 70% of the target cycle, 2-4 circular discrete points are added; when the computation time is more than 90% of the target cycle, 2-4 circular discrete points are reduced. At the same time, the number of line segments of the pipe model participating in collision interference detection is increased or decreased to keep the real-time simulation refresh within the target frame rate range (fluctuation amplitude not exceeding ±5FPS).
[0079] The secondary collision detection includes:
[0080] a) Pre-detection: Set the bounding body for the interference scene as a cuboid bounding body, and determine whether the endpoints of the line segments of the pipe model enter the cuboid bounding body, or whether the line segments intersect with the cuboid bounding body.
[0081] b) Fine detection: After entering the cuboid enclosure, calculate whether the straight line segment of the pipe model intersects with the interference surface of the simulation model; wherein, the interference surface of the simulation model is obtained by discretizing a number of quadrilateral surfaces attached to the surface of the simulation model, and each quadrilateral surface is composed of two triangles.
[0082] The precision detection includes:
[0083] Based on the spatial coordinates of the three vertices of the target triangle, establish the spatial plane equation Ax + By + Cz + D = 0, where A, B, and C are the components of the spatial plane normal vector in the x-axis, y-axis, and z-axis directions, respectively, D is the spatial plane constant term, and x, y, and z are the spatial coordinates of any point on the spatial plane. Based on the spatial coordinates of the two endpoints P0 and P1 of the target line segment, establish the line parametric equation L(t) = P0 + t(P1 - P0), where P0 and P1 are the spatial coordinates of the two endpoints of the target line segment, and t ∈ [0,1] is the line segment parameter. Calculate the intersection point of the line and the plane, and determine whether the parameter t corresponding to the intersection point is located in [0,1] and whether the intersection point is located within the triangular region. If both conditions are met, a collision interference is determined, and the collision determination accuracy can reach 0.02 mm.
[0084] The bidirectional data coupling interface is built using the Industrial Ethernet Profinet protocol, with a data transmission rate ≥100Mbps, including:
[0085] a) Model data interaction interface: The axis position and actuator status of the pipe bending machine control module are transmitted to the real-time simulation module in real time to update the pose of each movable part in the simulation model, so that the pose of each movable part in the simulation model corresponds to the actual pose of the pipe bending machine in real time, and the position correspondence error is ≤0.05mm, and the cylinder status of the simulation model is kept consistent with the cylinder status of the pipe bending machine.
[0086] b) Key data interaction interface for pipe shape attributes: The pipe forming action index, length / arc length, transition arc length, radius, radius increment, and rotation arc are exchanged in real time between the real-time simulation module and the pipe bending machine control module, with a data transmission delay of ≤10ms, so as to achieve accurate prediction of forming results;
[0087] c) Alarm detection interface: The collision interference result is transmitted to the pipe bending machine control module in real time, and the alarm signal response delay is ≤5ms;
[0088] The interface data includes a millisecond-level timestamp to ensure clock alignment between control commands and simulation states, with a time synchronization error of ≤1ms.
[0089] The bidirectional data coupling interface further includes trusted and secure coupling and degradation control steps:
[0090] Each data packet transmitted between the pipe bending machine control module and the real-time simulation module carries a timestamp and sequence number, and performs CRC32 integrity verification on the data packets. The collision interference detection module and the calculation process for generating pipe shape attributes are deployed in a Trusted Execution Environment (TEE) and run, outputting proof information containing runtime environment metrics and binding it to the data packets for storage to form a traceable audit chain. When integrity verification fails, proof information verification fails, or timestamp anomalies meet preset trigger conditions, the real-time simulation module enters a security degradation mode, at least maintaining the coarse screening detection and alarm feedback of collision interference warning, and reducing or suspending high-precision mesh updates and 3D rendering refreshes of the pipe model to ensure the reliability and real-time performance of the security warning link.
[0091] The real-time refresh mechanism further includes an adaptive precision allocation and predictive rendering compensation step based on the foveation point:
[0092] The real-time simulation module receives gaze point information from the gaze point acquisition module and divides the field of view into a gaze region (within ±15° of the center of the field of view) and a non-gaze region. For the gaze region, a first discrete precision (24-32 discrete points on the circumference of the curved section) is used to generate or update the pipe model, and a first patch density (8-12 triangular patches per square centimeter) is used to perform collision interference detection. For the non-gaze region, a second discrete precision (8-16 discrete points on the circumference of the curved section) is used to generate or update the pipe model, and a second patch density (2-4 triangular patches per square centimeter) is used, which is lower than the first patch density. The number of discrete points on the circumference corresponding to the first discrete precision is greater than the number of discrete points on the circumference corresponding to the second discrete precision. Based on the axis position and its change between the current frame and the previous frame, a linear prediction algorithm is used to predict the component pose and pipe shape parameters corresponding to the next refresh timestamp. The pose update and mesh update are performed in advance according to the prediction results to compensate for transmission and calculation delays (compensation amplitude ≤ 2ms) and stabilize the refresh cycle.
[0093] Working principle (method operation mechanism and data flow):
[0094] The core of the real-time simulation method for pipe bending machines in this invention is based on a "customized high-precision simulation model". Through rapid kinematics solution, real-time generation of pipe mesh, secondary collision detection, bidirectional data coupling clock alignment, and incremental / on-demand / timestamp-driven refresh, a hard real-time simulation closed loop that can be synchronized with the pipe bending machine processing is formed.
[0095] 1) Initialization Phase: Establishing virtual objects and computing foundations that can run in real time.
[0096] (1) Customization and lightweighting of simulation models
[0097] A 3D simulation model of the corresponding model is generated based on the original design drawings of the pipe bending machine. The model is then split, trimmed, and simplified according to the independently movable parts. Data inside the model is deleted, leaving only the outer shell surface and the texture is simplified. This significantly reduces the amount of data while ensuring engineering accuracy, making it easier for the 3D engine to load and render in real time (e.g., the original 798M is reduced to 39M).
[0098] (2) Establish the kinematic equations and the parent-child relationship.
[0099] A motion trajectory calculation model is established for each movable part, which is limited to two types of basic equations: linear motion equation and circular motion equation; and "parent-child" binding is performed according to mechanical assembly relationship, so that the pose of the child part is obtained by "superposition of its own motion and the motion of the parent part", thereby realizing real-time simulation of complex combined actions with low computational load.
[0100] (3) Establish a mathematical model for pipe forming (mesh generation rules)
[0101] The pipe surface is discretized into a triangular mesh. First, the straight and curved segments of the basic pipe shape are drawn. Then, the basic segments are spliced into the target pipe shape by spatial coordinate translation and rotation. During the forming process, the target pipe shape is changed in real time according to the actual forming action, and the mesh generation / update is repeated to simulate the pipe deformation process.
[0102] 2) Real-time operation phase: Closed-loop simulation is performed using a "timestamp-driven refresh cycle".
[0103] Each refresh cycle is triggered by a timestamp, independent of whether the previous frame has been calculated; and timely refresh is ensured through incremental / on-demand strategies.
[0104] (1) Control data input and clock alignment (virtual and real synchronization start point)
[0105] The pipe bending machine control module sends machine data (including multi-axis axisPos[] and the status of each cylinder) to the real-time simulation module through the "model data interaction interface". The real-time simulation module updates the pose of each movable part in the simulation model accordingly, so that the pose of each movable part in the simulation model corresponds to the actual mechanical pose in real time, and the position strictly corresponds to the actual mechanical position and the cylinder status is consistent, thus realizing virtual-real synchronization.
[0106] (2) Fast kinematics solution: update the pose of each component
[0107] The real-time simulation module calculates the current pose of each component based on the linear / circular motion equations and solves them by superimposing them according to the parent-child binding relationship, thereby obtaining the three-dimensional pose of the whole machine at the current moment.
[0108] (3) Real-time generation / update of pipe model: obtain the "current forming state"
[0109] The real-time simulation module is based on the real-time pose of each component of the simulation model obtained by the rapid kinematic solution in step (2) above, and combined with the pipe forming parameters and physical characteristics (including motion index, length / arc length, transition arc length, radius, radius increment and rotation arc) input by the pipe bending machine control module, changes the shape of the target pipe in real time and generates or updates the pipe triangular mesh model for display and subsequent detection.
[0110] To balance refresh rate and display / detection accuracy, the amount of mesh data can be controlled by adjusting the number of points on the curved section (number of polygon sides), thus finding a balance between achieving the desired presentation effect and ensuring the simulation refresh rate.
[0111] (4) Second-order collision interference detection: early rejection of coarse screening and confirmation of fine inspection
[0112] To perform interference judgment under real-time conditions, collision interference detection employs a two-stage mechanism:
[0113] Pre-detection (coarse screening of bounding body): Set a relatively broad cuboid bounding body. Proceed to the next step only when the endpoint of the pipe segment enters the bounding body; otherwise, exit the calculation.
[0114] Precise detection (line segment-triangle intersection): For the straight segment of the pipe entering the enclosing body, the intersection with several quadrilateral surfaces (each quadrilateral is composed of two triangles) attached to the interference surface of the pipe bending machine model is judged; if the intersection point is both on the line segment and within the triangle area, then a collision interference is determined to have occurred.
[0115] (5) Result output: Return forming parameters and alarms to achieve bidirectional closed loop.
[0116] The real-time simulation module transmits pipe forming result parameters (action index paramIdx, length len, transition arc length sTransLen / eTransLen, radius r, radius increment sRIncrement / eRIncrement, rotation) to the control module through the "pipe shape attribute data interaction interface" for result prediction; at the same time, it transmits early warning results such as collision interference results back in real time through the "detection alarm interface" to improve production safety.
[0117] (6) 3D engine rendering and display: visual monitoring and high frame rate refresh
[0118] The updated simulation model and pipe model are submitted to the 3D engine for rendering and display; the refresh mechanism adopts:
[0119] Incremental solution (based on the previous result, trading space for time);
[0120] On-demand computation (only updating the model with attitude changes to avoid redundant computation of the entire model);
[0121] Strict timestamp driven (refresh calculation starts as soon as the time arrives);
[0122] This enables high frame rate real-time display (e.g., frame rate ≥ 50 FPS) and keeps end-to-end latency at a low level.
[0123] 3) Summary of working principle (key points of closed loop)
[0124] Synchronization of control and simulation: The shaft position / cylinder status is input to the real-time simulation module, and the pose of the simulation model is updated in real time after kinematic solution.
[0125] Forming, Inspection and Feedback: Real-time generation of pipe mesh, execution of secondary collision detection, and feedback of forming parameters and alarm information to the pipe bending machine control module;
[0126] Real-time refresh guarantee: Incremental / on-demand / timestamp driven, ensuring continuous and stable refresh under real-time conditions.
[0127] Example 1: (A feasible implementation method for real-time simulation of a pipe bending machine)
[0128] This embodiment is based on the "pipe bending machine control module, real-time simulation module, 3D engine, collision interference detection module and bidirectional data coupling interface". It adopts a customized lightweight model, linear / circular kinematics parent-child binding, real-time generation of pipe triangular mesh, secondary collision detection, and timestamp-driven incremental on-demand refresh to achieve hard real-time simulation.
[0129] I. System Structure and Deployment Method
[0130] 1. Pipe bending machine control module
[0131] It is used to output the position data of each axis of the pipe bending machine and the status of the actuators such as the oil cylinder / clamping, and to receive the pipe forming result parameters and collision interference alarm signals returned by the real-time simulation module, thereby realizing the "control-simulation-feedback" closed loop.
[0132] 2. Real-time simulation module
[0133] Used for:
[0134] Receive data from the control module and perform clock alignment;
[0135] Calculate the pose of components in the virtual model of the pipe bending machine based on kinematic equations;
[0136] The pipe model is generated / updated in real time based on the forming parameters;
[0137] Perform a second-level collision interference detection;
[0138] Trigger the 3D engine to refresh the rendering and send back the result data.
[0139] 3. 3D Engine
[0140] Load the lightweight pipe bending machine simulation model (OBJ / MTL) and perform real-time rendering driven by timestamps, requiring a frame rate of 50 FPS or higher.
[0141] 4. Collision Interference Detection Module
[0142] A two-stage collision detection mechanism of "cubic prism enclosing body coarse screening and line segment-triangle fine inspection" is adopted. The line segments are taken from the pipe model, and the triangles are obtained by discretizing the quadrilateral surface attached to the interference surface of the pipe bending machine (a quadrilateral is composed of two triangles). The detection time is controlled within 5ms.
[0143] 5. Deployment Method
[0144] The real-time simulation method of this embodiment can be deployed on the pipe bending machine controller (e.g., the computing unit within the controller) to meet the hard real-time simulation requirement of end-to-end latency of less than 20ms.
[0145] II. Key Data Structures, Parameters, and Unified Conventions
[0146] 1) Machine data structure (from control module to real-time simulation module)
[0147] The control module periodically sends machine status data `MACHINE_STRU`:
[0148] `axisPos[AXIS_NUMS]`: Position of each axis (it is recommended to use the same unit as mm or rad and fix it in the system configuration);
[0149] `coreFwBkForward / coreFwBkBackward / ... / supportUp / supportDown`: Boolean values representing the states of various actuators such as cylinders, clamping mechanisms, and supports, used to ensure that the state of the simulation model is consistent with the actual state.
[0150] Convention 1: `AXIS_NUMS` is given by the machine configuration file (e.g., feed axis, rotary axis, bending axis, etc.) and corresponds one-to-one with the kinematic mapping table to avoid "multiple meanings for the same axis".
[0151] 2) Pipe forming properties and structure (from real-time simulation module to control module)
[0152] The real-time simulation module returns the pipe shape attributes `TUBE_STRU`:
[0153] `paramIdx`: Action index;
[0154] `len`: Length (or arc length of a uniform portion);
[0155] `sTransLen / eTransLen`: Start / end transition arc length;
[0156] `r`: radius; `sRIncrement / eRIncrement`: start / end radius increment;
[0157] `rotation`: Rotation radius.
[0158] This structure is used to enable real-time transmission and prediction of forming results.
[0159] 3) Performance and refresh parameters (values used in this example)
[0160] Rendering refresh cycle: After lightweighting, the real-time rendering cycle is less than 20ms;
[0161] End-to-end latency: less than 20ms;
[0162] Collision interference detection time: less than 5ms;
[0163] Frame rate: ≥50 FPS;
[0164] Simulation accuracy: error less than 0.05mm;
[0165] Agreement 2: The system adopts "strict timestamp-driven refresh", that is, the calculation of a new frame is started immediately when the timestamp is reached, regardless of whether the previous frame is completed; and the calculation is performed on demand, updating only the changed parts to avoid repeated calculation of the entire model.
[0166] III. Implementation Steps
[0167] Step S1: Simulation Model Customization and Lightweighting
[0168] S1.1 Generate a 3D model of the pipe bending machine based on the original mechanical drawings of the machine model, and divide it into several sub-models according to "independently movable parts" (such as clamps, bending dies, pushing mechanisms, support mechanisms, etc.).
[0169] S1.2 performs lightweight processing on each sub-model: internal data is deleted, and only the outer shell surface is retained; surface textures and small structures that do not affect interference (such as internal cavities, invisible thread details, etc.) are simplified.
[0170] S1.3 exports the lightweight sub-models to OBJ and MTL formats and loads them into the 3D engine.
[0171] Lightweight rendering example: Original model 798M, lightweight model 39M; before simplification, real-time rendering cycle >100ms and noticeable stuttering, after simplification, real-time rendering cycle <20ms and smooth playback.
[0172] Step S2: Establish kinematic equations and "parent-child binding" motion tree
[0173] S2.1 defines two types of fundamental kinematic equations: linear motion equations and circular motion equations, which serve as the basic motion descriptions for all movable parts.
[0174] S2.2 Creates a motion node (Node) for each sub-model. The node contains:
[0175] `parentId` (parent node ID);
[0176] `motionType∈{Linear,Circular}`;
[0177] `axisIndex` (the index mapped to `axisPos[]`);
[0178] `localTransform0` (initial local pose);
[0179] `motionParams` (such as the direction vector of a line, the center of a circle, the circumference axis, the radius, etc.).
[0180] S2.3 Establish parent-child binding:
[0181] The world pose of the child model is `T_world(child) = T_world(parent)T_local(child)`.
[0182] The `T_local(child)` is calculated from its linear / circular equation at the current axis position, thus achieving superposition of composite motions.
[0183] Step S3: Pipe forming model and triangular mesh generation rules
[0184] S3.1 Discretizes the pipe surface into a triangular grid, divides the basic shape of the pipe into straight segments and curved segments, and splices them into the target pipe shape through spatial translation and rotation.
[0185] S3.2 Linear Segment Mesh Generation: Generate two (or more) sets of circumferential cross-section points along the length `len` in the direction of the pipe centerline; connect adjacent cross-section points in sequence to form a quadrilateral, and then split it into two triangles to form a mesh surface.
[0186] S3.3 Mesh generation for curved segments: Based on parameters such as radius `r` and transition arc length `sTransLen / eTransLen`, the curved segment is discretized into several arc length sampling sections along the arc direction; a set of circumferential points is generated for each section and connected to adjacent sections to form a mesh.
[0187] S3.4 Discrete Precision Control: By controlling the "number of points on the circle (number of polygon sides)" of the curved segment, the amount of grid data is adjusted to achieve a balance between display effect and refresh rate.
[0188] To avoid ambiguity: In this embodiment, "number of points on the circle" is defined as the number of discrete points N on each circumferential cross section; the larger N is, the finer the mesh and the larger the amount of data.
[0189] Step S4: Construct a secondary collision interferometry detection scene (interference surface patch)
[0190] S4.1 In the simulation model of the pipe bending machine, identify the areas where interference may occur (such as the periphery of the bending die, the periphery of the clamping mechanism, the edge of the machine body, etc.), and attach several quadrilateral surfaces as "interference surface patches" to the 3D model surface of the area; each quadrilateral is divided into two triangles.
[0191] S4.2 Set a relatively broad cuboid bounding area (AABB or cuboid bounding area) as the pre-detection coarse screening area.
[0192] S4.3 Set the detection accuracy control strategy: The number and fit of the interference patches determine the detection accuracy, which can be configured according to the model and working conditions; in this embodiment, the configuration is fixed to the "Detection Scene Configuration File" and loaded at runtime.
[0193] Step S5: Establish a bidirectional data coupling interface and perform clock alignment.
[0194] S5.1 designs a bidirectional data coupling interface to align control commands with the simulation state clock, achieving millisecond-level response.
[0195] The S5.2 control module periodically sends "MACHINE_STRU" to the simulation module, which then updates the position of the simulation model and the state of the hydraulic cylinder accordingly, achieving virtual-real synchronization.
[0196] The S5.3 simulation module sends "TUBE_STRU" back to the control module to transmit the forming result to the control system in real time, and sends back early warning information such as collision interference through the detection alarm interface.
[0197] S5.4 Timestamp Alignment Implementation: Each transmitted and received data packet is accompanied by a timestamp (in this embodiment, the local clock of the control module is used as the reference timestamp). The real-time simulation module processes the data according to the "latest timestamp priority" to ensure that the simulation screen corresponds to the current mechanical state.
[0198] Step S6: Timestamp-driven real-time simulation loop (core running closed loop)
[0199] S6.1 sets the refresh cycle target to `Δt=20ms` (or no more than 20ms), which is triggered by a timestamp generated by a high-precision timer; the calculation of the current frame starts as soon as the timestamp is reached, regardless of whether the previous frame has been completed.
[0200] S6.2 On-demand calculation (Dirty mechanism): The real-time simulation module saves the previous frame `axisPos_prev[]` and the pose cache of each component; if the change in position of a certain axis is less than the threshold `ε_axis`, the component associated with that axis is marked as not to be updated, and only the components and incremental parts of the pipe that have changed are updated to avoid repeated calculation of the entire model.
[0201] S6.3 Kinematic Update: For components marked as needing updating, calculate the local pose according to their linear / circular equations, and recursively obtain the world pose from the root node according to the parent-child binding relationship, and update the simulation model.
[0202] S6.4 Pipe Model Update: Read / update the pipe properties of this frame (forming parameters corresponding to `TUBE_STRU`), and generate or incrementally update the pipe triangular mesh model based on the position of the pipe bending machine (simulation) and the forming physical characteristics.
[0203] S6.5 Level 2 Collision Detection:
[0204] Pre-detection: Determine whether the endpoints of several straight line segments of the pipe model enter the bounded area of the cuboid; if not, skip the fine detection.
[0205] Precision inspection: For each pipe segment entering the enclosure, perform segment-triangle intersection inspection with the interference surface patch triangle.
[0206] Calculate the plane coefficients A, B, C, and D from the three vertices of the triangle;
[0207] Establish the equation of the line segment from its two endpoints and calculate P, Q, R, M, N, and T;
[0208] Find the intersection point (x, y, z) and determine whether the intersection point is on the line segment and within the triangular region; if so, a collision interference has occurred.
[0209] To ensure real-time performance, this embodiment returns the result immediately after any collision is detected (early stop), ensuring that the detection time is less than 5ms.
[0210] S6.6 Result Feedback and Alarm: If a collision interference occurs, an alarm signal is sent to the control module through the detection alarm interface; at the same time, the pipe shape attribute `TUBE_STRU` of this frame is fed back for result prediction.
[0211] S6.7 Rendering Display: Submit the updated pipe bending machine simulation model and pipe model to the 3D engine for rendering; in the interface display, the pipe can be distinguished by color according to the first section / starting end of processing, and the pipe is highlighted when there is a collision to indicate the interference position.
[0212] IV. Implementation Results
[0213] After completing the above implementation steps, this embodiment can achieve the following:
[0214] 1. Hard real-time simulation with end-to-end latency <20ms;
[0215] 2. The simulation accuracy reaches an error of <0.05mm (the model is derived from the original drawings and maintains engineering accuracy even after being lightweighted).
[0216] 3. Frame rate ≥ 50 FPS, smooth gameplay;
[0217] 4. Collision interference detection takes less than 5ms and can be performed continuously during real-time simulation;
[0218] 5. The debugging cycle is significantly shortened, the scrap rate of test pieces is reduced, and offline testing, training and teaching are supported.
[0219] Example 2: (Real-time simulation method for pipe bending machine with trusted security coupling and degradation control)
[0220] This second embodiment is based on the first embodiment (real-time simulation closed loop), and further adds "trusted security coupling, running critical computations in a trusted execution environment (TEE), a traceable audit chain, and a security degradation mode" to improve the trustworthiness and anti-tampering capability of the simulation early warning link while ensuring real-time performance.
[0221] Example 2 still uses the bidirectional data coupling interface and data structure.
[0222] (MACHINE_STRU / TUBE_STRU), and maintain a real-time mechanism of "on-demand calculation + strict timestamp-driven refresh".
[0223] I. System Structure (A security module added based on Implementation Example 1)
[0224] Based on the existing structure of "pipe bending machine control module - real-time simulation module - 3D engine - collision interference detection module", the following new units are added:
[0225] 1. Trusted Execution Environment (TEE) (Trusted Computing Unit)
[0226] Used to perform at least one or a combination of the following key computations within an isolated, trusted runtime environment:
[0227] Collision interference detection calculation (outputs collision results and alarm level);
[0228] Calculate the shape properties of the pipe (output TUBE_STRU).
[0229] TEE can be implemented using equivalent trusted isolation methods such as ARMTrustZone Security World and IntelSGX (the implementation form is not limited, but it must have isolation and trusted measurement capabilities).
[0230] 2. Integrity Verification Module
[0231] Located at both ends of the data interface between the control module and the real-time simulation module, it performs message authentication code verification (MAC) on each data packet to detect tampering and replay.
[0232] 3. Audit Chain Recording Module (Traceable Log Chain)
[0233] After binding the "data packet header, key results and proof information", a chain hash record is performed to form a traceable audit chain for subsequent verification.
[0234] 4. Security Degradation Control Module
[0235] When an integrity / proof / timing anomaly is detected and the triggering condition is met, the system enters a security degradation mode: at least the coarse screening detection and alarm feedback of the collision warning are retained, and the high-precision mesh update / 3D rendering refresh is reduced or suspended.
[0236] II. Key Data Structures and Field Definitions
[0237] 1) Data Structure
[0238] The control module sends "MACHINE_STRU" to the simulation module, which contains the axisPos array of position data for each axis and Boolean values of the status of each cylinder (such as coreFwBkForward, etc.) to ensure that the position of the simulation model strictly corresponds to the mechanical position and that the cylinder status is consistent.
[0239] The simulation module sends a message to the control module: "TUBE_STRU", which contains key parameters such as forming action index, length / arc length, transition arc length, radius, radius increment, and rotation arc, to transmit the tube forming results back to the control system for prediction and verification.
[0240] 2) Added: Security data packet header (control module) (General-purpose real-time simulation module)
[0241] To implement "timestamp and sequence number + integrity verification", define the data packet header `SEC_HDR` (example fields are shown below; fields can be replaced with equivalent ones, but the semantics must be consistent):
[0242] `uint32seq`: Monotonically increasing frame sequence number (starting from 0, must be renegotiated before overflow and wrapback);
[0243] `uint64ts`: The sending side reference timestamp (unit: microseconds, µs), used for timing alignment and anomaly detection;
[0244] `uint8msgType`: Message type (e.g., 0=machine data, 1=pipe feedback, 2=alarm);
[0245] `uint8flags`: Flags (bit0 = downgrade mode, bit1 = contains proof information, etc.);
[0246] `uint8mac
[32] `: Message authentication code (e.g., HMAC-SHA256 result, 32 bytes in length).
[0247] 3) Added: Supporting information (TEE output supporting report)
[0248] Define the proof information `ATTEST_REP` (example field):
[0249] `uint8measHash
[32] `: Metric hash of code / configuration running within the TEE;
[0250] `uint8nonce
[16] `: Random number challenge (anti-replay);
[0251] `uint8sig
[64] `: TEE signature or equivalent integrity proof of (measHash||nonce||key output digest);
[0252] `uint64ts_tee`: Output timestamp on the TEE side.
[0253] 4) Key threshold parameters (value range and recommended values)
[0254] Refresh cycle: `Δt=20ms` (corresponding to strict timestamp driven refresh), which can be 20ms or no more than 30ms;
[0255] Timestamp tolerance: `Δts_max=3Δt` (60ms recommended), exceeding this is considered a timing anomaly;
[0256] Packet loss / sequence number jump tolerance: `G_max=2` (allows a maximum of 2 frames to be lost; exceeding this limit will result in an anomaly).
[0257] Integrity failure count threshold: `N_mac_fail=1` (one failure triggers degradation);
[0258] Failure count threshold: `N_att_fail=1` (one failure triggers downgrade);
[0259] Degradation duration: `N_degrade=200` frames (approximately 4 seconds at a 20ms cycle), during which recovery conditions are continuously monitored.
[0260] The above parameters are settings for an embodiment; engineering equivalent adjustments are allowed without departing from the spirit of the present invention.
[0261] III. Implementation Steps
[0262] Step S201: Initialization of Key and Proof Trust Root
[0263] 1. A shared symmetric key `K_mac` (256-bit) is pre-configured in the control module and the real-time simulation module for generating / verifying MACs. The key is stored in the TEE secure storage area. In the ordinary world, the MAC result can only be obtained by calling the TEE interface, and the key is not directly exposed.
[0264] 2. The pre-configured TEE verification public key `PK_tee` is placed in the control module and the real-time simulation module to verify `ATTEST_REP.sig`.
[0265] 3. Initialize the audit chain starting hash: `H_0=SHA256("INIT"||Device serial number||Time stamp)`.
[0266] Step S202: The control module encapsulates and sends the machine status (with sequence number / timestamp / MAC).
[0267] 1. The control module collects a frame of machine status and fills `MACHINE_STRU` (axisPos[] and cylinder status).
[0268] 2. Generate packet header `SEC_HDR`:
[0269] `seq=seq+1`;
[0270] `ts=current control module microsecond timestamp`;
[0271] `msgType=0`.
[0272] 3. Calculate the MAC: `mac=HMAC-SHA256(K_mac,SEC_HDR(excluding mac field)||MACHINE_STRU)`, and write the MAC to the packet header.
[0273] 4. Send the data packet `PKT_ctrl=SEC_HDR||MACHINE_STRU` to the real-time simulation module.
[0274] Step S203: Real-time simulation module package verification and timing consistency judgment
[0275] Upon receiving `PKT_ctrl`, the real-time simulation module processes it in the following order (the order is fixed to avoid ambiguity):
[0276] 1. Sequence number check: If `seq<=seq_last` is judged as replay / out-of-order, count `mac_fail` once and trigger the degradation condition; if `seq-seq_last>G_max+1` is judged as continuous packet loss exception and triggers the degradation condition.
[0277] 2. Timestamp check: Calculate `Δts=|ts-ts_expected|`, where `ts_expected=ts_last+Δt` (calculated based on the refresh cycle); if `Δts>Δts_max`, a timing anomaly is determined, triggering the degradation condition.
[0278] 3. MAC verification: Recalculate the MAC address locally and compare it with the original MAC address; if they do not match, trigger the downgrade condition.
[0279] 4. If the package verification passes, update `seq_last=seq` and `ts_last=ts`, and proceed to subsequent calculations.
[0280] This ensures that the interface concept of "clock alignment and millisecond-level response" still holds true, and strictly conforms to the "timestamp-driven refresh" refresh mechanism.
[0281] Step S204: Key calculations are executed in the TEE and proof information is generated.
[0282] 1. The real-time simulation module packages the following inputs into an `IN_tee` and sends it to the TEE:
[0283] This frame `MACHINE_STRU`;
[0284] The pipe status cached in the previous frame (such as the simplified description of the pipe mesh in the previous frame TUBE_STRU).
[0285] A summary of the collision interference detection scenario configuration (e.g., patch set ID and version number).
[0286] 2. The TEE internally executes at least one or a combination of the following:
[0287] Collision interference detection calculation (it is recommended to execute its decision logic within the TEE, and output `alarmLevel` and `collisionFlag`).
[0288] Pipe shape property calculation: Output `TUBE_STRU` (paramIdx, len, r, rotation, etc.).
[0289] 3. TEE output:
[0290] `OUT_tee={collisionFlag,alarmLevel,TUBE_STRU
[0291] (Optional), resultHash};
[0292] `ATTEST_REP={measHash,nonce,sig,ts_tee}`, where `sig` at least covers `resultHash`, ensuring that "proof information is bound to key outputs".
[0293] Step S205: Write the verification and audit chain (forming a traceable audit chain)
[0294] 1. Verify `ATTEST_REP.sig` using the real-time simulation module. If it fails, trigger the degradation condition.
[0295] 2. Generate audit log `LOG_i` (example includes items):
[0296] `seq,ts,msgType`;
[0297] `MACHINE_STRU digest hash_m`;
[0298] `OUT_tee.resultHash`;
[0299] `ATTEST_REP.measHash` and `ATTEST_REP.sig digest hash_sig`;
[0300] `collisionFlag,alarmLevel`.
[0301] 3. Calculate the chained hash: `H_i=SHA256(H_{i-1}||LOG_i)`; write `{H_i,LOG_i}` into a circular buffer (e.g., capacity 10,000 frames, approximately 200 seconds of recording).
[0302] 4. Optional: Upload audit chain fragments to the cloud or local read-only storage in batches at 1 second or 5 seconds for post-event verification.
[0303] Step S206: Postback and Render Refresh in Normal Mode
[0304] 1. If `collisionFlag=1`, an alarm will be immediately sent back to the control module through the "detection alarm interface" to improve security.
[0305] 2. If prediction is required, the `TUBE_STRU` data is sent back to the control module through the "Pipe Shape Attribute Data Interaction Interface" to achieve result prediction.
[0306] 3. Perform 3D engine rendering according to the refresh mechanism of Example 1: calculate on demand, only update the pose change model; strictly timestamp driven refresh.
[0307] IV. Security Degradation Mode (Triggering Conditions, Execution Actions, and Recovery Conditions)
[0308] 1) Downgrade trigger conditions (any one of these conditions must be met to trigger downgrade)
[0309] MAC verification failed (≥ `N_mac_fail`);
[0310] Prove that the verification failed (≥ `N_att_fail`);
[0311] The timestamp is abnormal (`Δts>Δts_max`) or the sequence number is abnormal (replay / out-of-order / packet loss exceeds the limit).
[0312] After entering the downgrade phase, set `degradeFlag=1` and count `degradeCnt=N_degrade`.
[0313] 2) Degrade the execution action (ensure that "at least the coarse screening early warning and alarm feedback are retained")
[0314] During the degradation process, the following actions are performed per frame:
[0315] 1. We will continue to accept and inspect packages (continuously monitor recovery conditions);
[0316] 2. Collision interference detection retains only coarse screening: Only the "enclosing body / cuboid enclosing body coarse screening" is run. Once a high-risk enclosing body is detected, an alarm is triggered and transmitted back. This action meets the requirement of "at least maintaining coarse screening detection and alarm transmission".
[0317] 3. Pause or reduce the frequency of high-precision mesh updates:
[0318] The pipe model only maintains a low-precision skeleton / centerline or a low-N value mesh;
[0319] The fine-tuning (line segment-triangle intersection) can be paused;
[0320] 4. Pause or reduce the frequency of 3D rendering refresh: For example, reduce the rendering frequency to `5FPS` or only refresh the screen when an alarm / status changes;
[0321] 5. Continuous audit chain recording: Record the downgrade reason code, downgrade start and end timestamps, and alarm events during the period.
[0322] 3) Recovery conditions (if met, exit the downgrade)
[0323] For 50 consecutive frames (approximately 1 second), the following conditions must be met simultaneously:
[0324] MAC verification passed consecutively;
[0325] The proof verification passes continuously (if TEE proof is stopped during the downgrade period, proof is generated for each frame in the recovery phase).
[0326] The timestamp / serial number is normal.
[0327] Once satisfied, clear `degradeFlag` and restore normal mode for fine-tuning and normal rendering refresh.
[0328] V. Implementation Results
[0329] This embodiment 2 further implements:
[0330] The data packets in the control / simulation link have integrity verification and anti-replay capabilities;
[0331] Key results are certified and bound by TEE, forming a traceable audit chain;
[0332] When tampering or timing anomalies occur, the system automatically enters a security degradation mode, while still maintaining the core safety functions of collision warning and alarm feedback. At the same time, it reduces non-critical computing to ensure that real-time performance and safety goals coexist.
[0333] Example 3: Real-time simulation method for pipe bending machine based on adaptive accuracy allocation and predictive rendering compensation of gaze point
[0334] This embodiment 3 is based on embodiment 1 (real-time simulation closed loop), and further adds the following:
[0335] 1) Receive gaze point information from the gaze point acquisition module and divide the field of view into a gaze region and a non-gaze region;
[0336] 2) For the gaze region, the pipe model is generated / updated using the first discrete precision (N1) and collision interference fine detection is performed using the first patch density (D1); for the non-gaze region, the second discrete precision (N2) and the second patch density (D2) are used; where N1>N2, D1>D2;
[0337] 3) Based on the axis position and changes of the current frame and the previous frame, predict the component pose and pipe shape parameters corresponding to the next refresh timestamp, and perform pose update and mesh update in advance to compensate for transmission and calculation delays and stabilize the refresh cycle.
[0338] This embodiment clearly provides the system structure, parameters, data structure, and steps.
[0339] I. System Structure (Modules added / expanded based on Implementation Example 1)
[0340] Based on the existing "pipe bending machine control module - real-time simulation module - 3D engine - collision interference detection module - bidirectional data coupling interface", the following modules are added / expanded:
[0341] 1. Focal Point Acquisition Module
[0342] Deployed on the display terminal side, it is used to output gaze point information. The display terminal can be:
[0343] AR glasses / VR headsets with eye tracking; or
[0344] Monitor + external eye tracker (USB / Ethernet connection).
[0345] The gaze point acquisition module outputs the gaze point coordinates (gx, gy) in the "screen coordinate system" and the confidence level conf, along with the timestamp ts_gaze.
[0346] 2. Field of View (LOD) Partitioning and Precision Scheduling Module
[0347] Deployed within the real-time simulation module: Based on the gaze point information, the display field of view is divided into gaze region and non-gaze region, and different pipe mesh discretization accuracy and collision interference detection patch density are assigned to different regions.
[0348] 3. Predictive Compensation Module
[0349] Deployed within the real-time simulation module: Calculates axis velocity / angular velocity based on axis position sequence and predicts axis position at the next refresh time, thereby predicting component pose and pipe shape parameters, and preparing the data required for the next frame rendering and detection in advance.
[0350] II. Key Parameters and Values
[0351] To avoid ambiguity, this embodiment uses the following parameters (which can be adjusted for engineering equivalents, but the semantics and constraints remain unchanged):
[0352] 1) Timing and refresh parameters
[0353] Refresh cycle: Δt = 20ms (i.e., 50 frames per second);
[0354] Control data reception period: consistent with the refresh period (20ms). If the control side has a higher frequency, the sampling will be aligned to the 20ms refresh point using the "latest timestamp".
[0355] Gaze output frequency: 120Hz (typical eye-tracking device), still usable below 60Hz but requires stronger filtering;
[0356] The maximum allowable foveation delay is L_gaze_max = 50ms (if this is exceeded, the "non-foveation degradation strategy" will be implemented, as described below).
[0357] 2) Field of view partitioning parameters (definition of the gaze area)
[0358] Screen resolution: Subject to actual device (e.g., 1920×1080).
[0359] Radius of the gaze area: R = min(0.18 × W, 0.18 × H) (W / H is the width and height of the screen in pixels), for example, when it is 1920 × 1080, R ≈ 194px;
[0360] Fixation smoothing time window: T_smooth=80ms (exponential smoothing of fixation points to prevent jitter);
[0361] Fog point dwell determination: The fog point will not switch partitions until it has continuously fallen in the same partition for at least T_dwell=100ms, in order to prevent frequent jitter from causing LOD to jump back and forth.
[0362] 3) Pipe mesh discretization accuracy (N1 / N2)
[0363] First discrete precision (viewing area): Number of discrete points on the circumference N1=32;
[0364] Second discrete precision (non-focused region): Number of discrete points on the circumference N2=16;
[0365] Constraint: N1 > N2
[0366] Note: N represents the number of sampling points for each circumferential section. The larger N is, the finer the grid and the larger the data volume.
[0367] 4) Collision interference detection patch density (D1 / D2)
[0368] First patch density (precise detection of the gaze area): The maximum number of triangles participating in the precision detection is D1=6000 (e.g., 3000 quadrilateral patches × 2 triangles).
[0369] Second patch density (non-focal area): Maximum number of triangles participating in detection, D2=1500;
[0370] Constraint: D1 > D2
[0371] Note: D1 / D2 does not change the basic mechanism of "secondary collision detection", but only regionalizes the "size of the patch set involved in the fine inspection stage", thereby reducing the overall computational burden while maintaining the quality of key areas.
[0372] 5) Predictive compensation parameters (for stable refresh)
[0373] Prediction lead time: Δt_pred = L_total + 0.5 × Δt;
[0374] in
[0375] L_total = L_net + L_comp + L_queue (representing interface transmission latency, computation time, and rendering queue waiting time, respectively).
[0376] In practice, a sliding window is used for statistics: L_total = median(L_total, the last 50 frames);
[0377] Axis speed limit: Set the maximum speed / angular velocity v_max[i] for each axis (from the model parameter table; if it cannot be obtained, use the 95th percentile speed of the most recent 1 second as the limit).
[0378] III. Data Structures (A new foveated structure has been added to avoid ambiguity)
[0379] Add a new gaze point data structure `GAZE_STRU` (example fields):
[0380] `uint64ts_gaze`: gaze point sampling timestamp (microseconds);
[0381] `floatgx,gy`: The pixel coordinates of the gaze point in the screen coordinate system (origin is the top left corner);
[0382] `floatconf`: Fove confidence [0,1];
[0383] `uint8deviceState`: Device status (0=normal, 1=occluded / lost, 2=calibrating).
[0384] Convention: When `conf<0.6` or `deviceState!=0`, the fove is considered invalid.
[0385] IV. Implementation Steps
[0386] Step S301: Initialization and Configuration Loading
[0387] 1. The real-time simulation module loads a lightweight pipe bending machine simulation model (OBJ / MTL) and instantiates it in the 3D engine;
[0388] 2. Load the collision interference detection scene configuration file to obtain the interference patch set, and record the information required for calculating the visibility of each patch projected onto the screen (e.g., the part ID to which the patch belongs, the spatial bounding box AABB, the axis-aligned bounding box).
[0389] 3. Set the refresh period Δt = 20ms and start the high-precision timer to generate the refresh timestamp sequence {ts_render(k)};
[0390] 4. Initialize the gaze point cache: `gaze_valid=false`, `gaze_smooth=(W / 2,H / 2)`.
[0391] Step S302: Gaze point acquisition, verification and smoothing
[0392] At the start of each refresh cycle (or in a higher frequency thread), execute:
[0393] 1. Read the most recent GAZE_STRU from the gaze point acquisition module;
[0394] 2. Validation: If `conf≥0.6` and `deviceState=0` and `current time-ts_gaze≤L_gaze_max`, then `gaze_valid=true`, otherwise `gaze_valid=false`;
[0395] 3. If effective, then apply exponential smoothing (shake stabilization) to the fixation point:
[0396] `gaze_smooth=αgaze_smooth+(1-α)(gx,gy)`,
[0397] Where α = exp(-Δt / T_smooth), and Δt is the refresh period of 20ms;
[0398] 4. Resident determination: The partition state is switched only when the continuous T_dwell time of `gaze_smooth` falls within the range of the new partition, so as to avoid frequent LOD switching.
[0399] Step S303: Divide the field of view into a fixational region and a non-fixational region.
[0400] 1. If `gaze_valid=true`: Define the gaze region `Region_F` with `gaze_smooth` as the center and R as the radius; the rest of the screen is the non-gaze region `Region_N`.
[0401] 2. If `gaze_valid=false`: Enter the degradation strategy (see step S309). At this time, the center area of the screen can be defined as `Region_F`, or the entire screen can be regarded as `Region_N` and the safety protection rule can be enabled.
[0402] Step S304: Regional mesh precision allocation (N1 / N2)
[0403] 1. When generating / updating the pipe model, segment the pipe mesh according to the display projection:
[0404] Calculate the bounding box of the pipe centerline or grid segment projected onto the screen;
[0405] If the bounding box overlaps with the gaze region `Region_F`, the segment is marked as a gaze region segment; otherwise, it is marked as a non-gaze region segment.
[0406] 2. For the viewed region segment, generate / update the circumferential section point set using N1=32 and construct a triangular mesh;
[0407] 3. Generate / update triangular meshes for non-focused region segments using N²=16;
[0408] 4. To prevent gaps in the connection: Add a transition zone (width = 0.1R) at the junction of the gaze / non-gaze area. Within the transition zone, generate a "seam ring" with high precision N1 to ensure the continuity of the mesh topology.
[0409] Step S305: Regionalized collision interferometry detection accuracy allocation (D1 / D2)
[0410] 1. Based on the current viewpoint and component pose, estimate the projection bounding box of each interference patch on the screen;
[0411] 2. If the patch projection intersects with `Region_F`, then the patch is added to the fine detection set `PatchSet_F`; otherwise, it is added to the set `PatchSet_N`.
[0412] 3. Prune the upper limit of the collection size:
[0413] If the number of triangles in `PatchSet_F` is greater than D1 (6000), truncate to D1 according to the "patch risk priority";
[0414] If the number of triangles in `PatchSet_N` is greater than D2 (1500), similarly truncate to D2;
[0415] Risk priorities can be assigned fixed weights based on the component to which the patch belongs (bending mold, clamping mechanism, etc.) to ensure that the sorting rules are determined.
[0416] 4. Perform collision interference detection:
[0417] Focused region: Fine detection using `PatchSet_F` (line segment-triangle intersection);
[0418] Non-focal regions: Perform detection using `PatchSet_N` (which can be a downsampled version of fine detection, or fine detection only after coarse screening is triggered).
[0419] This allows for differentiated detection of "first patch density / second patch density" without affecting the overall secondary collision detection framework.
[0420] Step S306: Prediction Compensation – Predict the axis position and component pose at the next refresh time.
[0421] To compensate for transmission and computation delays, the real-time simulation module performs predictions in each frame:
[0422] 1. Obtain the current frame axis position vector `A_k=axisPos_k[]` and the previous frame's `A_{k-1}`;
[0423] 2. Calculate the velocity (or angular velocity) of each axis:
[0424] `v_k[i]=(A_k[i]-A_{k-1}[i]) / Δt` (Δt=20ms);
[0425] Limit the amplitude of v_k: `v_k[i]=clamp(v_k[i],-v_max[i],v_max[i])`;
[0426] 3. Calculate the lead time for forecasting: `Δt_pred=L_total+0.5×Δt` (units consistent);
[0427] 4. Predict the axis position at the next moment:
[0428] `A_pred[i]=A_k[i]+v_k[i]Δt_pred`;
[0429] 5. Calculate the predicted pose `Pose_pred` based on `A_pred` according to the kinematic equation and parent-child binding relationship, and write it to the "next frame buffer".
[0430] Note: This prediction uses a "constant velocity model", which is stable and easy to implement in engineering. If a smoother result is needed, a first-order low-pass filter can be applied to v_k, but the filter coefficients must be fixed to ensure reproducibility.
[0431] Step S307: Predictive Compensation – Perform Pose Update and Mesh Update in Advance
[0432] 1. Pre-update pose: Immediately after the calculation of this frame is completed, use `Pose_pred` to pre-update the pose cache of the simulation model for the next frame;
[0433] 2. Advance grid updates:
[0434] If the pipe parameters (e.g., rotation or r) in the next frame are predicted to change beyond the threshold, the mesh of the gaze region segment (N1) in the next frame is generated in advance, and the mesh of the non-gaze region segment is postponed to the next frame (to ensure that the critical region is prioritized).
[0435] 3. When the next refresh timestamp ts_render(k+1) is actually reached, the prediction cache is directly read as the initial value, and only a small amount of correction is made, thereby stabilizing the refresh cycle and reducing stuttering.
[0436] Step S308: Rendering and Output
[0437] 1. Submit the generated / updated pipe model and simulation model to the 3D engine for rendering;
[0438] 2. If the collision interference detection outputs a collision or high-risk proximity, it will immediately send a signal back to the control module through the detection alarm interface;
[0439] 3. Simultaneously, pipe shape attributes (TUBE_STRU) are transmitted back as needed for control-side prediction (consistent with Example 1).
[0440] Step S309: Degradation strategy when fixation fails (avoiding ambiguity and ensuring feasibility)
[0441] When `gaze_valid=false`, this embodiment employs a fixed and reproducible degradation strategy:
[0442] Degradation strategy A (recommended): Define the viewing region `Region_F` with a radius R of (W / 2, H / 2) at the center of the screen, still using N1 / D1; use N2 / D2 for the remaining regions;
[0443] At the same time, a safety baseline rule is activated: if the coarse screening enclosure is triggered (the pipe enters the high-risk enclosure), then regardless of the area of focus, a D1 level fine inspection will be performed on the triggered area to prevent safety from being reduced due to the failure of the focus point.
[0444] V. Implementation Results
[0445] By combining "high precision in the gaze region, low precision in the non-gaze region, and prediction lead compensation," this embodiment 3 achieves the following under the same computing power conditions:
[0446] 1. The image clarity and collision detection accuracy in the gaze area are maintained at a high level (N1=32, D1=6000).
[0447] 2. The computational cost in non-focal regions is significantly reduced (N2=16, D2=1500), and the overall frame latency is more stable;
[0448] 3. By using predictive compensation (Δt_pred and Pose_pred caching) to suppress screen jumps caused by network / computation jitter, the refresh cycle is closer to a fixed 20ms, thus stabilizing a real-time display experience of ≥50FPS.
[0449] The above description is only a preferred embodiment of the present invention and does not limit the patent scope of the present invention. All equivalent structural transformations made under the inventive concept of the present invention using the contents of the present invention specification and drawings, or direct or indirect applications in other related technical fields, are included within the protection scope of the present invention.
Claims
1. A real-time simulation method for a pipe bending machine, characterized in that, The process includes the following steps: A) Model customization and lightweighting: Based on the original design drawings of the pipe bending machine, a simulation model of the corresponding model is generated, and the simulation model is lightweighted to reduce the amount of data for real-time rendering and calculation; B) Kinematic modeling: Kinematic equations are established for each movable part in the simulation model. The kinematic equations include at least linear motion equations and circular motion equations. Parent-child binding relationships are established for each movable part, so that the pose of the child part is obtained by superimposing its own motion and the motion of the parent part. C) Pipe forming modeling: Establish a mathematical model of pipe plastic deformation, discretize the pipe model into a surface composed of triangular meshes, and divide the basic shape of the pipe into straight segments and curved segments. By spatial translation and rotation, the basic segments are spliced together to form the target pipe shape. During the pipe bending forming process, the target pipe shape is updated in real time according to the movement of the pipe bending machine and the forming action, and the pipe model is reconstructed or incrementally updated. D) Collision Interference Detection: Construct a collision interference detection module to perform secondary collision detection on the interference surface between the pipe model and the simulation model. The secondary collision detection includes pre-detection of bounding volumes and fine detection of line segment-triangle intersections to obtain collision interference results; E) Two-way Data Coupling and Clock Alignment: Establish a two-way data coupling interface between the pipe bending machine control module and the real-time simulation module, align the control commands with the simulation state using a clock, and update the poses of each movable part in the simulation model in real time based on the axis position and actuator state transmitted by the pipe bending machine control module, so that the poses of each movable part in the simulation model correspond to the actual poses of the pipe bending machine in real time, and feed back the pipe forming results and collision interference results to the pipe bending machine control module in real time; F) Real-time refresh mechanism: The simulation cycle is executed with a timestamp-driven refresh cycle, and incremental solution and on-demand calculation are used to update only the simulation model components with changing attitudes and the pipe model with changing pipes, so as to reduce the end-to-end delay of a single simulation cycle and maintain the target refresh cycle.
2. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The model customization and lightweighting includes: splitting the 3D model corresponding to the original mechanical drawings into independently movable parts; deleting or simplifying internal structural data to retain the outer shell surface part, and simplifying the surface texture of the model; converting the lightweight simulation model into OBJ and MTL formats and loading it into the 3D engine; and the geometric dimension deviation of the simulation model is less than 0.05mm.
3. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The parent-child binding relationship includes: recording the local coordinate system transformation of the child component relative to the parent component; during real-time calculation, the pose of the parent component is first obtained based on the linear motion equation and the circular motion equation, and then the local coordinate system transformation is superimposed to obtain the pose of the child component, thereby realizing the real-time calculation of the composite motion trajectory.
4. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The pipe forming modeling includes: dynamically adjusting the number of discrete points on the circumference of the bending section according to the target refresh frequency threshold. The number of discrete points on the circumference is controlled within the range of 8-32, corresponding to 8-32 sides of the polygon of the bending section of the pipe model. This range is used to achieve a dynamic balance between the clarity of the pipe forming and the simulation refresh frequency, while ensuring that the calculation accuracy error of the pipe bending arc does not exceed 0.1mm.
5. The real-time simulation method for a pipe bending machine according to claim 4, characterized in that, The adaptive adjustment involves dynamically adjusting the number of discrete points on the circumference of the curved section based on the target refresh frequency threshold. This adaptive adjustment includes: measuring the calculation time of the previous refresh cycle in real time, and using the target refresh cycle as a constraint. When the calculation time is less than 70% of the target cycle, 2-4 discrete points are added; when the calculation time is greater than 90% of the target cycle, 2-4 discrete points are removed. Simultaneously, the number of line segments of the pipe model participating in collision interference detection is increased or decreased to keep the real-time simulation refresh within the target frame rate range.
6. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The secondary collision detection includes: a) Pre-detection: setting the bounding body for the interference scene as a cuboid bounding body, determining whether the endpoints of the line segments of the pipe model enter the cuboid bounding body, or whether the line segments intersect the cuboid bounding body; b) Fine detection: after entering the cuboid bounding body, calculating whether the line segments of the pipe model intersect the interference surface of the simulation model; wherein, the interference surface of the simulation model is obtained by discretizing several quadrilateral faces attached to the surface of the simulation model, and each quadrilateral face is composed of two triangles.
7. The real-time simulation method for a pipe bending machine according to claim 6, characterized in that, The precision detection includes: establishing a spatial plane equation Ax + By + Cz + D = 0 based on the spatial coordinates of the three vertices of the target triangle, where A, B, and C are the components of the spatial plane normal vector in the x-axis, y-axis, and z-axis directions, respectively, D is a spatial plane constant term, and x, y, and z are the spatial coordinates of any point on the spatial plane; establishing a line parameter equation L(t) = P0 + t(P1 - P0) based on the spatial coordinates of the two endpoints P0 and P1 of the target line segment, where P0 and P1 are the spatial coordinates of the two endpoints of the target line segment, and t ∈ [0,1] is the line segment parameter; calculating the intersection point of the line and the plane, and determining whether the parameter t corresponding to the intersection point is located in [0,1] and whether the intersection point is located within the triangular region; if both conditions are met, collision interference is determined, and the collision determination accuracy can reach 0.02 mm.
8. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The bidirectional data coupling interface is built using the Profinet industrial Ethernet protocol, with a data transmission rate ≥100Mbps. It includes: a) a model data interaction interface: transmitting the axis position and actuator status of the pipe bending machine control module to the real-time simulation module in real time to update the poses of each movable part in the simulation model, ensuring that the poses of each movable part in the simulation model correspond in real time to the actual poses of the pipe bending machine, with a positional correspondence error ≤0.05mm, and ensuring that the cylinder status of the simulation model is consistent with the cylinder status of the pipe bending machine; b) a key data interaction interface for pipe shape attributes: exchanging the pipe forming action index, length / arc length, transition arc length, radius, radius increment, and rotation arc between the real-time simulation module and the pipe bending machine control module in real time, with a data transmission delay ≤10ms, to achieve accurate prediction of the forming result; c) a detection alarm interface: transmitting the collision interference result to the pipe bending machine control module in real time, with an alarm signal response delay ≤5ms; wherein, the interface data includes a millisecond-level timestamp to achieve clock alignment between the control commands and the simulation status, with a time synchronization error ≤1ms.
9. The real-time simulation method for a pipe bending machine according to claim 8, characterized in that, The bidirectional data coupling interface further includes trusted security coupling and degradation control steps: each data packet transmitted between the pipe bending machine control module and the real-time simulation module carries a timestamp and sequence number, and performs CRC32 integrity verification on the data packets; the collision interference detection module and the calculation process for generating pipe shape attributes are deployed in a trusted execution environment (TEE) to run, outputting proof information containing runtime environment metrics and binding it to the data packets for storage to form a traceable audit chain; when integrity verification fails, proof information verification fails, and timestamp anomalies meet preset triggering conditions, the real-time simulation module enters a security degradation mode, at least maintaining the coarse screening detection and alarm feedback of collision interference warning, and reducing or pausing the high-precision mesh update and 3D rendering refresh of the pipe model to ensure the trustworthiness and real-time performance of the security warning link.
10. The real-time simulation method for a pipe bending machine according to claim 1, characterized in that, The real-time refresh mechanism further includes an adaptive precision allocation and predictive rendering compensation step based on the foveation point: the real-time simulation module receives foveation point information from the foveation point acquisition module and divides the field of view into a foveation region and a non-foveation region; for the foveation region, a pipe model is generated or updated using a first discrete precision, and collision interference detection is performed using a first patch density; for the non-foveation region, a pipe model is generated or updated using a second discrete precision lower than the first discrete precision, and collision interference detection is performed using a second patch density lower than the first patch density, wherein the number of circumferential discrete points corresponding to the first discrete precision is greater than the number of circumferential discrete points corresponding to the second discrete precision; and based on the axis position and its change between the current frame and the previous frame, the component pose and pipe shape parameters corresponding to the next refresh timestamp are predicted by a linear prediction algorithm, and pose update and mesh update are performed in advance according to the prediction results to compensate for transmission and calculation delays and stabilize the refresh cycle.
Citation Information
Patent Citations
Numerical control elbow machining simulation method and device
CN103792885A
Pipe bender and method for controlling bending of pipe bender
JP2007289974A