Dynamics Part Two

download Dynamics Part Two

of 69

Transcript of Dynamics Part Two

  • 8/12/2019 Dynamics Part Two

    1/69

    CHAPTER 4. DYNAMICS 232

    4.4 Application of Computational Procedures in Dy-

    namic Analysis

    4.4.1 Introduction

    An important numerical task in dynamic problems is the time integration of the

    equation of motion. The aim is to get the time history of the systems motion due to

    a given excitation or load profile. Different numerical codes are available in various

    programme packages. The routines offered in MATLAB are one-step and multistep

    methods with implicit or explicit time schemes. Routines for differential-algebraic

    equations (DAE), called as solvers for singular mass matrix, are available as well.

    Only a general advice can be given how to choose a code appropriate to the givenparticular problem, see also chapter 5. Nevertheless, a critical interpretation of the

    obtained solution is necessary and highly recommended since the reliability of the

    results depends on various conditions like truncation and round off errors of the

    computer, stability characteristics of the integration code, chosen error tolerances,

    configuration of the mechanical system and initial conditions.

    Example 1.1: Planar pendulum, ODE representation

    The simple example of a planar pendulum, shown in Fig. 4.17, shall illustrate the

    influence of numerical errors to the behaviour of the computed solution.

    x

    y

    Figure 4.17: Planar pendulum

    The pendulum consists of a mass attached on a rod of length where a torque

  • 8/12/2019 Dynamics Part Two

    2/69

    CHAPTER 4. DYNAMICS 233

    is applied. Considering the planar motion in the x-y plane, the equation of

    motion can be derived using Newtons and Eulers equations

    (4.117)

    (4.118)

    (4.119)

    In connection with two imposed geometrical constraints

    (4.120)

    (4.121)

    the system possesses

    degree of freedom. Choosing the angle

    as

    the generalised coordinate, the constraint forces can be eliminated and the equation

    of motion reads as

    (4.122)

    An other way to derive this equation is the application of Eulers equation with

    respect to the fixed pivot point A

    (4.123)

    For the comparison of the numerical solution obtained by time integration with theanalytical solution, we choose the trivial case of static equilibrium position as shown

    in Fig. 4.18.

    Figure 4.18: Different positions of planar pendulum

  • 8/12/2019 Dynamics Part Two

    3/69

    CHAPTER 4. DYNAMICS 234

    In a static equilibrium position

    , it is , which leads to the applied

    torque in the equilibrium state

    (4.124)

    For numerical solution, the integration code ode45 of MATLAB is used choosing

    a tolerance of RelTol = AbsTol = 10e-5 for the relative and the absolute error, re-

    spectively. The specific parameters of the pendulum considered are ,

    and (mathematical pendulum).

    Case I: Equilibrium position

    Fig. 4.18 shows the pendulum in the considered position. Starting the integra-

    tion with the initial conditions

    and

    and looking at the solution

    within a time period of 30 s it remains zero as it is expected. This means the

    solution is exact within the precision of the machine.

    An artificial error is now introduced into the initial conditions

    and and the result is shown in Fig. 4.19.

    An exponential-like deviation can be seen indicating an unstable behaviour. It

    can be shown by applying stability theory that the chosen position is a mechanically

    monotone unstable equilibrium.

    0 1 2 3 4 5 6 7 80

    1

    2

    3

    4

    5

    6

    7

    8

    9

    (t)[rad]

    t [s]

    Figure 4.19: Mechanically unstable motion of pendulum initiated by numerical er-

    rors, position I

  • 8/12/2019 Dynamics Part Two

    4/69

    CHAPTER 4. DYNAMICS 235

    Case II : Equilibrium position

    As indicated in Fig. 4.18, the mass of the pendulum is below the bearing, which

    is a mechanically stable position (more precisely, it is marginally stable). The inte-

    gration with the exact initial conditions again leads to a solution exact in the range

    of machine precision. An artificial error as above causes the solution as plotted in

    Fig. 4.20 showing an oscillatory instability behaviour.

    0 5 10 15 20 25 306

    4

    2

    0

    2

    4

    6x 10

    5

    (t)[rad]

    t [s]

    Figure 4.20: Unstable oscillation in position II

    Case III: Equilibrium position

    The hanging pendulum is mechanically marginally stable, of course.

    a) The integration with the exact and with the disturbed initial conditions leads

    to the same behaviour as we could see in case II.b) Changing the coordinate of description to leads to a sligthly

    changed equation of motion.

    Now the corresponding initial condition is

    . With this condition the

    computed solution shows the same oscillatory instability as in the case of the dis-

    turbed condition in a). Obviously the truncation error in the representation of the

    number is sufficient to cause this unacceptable behaviour.

    In addition to the stability properties of the mechanical system, the stability proper-

  • 8/12/2019 Dynamics Part Two

    5/69

    CHAPTER 4. DYNAMICS 236

    ties of the numerical procedure itself has to be taken into account when a numerical

    solution is computed. The details can not be provided here and reader ist referredto [8],[9]. Other illustrative examples can also be found in chapter 5.

    As it can be seen the stability behaviour depends on the configuration of the

    system. The sensitivity of the system on errors in the initial conditions (round off

    error due to numeric representation of ) is different. The numerical errors which

    cause the instability in case III do not cause unstable behaviour in case II.

    However, although the numerical representation of the initial conditions may

    influence the quality of solution, the characteristics and parameters of the chosen

    integration procedure (stability of the algorithm, relative and absolute tolerances)

    are cruical for obtaining reliable results.

    The programs Integpendode.mandOdefuncpend.mfor time integration reads:%

    % ODE-INTEGRATION PROGRAM: PLANAR PENDULUM

    % ---------------------------------------

    %

    %----------------------------------------------------------------------------

    %

    %

    load Date_pend % load the saved parameters and

    % % initial conditions

    %

    %

    %% set options for the integration subroutine

    %

    % RelTol - relativ tolerance of integration (default {1e-3});

    % AbsTol - absolut tolerance of integration (default {1e-6});

    %

    %

    options = odeset(RelTol,1e-5,AbsTol,[1e-5 1e-5]);

    %

    %-----------------------------------------------------------------------------

    %

    % Integration with solver ode45:

    % -----------------------------

    %

    % ode45 - MATLAB ODE nonstiff solver, based on an

    % explicit Runge-Kutta (4,5) formula,

    % the Dormand-Prince pair

    %

    % Vector [t,x] is to create, whereas:

    %

    % t - time, [0 3] - time interval;

    % x - statevector [alpha, omega];

    % odefuncpend - extern function, that provides right

    % hand side of ODE system

  • 8/12/2019 Dynamics Part Two

    6/69

    CHAPTER 4. DYNAMICS 237

    % incondvect_ode - initial condition vector

    % options - see above%

    [t,x]=ode45(odefuncpend,[0 30], incondvect_ode,options);

    %

    %----------------------------------------------------------------------------

    %

    % Function f of ODE system rhs

    %

    %

    % odefuncpend Name of function (responds to name in

    % integrpendode)%

    % t, x time, statevector (integration variables)

    %

    %

    %

    %-------------------------------------------------------------------------------

    %

    function rhs = odefuncpend(t,x)

    %

    %-------------------------------------------------------------------------------

    %

    % read parameters% ---------------

    %

    %

    %

    load Date_pend % load the saved parameters

    %

    %

    % calculate the torque for equilibrium position

    %

    Mom = m*g*l*sin(alphades);

    %

    %

    rhs = [x(2); (Mom - m*g*l*sin(x(1)))/(m*l^2)]; % right hand side

    %---------------------------------------------------------------

    Example 1.2: Planar pendulum, DAE representation

    In this example the integration in time domain is shown using a solver for differential-

    algebraic systems DAE.

  • 8/12/2019 Dynamics Part Two

    7/69

    CHAPTER 4. DYNAMICS 238

    The planar pendulum is considered as shown in Fig. 4.17 where the configura-

    tion coordinates are given by the coordinates

    (4.125)

    In contrary to the minimal form of equation of motion (4.114), the governing equa-

    tions consist of the Newton-Euler-equations (4.109-4.111) plus the kinematical con-

    straints (4.112, 4.113) as listed below

    (4.126)

    (4.127)

    These equations form a system of coupled differential and algebraic equations

    ( DAE system) of index 3 because the geometrical constraints in Eq. (4.119) are

    formulated at position level. Although it can be integrated in this form, many nu-merical procedures demand a formulation of the DAE in index 1 - form.

    The first differentiation of Eq.(4.119) provides constraints at velocity level

    (4.128)

    By combining Eq. (4.118) and Eq. (4.120), DAE of index 2 is established.

    Further differentiation of constraint equation results in

    (4.129)

    representing the geometrical constraints at acceleration level.

    To formulate DAE of index 1, dynamical equations (4.118) has to be combined

    with Eq. (4.121).

    Since this DAE system contains time derivatives of second order, it has to be

    reformulated to obtain the form

    (4.130)

    as it is demanded for utilisation of MATLABroutinesODE15s or ODE23t.

  • 8/12/2019 Dynamics Part Two

    8/69

    CHAPTER 4. DYNAMICS 239

    With this aim in view, a state vector is defined containing the unknown positions

    and the constraint forces . To formulate a first order differential equation, thevelocities

    have to be also included in the state vector.

    However, to formulate the right hand side , where only coordinates of are

    allowed to appear, the accelerations is introduced in the state vector as well.

    Finally it reads as

    (4.131)

    Then the governing equations are

    (4.132)

  • 8/12/2019 Dynamics Part Two

    9/69

    CHAPTER 4. DYNAMICS 240

    or

    . . .

    ...

    (4.133)

    The internal structure of is depending on how the structure of is

    chosen by the user.

    The representation used above show particular features, some of them are im-

    portant for the effective application ofODE15sand ODE23t.

    The mass matrix is singular. This is a general fact for DAE-system.

    has a diagonal form. Therefore the DAE-system is a semi-explicit DAE.

    By putting all variables on the right hand side, is a constant matrix. Mo-

    rover, is not sparse. This has positive consequences for the solver when

    building the Jacobian

    .

    The programs Intependdae.m and daefuncpend are listed. The corresponding datafile is already given in example 4.1.

  • 8/12/2019 Dynamics Part Two

    10/69

  • 8/12/2019 Dynamics Part Two

    11/69

    CHAPTER 4. DYNAMICS 242

    %

    % daefuncpend - Name of function (responds to name in% integrpendode)

    %

    % t, y - time, statevector (integration variables)

    % flag - string indicating the type information

    % that should be returned

    %

    %-------------------------------------------------------------------------------

    %

    function rhs = daefuncpend(t,y,flag)

    %

    %-------------------------------------------------------------------------------

    %

    % read parameters

    % ---------------

    %

    %

    %

    load Date_pend % load the saved parameters

    %

    %

    %-------------------------------------------------------------------------------

    %

    % DAE solver demands:

    % -------------------

    %% event1: right hand side f of DAE is required

    %

    switch(flag)

    case

    %

    % calculate torque for equilibrium position

    %

    Mom = m*g*l*sin(alphades);

    %

    % calculate the right hand side f

    %

    rhs = [y(4); y(5); y(6); y(7); y(8); y(9); -m*y(7) + y(10); -m*y(8) - m*g+ y(11); -I*y(9) + Mom + y(2)*y(10) - y(1)*y(11); y(7) + y(5)*y(6)

    + y(2)*y(9); y(8) - y(4)*y(6) - y(1)*y(9)];

    %

    %

    % event2: mass matrix of DAE is required

    %

    %

    case mass

    %

    % calculate the mass matrix

  • 8/12/2019 Dynamics Part Two

    12/69

    CHAPTER 4. DYNAMICS 243

    %

    rhs = diag([1,1,1,1,1,1,0,0,0,0,0])%

    % end o f switch

    %

    end

    %

    %----------------------------------------------------

    The results of a time integration using ODE15s with the default tolerances are

    discussed.

    a) Equilibrium positionsSimilar to example 1.1, the three cases shown in Fig. 4.18 are considered. Us-

    ing the exact initial conditions, in all three cases the numerical solutions show no

    difference to the analytical ones within the considered time interval of

    s.

    Using the disturbed initial condition with an error of in the

    positions, in all three cases the numerical solution converged to the exact one. Even

    in case I, representing the mechanical unstable position, the artificial error

    was damped out by the integrator.

    b) Oscillatory motion

    Considered is the case II with the statical equilibrium position

    and aninitial condition

    . A time integration delivers the solution

    is shown in

    Fig. 4.21.

    It is a periodical motion but not a harmonical one because the problem is kine-

    matically nonlinear (the lower reversal point is not at ).

    The full descriptor formulation contains also the constraint forces

    an

    which are plotted in Fig.4.22 with respect to time. A frequency double to that of the

    pendulum can be observed in the vertical component

    of constraint force.

    With these examples the utilisation of a DAE solver has been demonstrated.

    The particular properties of this procedure like damping out of numerical errors and

    delivering constraint force could be seen. Attention has to be drawn on the long

    term stability of computed solutions since drift effects may occur where energy is

    transfered between the motions in particular coordinates.

  • 8/12/2019 Dynamics Part Two

    13/69

    CHAPTER 4. DYNAMICS 244

    0 0.5 1 1.5 2 2.5 3 3.5 40

    0.2

    0.4

    0.6

    0.8

    1

    1.2

    1.4

    1.6

    [rad]

    t [s]

    Figure 4.21: Time evolution of the angle

    0 0.5 1 1.5 2 2.5 3 3.5 42

    1

    0

    1

    2

    3

    4

    5

    6

    7

    t [s]

    Fx

    [N],

    Fy

    [N]

    Fx(t)

    Fy(t)

    Figure 4.22: Pendulum constraint forces

  • 8/12/2019 Dynamics Part Two

    14/69

    CHAPTER 4. DYNAMICS 245

    Remark:

    In practice, sometimes small vibrations with respect to a reference motion haveto be investigated.

    In that case the equations of motion are linear with respect to the unknown

    variables. To obtain these equations a particular procedure must be followed or

    the nonlinear equation of motion have to be linearised. For that in the equation of

    motion (4.114) of the pendulum the coordinate

    is introduced.

    With the assumption of small vibration , it is and , follows.

    By use of these relations all nonlinear functions of

    are represented in a power

    series expansion. Neglecting all terms of quadratic and higher order, then

    hold.

    Introducing these relations into Eq. (4.114) it follows

    In particular cases the reference motion may be a constant

    = const, as it was in

    the example above.)

    4.4.2 Dynamics of robot

    In this chapter dynamic analysis of planar robot with two rigid links, that follows

    specified trajectory, is presented. Several case-studies (inverse and forward dynam-

    ics of 2 DOF robot, forward dynamics of 2 DOF robot that contains PD - control

    loop, inverse and forward dynanmics of robot whose end-effector is mechanically

    constrained) are performed and analysed within following examples.Mathematical modelling of 2 DOF robot, is schematically depicted in Fig. 4.23.

    The governing equations are derived in the full desriptor and minimal form as fol-

    lows. The mathematical models so obtained are basis for the particular examples

    presented in this chapter.

  • 8/12/2019 Dynamics Part Two

    15/69

    CHAPTER 4. DYNAMICS 246

    x

    y

    Robot: 2 DOF MBS

    Full descriptor form: Minimal form:

    Mathematical modellingleading to full descriptorform

    Mathematical modellingleading to minimal formvia LE of 2nd kind

    Figure 4.23: Modelling of 2 DOF robot

    Full descriptor form

    generalised Cartesian coordinates: 3 coordinates per body ( , , )

    dynamical equations of the free-body diagram

  • 8/12/2019 Dynamics Part Two

    16/69

    CHAPTER 4. DYNAMICS 247

    x

    y

    A

    B

    x

    y

    x

    y nth body

    generalised Cartesian coordinates

    Figure 4.24: Derivation of governing equations

    (4.138)

    (4.139)

    (4.140)

    (4.141)

    (4.142)

    (4.143)

  • 8/12/2019 Dynamics Part Two

    17/69

    CHAPTER 4. DYNAMICS 248

    kinematical constraint equations

    (4.144)

    (4.145)

    (4.146)

    (4.147)

    dynamical equations of the free body diagram in matrix form

    (4.148)

    (4.149)

    constraint forces can be expressed using "geometrical approach" via

    constraint matrix

    and Lagrange multipliers

    :

    (4.150)

    obviously:

    ,

    ,

    ,

    .

    (4.151)

    derivation of the constraint matrix

  • 8/12/2019 Dynamics Part Two

    18/69

    CHAPTER 4. DYNAMICS 249

    kinematical constraints in matrix form:

    (4.152)

    (4.153)

    (4.154)

    (4.155)

    dynamical equations of the free body diagram in the matrix form

    expressed via transposed constraint matrix and Langrange multipli-

    ers

    kinematical constraints in the matrix form

    (4.156)

    Minimal form

    Governing equations in the minimal form (equations of motion of the system)

    have been derived via transformation from the full descriptor form.

    the chosen generalised coordinates (2 DOF): absolute orientation angle

    of the first body, angle of the relative orientation of the second body with

    respect to the first one

    Jacobian matrix that specifies relation between two sets of coordinates

    has been established using NEWEUL multibody package

  • 8/12/2019 Dynamics Part Two

    19/69

    CHAPTER 4. DYNAMICS 250

    Example 2.1: Inverse dynamics of 2 DOF robot

    Inverse dynamics of the robot that follows a specified trajectory

    Determination of the applied forces (torques of the actuators of the force

    type) that have to be imposed to the robot to follow specified trajectory as

    well as the constraint forces due to the joints.

    Kinematical data which is the basis of inverse dynamic analysis has been cal-

    culated on the basis of the specified trajectory of the robots end-effector and

    the kinematical structure of robots mechanism (length of linkages). Inertia

    parameters and lengths of linkages are specified as follows:

    kg,

    ,

    kg,

    ,

    m,

    m.

    Inverse dynamics problem of the robots motion is solved using mathemati-

    cal model in full descriptor form, formulated above. Trajectory of the end-

    effector is prescribed by the equation

    ,

    .

    The time history of the generalized coordinates

    and

    , calculated on the

    basis of the specified trajectory of robots end-effector are shown in Fig. 4.25.

    The driving torques and constraint forces in two cases (with and without gravity)

    are shown in the Fig. 4.26 - Fig. 4.31. It can be observed that the forces due to the

    statical origin are dominant.

  • 8/12/2019 Dynamics Part Two

    20/69

  • 8/12/2019 Dynamics Part Two

    21/69

    CHAPTER 4. DYNAMICS 252

    Case I: gravity is included

    0 0.5 1 1.5 2 2.5 31

    0.5

    0

    0.5

    1

    1.5

    M

    1[Nm];M2

    [Nm]

    t [s]

    M1(t)

    M2(t)

    Figure 4.26: Robot driving torques needed to follow a specified end-effector trajec-

    tory. Calculated on the basis of robots prescribed motion

  • 8/12/2019 Dynamics Part Two

    22/69

    CHAPTER 4. DYNAMICS 253

    0 0.5 1 1.5 2 2.5 30.2

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    Fbx

    [N],Ffx

    [N]

    t [s]

    Fbx

    (t)

    Ffx(t)

    Figure 4.27: Constraint force in -direction: joint A (basis joint) and joint B

    (flying) joint

    0 0.5 1 1.5 2 2.5 34

    5

    6

    7

    8

    9

    10

    Fby

    [N],Ffy

    [N]

    t [s]

    Fby

    (t)

    Ffy

    (t)

    Figure 4.28: Constraint force in -direction: joint A (basis joint) and joint B

    (flying joint)

  • 8/12/2019 Dynamics Part Two

    23/69

    CHAPTER 4. DYNAMICS 254

    Case II: gravity is not included

    0 0.5 1 1.5 2 2.5 30.04

    0.03

    0.02

    0.01

    0

    0.01

    0.02

    0.03

    0.04

    0.05

    M1,

    M2

    [Nm]

    t [s]

    M1 (t)

    M2(t)

    Figure 4.29: Robot driving torques needed to follow a specified end-effector trajec-

    tory. Calculated on the basis of robots prescribed motion

    Example 2.2: Forward dynamics of 2 DOF robot,

    In this example forward dynamics of 2 DOF robot, based on the marhematical

    model in minimal form (two dimensional ODE system) is performed. The explicit

    Runge-Kutta method (within M ATLABcode: ode45integration algorithm) has been

    used. The tolerances have been set as follows: RelTol=1e-3, AbsTol=1e-6 (default

    values).

    The simulation results are shown in Fig. 4.32. In Fig. 4.33, the difference be-

    tween simulation results and reference values is depicted. It is visible that absolute

    error within the whole integration domain does not exceed the magnitude of 4e-6.Further analysis has shown that time integration with imposed more strict tolerances

    provides more accurate integration results.

    The proof-check if integration results converge when more strict tolerances are

    imposed on integration routine, is in the most case-studies a necessary step in ob-

    taining reliable simulation results.

  • 8/12/2019 Dynamics Part Two

    24/69

    CHAPTER 4. DYNAMICS 255

    0 0.5 1 1.5 2 2.5 30.2

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    Fbx

    [N],Ffx

    [N]

    t [s]

    Fbx

    (t)

    Ffx(t)

    Figure 4.30: Constraint force in -direction: joint A (basis joint) and joint B

    (flying joint)

    0 0.5 1 1.5 2 2.5 30.04

    0.03

    0.02

    0.01

    0

    0.01

    0.02

    0.03

    0.04

    Fby

    [N],Ffy

    [N]

    t [s]

    Fby

    (t)

    Ffy(t)

    Figure 4.31: Constraint force in

    -direction: joint A (basis joint) and joint B

    (flying joint)

  • 8/12/2019 Dynamics Part Two

    25/69

    CHAPTER 4. DYNAMICS 256

    0 0.5 1 1.5 2 2.5 31

    0.5

    0

    0.5

    1

    1.5

    1

    [rad],2

    [rad],

    t [s]

    1(t)

    2(t)

    Figure 4.32: Simulation results: generalised coordinates

    ,

    Example 2.3: Forward dynamics of 2 DOF robot,

    Here, the same robot is considered as in the Example 2.2, with the only difference

    that gravity forces act on the robot links. Integration routine ode45is used again.

    In contrary to the results obtained in the case (Fig. 4.32, Fig. 4.33), an

    integration with default tolerances leads to a very strongly divergent solution.

    Even when more strict tolerances (i. e. 1e-8) are imposed to the integratin

    routine the errors are reduced but the solution is still divergent, Fig. 4.34.

    A further restriction of tolerances to 1e-10 leads to further reduction of errors,

    but the divergent characteristics are still the same, as it can be seen in Fig. 4.35.

    The reason for such a behaviour lies in the fact that analysed system is me-

    chanically unstable (the proof is left to the reader) and numerical errors that are

    unvoidable during integration routine (discretisation errors due to the characteris-tics of the chosen routine and round-off errors) initiate an unstable behaviour of the

    system (see also Example 1.1 and Example 1.2).

    The consequences of the errors in the joint angles on the position of end-effector

    is illustrated in Fig. 4.36 (tolerances of magnitude 1e-8 have been used) and Fig.

    4.37 (tolerances of magnitude 1e-10).

  • 8/12/2019 Dynamics Part Two

    26/69

    CHAPTER 4. DYNAMICS 257

    0 0.5 1 1.5 2 2.5 34

    3

    2

    1

    0

    1

    2

    3x 10

    6

    1

    (t)[rad],

    2

    (t)[rad]

    t [s]

    1(t)

    2(t)

    Figure 4.33: Difference between simulated results (RelTol=1e-3, AbsTol=1e-6) and

    reference data: generalised coordinates

    ,

    Example 2.4: Control via PD-feedback

    From the previous examples it became clear, that mechanically unstable or marginally

    stable systems are difficult to simulate by numerical integration. In reality such

    feedforward calculation of the desired driving torques by inverse dynamics and ap-

    plying to the robot also does not result in a satisfactory motion, i.e. it is not possible

    to drive the robot along a prescribed path, since disturbances act on the robot.

    Therefore a feedback control is necessary, see Fig. 4.38. From control theory

    a broad variety of control laws are known and may be applied. The choice of a

    specific or an optimal control law is not considered here.

    In the following example it is assumed that the positions

    and

    as well as the

    corresponding velocities can be measured, e.g. by resolvers and tachogenerators,

    respectively. Therefore, a complete state variable feedback can be performed. In the

    case of rigid robot arms and ideal joints, this allows the full reduction of deviations

    of the end effector position

    (4.157)

    from its desired motion.

  • 8/12/2019 Dynamics Part Two

    27/69

    CHAPTER 4. DYNAMICS 258

    0 0.5 1 1.5 2 2.5 30.2

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    1

    (t)[rad],

    2

    (t)[rad]

    t [s]

    1(t)

    2(t)

    Figure 4.34: Difference between simulated results (RelTol=AbsTol=1e-8) and ref-

    erence data: generalised coordinates

    ,

    The control torques from the feedback due to a PD-controller reads as

    (4.158)

    where the gains of state variable feedback control have to fulfil the stability condi-

    tion that the poles must be in the left half-plane.

    With a desired modal damping of

    the gains are

    (4.159)

    Here

    has been chosen arbitrarily as

    leading to a stable system. For closer

    details of design of controllers see [14].

    The standard routineode45

    with the default tolerances ( RelTol = 10e-3, AbsTol= 10e-6 ) is used to calculate the trajectory of the robot, and the deviations of the

    angles

    ,

    ,

    and

    from their desired values were observed. The integration

    delivered satisfactory results, the errors are bounded and smaller than the chosen

    tolerance of the numerical integration process.

    To show the stability of the entire system, the initial condition is now disturbed

    by a

    e

    rad.

    First, the case

    is shown. It turns out that the initially given deviation can

    not be compensated by the PD-controller. Its feedback gain are too weak to cancel

    the destabilising forces, as illustrated in Fig. 4.39.

  • 8/12/2019 Dynamics Part Two

    28/69

    CHAPTER 4. DYNAMICS 259

    1.5 2 2.5 35

    4

    3

    2

    1

    0

    1

    2

    3x 10

    3

    1

    (t)[rad],

    2

    (t)[rad]

    t [s]

    1(t)

    2(t)

    Tol: 1010

    Tol: 108

    Figure 4.35: Comparison between simulation results obtained using integration rou-

    tines with different tolerances, RelTol=AbsTol=1e-8, RelTol=AbsTol=1e-10. Dif-

    ference between simulated results

    ,

    and reference data are depicted

    In the cases

    and

    , the simulations clearly show a decay of the

    initially given deviations. The remaining error is bounded within the precision of

    the integration routine. Depending on the parameters of the feedback control, the

    decay behaviour is different as it is shown in Fig. 4.40, Fig. 4.41 and Fig. 4.42. The

    position error (position of end-effector is expressed in worldcoordinates) is within

    acceptable range.

    On the basis of these numerical experiments, it could be seen that the feedback

    controller law stabilises the solution. This happens due to the fact that additional

    terms appear in the "stiffness matrix", leading to an asymptotic stable system.

    From the mechanical point of view, such terms can be caused by- a fictive mounting of springs and dampers between the real links of the robot

    and guiding device (not existing in reality) or

    - installation of a controller system (consisting of sensors, control law, amplifiers

    and actuators) to get a stable behaviour of the robot. It has to be mentioned that

    for very high feedback gains the system becomes stiff and beyond a certain limit

    instability may occur.

    Concerning the numerical integration of differential equations, this controller

    system can be considered as a kind of stabilisation procedure as mentioned in chap-

  • 8/12/2019 Dynamics Part Two

    29/69

    CHAPTER 4. DYNAMICS 260

    0 0.5 1 1.5 2 2.5 30.005

    0

    0.005

    0.01

    0.015

    0.02

    0.025

    xe

    [m],ye

    [m]

    t [s]

    xe(t)

    ye(t)

    Figure 4.36: Difference betweeen simulated results and referent values: end-

    effector position coordinates

    0 0.5 1 1.5 2 2.5 30.5

    0

    0.5

    1

    1.5

    2

    2.5x 10

    4

    xe

    [m],ye

    [m]

    t [s]

    xe(t)

    ye

    (t)

    Figure 4.37: Difference betweeen simulated results and referent values: end-

    effector position coordinates

  • 8/12/2019 Dynamics Part Two

    30/69

    CHAPTER 4. DYNAMICS 261

    Feedforward

    Controler

    Robot

    Figure 4.38: Closed loop structure of the 2-DOF robot

    0 0.5 1 1.5 2 2.5 30

    0.5

    1

    1.5

    2

    2.5 x 10

    4

    1

    [rad],

    2

    [rad]

    t [s]

    1(t)

    2(t)

    Figure 4.39: Unstable behaviour for feedback gain

    ter 4.3.3. (This type of stabilisation was proposed e.g. by Baumgarte.)Note: Real technical systems have elastic links and joints and their deformation

    may influence the position of the end effector considerably. If this position can

    not be measured directly, an observer based on the equations of motion has to be

    applied to estimate the elastic deformation and include it in the control.

  • 8/12/2019 Dynamics Part Two

    31/69

  • 8/12/2019 Dynamics Part Two

    32/69

    CHAPTER 4. DYNAMICS 263

    0 0.5 1 1.5 2 2.5 33

    2

    1

    0

    1

    2

    3

    4

    5

    6

    7

    x 106

    xe

    [m],ye

    [m]

    t [s]

    xe(t)

    ye(t)

    Figure 4.42: Stable behaviour for feedback gain

    , deviations

    and

    of

    end-effector

  • 8/12/2019 Dynamics Part Two

    33/69

    CHAPTER 4. DYNAMICS 264

    Example 2.5: Dynamics of robot with mechanically constrained end-effector

    x

    y

    Full descriptor form:

    Minimal form:

    Integration of ODE

    Inversedynamics

    constraintand appliedtorques and

    forces Forwarddynamics

    Figure 4.43: Modelling of 1 DOF robot

    MBS with 1 DOF

    Chosen generalised coordinate: absolute orientation angle of the first body or

    angle of the relative orientation of the second body with respect to the first

    one

  • 8/12/2019 Dynamics Part Two

    34/69

    CHAPTER 4. DYNAMICS 265

    System constraint forces: constraint forces at the joints, constraint force at

    the mechanically constrained end-effector

    INVERSE DYNAMICS

    Since robot (see Fig. 4.43) possesses 1 DOF, its motion can be controlled by

    just one force-actuator. There is a choice between two cases:

    a) Case I - torque acts at joint A (

    ),

    b) Case II - torque acts at joint B (

    ).

    However, actual magnitude of constraint force that acts on end-effector (as well

    as other applied and constraint forces) depenf on that choice.

    In the Case I the constraint force that acts on the end-effector is shown in Fig.

    4.44. On the contrary, if the actuation is provided via

    actuator (Case II), thetime-history of the end-effector constraint force is different as it is depicted in Fig.

    4.45.

    In copmpariison to the Case I, the constraint force is of much higher magnitude

    and with changing orientation. By comparing Fig. 4.44 and Fig. 4.45, it is visible

    that the actuation via is preferable, if the criteria of having small magnitude of

    constraint force acting on end-effector force is of importance.

    0 0.5 1 1.5 2 2.5 32.42

    2.43

    2.44

    2.45

    2.46

    2.47

    2.48

    2.49

    F

    end

    [N]

    t [s]

    Figure 4.44: Constraint force that acts on the end effector, Case I

  • 8/12/2019 Dynamics Part Two

    35/69

    CHAPTER 4. DYNAMICS 266

    0 0.5 1 1.5 2 2.5 315

    10

    5

    0

    5

    Fend

    [N]

    t [s]

    Figure 4.45: Constraint force that acts on the end effector, Case II

  • 8/12/2019 Dynamics Part Two

    36/69

    CHAPTER 4. DYNAMICS 267

    FORWARD DYNAMICS

    In Fig. 4.46 the result of time integration (difference between integrated resultsof end-effector

    coordinate and reference values, based on the mathematical model

    in minimal form (1 ODE), are shown for Case I. Integration routine ode45 with

    imposed tolerances RelTol=1e-8 and AbsTol=1e-8 has been applied.

    By dealing with Case II, the errors are considerably greater (Fig. 4.47). The

    errors of such magnitude exceed the precision demanded in robotics.

    Because of the inherent mechanical instability of the analysed system (see Ex-

    ample 1.1 and Example 2.4), the integration results deviate of the accurate values.

    This deviation is strongly dependent on the error tolerances that have been imposed

    on the integration routine.

    0 0.5 1 1.5 2 2.5 30.5

    0

    0.5

    1

    1.5

    2

    2.5

    3

    3.5

    4

    4.5x 10

    5

    xe

    (t)[m]

    t [s]

    Figure 4.46: Difference betweeen simulated results and referent values, Case I

  • 8/12/2019 Dynamics Part Two

    37/69

    CHAPTER 4. DYNAMICS 268

    0 0.5 1 1.5 2 2.5 30.5

    0

    0.5

    1

    1.5

    2

    2.5 x 103

    xe

    (t)[m]

    t [s]

    Figure 4.47: Difference betweeen simulated results and referent values, Case II

  • 8/12/2019 Dynamics Part Two

    38/69

    CHAPTER 4. DYNAMICS 269

    4.4.3 Dynamics of slider-crank mechanism

    Kinematics of slider-crank mechanism has been analysed in Chapter 2 (Excersise

    2.4.9). In Exampe 3.1 and Example 3.2 the results of dynamic analysis of slider-

    crank mechanism are presented.

    Example 3.1: Inverse dynamics of slider-crank mechanism

    Inverse dynamics of slider-crank has been solved using mathematical model in full

    descriptor form. In Fig. 4.48, time history of the torque that is needed to drive

    mechanism with the crank constant angular velocity

    is shown. Two

    different cases are calculated and compared: a) mass of the piston,

    kg b)

    mass of the piston kg.The components of constraint forces in crank bearing and piston-rod bearing as

    well as the transversal force of piston guidance are shown in Fig. 4.49 and Fig.

    4.50.

    0 0.5 1 1.5 2 2.5 320

    15

    10

    5

    0

    5

    10

    15

    20

    t [s]

    Mm[

    Nm]

    mp= 0.8 kg

    mp= 4.0 kg

    Figure 4.48: Driving torque of slider-crank mechanism: two cases with different

    masses of the piston

    Example 3.2: Forward dynamics of slider-crank mechanism

    Forward dynamics of slider-crank mechanism has been performed by:

  • 8/12/2019 Dynamics Part Two

    39/69

    CHAPTER 4. DYNAMICS 270

    0 0.2 0.4 0.6 0.8 1250

    200

    150

    100

    50

    0

    50

    100

    150

    200

    Fbx

    [N],Fby

    [N]

    t [s]

    Fbx

    (t)

    Fby

    (t)

    Figure 4.49: Components of constraint force in crank bearing

    0 0.2 0.4 0.6 0.8 130

    20

    10

    0

    10

    20

    30

    40

    50

    Ffx

    [N],Ffy

    [N],F

    px[N

    ]

    t [s]

    Ffx

    (t)

    Ffy

    (t)

    Fpx

    (t)

    Figure 4.50: Components of constraint force in piston-rod bearing and piston guid-

    ance

    integration of governing equations formulated in minimal form: 1ODE

  • 8/12/2019 Dynamics Part Two

    40/69

    CHAPTER 4. DYNAMICS 271

    using 1 generalised coordinate: crank angle

    deriving equation of motion via transformation from the full descriptor form

    Systems free-run has been studied (no driving torque is applied).

    In Fig. 4.51 time history of the angular velocity of crank shaft is presented for

    two cases: a) mass of the piston,

    kg b) mass of the piston

    kg.

    A comparison of the piston displacement travel with an ideal cos time-function

    is presented in Fig. 4.52. It becomes obvious that the piston does not follow an

    hatmonic function due to the nonlinearity in crank-slider mechanism

    0 0.5 1 1.5 2 2.5 35.8

    5.85

    5.9

    5.95

    6

    6.05

    6.1

    6.15

    6.2

    6.25

    6.3

    t [s]

    [rad/s]

    mp= 0.8 kg

    mp= 4.0 kg

    Figure 4.51: Angular velocity of crank: casses with different masses of the piston

    MATLAB program for forward dynamics of slider-crank mechanism in minimalform / main program reads as

    % Integration of the equations of motion of the slider% crank model in minimal form

    % integration interval

    t0=0; tf=1;

    % inital conditions, x(1)=positions, x(2)=velocities

    x0=[0, 0]

    % call of ode45 integrator

    [t,x]=ode45(Eqslide,t0,tf,x0)

    % description of the system: Eqslide.m

    % End

  • 8/12/2019 Dynamics Part Two

    41/69

    CHAPTER 4. DYNAMICS 272

    0 0.5 1 1.5 2 2.5 30.2

    0.4

    0.6

    0.8

    t [s]

    yp

    [m]

    yp

    ycos

    Figure 4.52: Piston displacement travel: comparison with the cos time-function

  • 8/12/2019 Dynamics Part Two

    42/69

    CHAPTER 4. DYNAMICS 273

    Example 8: Cable way

    Typical questions concerning the dynamics of a mechanical system are discussed

    on a cabin of a cable way.

    The cabin of a cable way as shown in Fig. 4.53 is considered with its carriage

    and suspension. The roller of the carriage by a spring (stiffness constant

    ). A

    bearing (mass

    , centre of mass

    ) is visco-elastically hinged (stiffness constant

    , damping constant ) in the trolley. It carries the cabin itself (mass

    , centre of

    mass

    , moment of inertia

    ).

    Forward dynamics is carried out to get an insight into the dynamical behaviour

    using time integration. Since large oscillations are expected the nonlinear equations

    of motion were used for the integration in time domain. In this example the excita-

    tion is assumed as a step-like switch on of the winding drum at

    :

    for

    ,

    for .

    g

    Figure 4.53: Cable way

    EQUATION OF MOTION

    Obviously, the system has

    degrees of freedom. An appropriate vector of

  • 8/12/2019 Dynamics Part Two

    43/69

    CHAPTER 4. DYNAMICS 274

    generalised coordinates is

    By writing Newtons equations for trolley, bearing and cabin and adding Eulers

    equation for cabin the Newton-Euler equation reads as

    By premultiplying with the transposed global Jacobian

  • 8/12/2019 Dynamics Part Two

    44/69

    CHAPTER 4. DYNAMICS 275

    the equation of motion is received as

    sym.

    .

    This premultiplication reduces the dimensions of the matrices and vectors to the

    dimension , it garantees a symmetrical mass matrix and eliminates the generalised

    constraint forces . This is due the orthogonality of the matrices and .

    PARAMETERS OFCABLEWAY

    All physical constants are kept in the seperate m-file values.m. Note that

    is

    denoted as w0 in all m-files.

    % values.m

    % Physical constants for cabin-problem:

    % Make constants accessible in all modulesglobal m1 m2 m3 g alpha w0 R r cf cs d Dbeta I3 l y0

    m1 = 50; % Mass of trolley [kg]

    m2 = 10; % Mass of cabin bearing [kg]

    m3 = 300; % Mass of cabin [kg]

    % possibly + 200 kg for persons

    I3 = m3*1; % Cabins moment of inertia [kg*m^2]

    g = 9.81; % Gravity [m/(s^2)]

    alpha = rad(35); % Inclination towards horizontal [rad]

    w0 = rad(180); % Rotary speed of drive roll [rad/s]

    R = 1; % Radius of drive roll [m]

    cf = 8e4; % Spring stiffness for cabin bearing [N/m]

    cs = 5e4; % Spring stiffness for towing rope [N/m]

    d = 1e3; % Damper constant for bearing [N*s/m]

    Dbeta = 800; % Rotational damper constant [N*m*s]

    l = 2; % Distance from bearing to [m]

    % cabins centre of gravity

    r = 0.6; % Distance rope - damper [m]

    % Initial condition

    % y0=[s;ds;u;du;beta;dbeta]

    y0=[0;0;0;0;0;0];

  • 8/12/2019 Dynamics Part Two

    45/69

    CHAPTER 4. DYNAMICS 276

    % Define constants for field-names to increase readability

    global fn_s fn_ds fn_u fn_du fn_beta fn_dbetafn_s = 1;

    fn_ds = 2;

    fn_u = 3;

    fn_du = 4;

    fn_beta = 5;

    fn_dbeta = 6;

    The incluence of parameter variation on the dynamical behaviour is shown on

    the time history of characteristic coordinates, a linearisation of the equations of

    motion and an eigenvalue analysis is not performed.

    The two short auxiliary functions deg and rad are used to convert radian to

    degree and vice versa. Each function is defined in a separate m-file.

    % deg.m

    % Convert rad into degree

    function angle_deg=deg(angle_rad)

    angle_deg=angle_rad.*180./pi;

    % rad.m

    % Convert degree into rad

    function angle_rad=rad(angle_deg)

    angle_rad=angle_deg.*pi./180;

    The right hand side of the ODE system is generated in the Fcabin.m:

    % Fcabin.m

    % ODE-File for cabin-problem

    % Defines the ODE-system

    % y(1)=s

    % y(2)=ds=dy(1)

    % dds=dy(2)

    % y(3)=u

    % y(4)=du=dy(3)

    % ddu=dy(4)

    % y(5)=beta

    % y(6)=dbeta=dy(5)

    % ddbeta=dy(6)

    function dy = Fcabin(t,y,command)

    % get access to physical constants and field-names

    global m1 m2 m3 g alpha w0 R cf cs d Dbeta I3 l

  • 8/12/2019 Dynamics Part Two

    46/69

  • 8/12/2019 Dynamics Part Two

    47/69

    CHAPTER 4. DYNAMICS 278

    y0(fn_s)=-(m1+m2+m3)*g*sin(alpha)/cs;

    y0(fn_u)=m3*g*cos(alpha+y0(fn_beta))/cf;

    % Solve the system

    [T,Y]=ode45(Fcabin,time_range,y0,options);

    % Calculate desired path of trolley

    s_des = w0.*R.*T-(m1+m2+m3)*g*sin(alpha)/cs;

    % Store data for plot in another matrix

    solution(:,1)=Y(:,fn_s)-s_des;

    solution(:,2)=Y(:,fn_u);

    solution(:,3)=deg(Y(:,fn_beta)); % give beta in degree

    % Prepare graphic window

    figure(1)

    clf

    % Plot all solutions in a single window

    subplot(3,1,1)

    plot(T,solution(:,1));

    title(Excursions versus time using default error tolerance)

    % Define plot layout

    axis tight % Scale axes

    grid on % Switch grid on

    xlabel(Time t [s]) % Label axesylabel(s(t) - s_d (t) [m])

    subplot(3,1,2)

    plot(T,solution(:,2));

    % Define plot layout

    axis tight % Scale axes

    grid on % Switch grid on

    xlabel(Time t [s]) % Label axes

    ylabel(u(t) [m])

    subplot(3,1,3)plot(T,solution(:,3));

    % Define plot layout

    axis tight % Scale axes

    grid on % Switch grid on

    xlabel(Time t [s]) % Label axes

    ylabel(\beta(t) [\circ])

    This program calculates a solution by using default tolerances for the integrator

    and shows the results in a single window. The first graph shows the difference

  • 8/12/2019 Dynamics Part Two

    48/69

    CHAPTER 4. DYNAMICS 279

    0 1 2 3 4 5 6 7 8

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    Excursions versus time using default error tolerance

    Time t [s]

    s(t)sd

    (t)[m]

    0 1 2 3 4 5 6 7 8

    0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6 7 8

    15

    10

    5

    0

    5

    10

    15

    20

    25

    Time t [s]

    (t)[]

    Figure 4.54: Solution of ODE by use ofode45

    between the actual location of the cable ways carriage and the desired location

    . The desired location can be expressed as

    (4.160)

    The second graph shows the excursion of the suspension relative to the

    carriage. The third graph depicts the swing motion of the cabin relative to its

    suspension. As can be seen, the solution is already stable when using default error

    tolerance. To check the reliability of the solution, stricter error tolerances of 10e-6

    for relative and 10e-8 for absolute error have been chosen.For doing this, only very few lines have to be modified in cabin.m:

    % cabin_H.m

  • 8/12/2019 Dynamics Part Two

    49/69

    CHAPTER 4. DYNAMICS 280

    ...

    % Define options used for integration

    % relative error tolerance

    options = odeset(reltol,1e-6);

    % absolute error tolerance

    options = odeset(options,abstol,1e-8);

    ...

    The result obtained from the modified m-file looks very similar to the pre-

    vious one. To show the actual difference between the two solutions, the m-file

    cabin_lh.m can be used:

    % cabin_lh.m

    % Initialisation:

    clear;

    values; % read constants

    % Define time interval of integration,

    % use steps of 0.01 seconds for output.

    time_range = 0:0.01:8;

    % Define options used for integration

    % relative error tolerance (default)

    options = odeset(reltol,1e-3);

    % absolute error tolerance (default)options = odeset(options,abstol,1e-6);

    % Calculate the initial static equilibrium

    y0(fn_s)=-(m1+m2+m3)*g*sin(alpha)/cs;

    y0(fn_u)=m3*g*cos(alpha+y0(fn_beta))/cf;

    % Solve the system

    [T,Y]=ode45(Fcabin,time_range,y0,options);

    % Switch to high accurancy

    % relative error tolerance

    options = odeset(reltol,1e-6);

    % absolute error tolerance

    options = odeset(options,abstol,1e-8);

    % Solve the system using new error tolerances

    [T,Y_H]=ode45(Fcabin,time_range,y0,options);

    % Calculate difference between the two solutions

    solution(:,1)=Y(:,fn_s)-Y_H(:,fn_s);

    solution(:,2)=Y(:,fn_u)-Y_H(:,fn_u);

    % Convert beta to degree

    solution(:,3)=deg(Y(:,fn_beta))-deg(Y_H(:,fn_beta));

  • 8/12/2019 Dynamics Part Two

    50/69

    CHAPTER 4. DYNAMICS 281

    ...

    % Print maximum differences as numbers

    max(solution)

    0 1 2 3 4 5 6 7 8

    1

    0.5

    0

    0.5

    1

    x 104 Differences between default and small error tolerance

    Time t [s]

    s(t)sd

    (t)[m]

    0 1 2 3 4 5 6 7 8

    8

    6

    4

    2

    0

    2

    4

    6

    8

    x 105

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6 7 8

    5

    4

    3

    2

    1

    0

    1

    2

    x 103

    Time t [s]

    (t)[]

    Figure 4.55: Comparison of solution with default and high accuracy

    Note: Here it is mandatory to use a fixed width of the time steps. Otherwise

    the output matrices of the different solvers could have different dimensions and

    therefore can not be subtracted from each other. The program prints out the maximal

    differences of the two solutions. These are less than 2e-4 meters for

    and

    ,

    and less than 3e-3 for

    .

    Now the integrator ode45 is compared to ode15s. Therefore the m-file has to

    be changed slightly:

  • 8/12/2019 Dynamics Part Two

    51/69

    CHAPTER 4. DYNAMICS 282

    % cabin_45_15s.m

    ...

    % Solve the system using ode45

    [T,Y]=ode45(Fcabin,time_range,y0,options);

    % Solve the system using ode15s

    [T,Y_H]=ode15s(Fcabin,time_range,y0,options);

    % Calculate difference between the two solutions

    solution(:,1)=Y(:,fn_s)-Y_H(:,fn_s);

    solution(:,2)=Y(:,fn_u)-Y_H(:,fn_u);

    % Convert beta to degree

    solution(:,3)=deg(Y(:,fn_beta))-deg(Y_H(:,fn_beta));

    ...

    Again, the comparison shows that the absolute difference is acceptable from the

    engineering point of view. Therefore, ode45with default error tolerance is used for

    further calulations.

    PARAMETER VARIATION

    Now it is investigated how variations of several parameters influence the be-

    haviour of the cable way. To present the data in graphs, the function plotcabin

    is used. This function controls different line types, 2D and 3D-plots, automatic la-

    beling and some other things. Control arguments are Y for the solution including

    the time vectors, and Param for the varied parameter. The other arguments are for

    describing the plots and are explained in the file.

    % plotcabin.m

    % Plot three graphs containing 3d-lines

    function plotcabin(Y,Param,ParamUnit,ParamName,TitleSuff, AZ,EL)

    % input arguments:

    % Y 3-dim. matrix containing solutions of several

    % diff. equations:

    % Each 2D-matrix contains solutions in column-

    % vectors, each column contains values for a single

    % parameter value.

    % y{i}(:,1) Deviation from desired position for i-th

    % parameter value

    % y{i}(:,2) Excursion of bearing for i-th parameter value

    % y{i}(:,3) Angle beta (in DEGREE!) for i-th parameter value

    % Y{i}(:,4) Time vector for i-th parameter value

    %

    % Param Matrix containing values of varied parameter

    % ParamUnit Name of measure unit for Parameter

    % ParamName Name of varied parameter

  • 8/12/2019 Dynamics Part Two

    52/69

    CHAPTER 4. DYNAMICS 283

    0 1 2 3 4 5 6 7 8

    5

    0

    5

    10

    x 104 Differences between ode45 and ode15s

    Time t [s]

    s(t)sd

    (t)[m]

    0 1 2 3 4 5 6 7 8

    6

    4

    2

    0

    2

    4

    6

    8

    x 104

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6 7 8

    0.02

    0.01

    0

    0.01

    0.02

    Time t [s]

    (t

    )[]

    Figure 4.56: Comparison of solution with ode45and ode15s

    %

    % TitleSuff Suffix for title

    %

    % AZ Azimuth angle for viewing, default: 40 degree

    % EL Elevation angle for viewing, default: 50 degree

    %Apply default values if necessary if nargin < 7, EL=50; end;

    if nargin < 6, AZ=40; end;

    if nargin < 5, TitleSuff = ; end;

    if nargin < 4, ParamName =Parameter; end;

    if nargin < 3, ParamUnit =; end;

    % Deside wether to use different line-styles or not

  • 8/12/2019 Dynamics Part Two

    53/69

    CHAPTER 4. DYNAMICS 284

    if (length(Param) < 5) % less than 5 lines ?

    UseDiffStyles = 1;else

    UseDiffStyles = 0;

    end;

    % Prepare graphic window

    figure(1)

    clf

    % Plot all results in a single window

    subplot(3,1,1)

    title([Excursions versus time TitleSuff])

    DoPlot(Y,1,Param,s(t) - s_d (t) [m],ParamName,ParamUnit,...

    AZ,EL,UseDiffStyles)

    subplot(3,1,2)

    DoPlot(Y, 2,Param, u(t) [m], ParamName,ParamUnit, AZ,EL,...

    UseDiffStyles)

    subplot(3,1,3)

    DoPlot(Y,3,Param,\beta(t)[\circ],ParamName,ParamUnit,...

    AZ,EL,UseDiffStyles)

    if UseDiffStyles == 1 % Show legend if needed

    subplot(3,1,1);

    for n = 1:length(Param)

    legendtext{n}= sprintf(%s = %.2e %s,ParamName,Param(n),...

    ParamUnit);

    end;legend(legendtext,1); % Place legend in upper right-hand corner

    end;

    function DoPlot(Y,Sel,Param,V_Name,ParamName,ParamUnit,...

    AZ,EL,UseDiffStyles)

    % Sub-function used for drawing actual plot

    % Y Solution array

    % Sel Selector for data to plot

    % Param Values of parameter

    % V_Name Name of plotted value

    % ParamName Name of parameter

    % ParamUnit Name of measure-unit% AZ, EZ Azimuth and elevation angles

    % UseDiffStyle Set to 1 to use different line-styles

    % Define array containing different line-styles:

    % [Parameter for plot3d-function, line-width]

    linestyles = {r-,g-,b:,m:};

    linewidths = { 0.5, 1, 0.7, 1, 1};

    % Rotate coordinate system

    view(AZ,EL)

  • 8/12/2019 Dynamics Part Two

    54/69

    CHAPTER 4. DYNAMICS 285

    % Keep existing graphicshold on

    % Plot one curve for each parameter value

    for n = 1:length(Param)

    if UseDiffStyles == 1

    linestyle = linestyles{n}; % use different line-styles

    linewidth = linewidths{n};

    else

    linestyle = b-; % use same line-style if more than 4 lines

    linewidth = 0.5;

    end;

    % Plot line in space

    % Y{n}(:,4) contains always the time vector

    L=plot3(Y{n}(:,4),ones(1,length(Y{n}(:,4))).*Param(n),...

    Y{n}(:,Sel),linestyle); set(L,LineWidth,linewidth);

    Style=get(L);

    if AZ ~= 0

    % If azimuth angle is different from zero, draw pointer at the

    % end of integration interval

    % Find global minimum of plot

    for i = 1:length(Y)

    mins(i) = min(Y{i}(:,Sel));end;

    last=length(Y{n}(:,4));

    L=line([Y{n}(last,4), Y{n}(last,4)], [Param(n), Param(n)],...

    [Y{n}(last,Sel) , min(mins)]);

    set(L,Color,Style.Color);

    set(L,LineStyle,--);

    set(L,LineWidth,Style.LineWidth);

    end

    end

    hold off

    % Define plot layout

    axis tight % Scale axes

    grid on % Switch grid on

    xlabel(Time t [s]) % Label axes

    if isempty(ParamUnit)

    ylabel(ParamName);

    else

    % Concatenate strings to form description

    ylabel(strcat(ParamName, [, ParamUnit, ]));

  • 8/12/2019 Dynamics Part Two

    55/69

    CHAPTER 4. DYNAMICS 286

    end;

    zlabel(V_Name)

    With this powerful function the main programs become much shorter. To get

    smooth plots, the step size of the output is automatically controlled by the ODE-

    solver. Then the time vectors differ between different solutions. In order to store

    the results in a single variable despite of this, a cell-array is used, and the time vec-

    tor is stored together with each solution. Then the variable containing the results is

    then passed to the function plotcabin.

    Mass of cabin

    Obviously, in practice

    may change widely. This refers to the load of the

    cabin. The output showing the influence of the mass of the cabin is generated bythe m-file cabin_m3.m:

    % cabin_m3.m

    % Vary mass of cabin m3:

    % Initialisation:

    clear;

    values; % Read constants

    % Define time interval of integration

    time_range = [0, 6];

    % Define range and step for m3

    range = 300:150:600;

    for n = 1:length(range)

    % Set parameter for current loop

    m3 = range(n);

    % Calculate initial spring excursions

    y0(fn_s)=-(m1+m2+m3)*g*sin(alpha)/cs;

    y0(fn_u)=m3*g*cos(alpha+y0(fn_beta))/cf;

    % Clear previous dimensions of T and Y

    clear T Y

    % Solve the system

    [T,Y(:,:)]=ode45(Fcabin,time_range,y0);

    % Calculate desired position for trolley

    s_des = w0.*R.*T-(m1+m2+m3)*g*sin(alpha)/cs;

    % Store data that should be plotted in a cell-array

    solution{n}(:,1)=Y(:,fn_s)-s_des;

  • 8/12/2019 Dynamics Part Two

    56/69

    CHAPTER 4. DYNAMICS 287

    solution{n}(:,2)=Y(:,fn_u);

    solution{n}(:,3)=deg(Y(:,fn_beta)); % give beta in degreesolution{n}(:,4)=T; % Store time-points for each solution

    end

    % Draw plots, set azimuth and elevation angle to zero

    % to draw 2d-plot

    plotcabin(solution,range,kg,m3,, variation of m3,0,0);

    0 1 2 3 4 5 6

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    Time t [s]

    Excursions versus time, variation of m3

    s(t)sd

    (t)[m]

    m3 = 3.00e+02 kgm3 = 4.50e+02 kgm3 = 6.00e+02 kg

    0 1 2 3 4 5 6

    0

    0.05

    0.1

    0.15

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    20

    10

    0

    10

    20

    Time t [s]

    (t)[]

    Figure 4.57: Variation of mass of cabin

    An increasing mass

    leads to increased amplitudes and larger periods in trol-

    ley oscillation. Suspension excursions are significatly larger bringing the damp.

    The swing motion of the cabin shows increased amplitudes whereas the time period

  • 8/12/2019 Dynamics Part Two

    57/69

    CHAPTER 4. DYNAMICS 288

    is not affected.

    Stiffness of towing rope

    % cabin_cs.m

    % Vary stiffness cs:

    ...

    % Define range and step for cs

    range = 1e4:4.5e4:10e4;

    for n = 1:length(range)

    % Set parameter for current loopcs = range(n);

    ...

    plotcabin(solution,range,N/m,c_s,, variation of c_s,0,0);

    The trolley carries out large and slow motion for low stiffness of the towing

    rope. The suspension shows only a small amplitude resulting in weak damping.

    This is seen also in the large, weakly damped swing of the cabin.

    Stiffness of suspension

    % cabin_cf.m

    % Vary stiffness cf:

    ...

    % Define range for cf

    range = 1e4:2e4:5e4; % starting value

    for n = 1:length(range)

    % Set parameter for current loop

    cf = range(n);

    ...plotcabin(solution,range,N/m,c_f,, variation of c_f,0,0);

    A stiffer suspension leads to a larger exxcursion of the trolley. The amplitudes

    of the bearing are significantly reduced and the time periods become shorter. Nearly

    no influence on the swing motion is found.

    Damping constant of suspension

    To find an optimal damping is an important task in optimisation. The variation

    of the damping constant shall give a rough information about the sensivity.

  • 8/12/2019 Dynamics Part Two

    58/69

  • 8/12/2019 Dynamics Part Two

    59/69

    CHAPTER 4. DYNAMICS 290

    0 1 2 3 4 5 6

    0.15

    0.1

    0.05

    0

    0.05

    Time t [s]

    Excursions versus time, variation of cf

    s(t)sd

    (t)[m]

    cf= 1.00e+04 N/mc

    f= 3.00e+04 N/m

    cf= 5.00e+04 N/m

    0 1 2 3 4 5 6

    0

    0.1

    0.2

    0.3

    0.4

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    15

    10

    5

    0

    5

    10

    15

    20

    25

    Time t [s]

    (t)

    []

    Figure 4.59: Variation of stiffness of suspension

    plotcabin(solution,range,N*s/m,d,, variation of d, 0,0)

    A direct influence can be seen on the motion of the bearing. Also the trolley is

    considerably damped. The high frequency vibrations in the swing motion are de-

    caying.

    Rotational damper constant of cabin

    All the previous alterations of design parameters influence the slow swing mo-

    tion of the cabin only very weakly. Therefore, the constant of the damper between

    the suspension and the cabin is increased now.

    The two cases and are shown:

  • 8/12/2019 Dynamics Part Two

    60/69

    CHAPTER 4. DYNAMICS 291

    0 1 2 3 4 5 6

    0.15

    0.1

    0.05

    0

    0.05

    Time t [s]

    Excursions versus time, variation of cf

    s(t)sd

    (t)[m]

    cf= 1.00e+04 N/mc

    f= 3.00e+04 N/m

    cf= 5.00e+04 N/m

    0 1 2 3 4 5 6

    0

    0.1

    0.2

    0.3

    0.4

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    15

    10

    5

    0

    5

    10

    15

    20

    25

    Time t [s]

    (t)

    []

    Figure 4.60: Variation of stiffness of suspension

    % cabin_dbeta1.m

    % Vary damper constant dbeta for alpha = 20 degree:

    % Initialisation:

    clear;

    values; % read constants

    % Set alpha to 20 degree and convert to rad

    alpha = rad(20);

    % Define time interval of integration

  • 8/12/2019 Dynamics Part Two

    61/69

    CHAPTER 4. DYNAMICS 292

    0 1 2 3 4 5 6

    0.15

    0.1

    0.05

    0

    0.05

    0.1

    Time t [s]

    Excursions versus time, variation of d

    s(t)sd

    (t)[m]

    d = 5.00e+02 N*s/md = 1.50e+03 N*s/md = 2.50e+03 N*s/m

    0 1 2 3 4 5 6

    0.04

    0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    0.12

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    15

    10

    5

    05

    10

    15

    20

    25

    Time t [s]

    (t)[]

    Figure 4.61: Variation of damp constant of suspension

    time_range = [0, 6];

    % Define range and step for dbeta

    range = 8e2:15e2:38e2;

    for n = 1:length(range)

    % Set parameter for current loop

    Dbeta = range(n);

    ...

    plotcabin(solution,range,N*m*s,d_{\beta},...

    , variation of d_{\beta} for \alpha = 20 \circ,0,0)

  • 8/12/2019 Dynamics Part Two

    62/69

    CHAPTER 4. DYNAMICS 293

    0 1 2 3 4 5 6

    0.15

    0.1

    0.05

    0

    0.05

    Time t [s]

    Excursions versus time, variation of dfor = 20

    s(t)sd

    (t)[m]

    d= 8.00e+02 N*m*sd= 2.30e+03 N*m*s

    d= 3.80e+03 N*m*s

    0 1 2 3 4 5 6

    0.04

    0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    15

    10

    5

    0

    5

    10

    15

    20

    25

    Time t [s]

    (t)

    []

    Figure 4.62: Variation of rotational damper constant,

    An effective decay of the swing motion is obtained. It can be seen that increasing

    the damping coefficient of the suspension is strongly influencing the motion of thetrolley as well as of the suspension.

    Previously the elevation angle of the guiding rope was . Now the eleva-

    tion angle is considered to be degree. For this, replace with :

    % cabin_dbeta2.m

    % Vary damper constant dbeta for alpha = 70 degree:

    % Initialisation:

    clear;

  • 8/12/2019 Dynamics Part Two

    63/69

    CHAPTER 4. DYNAMICS 294

    values; % read constants

    % Set alpha to 70 degree and convert to rad

    alpha = rad(70);

    ...

    0 1 2 3 4 5 6

    0.2

    0.1

    0

    0.1

    0.2

    Time t [s]

    Excursions versus time, variation of dfor = 70

    s(t)sd

    (t)[m]

    d= 8.00e+02 N*m*s

    d= 2.30e+03 N*m*s

    d= 3.80e+03 N*m*s

    0 1 2 3 4 5 6

    0.02

    0

    0.02

    0.04

    0.06

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 66

    4

    2

    0

    2

    4

    6

    8

    10

    Time t [s]

    (t)[]

    Figure 4.63: Variation of rotational damper constant,

    Here again the effective reduction of the swing amplitudes of the cabin can be

    seen. Because of the high inclination angle, the coupling to the trolley and the sus-

    pension oscillations is weak, there is nearly no influence on the swing damper.

    Elevation of the guiding rope

  • 8/12/2019 Dynamics Part Two

    64/69

    CHAPTER 4. DYNAMICS 295

    The influence of the slope of the guiding rope is considered.

    % cabin_alpha.m

    % Vary alpha:

    ...

    % Define range and step for alpha and convert into rad

    range = rad(20:25:70);

    for n = 1:length(range)

    % Set parameter for current loop

    alpha = range(n);

    ...

    % Convert parameter alpha back to degree

    plotcabin(solution,deg(range),\circ,alpha,...

    , variation of alpha,0,0)

    For a steep slope nearly the whole mass is hanging at the towing rope, both

    dampers are only weakly articulated which results in weakly damped motions.

    DIFFERENT SOLVERS FOR DIFFERENT SYSTEM CONFIGURATIONS

    Here a variation of the angle of the guiding rope is carried out to show thedependence of the sensivity on numerical errors. The two integration routines ode45

    and ode15swith default tolerances are used.

    % cabin_alpha_dif.m

    % Vary alpha and compare different integration methods:

    % Initialisation:

    clear;

    values; % read constants

    % Define time interval of integration. Here it is mandatory to

    % use a fixed step-width, otherwise later the two solutions

    % cannot be compared

    time_range = 0:0.01:6;

    % Define range and step-width for alpha and convert into rad

    range = rad(20:25:70);

    % First, find a solution with ode45

    for n = 1:length(range)

    % Set parameter for current loop

    alpha = range(n);

  • 8/12/2019 Dynamics Part Two

    65/69

    CHAPTER 4. DYNAMICS 296

    0 1 2 3 4 5 6

    0.2

    0.1

    0

    0.1

    0.2

    Time t [s]

    Excursions versus time, variation of alpha

    s(t)sd

    (t)[m]

    alpha = 2.00e+01 alpha = 4.50e+01

    alpha = 7.00e+01

    0 1 2 3 4 5 6

    0.04

    0.02

    0

    0.02

    0.04

    0.06

    0.08

    0.1

    Time t [s]

    u(t)[m]

    0 1 2 3 4 5 6

    15

    10

    5

    05

    10

    15

    20

    25

    Time t [s]

    (t)[]

    Figure 4.64: Variation of the elevation of the guiding rope

    % Calculate initial spring excursions

    y0(fn_s)=-(m1+m2+m3)*g*sin(alpha)/cs;

    y0(fn_u)=m3*g*cos(alpha+y0(fn_beta))/cf;

    % Clear previous dimensions of T and Y

    clear T Y

    % Solve the system using default error tolerance

    [T,Y(:,:)]=ode45(Fcabin,time_range,y0);

    % Calculate desired position for trolley

    s_des = w0.*R.*T-(m1+m2+m3)*g*sin(alpha)/cs;

  • 8/12/2019 Dynamics Part Two

    66/69

    CHAPTER 4. DYNAMICS 297

    % Store data that should be plotted in a cell-arraysolution1{n}(:,1)=Y(:,fn_s)-s_des;

    solution1{n}(:,2)=Y(:,fn_u);

    solution1{n}(:,3)=deg(Y(:,fn_beta)); % give beta in degree

    solution1{n}(:,4)=T; % Store time-points for each solution

    end

    % Then integrate by using ode15s

    for n = 1:length(range)

    % Set parameter for current loop

    alpha = range(n);

    % Calculate initial spring excursions

    y0(fn_s)=-(m1+m2+m3)*g*sin(alpha)/cs;

    y0(fn_u)=m3*g*cos(alpha+y0(fn_beta))/cf;

    % Clear previous dimensions of T and Y

    clear T Y

    % Solve the system using default error tolerance

    [T,Y(:,:)]=ode15s(Fcabin,time_range,y0);

    % Calculate desired position for trolley

    s_des = w0.*R.*T-(m1+m2+m3)*g*sin(alpha)/cs;

    % Store data that should be plotted in a cell-array

    solution2{n}(:,1)=Y(:,fn_s)-s_des;

    solution2{n}(:,2)=Y(:,fn_u);

    solution2{n}(:,3)=deg(Y(:,fn_beta)); % give beta in degree

    solution2{n}(:,4)=T; % Store time-points for each solution

    end

    % Calculate difference between the two solutions.

    % Time-vector must stay untouched!

    for i = 1:length(range)

    diff{i}(:,1:3) = solution1{i}(:,1:3)-solution2{i}(:,1:3);% Time-vector must stay untouched!

    diff{i}(:,4) = solution1{i}(:,4);

    end;

    % Convert parameter alpha back to degree

    plotcabin(diff,deg(range),\circ,alpha,...

    using different integration methods (plotted: difference!),...

    35,50)

    In Fig. 4.65 the difference between the obtained solutions is plotted. Obviously,

    the error is depending on the system configuration. The errors are maximal in the

  • 8/12/2019 Dynamics Part Two

    67/69

    BIBLIOGRAPHY 298

    01

    23

    45

    6 20

    30

    40

    50

    60

    702

    0

    2

    x 103

    alpha []

    Excursions versus time using different integration methods (plotted: difference!)

    Time t [s]

    s(t)sd

    (t)[m]

    alpha = 2.00e+01

    alpha = 4.50e+01

    alpha = 7.00e+01

    01

    23

    45

    6 20

    30

    40

    50

    60

    705

    0

    5

    x 104

    alpha []

    Time t [s]

    u(t)[m]

    01

    23

    45

    6 20

    30

    40

    50

    60700.04

    0.02

    0

    0.02

    alpha []

    Time t [s]

    (t)[]

    Figure 4.65: Comparison ofode45and ode15sfor different configurations

    case of a steep slope. Of course, for a steep angle large trolley amplitudes occur

    whereas only a small swing amplitude is induced. On the other hand, the damping

    of the motion of the trolley is very low.

    Bibliography

    [1] Klaus-Jrgen Bathe. Finite-Elemente-Methoden. 1990. (in German).

    [2] D. Bestle. Analyse und Optimierung von Mehrkrper-systemen. 1994. (in

    German).

  • 8/12/2019 Dynamics Part Two

    68/69

    BIBLIOGRAPHY 299

    [3] A. F. DSouza and V. K. Garg. Advanced Dynamics, Modeling and Analy-

    sis. Prentice-Hall International Editions, Englewood Cliffs, New Jersey, USA,1984.

    [4] W. Schiehlen (ed.). Multibody Systems Handbook. Springer-Verlag, Berlin,

    Heidelberg, Germany, 1990.

    [5] W. Schiehlen (ed.).Advanced Multibody System Dynamics. Kluwer Academic

    Publishers, Dordrecht, The Netherlands, 1993.

    [6] R. Fletcher. Practical Methods of Optimization. John Wiley & Sons, Chich-

    ester, UK, 1987.

    [7] N. Gershenfeld. The Nature of Mathematical Modelling. University Press,

    Cambridge, 1999.

    [8] E. Hairer, S. P. Nrsett, and G. Wanner. Solving Ordinary Differential Equa-

    tions I. Springer-Verlag, Berlin, Germany, 1987.

    [9] E. Hairer and G. Wanner. Solving Ordinary Differential Equations II.

    Springer-Verlag, Berlin, Germany, 1991.

    [10] J. L. Junkins and Youdan Kim.Introduction to Dynamics and Control of Flex-

    ible Structures. AIAA, American Institute of Aeronautics and Astronautics,

    Inc., Reston, VA, USA, 1993.

    [11] K. Kreuzer and W. Schiehlen. NEWEUL. 1988. (in German).

    [12] K. Magnus and H. H. Mller. Grundlagen der Technischen Mechanik. 1974.

    (in German).

    [13] P. C. Mller and W. O. Schiehlen. Linear Vibrations. Martinus Nijhoff Pub-

    lishers, Dordrecht, The Netherlands, 1985.

    [14] Nattick. Control Toolbox Users Guide. The MathWorks, 1996.

    [15] D. E. Newland. Mechanical Vibration Analysis and Computation. Longman

    Scientific and Technical, Essex, England, 1989.

    [16] P. E. Nikravesh. Computer-Aided Analysis of Mechanical Systems. Prentice-

    Hall International Editions, Englewood Cliffs, New Jersey, USA, 1988.

    [17] J. C. Polking.MATLAB Manual for Ordinary Differential Equations. Prentice-

    Hall, Englewood Cliffs, NJ, USA, 1995.

    [18] W. Schiehlen. Technische Dynamik. 1986. (in German).

  • 8/12/2019 Dynamics Part Two

    69/69

    BIBLIOGRAPHY 300

    [19] A. A. Shabana. Dynamics of Multibody Systems. John Wiley & Sons, New

    York, USA, 1989.

    [20] Irving H. Shames. Engineering Mechanics. Statics and Dynamics. Prentice

    Hall, Upper Saddle River, New Jersey, USA, 1996.

    [21] V. Stejskal and M. Valek. Kinematics and Dynamics of Machinery. Marcel

    Dekker, Inc., New York, USA, 1996.

    [22] Z. Terze, D. Lefeber, and O. Muftic. Null Space Integration Method for Con-

    strained Multibody Systems with No Constraint Viola tion, in: Multibody Sys-

    tem Dynamics. 2001. (in print).