AnalyticLoopHandling

Analytic loop handling

    AnalyticLoopHandling

Library

Modelica/Mechanics/MultiBody/UsersGuide/Tutorial/LoopStructures

Description

It is well known that the non-linearalgebraic equations of most mechanical loops in technical devices can besolved analytically. It is, however, difficult to perform this fullyautomatically and therefore none of the commercial, general purpose multi-bodyprograms, such as MSC ADAMS, LMS DADS, SIMPACK, have this feature.These programs solve loop structures with pure numerical methods. Multi-bodyprograms that are designed for real-time simulation of the dynamics ofspecific vehicles, such as ve-DYNA, usually contain manual implementationsof a particular multi-body system (the vehicle) where the occurring loops areeither analytically solved, if this is possible, or are treated by tablelook-up where the tables are constructed in a pre-processing phase. Withoutthese features the required real-time capability would be difficult toachieve.

In a series of papers and dissertationsProf. Hiller and his group in Duisburg, Germany,have developed systematic methods to handle mechanicalloops analytically, see alsoMultiBody.UsersGuide.Literature.The "characteristic pair of joints" methodbasically cuts a loop at two joints and uses geometricinvariants to reduce the number of algebraicequations, often down to one equation that can be solved analytically. Alsoseveral multi-body codes have been developed that are based on this method,e.g., MOBILE. Besides the very desired feature to solve non-linearalgebraic equations analytically, i.e., efficiently and in a robust way, thereare several drawbacks: It is difficult to apply this method automatically.Even if this would be possible in a good way, there is always the problem thatit cannot be guaranteed that the statically selected states lead to nosingularity during simulation. Therefore, the "characteristic pair of joints"method is usually manually applied which requires know-how and experience.

In the MultiBody library, the "characteristic pair ofjoints" method is supported in a restricted form such that it can be appliedalso by non-specialists. The idea is to provide aggregations of joints in packageMultiBody.Joints.Assembliesas one object that either have 6 degrees of freedom or3 degrees of freedom (for usage in planar loops).

As an example, a variant of the four bar mechanism is given inthe figure below.

Here, the mechanism is modeled with six revolutejoints and one prismatic joint.In the figure below, the five revolute jointsand the prismatic joint are collected together in an assembly objectcalled "jointSSP" fromMultiBody.Joints.Assemblies.JointSSP.

The JointSSP joint aggregation has a frame at theouter spherical joint (frame_a) and a frame atthe prismatic joint (frame_b). JointSSP, as all other objects from theJoints.Assemblies package, has the property, that the generalizedcoordinates, and all other framesdefined in the assembly, can be calculated given the movement of frame_a andof frame_b. This is performed by analytically solving non-linearsystems of equations.From astructural point of view, the equations in an assembly object are written inthe form

q = f1(ra, Ra, rb, Rb)

where ra, Ra,rb, Rb are the variables defining theposition and orientation of the frame_a and frame_b, respectively, andq are the generalized positional coordinates inside theassembly, e.g., the angle of a revolute joint. Given anglej of revolute joint j1 from the fourbar mechanism, frame_a and frame_b of the assembly object can be computed by aforward recursion

(ra,Ra, rb, Rb) = f(j)

Since this is a structural property, thesymbolic algorithms can automatically select j and its derivative as states and then all positional variables can becomputed in a forwards sequence. It is now understandable that a Modelicatranslator cantransform the equations of the four bar mechanism to a recursive sequence ofstatements that has no non-linear algebraic loops anymore (remember,the previous "straightforward" solution with 6 revolute joints and 1prismatic joint has a nonlinear system of equations of order 5).

The aggregated jointobjects consist of a combination of either a revolute or prismatic joint andof a rod that has either two spherical joints at its two ends or a sphericaland a universal joint, respectively. For all combinations, analytic solutionscan be determined. For planar loops, combinations of 1, 2 or 3 revolute jointswith parallel axes and of 2 or 1 prismatic joint with axes that are orthogonalto the revolute joints can be treated analytically. The currently supportedcombinations are listed in the table below.

