Changeset 1140

Show
Ignore:
Timestamp:
06/26/08 08:30:12 (5 months ago)
Author:
otter
Message:

Serious bugs in Translational.Components.SupportFriction/Brake fixed (sign of friction was wrong).
Additionally, introduced examples to test these two elements:
- Enhanced Translational.Examples.Friction
- New example Translational.Examples.Brake

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/Modelica/Mechanics/Translational.mo

    r1120 r1140  
    813813            grid={2,2}), graphics={ 
    814814            Text( 
    815               extent={{-56,-88},{62,-100}}, 
    816               textString="simulate 5 s", 
    817               lineColor={0,0,255}), 
    818             Text( 
    819815              extent={{-100,80},{-80,60}}, 
    820816              textString="1)", 
     
    823819              extent={{-100,20},{-80,0}}, 
    824820              textString="2)", 
    825               lineColor={0,0,255})}), 
     821              lineColor={0,0,255}), 
     822            Text( 
     823              extent={{-100,-40},{-80,-60}}, 
     824              lineColor={0,0,255}, 
     825              textString="3)")}), 
    826826        Documentation(info="<html> 
    827827<ol> 
    828 <li> Simulate and then plot Stop1.f as a function of Stop1.v 
     828<li> Simulate and then plot stop1.f as a function of stop1.v 
    829829     This gives the Stribeck curve.</li> 
    830 <li> This model gives an example for a hard stop. However there 
     830<li> The same model is also available by modeling the system with a Mass and 
     831     a SupportFriction model. The SupportFriction model defines the friction characteristic 
     832     with a table. The table is constructed with function 
     833     Examples.Utilities.GenerateStribeckFrictionTable(..) to generate the 
     834     same friction characteristic as with stop1. 
     835     The simulation results of stop1 and of model mass are therefore identical.</li> 
     836<li> Model stop2 gives an example for a hard stop. However there 
    831837     can arise some problems with the used modeling approach (use of 
    832      Reinit, convergence problems). In this case use the ElastoGap 
     838     <b>reinit</b>(..), convergence problems). In this case use the ElastoGap 
    833839     to model a stop (see example Preload).</li> 
    834840</ol> 
     
    845851        F_Coulomb=5, 
    846852        F_Stribeck=10, 
    847         fexp=2)                     annotation (Placement(transformation(extent= 
    848                {{60,60},{80,80}}, rotation=0))); 
     853        fexp=2)                     annotation (Placement(transformation(extent={{20,60}, 
     854                {40,80}},        rotation=0))); 
    849855      Translational.Sources.Force force  
    850                                  annotation (Placement(transformation(extent={{20,60}, 
    851                 {40,80}},        rotation=0))); 
     856                                 annotation (Placement(transformation(extent={{-20,60}, 
     857                {0,80}},         rotation=0))); 
    852858      Modelica.Blocks.Sources.Sine sineForce(amplitude=25, freqHz=0.25)  
    853859                                                                    annotation (Placement( 
    854             transformation(extent={{-20,60},{0,80}}, rotation=0))); 
     860            transformation(extent={{-60,60},{-40,80}}, 
     861                                                     rotation=0))); 
    855862      Modelica.Mechanics.Translational.Components.MassWithStopAndFriction stop2 
    856863        ( 
     
    861868        F_Stribeck=5, 
    862869        s(start=0, fixed=true), 
    863         v(start=-5, fixed=true), 
    864870        m=1, 
    865871        F_prop=1, 
    866         fexp=2)      annotation (Placement(transformation(extent={{60,0},{80,20}}, 
     872        fexp=2, 
     873        v(start=-5, fixed=true))  
     874                     annotation (Placement(transformation(extent={{42,-60},{62, 
     875                -40}}, 
    867876              rotation=0))); 
    868877      Translational.Components.Spring spring(s_rel0=1, c=500)  
    869878                                                    annotation (Placement( 
    870             transformation(extent={{20,0},{40,20}}, rotation=0))); 
     879            transformation(extent={{2,-60},{22,-40}}, 
     880                                                    rotation=0))); 
    871881      Translational.Components.Fixed fixed2(s0=-1.75)  
    872882                                           annotation (Placement(transformation( 
    873               extent={{-22,0},{-2,20}}, rotation=0))); 
    874     equation 
    875       connect(spring.flange_b, stop2.flange_a)  annotation (Line(points={{40,10}, 
    876               {60,10}}, color={0,191,0})); 
     883              extent={{-40,-60},{-20,-40}}, 
     884                                        rotation=0))); 
     885      Translational.Sources.Force force2  
     886                                 annotation (Placement(transformation(extent={{-22,0}, 
     887                {-2,20}},        rotation=0))); 
     888      Components.Mass mass( 
     889        m=1, 
     890        L=1, 
     891        s(fixed=true), 
     892        v(fixed=true))  
     893        annotation (Placement(transformation(extent={{10,0},{30,20}}))); 
     894      Components.SupportFriction supportFriction(f_pos= 
     895            Examples.Utilities.GenerateStribeckFrictionTable( 
     896                F_prop=1, 
     897                F_Coulomb=5, 
     898                F_Stribeck=10, 
     899                fexp=2, 
     900                v_max=12, 
     901                nTable=50))  
     902        annotation (Placement(transformation(extent={{40,0},{60,20}}))); 
     903    equation 
     904      connect(spring.flange_b, stop2.flange_a)  annotation (Line(points={{22,-50}, 
     905              {42,-50}},color={0,191,0})); 
    877906      connect(sineForce.y, force.f)  
    878         annotation (Line(points={{1,70},{18,70}}, color={0,0,127})); 
     907        annotation (Line(points={{-39,70},{-22,70}}, 
     908                                                  color={0,0,127})); 
    879909      connect(spring.flange_a, fixed2.flange) annotation (Line( 
    880           points={{20,10},{-12,10}}, 
     910          points={{2,-50},{-30,-50}}, 
    881911          color={0,127,0}, 
    882912          smooth=Smooth.None)); 
    883913      connect(force.flange, stop1.flange_a) annotation (Line( 
    884           points={{40,70},{60,70}}, 
    885           color={0,127,0}, 
     914          points={{0,70},{20,70}}, 
     915          color={0,127,0}, 
     916          smooth=Smooth.None)); 
     917      connect(force2.flange, mass.flange_a) annotation (Line( 
     918          points={{-2,10},{10,10}}, 
     919          color={0,127,0}, 
     920          smooth=Smooth.None)); 
     921      connect(mass.flange_b, supportFriction.flange_a) annotation (Line( 
     922          points={{30,10},{40,10}}, 
     923          color={0,127,0}, 
     924          smooth=Smooth.None)); 
     925      connect(sineForce.y, force2.f) annotation (Line( 
     926          points={{-39,70},{-30,70},{-30,10},{-24,10}}, 
     927          color={0,0,127}, 
    886928          smooth=Smooth.None)); 
    887929    end Friction; 
     
    11721214          smooth=Smooth.None)); 
    11731215    end ElastoGap; 
     1216 
     1217    model Brake "Demonstrate braking of a translational moving mass" 
     1218      extends Modelica.Icons.Example; 
     1219 
     1220      annotation (Diagram(coordinateSystem( 
     1221              preserveAspectRatio=true, extent={{-100,-100},{100,100}}), graphics), 
     1222        experiment(StopTime=2), 
     1223        Documentation(info="<html> 
     1224<p> 
     1225This model consists of a mass with an initial velocity of 1 m/s. 
     1226After 0.1 s, a brake is activated and it is shown that the mass decelerates until 
     1227it arrives at rest and remains at rest. Two versions of this system are present, 
     1228one where the brake is implicitly grounded and one where it is explicitly grounded. 
     1229</p> 
     1230  
     1231</html>")); 
     1232      Modelica.Mechanics.Translational.Components.Brake brake(fn_max=1, useSupport= 
     1233            false)  
     1234        annotation (Placement(transformation(extent={{6,40},{26,20}}))); 
     1235      Modelica.Mechanics.Translational.Components.Mass mass1(m=1, 
     1236        s(fixed=true), 
     1237        v(start=1, fixed=true))  
     1238        annotation (Placement(transformation(extent={{-34,20},{-14,40}}))); 
     1239      Modelica.Blocks.Sources.Step step(startTime=0.1, height=2)  
     1240        annotation (Placement(transformation(extent={{-10,-10},{10,10}}, 
     1241            rotation=0, 
     1242            origin={-24,-10}))); 
     1243      Modelica.Mechanics.Translational.Components.Brake brake1( 
     1244                                                              fn_max=1, useSupport= 
     1245            true)  
     1246        annotation (Placement(transformation(extent={{6,-60},{26,-40}}))); 
     1247      Modelica.Mechanics.Translational.Components.Mass mass2(m=1, 
     1248        s(fixed=true), 
     1249        v(start=1, fixed=true))  
     1250        annotation (Placement(transformation(extent={{-34,-60},{-14,-40}}))); 
     1251      Modelica.Mechanics.Translational.Components.Fixed fixed  
     1252        annotation (Placement(transformation(extent={{6,-80},{26,-60}}))); 
     1253    equation 
     1254      connect(mass1.flange_b, brake.flange_a)  
     1255                                             annotation (Line( 
     1256          points={{-14,30},{6,30}}, 
     1257          color={0,127,0}, 
     1258          smooth=Smooth.None)); 
     1259      connect(step.y, brake.f_normalized) annotation (Line( 
     1260          points={{-13,-10},{16,-10},{16,19}}, 
     1261          color={0,0,127}, 
     1262          smooth=Smooth.None)); 
     1263      connect(mass2.flange_b, brake1.flange_a)  
     1264                                             annotation (Line( 
     1265          points={{-14,-50},{6,-50}}, 
     1266          color={0,127,0}, 
     1267          smooth=Smooth.None)); 
     1268      connect(step.y, brake1.f_normalized) annotation (Line( 
     1269          points={{-13,-10},{16,-10},{16,-39}}, 
     1270          color={0,0,127}, 
     1271          smooth=Smooth.None)); 
     1272      connect(fixed.flange, brake1.support) annotation (Line( 
     1273          points={{16,-70},{16,-60}}, 
     1274          color={0,127,0}, 
     1275          smooth=Smooth.None)); 
     1276    end Brake; 
     1277 
     1278    package Utilities "Utility classes used by the Example models" 
     1279      extends Modelica.Icons.Library; 
     1280      function GenerateStribeckFrictionTable 
     1281        "Generate stribeck friction table for example Friction for the SupportFriction" 
     1282         input Real F_prop(final unit="N.s/m", final min=0) 
     1283          "Velocity dependent friction coefficient"; 
     1284         input Modelica.SIunits.Force F_Coulomb 
     1285          "Constant friction: Coulomb force"; 
     1286         input Modelica.SIunits.Force F_Stribeck "Stribeck effect"; 
     1287         input Real fexp(final unit="s/m", final min=0) "Exponential decay"; 
     1288         input Real v_max "Generate table from v=0 ... v_max"; 
     1289         input Integer nTable(min=2)=100 "Number of table points"; 
     1290         output Real table[nTable,2] "Friction table"; 
     1291      algorithm 
     1292         for i in 1:nTable loop 
     1293            table[i,1] :=v_max*(i - 1)/(nTable - 1); 
     1294            table[i,2] :=F_Coulomb + F_prop*table[i, 1] + 
     1295                         F_Stribeck*exp(-fexp*table[i, 1]); 
     1296         end for; 
     1297        annotation (Documentation(info="<html> 
     1298<p> 
     1299Returns a table with the friction characteristic table[nTable,2] = [0, f1; ....; v_max, fn], where the first 
     1300column is the velocity v in the range 0..v_max and the second column is the friction force 
     1301according to the stribeck curve: 
     1302</p> 
     1303<pre> 
     1304  F_Coulomb + F_prop*v + F_Stribeck*exp(-fexp*v); 
     1305</pre> 
     1306  
     1307</html>")); 
     1308      end GenerateStribeckFrictionTable; 
     1309    end Utilities; 
    11741310  end Examples; 
    11751311 
     
    19882124 
    19892125    // Friction force 
    1990       flange_a.f + flange_b.f + f = 0; 
     2126      flange_a.f + flange_b.f - f = 0; 
    19912127 
    19922128    // Friction force 
     
    21752311 
    21762312    // Friction force, normal force and friction force for v_rel=0 
    2177       flange_a.f + flange_b.f + f = 0; 
     2313      flange_a.f + flange_b.f - f = 0; 
    21782314      fn = fn_max*f_normalized; 
    21792315      f0 = mue0*cgeo*fn;