1
2-- Copyright (C) 2002 Morgan Kaufmann Publishers, Inc
3
4-- This file is part of VESTs (Vhdl tESTs).
5
6-- VESTs is free software; you can redistribute it and/or modify it
7-- under the terms of the GNU General Public License as published by the
8-- Free Software Foundation; either version 2 of the License, or (at
9-- your option) any later version.
10
11-- VESTs is distributed in the hope that it will be useful, but WITHOUT
12-- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13-- FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14-- for more details.
15
16-- You should have received a copy of the GNU General Public License
17-- along with VESTs; if not, write to the Free Software Foundation,
18-- Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19
20library ieee_proposed;  use ieee_proposed.mechanical_systems.all;
21
22entity gear_rv_r is
23  generic ( ratio : real := 1.0 );  -- gear ratio (revs of shaft2 for 1 rev of shaft1)
24                            	    -- note: can be negative, if shaft polarity changes
25  port ( terminal rotv1 : rotational_v;  -- rotational velocity terminal
26         terminal rot2 : rotational );	 -- rotational angle terminal
27end entity gear_rv_r;
28
29----------------------------------------------------------------
30
31architecture ideal of gear_rv_r is
32
33  quantity w1 across torq_vel through rotv1 to rotational_v_ref;
34  quantity theta across torq_ang through rot2 to rotational_ref;
35
36begin
37
38  theta  == ratio * w1'integ;           -- output is angle (integral of w1)
39  torq_vel == -1.0 * torq_ang * ratio;  -- input torque as function of output angle
40
41end architecture ideal;
42