3-dimensional Loops:
JointSSR Spherical - Spherical - Revolute
JointSSP Spherical - Spherical - Prismatic
JointUSR Universal - Spherical - Revolute
JointUSP Universal - Spherical - Prismatic
JointUPS Universal - Prismatic - Spherical
Planar Loops:
JointRRR Revolute - Revolute - Revolute
JointRRP Revolute - Revolute - Prismatic

On first view this seems to be quite restrictive. However, mechanical devices are usually built up with rods connected by spherical joints on each end,and additionally with revolute and prismatic joints.Therefore, the combinations of the above table occur frequently.The universal joint is usually not present in actual devices but is used(a) if two JointXXX components can be connected such that a revoluteand a universal joint together form a spherical jointand (b) if the orientation of the connecting rod between twospherical joints is needed, e.g., since a body shall be attached.In this case one of the spherical joints might be replaced by auniversal joint. This approximation is fine as long as the massand inertia of the rod is not significant.

Let us discuss item (a) in more detail: TheMacPherson suspension in the next figure has three frame connectors.

The lower left one (frameChassis) is fixed to the vehicle chassis. Theupper left one (frameSteering) is driven by the steering mechanism, i.e. themovement of both frames are given. The frame connector on the right (frameWheel)drives the wheel. The three frames are connected by a mechanism consistingessentially of two rods with spherical joints on both ends. These are built upby a jointUPS and a jointSSR assemblies.As can be seen, the universal joint from the jointUPSassembly is connected to the revolute joint of the jointSSR assembly.Therefore, we have 3 revolute joints connected together at one point and ifthe axes of rotations are chosen appropriately, this describes a sphericaljoint. In other words, the two connected assemblies define the desired tworods with spherical joints on each ends.

The movement of the chassis, frameChassis, is computedoutside of the suspension model. When the generalized coordinates of revolute joint"jointArm" (lower left part in figure) are used as states, then frame_a andframe_b of the jointUPS joint can be calculated. After the non-linear loopwith jointUPS is (analytically) solved, all frames on this assembly areknown, especially,the one connected to frame_b of the jointSSR assembly. Since frame_a ofjointSSR is connected to frameSteering which is computed from the steeringmechanism, again the two required frame movements of the jointSSR assembly arecalculated. This in turn means that also all other frames on the jointSSRassembly can be computed, especially, the one connected to frameWheel that drivesthe wheel. From this analysis it is clear that a tool is able to solve thesecoupled loops analytically.

Another example is the model of the V6 engine,see next figure for an animation view and the original definitionof one cylinder with elementary joints.

Here, it is sufficient to rewrite the basic cylinder modelby replacing the joints with a JointRRP object that has tworevolute and one prismatic joint, as can be seen in next figure.

Since 6cylinders are connected together, 6 coupled loops with 6 JointRRP objects arepresent. This model is available asMultiBody.Examples.Loops.EngineV6_analytic.

The composition diagram of the connected 6 cylinders isshown in the next figure

It can be seen that the revolute jointof the crank shaft (joint "bearing" in left part of figure) might beselected as degree of freedom. Then, the 4 connector frames of all cylinderscan be computed. As a result, the computations of the cylinders are decoupledfrom each other. Within one cylinderthe position of frame_a and frame_b of the jointRRP assemblycan be computed and therefore the generalized coordinates of the two revoluteand the prismatic joint in the jointRRP object can be determined. Considering thisanalysis, it is not surprising that a Modelica translatoris able to transform the DAEequations into a sequential evaluation without any non-linear loop.Compare this nice result with the model using only elementary jointsthat leads to a DAE with 6 algebraic loops and 5 non-linear equations perloop. Additionally, a linear system of equations of order 43 is present.The simulation time is about 5 times faster with the analytic loop handling.