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
20-------------------------------------------------------------------------------
21-- Copyright (c) 2001 Mentor Graphics Corporation
22--
23-- This model is a component of the Mentor Graphics VHDL-AMS educational open
24-- source model library, and is covered by this license agreement. This model,
25-- including any updates, modifications, revisions, copies, and documentation
26-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR
27-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH
28-- IN THIS LICENSE AGREEMENT.  Mentor Graphics grants you a non-exclusive
29-- license to use, reproduce, modify and distribute this model, provided that:
30-- (a) no fee or other consideration is charged for any distribution except
31-- compilations distributed in accordance with Section (d) of this license
32-- agreement; (b) the comment text embedded in this model is included verbatim
33-- in each copy of this model made or distributed by you, whether or not such
34-- version is modified; (c) any modified version must include a conspicuous
35-- notice that this model has been modified and the date of modification; and
36-- (d) any compilations sold by you that include this model must include a
37-- conspicuous notice that this model is available from Mentor Graphics in its
38-- original form at no charge.
39--
40-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR
41-- IMPLIED.  MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF
42-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  MENTOR GRAPHICS SHALL
43-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER.
44-------------------------------------------------------------------------------
45-- File       : gear_rv_r.vhd
46-- Author     : Mentor Graphics
47-- Created    : 2001/10/10
48-- Last update: 2001/10/10
49-------------------------------------------------------------------------------
50-- Description: Gear Model (ROTATIONAL_V/ROTATIONAL domains)
51-------------------------------------------------------------------------------
52-- Revisions  :
53-- Date        Version     Author              Description
54-- 2001/10/10  1.0         Mentor Graphics     Created
55-------------------------------------------------------------------------------
56
57-- Use proposed IEEE natures and packages
58library IEEE_proposed;
59use IEEE_proposed.mechanical_systems.all;
60
61entity gear_rv_r is
62
63  generic(
64    ratio : real := 1.0);   -- Gear ratio (Revs of shaft2 for 1 rev of shaft1)
65                            -- Note: can be negative, if shaft polarity changes
66
67  port ( terminal rotv1 : rotational_v;
68  		terminal rot2 : rotational);
69
70end entity gear_rv_r;
71
72-------------------------------------------------------------------------------
73-- Ideal Architecture
74-------------------------------------------------------------------------------
75architecture ideal of gear_rv_r is
76
77  quantity w1 across torq_vel through rotv1 to rotational_v_ref;
78--  quantity w2 across torq2 through rotv2 to rotational_v_ref;
79  quantity theta across torq_ang through rot2 to rotational_ref;
80
81begin
82
83--  w2  == w1*ratio;
84  theta == ratio*w1'integ;
85  torq_vel == -1.0*torq_ang*ratio;
86
87end architecture ideal;
88
89-------------------------------------------------------------------------------
90-- Copyright (c) 2001 Mentor Graphics Corporation
91-------------------------------------------------------------------------------
92--
93
94-------------------------------------------------------------------------------
95-- Rotational to Electrical Converter
96--
97-------------------------------------------------------------------------------
98
99-- Use IEEE_proposed instead of disciplines
100library IEEE;
101use ieee.math_real.all;
102library IEEE_proposed;
103use IEEE_proposed.mechanical_systems.all;
104use IEEE_proposed.electrical_systems.all;
105
106entity rot2v is
107
108  generic (
109    k : real := 1.0);                -- optional gain
110
111  port (
112    terminal input   : rotational;  -- input terminal
113    terminal output    : electrical);   -- output terminal
114
115end entity rot2v ;
116
117architecture bhv of rot2v is
118quantity rot_in across input to rotational_ref;     -- Converter's input branch
119quantity v_out across out_i through output to electrical_ref;-- Converter's output branch
120
121  begin  -- bhv
122   v_out ==  k*rot_in;
123end bhv;
124--
125
126-------------------------------------------------------------------------------
127-- Control Horn for Rudder Control (mechanical implementation)
128--
129--  Transfer Function:
130--
131--  tran =   R*sin(rot)
132--
133-- Where pos = output translational position,
134-- R = horn radius,
135-- theta = input rotational angle
136-------------------------------------------------------------------------------
137
138-- Use IEEE_proposed instead of disciplines
139library IEEE;
140use ieee.math_real.all;
141library IEEE_proposed;
142use IEEE_proposed.mechanical_systems.all;
143
144entity horn_r2t is
145
146  generic (
147    R   : real := 1.0);            		-- horn radius
148
149  port (
150    terminal theta    : ROTATIONAL;   	-- input angular position port
151    terminal pos   : TRANSLATIONAL);  	-- output translational position port
152
153end entity horn_r2t;
154
155architecture bhv of horn_r2t is
156
157  QUANTITY rot across rot_tq through theta TO ROTATIONAL_REF;
158  QUANTITY tran across tran_frc through pos TO TRANSLATIONAL_REF;
159
160  begin			-- bhv
161   tran == R*sin(rot);		-- Convert angle in to translational out
162   tran_frc == -rot_tq/R;	-- Convert torque in to force out
163end bhv;
164--
165
166-------------------------------------------------------------------------------
167-- Control Horn for Rudder Control (mechanical implementation)
168--
169--  Transfer Function:
170--
171--  theta =   arcsin(pos/R)
172--
173-- Where pos = input translational position,
174-- R = horn radius,
175-- theta = output rotational angle
176-------------------------------------------------------------------------------
177
178-- Use IEEE_proposed instead of disciplines
179library IEEE;
180use ieee.math_real.all;
181library IEEE_proposed;
182use IEEE_proposed.mechanical_systems.all;
183
184entity horn_t2r is
185
186  generic (
187    R   : real := 1.0);            -- Rudder horn radius
188
189  port (
190    terminal pos    : translational;   -- input translational position port
191    terminal theta   : rotational);  -- output angular position port
192
193end entity horn_t2r ;
194
195architecture bhv of horn_t2r is
196
197  QUANTITY tran across tran_frc through pos TO TRANSLATIONAL_REF;
198  QUANTITY rot across rot_tq through theta TO ROTATIONAL_REF;
199
200  begin  -- bhv
201   rot == arcsin(tran/R);	-- Convert translational to angle
202   rot_tq == -tran_frc*R;	-- Convert force to torque
203
204end bhv;
205--
206
207-------------------------------------------------------------------------------
208-- Copyright (c) 2001 Mentor Graphics Corporation
209--
210-- This model is a component of the Mentor Graphics VHDL-AMS educational open
211-- source model library, and is covered by this license agreement. This model,
212-- including any updates, modifications, revisions, copies, and documentation
213-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR
214-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH
215-- IN THIS LICENSE AGREEMENT.  Mentor Graphics grants you a non-exclusive
216-- license to use, reproduce, modify and distribute this model, provided that:
217-- (a) no fee or other consideration is charged for any distribution except
218-- compilations distributed in accordance with Section (d) of this license
219-- agreement; (b) the comment text embedded in this model is included verbatim
220-- in each copy of this model made or distributed by you, whether or not such
221-- version is modified; (c) any modified version must include a conspicuous
222-- notice that this model has been modified and the date of modification; and
223-- (d) any compilations sold by you that include this model must include a
224-- conspicuous notice that this model is available from Mentor Graphics in its
225-- original form at no charge.
226--
227-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR
228-- IMPLIED.  MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF
229-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  MENTOR GRAPHICS SHALL
230-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER.
231-------------------------------------------------------------------------------
232-- File       : DC_Motor.vhd
233-- Author     : Mentor Graphics
234-- Created    : 2001/06/16
235-- Last update: 2001/06/16
236-------------------------------------------------------------------------------
237-- Description: Basic DC Motor
238-------------------------------------------------------------------------------
239-- Revisions  :
240-- Date        Version     Author              Description
241-- 2001/06/16  1.0         Mentor Graphics     Created
242-------------------------------------------------------------------------------
243
244-- Use proposed IEEE natures and packages
245library IEEE_proposed;
246use IEEE_proposed.mechanical_systems.all;
247use IEEE_proposed.electrical_systems.all;
248
249entity DC_Motor is
250
251  generic (
252    r_wind : resistance;                -- Motor winding resistance [Ohm]
253    kt     : real;                      -- Torque coefficient [N*m/Amp]
254    l      : inductance;                -- Winding inductance [Henrys]
255    d      : real;                      -- Damping coefficient [N*m/(rad/sec)]
256    j      : mmoment_i);                -- Moment of inertia [kg*meter**2]
257
258  port (terminal p1, p2 : electrical;
259        terminal shaft_rotv : rotational_v);
260
261end entity DC_Motor;
262
263-------------------------------------------------------------------------------
264-- Basic Architecture
265-- Motor equations:  V = Kt*W + I*Rwind + L*dI/dt
266--                   T = -Kt*I + D*W + J*dW/dt
267-------------------------------------------------------------------------------
268architecture basic of DC_Motor is
269
270  quantity v across i through p1 to p2;
271  quantity w across torq through shaft_rotv to rotational_v_ref;
272
273begin
274
275  torq == -1.0*kt*i + d*w + j*w'dot;
276  v  == kt*w + i*r_wind + l*i'dot;
277
278end architecture basic;
279
280-------------------------------------------------------------------------------
281-- Copyright (c) 2001 Mentor Graphics Corporation
282-------------------------------------------------------------------------------
283--
284
285-------------------------------------------------------------------------------
286-- Copyright (c) 2001 Mentor Graphics Corporation
287--
288-- This model is a component of the Mentor Graphics VHDL-AMS educational open
289-- source model library, and is covered by this license agreement. This model,
290-- including any updates, modifications, revisions, copies, and documentation
291-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR
292-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH
293-- IN THIS LICENSE AGREEMENT.  Mentor Graphics grants you a non-exclusive
294-- license to use, reproduce, modify and distribute this model, provided that:
295-- (a) no fee or other consideration is charged for any distribution except
296-- compilations distributed in accordance with Section (d) of this license
297-- agreement; (b) the comment text embedded in this model is included verbatim
298-- in each copy of this model made or distributed by you, whether or not such
299-- version is modified; (c) any modified version must include a conspicuous
300-- notice that this model has been modified and the date of modification; and
301-- (d) any compilations sold by you that include this model must include a
302-- conspicuous notice that this model is available from Mentor Graphics in its
303-- original form at no charge.
304--
305-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR
306-- IMPLIED.  MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF
307-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  MENTOR GRAPHICS SHALL
308-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER.
309-------------------------------------------------------------------------------
310-- File       : stop_r.vhd
311-- Author     : Mentor Graphics
312-- Created    : 2001/10/10
313-- Last update: 2001/10/10
314-------------------------------------------------------------------------------
315-- Description: Mechanical Hard Stop (ROTATIONAL domain)
316-------------------------------------------------------------------------------
317-- Revisions  :
318-- Date        Version     Author              Description
319-- 2001/06/16  1.0         Mentor Graphics     Created
320-------------------------------------------------------------------------------
321
322-- library IEEE;
323-- use IEEE.MATH_REAL.all;
324
325-- Use proposed IEEE natures and packages
326library IEEE_proposed;
327use IEEE_proposed.MECHANICAL_SYSTEMS.all;
328
329
330entity stop_r is
331
332  generic (
333    k_stop    : real;
334--    ang_max   : angle;
335--    ang_min   : angle := 0.0;
336	ang_max   : real;
337    ang_min   : real := 0.0;
338    damp_stop : real  := 0.000000001
339    );
340
341  port ( terminal ang1, ang2 : rotational);
342
343end entity stop_r;
344
345architecture ideal of stop_r is
346
347  quantity velocity : velocity;
348  quantity ang across trq through ang1 to ang2;
349
350begin
351
352  velocity == ang'dot;
353
354  if ang > ang_max use
355    trq == k_stop * (ang - ang_max) + (damp_stop * velocity);
356  elsif ang > ang_min use
357    trq   == 0.0;
358  else
359    trq   == k_stop * (ang - ang_min) + (damp_stop * velocity);
360  end use;
361
362break on ang'above(ang_min), ang'above(ang_max);
363
364end architecture ideal;
365
366-------------------------------------------------------------------------------
367-- Copyright (c) 2001 Mentor Graphics Corporation
368-------------------------------------------------------------------------------
369--
370
371library IEEE;
372use IEEE.std_logic_arith.all;
373library IEEE_proposed;
374use IEEE_proposed.mechanical_systems.all;
375
376entity tran_linkage is
377port
378(
379      terminal p1, p2 : translational
380);
381
382begin
383
384end tran_linkage;
385
386architecture a1 of tran_linkage is
387
388  QUANTITY pos_1 across frc_1 through p1 TO translational_ref;
389  QUANTITY pos_2 across frc_2 through p2 TO translational_ref;
390
391begin
392
393   pos_2 == pos_1;		-- Pass position
394   frc_2 == -frc_1;	-- Pass force
395
396end;
397--
398
399-------------------------------------------------------------------------------
400-- Rudder Model (Rotational Spring)
401--
402--  Transfer Function:
403--
404--  torq =   -k*(theta - theta_0)
405--
406-- Where theta = input rotational angle,
407-- torq = output rotational angle,
408-- theta_0 = reference angle
409-------------------------------------------------------------------------------
410
411-- Use IEEE_proposed instead of disciplines
412library IEEE;
413use ieee.math_real.all;
414library IEEE_proposed;
415use IEEE_proposed.mechanical_systems.all;
416
417entity rudder is
418
419  generic (
420    k   : real := 1.0;            -- Spring constant
421	theta_0 : real := 0.0);
422
423  port (
424    terminal rot    : rotational);   -- input rotational angle
425
426end entity rudder;
427
428architecture bhv of rudder is
429
430  QUANTITY theta across torq through rot TO ROTATIONAL_REF;
431
432  begin  -- bhv
433
434   torq == k*(theta - theta_0);	-- Convert force to torque
435
436end bhv;
437--
438
439library IEEE;
440library IEEE_proposed;
441use IEEE_proposed.electrical_systems.all;
442use IEEE_proposed.mechanical_systems.all;
443
444entity sum2_e is
445	generic (k1, k2: real := 1.0);  -- Gain multipliers
446	port 	(	terminal in1, in2: electrical;
447			terminal output: electrical);
448end entity sum2_e;
449
450architecture simple of sum2_e is
451  QUANTITY vin1 ACROSS in1 TO ELECTRICAL_REF;
452  QUANTITY vin2 ACROSS in2 TO ELECTRICAL_REF;
453  QUANTITY vout ACROSS iout THROUGH output TO ELECTRICAL_REF;
454
455begin
456	vout == k1*vin1 + k2*vin2;
457end architecture simple;
458--
459
460library IEEE;
461use IEEE.MATH_REAL.all;
462-- Use proposed IEEE natures and packages
463library IEEE_proposed;
464use IEEE_proposed.ELECTRICAL_SYSTEMS.all;
465
466entity gain_e is
467	generic (
468		k: REAL := 1.0);  -- Gain multiplier
469	port 	(	terminal input : electrical;
470			terminal output: electrical);
471end entity gain_e;
472
473architecture simple of gain_e is
474
475  QUANTITY vin ACROSS input TO ELECTRICAL_REF;
476  QUANTITY vout ACROSS iout THROUGH output TO ELECTRICAL_REF;
477
478begin
479	vout == k*vin;
480end architecture simple;
481--
482
483-------------------------------------------------------------------------------
484-- S-Domain Limiter Model
485--
486-------------------------------------------------------------------------------
487
488library IEEE_proposed; use IEEE_proposed.electrical_systems.all;
489entity limiter_2_e is
490	generic (
491		limit_high : real := 4.8;	-- upper limit
492		limit_low : real := -4.8); 	-- lower limit
493	port (
494		terminal input: electrical;
495		terminal output: electrical);
496end entity limiter_2_e;
497
498architecture simple of limiter_2_e is
499  	QUANTITY vin ACROSS input TO ELECTRICAL_REF;
500  	QUANTITY vout ACROSS iout THROUGH output TO ELECTRICAL_REF;
501	constant slope : real := 1.0e-4;
502begin
503	if vin > limit_high use	-- Upper limit exceeded, so limit input signal
504		vout == limit_high + slope*(vin - limit_high);
505	elsif vin < limit_low use	-- Lower limit exceeded, so limit input signal
506		vout == limit_low + slope*(vin - limit_low);
507	else		-- No limit exceeded, so pass input signal as is
508		vout == vin;
509	end use;
510	break on vin'above(limit_high), vin'above(limit_low);
511end architecture simple;
512--
513
514LIBRARY ieee;
515LIBRARY IEEE_proposed;
516USE IEEE_proposed.electrical_systems.ALL;
517
518ENTITY lead_lag_ztf IS
519
520  GENERIC (
521     a1, a2 : real;
522	 b1, b2 : real;
523	 k : real := 1.0;
524	tsampl: real;
525	init_delay: real := 0.0);
526
527  PORT (
528    TERMINAL input   : electrical;
529    TERMINAL output   : electrical);
530
531END ENTITY lead_lag_ztf ;
532
533ARCHITECTURE simple OF lead_lag_ztf IS
534
535  QUANTITY vin across input TO electrical_ref;
536  QUANTITY vout across iout through output TO electrical_ref;
537
538  constant num: real_vector := (a1, a2);
539  constant den: real_vector := (b1, b2);
540
541BEGIN  -- ARCHITECTURE simple
542
543vout == k*vin'ztf(num, den, tsampl, init_delay);
544
545END ARCHITECTURE simple;
546--
547
548library IEEE;
549use IEEE.std_logic_1164.all;
550use IEEE.std_logic_arith.all;
551
552library IEEE_proposed;
553use IEEE_proposed.electrical_systems.all;
554use IEEE_proposed.mechanical_systems.all;
555
556entity rudder_servo_ztf is
557    port(
558        terminal servo_in : electrical;
559        terminal pos_fb : electrical;
560        terminal servo_out : electrical
561    );
562end rudder_servo_ztf;
563
564architecture rudder_servo_ztf of rudder_servo_ztf is
565    -- Component declarations
566    -- Signal declarations
567    terminal error : electrical;
568    terminal limit_in : electrical;
569    terminal ll_in : electrical;
570    terminal summer_fb : electrical;
571begin
572    -- Signal assignments
573    -- Component instances
574    summer : entity work.sum2_e(simple)
575        port map(
576            in1 => servo_in,
577            in2 => summer_fb,
578            output => error
579        );
580    forward_gain : entity work.gain_e(simple)
581        generic map(
582            k => 100.0
583        )
584        port map(
585            input => error,
586            output => ll_in
587        );
588    fb_gain : entity work.gain_e(simple)
589        generic map(
590            k => -4.57
591        )
592        port map(
593            input => pos_fb,
594            output => summer_fb
595        );
596    XCMP21 : entity work.limiter_2_e(simple)
597        generic map(
598            limit_high => 4.8,
599            limit_low => -4.8
600        )
601        port map(
602            input => limit_in,
603            output => servo_out
604        );
605    ll_ztf : entity work.lead_lag_ztf(simple)
606        generic map(
607            a1 => 2.003140,
608            a2 => -1.996860,
609            b1 => 3.25000,
610            b2 => -0.75000,
611            k => 400.0,
612            tsampl => 0.0001
613        )
614        port map(
615            input => ll_in,
616            output => limit_in
617        );
618end rudder_servo_ztf;
619--
620
621-------------------------------------------------------------------------------
622-- Copyright (c) 2001 Mentor Graphics Corporation
623--
624-- This model is a component of the Mentor Graphics VHDL-AMS educational open
625-- source model library, and is covered by this license agreement. This model,
626-- including any updates, modifications, revisions, copies, and documentation
627-- are copyrighted works of Mentor Graphics. USE OF THIS MODEL INDICATES YOUR
628-- COMPLETE AND UNCONDITIONAL ACCEPTANCE OF THE TERMS AND CONDITIONS SET FORTH
629-- IN THIS LICENSE AGREEMENT.  Mentor Graphics grants you a non-exclusive
630-- license to use, reproduce, modify and distribute this model, provided that:
631-- (a) no fee or other consideration is charged for any distribution except
632-- compilations distributed in accordance with Section (d) of this license
633-- agreement; (b) the comment text embedded in this model is included verbatim
634-- in each copy of this model made or distributed by you, whether or not such
635-- version is modified; (c) any modified version must include a conspicuous
636-- notice that this model has been modified and the date of modification; and
637-- (d) any compilations sold by you that include this model must include a
638-- conspicuous notice that this model is available from Mentor Graphics in its
639-- original form at no charge.
640--
641-- THIS MODEL IS LICENSED TO YOU "AS IS" AND WITH NO WARRANTIES, EXPRESS OR
642-- IMPLIED.  MENTOR GRAPHICS SPECIFICALLY DISCLAIMS ALL IMPLIED WARRANTIES OF
643-- MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  MENTOR GRAPHICS SHALL
644-- HAVE NO RESPONSIBILITY FOR ANY DAMAGES WHATSOEVER.
645-------------------------------------------------------------------------------
646-- File       : v_sine.vhd
647-- Author     : Mentor Graphics
648-- Created    : 2001/06/16
649-- Last update: 2001/07/03
650-------------------------------------------------------------------------------
651-- Description: Electrical sinusoidal voltage source
652--              Includes frequency domain settings
653-------------------------------------------------------------------------------
654-- Revisions  :
655-- Date        Version     Author              Description
656-- 2001/06/16  1.0         Mentor Graphics     Created
657-- 2001/07/03  1.1         Mentor Graphics     Changed generics from real to
658--                                             voltage.
659-------------------------------------------------------------------------------
660
661library IEEE;
662use IEEE.MATH_REAL.all;
663-- Use proposed IEEE natures and packages
664library IEEE_proposed;
665use IEEE_proposed.ELECTRICAL_SYSTEMS.all;
666
667entity v_sine is
668
669  generic (
670    freq      : real;                   -- frequency [Hertz]
671    amplitude : voltage;                -- amplitude [Volts]
672    phase     : real    := 0.0;         -- initial phase [Degrees]
673    offset    : voltage := 0.0;         -- DC value [Volts]
674    df        : real    := 0.0;         -- damping factor [1/second]
675    ac_mag    : voltage := 1.0;         -- AC magnitude [Volts]
676    ac_phase  : real    := 0.0);        -- AC phase [Degrees]
677
678  port (
679    terminal pos, neg : electrical);
680
681end entity v_sine;
682
683-------------------------------------------------------------------------------
684-- Ideal Architecture
685-------------------------------------------------------------------------------
686architecture ideal of v_sine is
687-- Declare Branch Quantities
688  quantity v across i through pos to neg;
689-- Declare Quantity for Phase in radians (calculated below)
690  quantity phase_rad : real;
691-- Declare Quantity in frequency domain for AC analysis
692  quantity ac_spec   : real spectrum ac_mag, math_2_pi*ac_phase/360.0;
693
694begin
695-- Convert phase to radians
696  phase_rad == math_2_pi *(freq * NOW + phase / 360.0);
697
698  if domain = quiescent_domain or domain = time_domain use
699    v == offset + amplitude * sin(phase_rad) * EXP(-NOW * df);
700  else
701    v == ac_spec;           -- used for Frequency (AC) analysis
702  end use;
703
704end architecture ideal;
705
706-------------------------------------------------------------------------------
707-- Copyright (c) 2001 Mentor Graphics Corporation
708-------------------------------------------------------------------------------
709--
710library IEEE;
711use IEEE.std_logic_1164.all;
712use IEEE.std_logic_arith.all;
713
714library IEEE_proposed;
715use IEEE_proposed.electrical_systems.all;
716use IEEE_proposed.mechanical_systems.all;
717use IEEE_proposed.fluidic_systems.all;
718use IEEE_proposed.thermal_systems.all;
719use IEEE_proposed.radiant_systems.all;
720
721entity TB_CS2_Z_Domain_ZTF is
722end TB_CS2_Z_Domain_ZTF ;
723
724architecture TB_CS2_Z_Domain_ZTF of TB_CS2_Z_Domain_ZTF is
725    -- Component declarations
726    -- Signal declarations
727    terminal gear_out : rotational;
728    terminal link_in : translational;
729    terminal link_out : translational;
730    terminal mtr_in : electrical;
731    terminal mtr_out : rotational_v;
732    terminal pot_fb : electrical;
733    terminal rudder : rotational;
734    terminal src_in : electrical;
735begin
736    -- Signal assignments
737    -- Component instances
738    gear5 : entity work.gear_rv_r(ideal)
739        generic map(
740            ratio => 0.01
741        )
742        port map(
743            rotv1 => mtr_out,
744            rot2 => gear_out
745        );
746    XCMP42 : entity work.rot2v(bhv)
747        generic map(
748            k => 1.0
749        )
750        port map(
751            output => pot_fb,
752            input => gear_out
753        );
754    XCMP43 : entity work.horn_r2t(bhv)
755        port map(
756            theta => gear_out,
757            pos => link_in
758        );
759    XCMP44 : entity work.horn_t2r(bhv)
760        port map(
761            theta => rudder,
762            pos => link_out
763        );
764    motor3 : entity work.DC_Motor(basic)
765        generic map(
766            r_wind => 2.2,
767            kt => 3.43e-3,
768            l => 2.03e-3,
769            d => 5.63e-6,
770            j => 168.0e-9
771        )
772        port map(
773            p1 => mtr_in,
774            p2 => ELECTRICAL_REF,
775            shaft_rotv => mtr_out
776        );
777    stop3 : entity work.stop_r(ideal)
778        generic map(
779            damp_stop => 1.0e2,
780            k_stop => 1.0e6,
781            ang_max => 1.05,
782            ang_min => -1.05
783        )
784        port map(
785            ang1 => gear_out,
786            ang2 => ROTATIONAL_REF
787        );
788    \linkage\ : entity work.tran_linkage(a1)
789        port map(
790            p2 => link_out,
791            p1 => link_in
792        );
793    XCMP46 : entity work.rudder(bhv)
794        generic map(
795            k => 0.2
796        )
797        port map(
798            rot => rudder
799        );
800    rudder_servo_zt1 : entity work.rudder_servo_ztf
801        port map(
802            servo_out => mtr_in,
803            servo_in => src_in,
804            pos_fb => pot_fb
805        );
806    v8 : entity work.v_sine(ideal)
807        generic map(
808            amplitude => 4.8,
809            freq => 1.0
810        )
811        port map(
812            pos => src_in,
813            neg => ELECTRICAL_REF
814        );
815end TB_CS2_Z_Domain_ZTF;
816--
817
818