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;
21use ieee_proposed.mechanical_systems.all;
22use ieee_proposed.electrical_systems.all;
23
24entity DC_Motor is
25  generic ( r_wind : resistance;  -- motor winding resistance [ohm]
26            kt : real;		  -- torque coefficient [N*m/amp]
27            l : inductance;	  -- winding inductance [henrys]
28            d : real;		  -- damping coefficient [N*m/(rad/sec)]
29            j : mmoment_i );	  -- moment of inertia [kg*meter**2]
30  port ( terminal p1, p2 : electrical;
31         terminal shaft_rotv : rotational_v);
32end entity DC_Motor;
33
34----------------------------------------------------------------
35
36architecture basic of DC_Motor is
37
38  quantity v across i through p1 to p2;
39  quantity w across torq through shaft_rotv to rotational_v_ref;
40
41begin
42
43  torq == -1.0 * kt * i + d * w + j * w'dot;
44  v  == kt * w + i * r_wind + l * i'dot;
45
46end architecture basic;
47