Much of this post is written and/or edited by ChatGPT 4 based on my prompts.
Abstract
This paper presents a novel approach to simulating complex mechanical systems by representing mechanisms as collections of individual components that interact to form functional units. A key focus of the method is identifying and grouping components, such as links and hydraulic cylinders, into larger, cohesive sub-mechanisms, exemplified by link triangles. These triangles, which might consist of two links and a hydraulic cylinder, dynamically adjust their shape, influencing the position and motion of other links in the system. The core contribution of this work lies in the algorithmic generation of a list of all components and their interconnections, followed by a process of identifying sets of three links that form triangles. Upon detecting a triangle, it is abstracted as a single link, which is then reintegrated into the mechanism. This process repeats recursively, allowing the simulation of increasingly complex structures. By incrementally building from simple linkages, the methodology facilitates the simulation of intricate mechanisms through a straightforward yet effective algorithm, offering a robust foundation for applications in mechanical design and analysis.
Introduction
In mechanical simulation, solving for the positions of individual links in simple mechanisms such as a four-bar linkage can often be accomplished using straightforward geometric principles, such as the intersection of two circles. However, as the number of links increases and the mechanism’s complexity grows, conventional methods become insufficient. Early algorithms designed for linkage analysis, such as those employed in the initial version of the Linkage app, relied on iterative processes to address these complexities. The approach involved identifying pairs of links, where each link had a single connection to the other link and a single connection to a fixed connector, such as the ground. The position of each link was determined by constructing circles centered on these fixed points, with radii corresponding to the lengths of the links, and the intersections of the circles defined the possible joint positions. The two intersection points of the circles defined the possible end positions of the links, and the intersection closest to a previously simulated point, or to the starting point, was selected as the final position of the links.
For mechanisms with more than four links, this process became iterative: each newly determined link position could introduce further possible link interactions, and the algorithm would continue until all link positions were defined. In cases where no valid intersections existed, the mechanism was flagged as invalid or “floppy,” indicating it could not be simulated. Although limited by design complexity, this method proved efficient for simulating most mechanisms with minimal computational overhead.
The updated approach to simulating complex mechanisms involves identifying subsets of links that function as a unit, simulating them together as a cohesive entity. In simpler scenarios, these subsets may consist of rigid links that can be merged without further processing. However, in more intricate cases, the subsets might include components like linear actuators or hydraulic systems that dynamically alter the shape of the subset during simulation. For these more advanced configurations, the new algorithm simulates the behavior of the subset first, adjusting for its changing geometry, before incorporating the resulting shape into the overall simulation as a single entity. This new simulation method introduces a more sophisticated data structure, yet it retains core principles from the original approach, such as utilizing circle-to-circle intersection methods for final position calculations.
Utilizing a Tree Data Structure for Managing Link Triangles
The newly introduced data structure enhances modularity by treating each link as an independent entity, with connections to other links managed through distinct connector objects. This design allows the shape of any link to be modified without directly impacting others. Each link object contains a list of connector elements that define its geometry. These connectors store both positional data and a reference to a unifying connector, which serves to locate and associate other connected links. The unifying connector maintains positional information primarily used during the final stage of simulation, while the link-specific connectors are responsible for tracking the positions of individual links throughout the main processing phases. This separation of concerns ensures flexibility and efficiency during the simulation of complex mechanisms.
The tree structure begins with all links represented at the root level, organized on a single tier. The algorithm processes the tree iteratively to identify sets of three links whose connectors form a triangle. While individual links may have more than two connectors, only those that contribute to the triangular configuration are relevant to the algorithm. When a triangle is detected among three links at the root level, a new entry is added to the tree representing a composite link that encapsulates the triangular structure. This newly generated link inherits all the connectors from the original three links. Once this new link is established, the original links are removed from the root level and repositioned as child nodes of the composite link.
This tree structure allows subsequent iterations of the algorithm to incorporate newly created composite links into other composite links, creating a hierarchical organization. The tree can develop multiple levels of composite links, with the original links stored at the lower levels (if necessary), while higher levels represent increasingly complex combinations of links. To enhance performance, if a composite link is determined to be static and unchangeable during simulation, the original links can be discarded, as their positional information is fully contained within the composite link.
Simulation and Subsimulation
The simulation algorithm operates by making multiple passes through the tree structure, starting from the root. During each pass, links that have already been processed are flagged as “true” and skipped to avoid redundant calculations. When an unsimulated link is encountered, the algorithm will recursively process its child links if needed. For composite links with only non-composite children, the algorithm attempts a simulation on the three child links that form a triangular group. If all child links are static, this step is unnecessary; however, if any can change length (e.g., due to hydraulic actuators), the algorithm runs a specialized simulation to update the composite link’s shape.
In the final passes, the algorithm focuses on the root level, determining the positions of pairs of links—composite or individual—and calculating their final positions. Once the positions are determined, they are stored in the unifying connector object. Upon completion of all simulation passes without errors, the unifying connectors will hold the positions for all connections in the mechanism.
Data Structure Details
In the document data utilized by the visual editor, links share the same objects that represent their connection points. This design causes an issue where altering the shape of one link inadvertently changes the shape of other links that share the modified connector. To address this, the data structure used in the new simulation tree is more sophisticated, requiring separate connector objects for each individual link. This separation allows for independent manipulation of each link’s shape. However, it also necessitates that each connector maintains information about its counterparts on connected links to ensure proper behavior during the simulation.
A unifying connector object serves as the final element to manage this situation. It consolidates the information from all the individual connectors of interconnected links and provides a reference to the visual editor’s data. This enables the algorithm to not only simulate the movement of the mechanism but also visually animate these movements within the editor.
Pre-Simulation Optimization
Given that the structure of the mechanism remains static throughout the simulation process, significant optimizations can be achieved by constructing the tree structure and identifying composite links prior to the start of the simulation. By preprocessing these elements, the computational load during the actual simulation is reduced to only repositioning link pairs in real-time. This approach minimizes the simulation’s runtime complexity and allows for smoother, more efficient animation of the mechanism’s movement. Since the tree structure and link combinations are calculated in advance, the simulation focuses purely on dynamic repositioning, significantly improving real-time performance.
Summary
This paper presents a novel approach to simulating complex mechanical linkages, with a particular focus on mechanisms that involve groups of interconnected links working together as a unit. Traditional methods of simulating individual links can struggle to handle complex structures, particularly when the interactions between multiple links, such as those forming triangles or involving linear actuators, need to be simulated as a group.
The proposed approach introduces a tree-based data structure to represent the mechanism, where each link and its connections are stored separately, allowing for the simulation of individual components without affecting the rest of the mechanism. Links that form triangles are combined into composite links, and these composite links can themselves form new structures with other links, allowing for a recursive process that simplifies the overall mechanism.
The paper discusses how the simulation algorithm processes this tree structure, with recursive passes through composite links to determine their shape and positions. By treating groups of links as single units in the simulation, the approach improves efficiency. The final step in the simulation records the positions of all the mechanism’s connections, ensuring that the mechanism can be accurately animated in real time.
The paper also outlines optimization strategies, emphasizing that the static nature of the mechanism allows for pre-simulation processing of the tree structure and composite links. This optimization reduces the computational load during the active simulation phase, improving real-time performance.
This new approach is particularly effective for simulating complex mechanisms where traditional iterative methods would struggle, making it suitable for both real-time animations and more computationally intensive mechanical simulations.