Page 89 - Mechatronic Systems Modelling and Simulation with HDLs
P. 89

78                      4 MODELLING IN HARDWARE DESCRIPTION LANGUAGES


               voltage law is applied for potential quantities, which means that all ACROSS quan-
               tities in a closed loop add up to zero. For the flow quantities, Kirchhoff’s current
               law applies. Thus all THROUGH quantities at a node add up to zero. In addition to
               the declared quantities others are implicitly defined such as, for example, q’DOT,
               q’INTEG and q’DELAYED(t). These denote the derivative of the quantity q with
               respect to time, the integral of the quantity q with respect to time and a quan-
               tity q delayed by time t. In addition to the potentials and flows it is sometimes
               worthwhile considering quantities that are not subject to Kirchhoff’s laws. For
               example, in control technology signal flow diagrams or block diagrams are often
               considered, in which the individual quantities do not occur in pairs and furthermore
               have a direction. Kirchhoff’s laws in particular do not apply to these quantities. In
               VHDL-AMS such quantities can also be used, as is demonstrated by the following
               example of a combined adder/integrator, see Hardware description 4.11 and [16].

               ENTITY adder_integrator IS
                GENERIC (k1,k2: real);
                PORT     (QUANTITY in1, in2: IN real;
                          QUANTITY outp: OUT real);
               END ENTITY adder_integrator;

               ARCHITECTURE signal_flow OF adder_integrator IS
                QUANTITY qint: real;
               BEGIN -- defining equations ...
                qint == k1*in1 + k2*in2;
                outp == qint’INTEG; -- Integration
               END ARCHITECTURE signal_flow;

               Hardware description 4.11 Signal flow modelling of a combined adder/integrator


               Discontinuities
               In the case of mechanical models in particular, non-continuous relationships also
               often have to be modelled. These are illustrated in what follows based upon the
               example of a bouncing ball, see Hardware description 4.12 and Bakalar et al. [16].
               Two discontinuities are considered in this model. The first of these is the start of
               the simulation at which the initial state is set at the first BREAK command. The
               second discontinuity consists of the fact that the bouncing ball reverses its velocity
               when the it hits a surface, i.e. at s ≤ 0. This corresponds with an elastic impact.
               Furthermore, the IF instruction ensures that the braking effect of air resistance acts
               with gravity when rising and against gravity when falling.

               LIBRARY disciplines;                 -- Reference to a package with
               USE disciplines.mechanical.all;      -- the mechanical declarations
               ENTITY ball IS                       -- Autonomous model,
               END ENTITY ball;                     -- no connections
               ARCHITECTURE simple OF ball IS
   84   85   86   87   88   89   90   91   92   93   94