Changeset 713 for branches/maintenance

Show
Ignore:
Timestamp:
10/16/07 22:05:39 (13 months ago)
Author:
AHaumer
Message:

removed replaceable from airgaps
removed cardinality from support
(using a boolean parameter)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • branches/maintenance/2.2.2/Modelica/Electrical/Machines.mo

    r702 r713  
    1 within Modelica.Electrical; 
     1within ; 
     2             // Modelica.Electrical; 
     3 
    24 
    35package Machines "Library for electric machines"  
    46  extends Modelica.Icons.Library2; 
    5   annotation ( 
    6   version="1.8.9", versionDate="2007-10-15", 
     7  annotation (uses(Modelica(version="2.2.2")), 
     8  version="1.8.9a", versionDate="2007-10-16", 
    79  Settings(NewStateSelection=true, Evaluate=true), 
    810  preferedView="info", Documentation(info="<HTML> 
     
    127129  <li> v1.8.9 2007/10/15 Anton Haumer<br> 
    128130       solved a bug with replaceable airgap / partial machines</li> 
     131  <li> v1.8.9a 2007/10/16 Anton Haumer<br> 
     132       removed replaceable from airgaps<br> 
     133       removed cardinality from support, using a boolean parameter</li> 
    129134  </ul> 
    130135</HTML>"), 
     
    15121517            70; -20,83], style(color=5, rgbcolor={255,0,255})); 
    15131518      connect(plugToPin_p3.plug_p, plugToPin_p2.plug_p)  
    1514         annotation (points=[-30,-12; -25,-12; -25,-4; -20,-4; -20,-20; -10,-20], 
     1519        annotation (points=[-30,-12; -25,-12; -25,-4; -20,-4; -20,-12; -10,-12], 
    15151520                                               style(color=3, rgbcolor={0,0,255})); 
    15161521      connect(plugToPin_p2.plug_p,plugToPin_p1. plug_p)  
    1517         annotation (points=[-10,-12; -5,-12; -5,-4; 0,-4; 0,-20; 10,-20], 
     1522        annotation (points=[-10,-12; -5,-12; -5,-4; 0,-4; 0,-12; 10,-12], 
    15181523                                              style(color=3, rgbcolor={0,0,255})); 
    15191524      connect(plugToPin_p3.pin_p, SineVoltage1.n) annotation (points=[-30,-8; 
     
    19211926          final idq_rs = airGapS.i_rs, 
    19221927          final idq_rr = airGapS.i_rr); 
    1923         replaceable Components.AirGapS airGapS(final p=p, final m=3, final Lm=Lm) extends  
    1924           Components.PartialAirGap  
     1928        Components.AirGapS airGapS(            final p=p, final m=3, final Lm=Lm)  
    19251929          annotation (extent=[-10,-10; 10,10], rotation=-90); 
    19261930        parameter Modelica.SIunits.Inductance Lm=3*sqrt(1 - 0.0667)/(2*pi*fNominal)  
     
    20542058          final idq_rs = airGapS.i_rs, 
    20552059          final idq_rr = airGapS.i_rr); 
    2056         replaceable Components.AirGapS airGapS(final p=p, final m=3, final Lm=Lm) extends  
    2057           Components.PartialAirGap  
     2060        Components.AirGapS airGapS(            final p=p, final m=3, final Lm=Lm)  
    20582061          annotation (extent=[-10,-10; 10,10], rotation=-90); 
    20592062        parameter Modelica.SIunits.Inductance Lm=3*sqrt(1 - 0.0667)/(2*pi*fNominal)  
     
    23272330            final idq_rs = airGapR.i_rs, 
    23282331            final idq_rr = airGapR.i_rr); 
    2329         replaceable Components.AirGapR airGapR(final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq) extends  
    2330           Components.PartialAirGap  
     2332        Components.AirGapR airGapR(            final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq)  
    23312333          annotation (extent=[-10,-10; 10,10], rotation=-90); 
    23322334        parameter Modelica.SIunits.Voltage V0=112.3  
     
    25332535            final idq_rs = airGapR.i_rs, 
    25342536            final idq_rr = airGapR.i_rr); 
    2535         replaceable Components.AirGapR airGapR(final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq) extends  
    2536           Components.PartialAirGap  
     2537        Components.AirGapR airGapR(            final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq)  
    25372538          annotation (extent=[-10,-10; 10,10], rotation=-90); 
    25382539        parameter Modelica.SIunits.Inductance Lmd=1.5/(2*pi*fNominal)  
     
    27862787            final idq_rs = airGapR.i_rs, 
    27872788            final idq_rr = airGapR.i_rr); 
    2788         replaceable Components.AirGapR airGapR(final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq) extends  
    2789           Components.PartialAirGap  
     2789        Components.AirGapR airGapR(            final p=p, final m=3, final Lmd=Lmd, final Lmq=Lmq)  
    27902790          annotation (extent=[-10,-10; 10,10], rotation=-90); 
    27912791        parameter Modelica.SIunits.Inductance Lmd=2.9/(2*pi*fNominal)  
     
    30043004        extends Machines.Interfaces.PartialBasicDCMachine( 
    30053005        final TurnsRatio=(VaNominal-Ra*IaNominal)/(Modelica.SIunits.Conversions.from_rpm(rpmNominal)*Le*IeNominal)); 
    3006         replaceable Components.AirGapDC airGapDC(final TurnsRatio=TurnsRatio, final Le=Le) extends  
    3007           Components.PartialAirGapDC annotation (extent=[-10,-10; 10,10], rotation=-90); 
     3006        Components.AirGapDC airGapDC(            final TurnsRatio=TurnsRatio, final Le=Le)  
     3007                                    annotation (extent=[-10,-10; 10,10], rotation=-90); 
    30083008      protected  
    30093009        final parameter Modelica.SIunits.Inductance Le=1  
     
    31153115        extends Machines.Interfaces.PartialBasicDCMachine( 
    31163116          final TurnsRatio=(VaNominal-Ra*IaNominal)/(Modelica.SIunits.Conversions.from_rpm(rpmNominal)*Le*IeNominal)); 
    3117         replaceable Components.AirGapDC airGapDC(final TurnsRatio=TurnsRatio, final Le=Le) extends  
    3118           Components.PartialAirGapDC annotation (extent=[-10,-10; 10,10], rotation=-90); 
     3117        Components.AirGapDC airGapDC(            final TurnsRatio=TurnsRatio, final Le=Le)  
     3118                                    annotation (extent=[-10,-10; 10,10], rotation=-90); 
    31193119        parameter Modelica.SIunits.Current IeNominal=1  
    31203120          "nominal excitation current"  
     
    32563256        extends Machines.Interfaces.PartialBasicDCMachine(rpmNominal =  1410, 
    32573257          final TurnsRatio=(VaNominal-(Ra+Re)*IaNominal)/(Modelica.SIunits.Conversions.from_rpm(rpmNominal)*Le*IaNominal)); 
    3258         replaceable Components.AirGapDC airGapDC(final TurnsRatio=TurnsRatio, final Le=Le) extends  
    3259           Components.PartialAirGapDC annotation (extent=[-10,-10; 10,10], rotation=-90); 
     3258        Components.AirGapDC airGapDC(            final TurnsRatio=TurnsRatio, final Le=Le)  
     3259                                    annotation (extent=[-10,-10; 10,10], rotation=-90); 
    32603260        parameter Modelica.SIunits.Resistance Re=0.01  
    32613261          "warm field excitation resistance"  
     
    33633363            rgbcolor={0,0,0}, 
    33643364            smooth=0)); 
    3365         connect(airGapDC.pin_ap, la.n) annotation (points=[10,10; 10,60; 10,60], 
     3365        connect(airGapDC.pin_ap, la.n) annotation (points=[10,10; 10,60], 
    33663366            style( 
    33673367            color=3, 
     
    58305830      constant Integer m=3 "number of phases"; 
    58315831      parameter Integer p(min=1) "number of pole pairs"; 
     5832      parameter Boolean useSupport=false "use support or fixed housing"  
     5833        annotation(Evaluate=true); 
    58325834      Modelica.Blocks.Interfaces.RealOutput rotorAngle(redeclare type  
    58335835          SignalType =  
     
    58555857      Modelica.Blocks.Routing.DeMultiplex2 deMultiplex2(final n1=1, 
    58565858           final n2=1) annotation (extent=[60,-20; 80,0]); 
    5857       Modelica.Mechanics.Rotational.Interfaces.Flange_a support  
     5859      Modelica.Mechanics.Rotational.Interfaces.Flange_a support if useSupport  
    58585860        "support at which the reaction torque is acting"  
    58595861           annotation (extent=[90,90; 110,110]); 
    5860     protected  
    5861       Interfaces.Adapter adapter(final bearingConnected=cardinality(support) > 1)  
    5862         annotation (extent=[80,70; 60,90]); 
     5862      Modelica.Mechanics.Rotational.Fixed fixed if (not useSupport)  
     5863        annotation (extent=[90,70; 110,90]); 
    58635864      annotation ( 
    58645865        Diagram, 
     
    59215922rotating the space phasor to the rotor-fixed coordinate system and calculating the angle of this space phasor. 
    59225923<p> 
    5923 The sensor's housing is implicitely fixed.<br> 
    5924 Since the machine's stator also implicitely fixed, the angle at the flange  
    5925 is equal to the angle of the machine's rotor against the stator. 
     5924The sensor's housing can be implicitely fixed (useSupport=false).<br> 
     5925If the machine's stator also implicitely fixed (useSupport=false), the angle at the flange  
     5926is equal to the angle of the machine's rotor against the stator.<br> 
     5927Otherwise, the sensor's support has to be connected to the machine's support. 
    59265928</p> 
    59275929</HTML>")); 
     
    59545956      connect(relativeAngleSensor.flange_b, flange) annotation (points=[20,80; 
    59555957            0,80; 0,100], style(color=0, rgbcolor={0,0,0})); 
    5956       connect(relativeAngleSensor.flange_a, adapter.flange_b)  
    5957         annotation (points=[40,80; 60,80], style(color=0, rgbcolor={0,0,0})); 
    5958       connect(adapter.flange_a, support) annotation (points=[80,80; 100,80; 100, 
    5959             100], style(color=0, rgbcolor={0,0,0})); 
     5958      connect(relativeAngleSensor.flange_a, fixed.flange_b) annotation (points=[40, 
     5959            80; 100,80], style( 
     5960          color=0, 
     5961          rgbcolor={0,0,0}, 
     5962          smooth=0)); 
     5963      connect(relativeAngleSensor.flange_a, support) annotation (points=[40,80; 60, 
     5964            80; 60,100; 100,100], style( 
     5965          color=0, 
     5966          rgbcolor={0,0,0}, 
     5967          smooth=0)); 
    59605968    end RotorAngle; 
    59615969  end Sensors; 
     
    66086616    end SpacePhasor; 
    66096617     
    6610     model Adapter  
    6611       "From Modelica.Mechanics.Rotational.Interfaces.TwoFlangesAndBearingH"  
    6612       extends Modelica.Mechanics.Rotational.Interfaces.TwoFlanges; 
    6613       parameter Boolean bearingConnected "Choose wether bearing is connected"; 
    6614       annotation (Icon(Rectangle(extent=[-90, 10; 90, -10], style(color=8, 
    6615                 fillColor=8)), Text(extent=[0, 60; 0, 20], string="%name")), 
    6616           Documentation(info="<html> 
    6617 From Modelica.Mechanics.Rotational.Interfaces.TwoFlangesAndBearingH:<br> 
    6618 If bearingConnected = true torque is given from flange_a to flange_b<br> 
    6619 If bearingConnected = false flange_a is fixed 
    6620 </html>")); 
    6621     equation  
    6622       flange_a.phi = flange_b.phi; 
    6623       if bearingConnected then 
    6624         0 = flange_a.tau + flange_b.tau; 
    6625       else 
    6626         0 = flange_a.phi; 
    6627       end if; 
    6628     end Adapter; 
    66296618     
    66306619    partial model PartialBasicMachine "Partial model for all machines"  
    66316620      parameter Modelica.SIunits.Inertia J_Rotor "rotor's moment of inertia"; 
     6621      parameter Boolean useSupport=false "use support or fixed stator"  
     6622        annotation(Evaluate=true); 
    66326623      parameter Modelica.SIunits.Inertia J_Stator=J_Rotor  
    6633         "stator's moment of inertia"; 
    6634       output Modelica.SIunits.Angle phi_mechanical = flange_a.phi-support.phi  
     6624        "stator's moment of inertia"  
     6625        annotation(Dialog(enable=useSupport)); 
     6626      output Modelica.SIunits.Angle phi_mechanical = flange_a.phi-internalSupport.phi  
    66356627        "mechanical angle of rotor against stator"; 
    66366628      output Modelica.SIunits.AngularVelocity w_mechanical = der(phi_mechanical)  
     
    66466638      Modelica.Mechanics.Rotational.Inertia inertiaRotor(final J=J_Rotor)  
    66476639        annotation (extent=[80,10; 60,-10],   rotation=-180); 
    6648       Modelica.Mechanics.Rotational.Interfaces.Flange_a support  
     6640      Modelica.Mechanics.Rotational.Interfaces.Flange_a support if useSupport  
    66496641        "support at which the reaction torque is acting"  
    66506642           annotation (extent=[90,-110; 110,-90]); 
    6651       Modelica.Mechanics.Rotational.Inertia inertiaStator(final J=J_Stator)  
     6643      Modelica.Mechanics.Rotational.Inertia inertiaStator(final J=J_Stator) if useSupport  
    66526644        annotation (extent=[80,-90; 60,-110], rotation=-180); 
     6645      Modelica.Mechanics.Rotational.Fixed fixed if (not useSupport)  
     6646        annotation (extent=[30,-110; 50,-90]); 
    66536647    protected  
    6654       Machines.Interfaces.Adapter adapter(final bearingConnected=cardinality(support) > 1)  
    6655         annotation (extent=[30,-90; 50,-110],   rotation=180); 
    66566648      Modelica.Mechanics.Rotational.Interfaces.Flange_b internalSupport  
    66576649        annotation (extent=[19,-101; 21,-99]); 
     
    67036695</ul> 
    67046696Besides the mechanical connector <i>flange_a</i> (i.e. the shaft) the machines have a second mechanical connector <i>support</i>.<br> 
    6705 If nothing is connected to <i>support</i>, it is assumed that the stator is fixed.<br> 
     6697If <i>useSupport</i> = false, it is assumed that the stator is fixed.<br> 
    67066698Otherwise reaction torque (i.e. airGap torque, minus acceleration torque for stator's moment of inertia) can be measured at <i>support</i>.<br> 
    6707 One may also fix the the shaft and let rotate the stator; parameter Js is only of importance when the stator is rotating.<br> 
    6708 <b>Take care:</b> Even if You connect only a sensor (e.g. Modelica.Mechanics.Rotational.Sensors.RelAngleSensor or Machines.Sensors.RotorDisplacementAngle) to the <i>support</i>, You have to fix the <i>support</i>! 
     6699One may also fix the the shaft and let rotate the stator; parameter Js is only of importance when the stator is rotating. 
    67096700</HTML>"), 
    67106701        Diagram); 
     
    67156706      connect(inertiaStator.flange_b, support)  
    67166707        annotation (points=[80,-100; 100,-100], style(color=0, rgbcolor={0,0,0})); 
    6717       connect(adapter.flange_a, inertiaStator.flange_a) annotation (points=[50,-100; 
    6718             60,-100], 
    6719                    style(color=0, rgbcolor={0,0,0})); 
    6720       connect(adapter.flange_b, internalSupport)  
    6721         annotation (points=[30,-100; 20,-100], style(color=0, rgbcolor={0,0,0})); 
     6708      connect(internalSupport, fixed.flange_b) annotation (points=[20,-100; 40,-100], 
     6709          style( 
     6710          color=0, 
     6711          rgbcolor={0,0,0}, 
     6712          smooth=0)); 
     6713      connect(internalSupport, inertiaStator.flange_a) annotation (points=[20,-100; 
     6714            20,-96; 60,-96; 60,-100], style( 
     6715          color=0, 
     6716          rgbcolor={0,0,0}, 
     6717          smooth=0)); 
    67226718    end PartialBasicMachine; 
    67236719     
     
    67886784          rgbcolor={0,0,255}, 
    67896785          smooth=0)); 
    6790       connect(spacePhasorS.ground,spacePhasorS. zero) annotation (points=[-10,20;  
     6786      connect(spacePhasorS.ground,spacePhasorS. zero) annotation (points=[-10,20; 
    67916787            -10,14; -6.12323e-016,14; -6.12323e-016,20],     style( 
    67926788          color=3,