Download presentation

Presentation is loading. Please wait.

Published byEddy Wetmore Modified about 1 year ago

1
Automatic Generation and Integration of Equations of Motion for Linked Mechanical Systems D. Todd Griffith, John L. Junkins, James D. Turner Department of Aerospace Engineering Texas A&M University College Station, TX {griffith; junkins; presented at 6th International Conference on Dynamics and Control of Systems and Structures in Space 2004 Cinque Terre, Italy July, 2004

2
Dynamics and Control of Systems and Structures in Space Slide 2 Outline Introduction and previous work Overview of automatic differentiation by OCEA Eqn of motion formulation using automatic differentiation Numerical examples An illustrative two degree of freedom example Open- and closed-chain flexible multi-body systems Conclusions

3
Dynamics and Control of Systems and Structures in Space Slide 3 Introduction and previous work Work on multibody dynamics dates back to around 1960’s Multibody dynamics is a “mature” field; many papers, codes (e.g., DISCOS, DCAP …) and a few books have been written in the area Numerous methods exist for equation of motion generation. e.g., Lagrange’s equations, Kane’s equations, or Newton/Euler Methods In this paper, we present an approach for automatic generation and solution of Lagrangian equations of motion using automatic differentiation => requires coding only velocity-level kinematics. –Previously, open- and closed-chain topologies of rigid bodies were studied by this method (Griffith, et. al. 2004) => we extend these results herein. We demonstrate the method for several simple multiple flexible- body systems

4
Dynamics and Control of Systems and Structures in Space Slide 4 Equation of motion formulation using automatic differentiation Lagrange’s equations: subject to Lagrangian: T, V: kinetic and potential energy q: generalized coordinates Q: generalized force C(q): constraint Jacobian matrix : Lagrange multipliers Of course, many choices for equation of motion formulation exist. The OCEA approach is broadly applicable, however, the utility of automatic differentiation can be immediately seen and appreciated for implementing Lagrange’s Equations…

5
Dynamics and Control of Systems and Structures in Space Slide 5 Overview of automatic differentiation by OCEA (1) OCEA (Object Oriented Coordinate Embedding Method) –Automatic Differentiation (AD) equation manipulation package –Operator-overloading allows for implementation of the OCEA-AD approach in any of the popular programming languages (currently implemented as a FORTRAN90 extension) –Computes first- through fourth-order partial derivatives of ‘any’ differentiable function, in the background without user intervention OCEA Methodology –Aim: Let the computer do the hard part (derive & compute partials)! –Means: Re-define (and code) standard mathematical library functions (e.g. sin, cos, exp) using operator – overloading that automatically computes partial derivatives each time the function is called. Automate (in a general code) once and for all a recursive form of the chain rule for partial differentiation => automate all book-keeping for recursive application of the chain rule

6
Dynamics and Control of Systems and Structures in Space Slide 6 Overview of automatic differentiation by OCEA (2) –Define new data structure (OCEA second-order method), for example for the function scalar f : –All intrinsic operators ( +, -, *, /, = ) are overloaded to enable, for example, addition and multiplication of OCEA variables. Examples: You code: OCEA computes: –Composite Functions (chain rule, use recursively, numerically!): You code: OCEA computes: –Let’s take a look at an illustrative example….

7
Dynamics and Control of Systems and Structures in Space Slide 7 Overview of automatic differentiation by OCEA (3) A second-order OCEA example Suppose: OCEA-FORTRAN Type(EBI):: Z(2) Type(EB):: F1, F2, F3 Real(DP):: V_F3, JAC_F3(2), HES_F3(2,2) ! Z(1) = X, Z(2) = Y F1 = Z(1)**3 + Z(2) F2 = sin( Z(1) ) F3 = F1 + F2 V_F3 = F3 ! Extract function JAC_F3 = F3 ! Extract Jacobian (2x1) HES_F3 = F3 ! Extract Hessian (2x2) Declare OCEA inde-pendent variables, type EB Declare OCEA dependent variables, type EB Declare function and partial derivative arrays, type DP Define functions Extract partial derivative information function Jacobian Hessian We desire to compute f 3 and most importantly its partials:

8
Dynamics and Control of Systems and Structures in Space Slide 8 Implementation of Lagrange’s Equations: A Direct Approach (1) Automatic Differentiation (AD) Specified & coded AD or specified & coded Many numerical methods AD or specified & coded Mass matrix and its time derivative computed by second-order Automatic Differentiation of T …..

9
Dynamics and Control of Systems and Structures in Space Slide 9 Implementation of Lagrange’s Equations: A Direct Approach (2) Can also compute constraint matrix, C, automatically for holonomic type constraint. Now forming the equations: Accelerations computed after generating or prescribing all terms here. Now, can proceed with numerical integration…….

10
Dynamics and Control of Systems and Structures in Space Slide 10 Illustrative Example: Spring Pendulum (1) r

11
Dynamics and Control of Systems and Structures in Space Slide 11 Spring Pendulum (2) SUBROUTINE SPRING_PEND_EQNS( PASS, TIME, X, DXDT, FLAG ) USE EB_HANDLING IMPLICIT NONE **************************************** !.....LOCAL VARIABLES TYPE(EB)::L, T, V! LAGRANGIAN, KINETIC, POTENTIAL REAL(DP):: M, K! MASS AND STIFFNESS VALUES REAL(DP), DIMENSION(NV):: JAC_L REAL(DP), DIMENSION(NV,NV):: HES_L **************************************** ! X(1) = Q(1) = R, X(2) = Q(2) = THETA, X(3) = dR/dt, X(4) = dTHETA/dt R0 = 0.55D0 GRAV = 9.81D0 T = 0.5D0*M*(X(3)**2 + X(1)**2*X(4)**2) ! DEFINE KE V = 0.5D0*K*(X(1)-R0)**2 + M*GRAV*(R0-X(1)*COS(X(2))) ! DEFINE PE L = T – V! DEFINE LAGRANGIAN FUNCTION JAC_L = L! EXTRACT dL/(dq,dqdot) JAC_L_Q = JAC_L(1:NV/2)! EXTRACT dL/dq HES_L = L ! EXTRACT 2nd ORDER PARTIALS OF LAGRANGIAN MASS = HES_L(NV/2+1:NV,NV/2+1:NV)! EXTRACT MASS MATRIX MASSDOT = HES_L(NV/2+1:NV,1:NV/2)! EXTRACT MDOT ! QDOTDOT = INV(MASS)*(- MASSDOT*Q + JAC_L_Q ) ! SEE PAPER … **************************************** DXDT(1)%E = X(3)%E! RDOT DXDT(2)%E = X(4)%E! THETADOT DXDT(3)%E = QDOTDOT(1)! RDOTDOT DXDT(4)%E = QDOTDOT(2)! THETADOTDOT END SUBROUTINE SPRING_PEND_EQNS

12
Dynamics and Control of Systems and Structures in Space Slide 12 Geometry of Multiple Flexible Link Configuration Note from the figure of a series of deformed links that the local coordinate frames attached to the links are defined such that the elastic deformation vanishes at the endpoints. This choice greatly simplifies the “downstream” velocity expressions.

13
Dynamics and Control of Systems and Structures in Space Slide 13 Kinetic Energy Generalization Assumed Modes Method used to transform the kinetic energy expression into a form which can be tamed by Lagrange’s Equations. The details can be found in the paper. Along with the potential energy expression, we can define the Lagrangian and proceed to generate the equations of motion…………..

14
Dynamics and Control of Systems and Structures in Space Slide 14 Example: Three Body Flexible Chain The Lagrangian expressions are developed for each link and summed to form the total system Lagrangian. Initially all links hanging vertically. All additional initial conditions are zero with the exception of and angular velocity (0.5 rad/sec) and the initial midpoint deflection (0.01 m) of the third link. Rigid Body contribution Flexible contribution Kinetic Energy of Link 3

15
Dynamics and Control of Systems and Structures in Space Slide 15 Example: Closed-chain 5-link Manipulator (1) The Lagrangian expressions are developed for each link and summed to form the total system Lagrangian. Additionally, we specify two holonomic constraints of the form: And, we specify damping at all joints with the exception of the base end of link 5. OCEA automatically generates the equations of motion for the constrained system 5 link manipulator g D

16
Dynamics and Control of Systems and Structures in Space Slide 16 Example: Closed-chain 5-link Manipulator (2)

17
Dynamics and Control of Systems and Structures in Space Slide 17 Conclusion OCEA has broad potential in Dynamics and Control. Automating differentiation by operator overloading is a beautiful idea whose time has come – the applications are endless! Ideal for implementing Lagrange’s Equations – the present paper provides some simple illustrations – a few important first steps along the path. No hand derivation effort beyond code specifying the building of the Lagrangian, constraints and external forces is required Requires only second-order OCEA differentiation capability to compute equations of motion & solve them with (kinematics only) coding A generalized code {for dynamics of chain topology systems containing many flexible links, with both open and closed-chain topologies} is presented Future work involves a new approach for validation of codes for flexible systems: Question: How well do discretized approximate numerical solutions (and the corresponding space/time derivatives) satisfy the automatically derived systems of PDEs and BCs corresponding to the same modeling assumptions?

Similar presentations

© 2017 SlidePlayer.com Inc.

All rights reserved.

Ads by Google