| | 835 | Blocks.Interfaces.RealOutput r_rel[3] if get_r_rel |
| | 836 | "Relative position vector frame_b.r_0 - frame_a.r_0 resolved in frame_a or frame_b" |
| | 837 | annotation (Placement(transformation( |
| | 838 | origin={-100,-110}, |
| | 839 | extent={{10,-10},{-10,10}}, |
| | 840 | rotation=90))); |
| | 841 | Blocks.Interfaces.RealOutput v_rel[3] if get_v_rel |
| | 842 | "Relative velocity vector (= der(r_rel))" |
| | 843 | annotation (Placement(transformation( |
| | 844 | origin={-60,-110}, |
| | 845 | extent={{10,-10},{-10,10}}, |
| | 846 | rotation=90))); |
| | 847 | Blocks.Interfaces.RealOutput a_rel[3] if get_a_rel |
| | 848 | "Relative acceleration vector (= der(v_rel))" |
| | 849 | annotation (Placement(transformation( |
| | 850 | origin={-20,-110}, |
| | 851 | extent={{10,-10},{-10,10}}, |
| | 852 | rotation=90))); |
| | 853 | Blocks.Interfaces.RealOutput angles[3] if get_angles |
| | 854 | "Angles to rotate frame_a into frame_b via 'sequence'" |
| | 855 | annotation (Placement(transformation( |
| | 856 | origin={20,-110}, |
| | 857 | extent={{10,-10},{-10,10}}, |
| | 858 | rotation=90))); |
| | 859 | Blocks.Interfaces.RealOutput w_rel[3] if get_w_rel |
| | 860 | "Relative angular velocity vector" |
| | 861 | annotation (Placement(transformation( |
| | 862 | origin={60,-110}, |
| | 863 | extent={{10,-10},{-10,10}}, |
| | 864 | rotation=90))); |
| | 865 | Blocks.Interfaces.RealOutput z_rel[3] if get_z_rel |
| | 866 | "Relative angular acceleration vector (= der(w_rel))" |
| | 867 | annotation (Placement(transformation( |
| | 868 | origin={100,-110}, |
| | 869 | extent={{10,-10},{-10,10}}, |
| | 870 | rotation=90))); |
| | 871 | |
| | 872 | annotation (Diagram(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
| | 873 | -100},{100,100}}, |
| | 874 | grid={1,1}), graphics), |
| | 875 | Icon(coordinateSystem(preserveAspectRatio=true, |
| | 876 | extent={{-100,-100},{100,100}}, |
| | 877 | grid={1,1}), graphics={ |
| | 878 | Line( |
| | 879 | points={{-70,0},{-95,0}}, |
| | 880 | color={0,0,0}, |
| | 881 | smooth=Smooth.None), |
| | 882 | Line( |
| | 883 | points={{96,0},{70,0}}, |
| | 884 | color={0,0,0}, |
| | 885 | smooth=Smooth.None), |
| | 886 | Text( |
| | 887 | extent={{-127,-77},{-92,-93}}, |
| | 888 | lineColor={0,0,0}, |
| | 889 | textString="r"), |
| | 890 | Text( |
| | 891 | extent={{-112,44},{-76,19}}, |
| | 892 | lineColor={128,128,128}, |
| | 893 | textString="a"), |
| | 894 | Text( |
| | 895 | extent={{72,44},{108,19}}, |
| | 896 | lineColor={128,128,128}, |
| | 897 | textString="b"), |
| | 898 | Text( |
| | 899 | extent={{-132,90},{129,138}}, |
| | 900 | textString="%name", |
| | 901 | lineColor={0,0,255}), |
| | 902 | Line( |
| | 903 | points={{-60,-36},{-60,-100}}, |
| | 904 | color={0,0,127}, |
| | 905 | smooth=Smooth.None), |
| | 906 | Line( |
| | 907 | points={{20,-67},{20,-100}}, |
| | 908 | color={0,0,127}, |
| | 909 | smooth=Smooth.None), |
| | 910 | Text( |
| | 911 | extent={{-90,-77},{-55,-93}}, |
| | 912 | lineColor={0,0,0}, |
| | 913 | textString="v"), |
| | 914 | Text( |
| | 915 | extent={{-58,-77},{-23,-93}}, |
| | 916 | lineColor={0,0,0}, |
| | 917 | textString="a"), |
| | 918 | Line( |
| | 919 | points={{-84,0},{-84,-60},{-100,-60},{-100,-100}}, |
| | 920 | color={0,0,127}, |
| | 921 | smooth=Smooth.None), |
| | 922 | Line( |
| | 923 | points={{-20,-67},{-20,-100}}, |
| | 924 | color={0,0,127}, |
| | 925 | smooth=Smooth.None), |
| | 926 | Line( |
| | 927 | points={{60,-36},{60,-100}}, |
| | 928 | color={0,0,127}, |
| | 929 | smooth=Smooth.None), |
| | 930 | Line( |
| | 931 | points={{86,0},{86,-60},{100,-60},{100,-100}}, |
| | 932 | color={0,0,127}, |
| | 933 | smooth=Smooth.None), |
| | 934 | Text( |
| | 935 | extent={{96,-76},{136,-93}}, |
| | 936 | lineColor={0,0,0}, |
| | 937 | textString="z"), |
| | 938 | Text( |
| | 939 | extent={{55,-76},{100,-92}}, |
| | 940 | lineColor={0,0,0}, |
| | 941 | textString="w"), |
| | 942 | Line( |
| | 943 | points={{95,80},{50,80},{50,49}}, |
| | 944 | color={0,0,0}, |
| | 945 | pattern=LinePattern.Dot, |
| | 946 | smooth=Smooth.None)})); |
| | 947 | |
| 821 | | |
| 822 | | encapsulated model RelativePosition "Determine relative position" |
| 823 | | import Modelica; |
| 824 | | import Modelica.Mechanics.MultiBody.Frames; |
| 825 | | extends Modelica.Blocks.Interfaces.BlockIcon; |
| 826 | | |
| 827 | | Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a |
| 828 | | "Coordinate system a" annotation (Placement( |
| 829 | | transformation(extent={{-116,-16},{-84,16}}, rotation=0))); |
| 830 | | Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b |
| 831 | | "Coordinate system b" annotation (Placement( |
| 832 | | transformation(extent={{84,-16},{116,16}}, rotation=0))); |
| 833 | | Modelica.Blocks.Interfaces.RealOutput r_rel[3] |
| 834 | | "Relative position vector, frame_b.r_0 - frame_a.r_0, resolved in frame_a or frame_b depending on parameter resolveInFrame_a)" |
| 835 | | annotation (Placement(transformation( |
| 836 | | origin={0,-110}, |
| 837 | | extent={{-10,-10},{10,10}}, |
| 838 | | rotation=270))); |
| 839 | | parameter Boolean resolveInFrame_a=true |
| 840 | | "= true, if relative vectors from frame_a to frame_b are resolved before differentiation in frame_a, otherwise in frame_b"; |
| 841 | | |
| 842 | | equation |
| 843 | | frame_a.f = zeros(3); |
| 844 | | frame_a.t = zeros(3); |
| 845 | | frame_b.f = zeros(3); |
| 846 | | frame_b.t = zeros(3); |
| 847 | | if resolveInFrame_a then |
| 848 | | r_rel = Frames.resolve2(frame_a.R, frame_b.r_0 - frame_a.r_0); |
| 849 | | else |
| 850 | | r_rel = Frames.resolve2(frame_b.R, frame_b.r_0 - frame_a.r_0); |
| 851 | | end if; |
| 852 | | |
| 853 | | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{ |
| 854 | | -100,-100},{100,100}}), graphics={Text( |
| 855 | | extent={{-78,-60},{78,-82}}, |
| 856 | | lineColor={0,0,0}, |
| 857 | | textString="r_rel")})); |
| 858 | | end RelativePosition; |
| 859 | | |
| 860 | | protected |
| 861 | | RelativePosition relativePosition annotation (Placement(transformation( |
| 862 | | extent={{-70,-10},{-50,10}}, rotation=0))); |
| 863 | | annotation (Diagram(coordinateSystem(preserveAspectRatio=false, extent={{ |
| 864 | | -100,-100},{100,100}}), |
| 865 | | graphics), |
| 866 | | Icon(coordinateSystem(preserveAspectRatio=true, |
| 867 | | extent={{-100,-100},{100,100}}), graphics={ |
| 868 | | Line( |
| 869 | | points={{-70,0},{-96,0}}, |
| 870 | | color={0,0,0}, |
| 871 | | smooth=Smooth.None), |
| 872 | | Line( |
| 873 | | points={{96,0},{70,0}}, |
| 874 | | color={0,0,0}, |
| 875 | | smooth=Smooth.None), |
| 876 | | Line( |
| 877 | | points={{-80,0},{-80,-100}}, |
| 878 | | color={0,0,127}, |
| 879 | | smooth=Smooth.None), |
| 880 | | Text( |
| 881 | | extent={{-116,-62},{-44,-76}}, |
| 882 | | lineColor={0,0,0}, |
| 883 | | textString="r_rel"), |
| 884 | | Text( |
| 885 | | extent={{-112,51},{-76,26}}, |
| 886 | | lineColor={128,128,128}, |
| 887 | | textString="a"), |
| 888 | | Text( |
| 889 | | extent={{78,51},{114,26}}, |
| 890 | | lineColor={128,128,128}, |
| 891 | | textString="b"), |
| 892 | | Text( |
| 893 | | extent={{-132,76},{129,124}}, |
| 894 | | textString="%name", |
| 895 | | lineColor={0,0,255})})); |
| | 1008 | connect(zeroForce1.frame_a, frame_a) |
| | 1009 | annotation (Line( |
| | 1010 | points={{-80,50},{-90,50},{-90,0},{-100,0}}, |
| | 1011 | color={95,95,95}, |
| | 1012 | thickness=2, |
| | 1013 | smooth=Smooth.None)); |
| | 1014 | connect(zeroForce2.frame_a, frame_b) |
| | 1015 | annotation (Line( |
| | 1016 | points={{80,30},{90,30},{90,0},{100,0}}, |
| | 1017 | color={95,95,95}, |
| | 1018 | thickness=2, |
| | 1019 | smooth=Smooth.None)); |
| | 1020 | connect(relativePosition.r_rel, der1.u) annotation (Line( |
| | 1021 | points={{-70,-11},{-70,-20},{-60,-20},{-60,-28}}, |
| | 1022 | color={0,0,127}, |
| | 1023 | smooth=Smooth.None)); |
| | 1024 | connect(der2.u, der1.y) annotation (Line( |
| | 1025 | points={{-20,-68},{-20,-60},{-60,-60},{-60,-51}}, |
| | 1026 | color={0,0,127}, |
| | 1027 | smooth=Smooth.None)); |
| | 1028 | connect(der2.y, a_rel) annotation (Line( |
| | 1029 | points={{-20,-91},{-20,-100.5},{-20,-100.5},{-20,-110}}, |
| | 1030 | color={0,0,127}, |
| | 1031 | smooth=Smooth.None)); |
| | 1032 | connect(der1.y, v_rel) annotation (Line( |
| | 1033 | points={{-60,-51},{-60,-110}}, |
| | 1034 | color={0,0,127}, |
| | 1035 | smooth=Smooth.None)); |
| | 1036 | connect(relativeAngles.frame_a, frame_a) annotation (Line( |
| | 1037 | points={{10,-15},{0,-15},{0,30},{-90,30},{-90,0},{-100,0}}, |
| | 1038 | color={95,95,95}, |
| | 1039 | thickness=2, |
| | 1040 | smooth=Smooth.None)); |
| | 1041 | connect(relativeAngles.frame_b, frame_b) annotation (Line( |
| | 1042 | points={{30,-15},{40,-15},{40,0},{100,0}}, |
| | 1043 | color={95,95,95}, |
| | 1044 | thickness=2, |
| | 1045 | smooth=Smooth.None)); |
| | 1046 | connect(relativeAngles.angles, angles) annotation (Line( |
| | 1047 | points={{20,-26},{20,-110}}, |
| | 1048 | color={0,0,127}, |
| | 1049 | smooth=Smooth.None)); |
| | 1050 | connect(relativeAngularVelocity.frame_b, frame_b) annotation (Line( |
| | 1051 | points={{70,-37},{80,-37},{80,0},{100,0}}, |
| | 1052 | color={95,95,95}, |
| | 1053 | thickness=2, |
| | 1054 | smooth=Smooth.None)); |
| | 1055 | connect(relativeAngularVelocity.frame_a, frame_a) annotation (Line( |
| | 1056 | points={{50,-37},{0,-37},{0,30},{-90,30},{-90,0},{-100,0}}, |
| | 1057 | color={95,95,95}, |
| | 1058 | thickness=2, |
| | 1059 | smooth=Smooth.None)); |
| | 1060 | connect(relativeAngularVelocity.w_rel, w_rel) annotation (Line( |
| | 1061 | points={{60,-48},{60,-110}}, |
| | 1062 | color={0,0,127}, |
| | 1063 | smooth=Smooth.None)); |
| | 1064 | connect(relativeAngularVelocity.w_rel, der3.u) annotation (Line( |
| | 1065 | points={{60,-48},{60,-54},{100,-54},{100,-58}}, |
| | 1066 | color={0,0,127}, |
| | 1067 | smooth=Smooth.None)); |
| | 1068 | connect(der3.y, z_rel) annotation (Line( |
| | 1069 | points={{100,-81},{100,-110}}, |
| | 1070 | color={0,0,127}, |
| | 1071 | smooth=Smooth.None)); |
| | 1072 | connect(frame_resolve, relativePosition.frame_resolve) annotation (Line( |
| | 1073 | points={{100,80},{-50,80},{-50,7},{-60,7}}, |
| | 1074 | color={95,95,95}, |
| | 1075 | pattern=LinePattern.Dot, |
| | 1076 | smooth=Smooth.None, |
| | 1077 | thickness=2)); |
| | 1078 | connect(zeroPosition.frame_resolve, relativePosition.frame_resolve) |
| | 1079 | annotation (Line( |
| | 1080 | points={{-30,13},{-50,13},{-50,7},{-60,7}}, |
| | 1081 | color={95,95,95}, |
| | 1082 | pattern=LinePattern.Dot, |
| | 1083 | smooth=Smooth.None, |
| | 1084 | thickness=2)); |
| | 1585 | package Internal "Internal package, should not be used by user" |
| | 1586 | model ZeroForceAndTorque |
| | 1587 | extends Modelica.Blocks.Interfaces.BlockIcon; |
| | 1588 | Interfaces.Frame_a frame_a |
| | 1589 | annotation (Placement(transformation(extent={{-116,-16},{-84,16}}))); |
| | 1590 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, |
| | 1591 | -100},{100,100}}), graphics={Text( |
| | 1592 | extent={{-74,24},{80,-20}}, |
| | 1593 | lineColor={0,0,0}, |
| | 1594 | textString="f = t = 0")})); |
| | 1595 | equation |
| | 1596 | frame_a.f = zeros(3); |
| | 1597 | frame_a.t = zeros(3); |
| | 1598 | end ZeroForceAndTorque; |
| | 1599 | |
| | 1600 | model ZeroPosition |
| | 1601 | extends Modelica.Blocks.Interfaces.BlockIcon; |
| | 1602 | Interfaces.Frame_resolve frame_resolve |
| | 1603 | annotation (Placement(transformation(extent={{-116,-16},{-84,16}}))); |
| | 1604 | annotation (Icon(coordinateSystem(preserveAspectRatio=false, extent={{-100, |
| | 1605 | -100},{100,100}}), graphics={Text( |
| | 1606 | extent={{-74,24},{80,-20}}, |
| | 1607 | lineColor={0,0,0}, |
| | 1608 | textString="r = 0")}), Diagram(coordinateSystem( |
| | 1609 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}), |
| | 1610 | graphics)); |
| | 1611 | equation |
| | 1612 | defineRoot(frame_resolve.R); |
| | 1613 | frame_resolve.R = Modelica.Mechanics.MultiBody.Frames.nullRotation(); |
| | 1614 | frame_resolve.r_0 = zeros(3); |
| | 1615 | end ZeroPosition; |
| | 1616 | |
| | 1617 | model PartialRelativeSensor "Determine relative position" |
| | 1618 | // extends Modelica.Blocks.Interfaces.BlockIcon; |
| | 1619 | |
| | 1620 | Modelica.Mechanics.MultiBody.Interfaces.Frame_a frame_a |
| | 1621 | "Coordinate system a" annotation (Placement( |
| | 1622 | transformation(extent={{-116,-16},{-84,16}}, rotation=0))); |
| | 1623 | Modelica.Mechanics.MultiBody.Interfaces.Frame_b frame_b |
| | 1624 | "Coordinate system b" annotation (Placement( |
| | 1625 | transformation(extent={{84,-16},{116,16}}, rotation=0))); |
| | 1626 | parameter Modelica.Mechanics.MultiBody.Types.ResolveInFrame2 |
| | 1627 | resolveInFrame= |
| | 1628 | Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_a |
| | 1629 | "Frame in which relative vector from frame_a to frame_b is resolved before differentiation"; |
| | 1630 | |
| | 1631 | annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
| | 1632 | -100},{100,100}}, |
| | 1633 | grid={1,1}), graphics={ |
| | 1634 | Ellipse( |
| | 1635 | extent={{-70,70},{70,-70}}, |
| | 1636 | lineColor={0,0,0}, |
| | 1637 | fillColor={255,255,255}, |
| | 1638 | fillPattern=FillPattern.Solid), |
| | 1639 | Line(points={{0,70},{0,40}}, color={0,0,0}), |
| | 1640 | Line(points={{22.9,32.8},{40.2,57.3}}, color={0,0,0}), |
| | 1641 | Line(points={{-22.9,32.8},{-40.2,57.3}}, color={0,0,0}), |
| | 1642 | Line(points={{37.6,13.7},{65.8,23.9}}, color={0,0,0}), |
| | 1643 | Line(points={{-37.6,13.7},{-65.8,23.9}}, color={0,0,0}), |
| | 1644 | Line(points={{0,0},{9.02,28.6}}, color={0,0,0}), |
| | 1645 | Polygon( |
| | 1646 | points={{-0.48,31.6},{18,26},{18,57.2},{-0.48,31.6}}, |
| | 1647 | lineColor={0,0,0}, |
| | 1648 | fillColor={0,0,0}, |
| | 1649 | fillPattern=FillPattern.Solid), |
| | 1650 | Ellipse( |
| | 1651 | extent={{-5,5},{5,-5}}, |
| | 1652 | lineColor={0,0,0}, |
| | 1653 | fillColor={0,0,0}, |
| | 1654 | fillPattern=FillPattern.Solid), |
| | 1655 | Line( |
| | 1656 | points={{-70,0},{-95,0}}, |
| | 1657 | color={0,0,0}, |
| | 1658 | smooth=Smooth.None), |
| | 1659 | Line( |
| | 1660 | points={{96,0},{70,0}}, |
| | 1661 | color={0,0,0}, |
| | 1662 | smooth=Smooth.None), |
| | 1663 | Text( |
| | 1664 | extent={{-112,51},{-76,26}}, |
| | 1665 | lineColor={128,128,128}, |
| | 1666 | textString="a"), |
| | 1667 | Text( |
| | 1668 | extent={{-132,76},{129,124}}, |
| | 1669 | textString="%name", |
| | 1670 | lineColor={0,0,255}), |
| | 1671 | Text( |
| | 1672 | extent={{78,51},{114,26}}, |
| | 1673 | lineColor={128,128,128}, |
| | 1674 | textString="b"), |
| | 1675 | Line( |
| | 1676 | points={{0,-70},{0,-100}}, |
| | 1677 | color={0,0,127}, |
| | 1678 | smooth=Smooth.None)}), Diagram(coordinateSystem( |
| | 1679 | preserveAspectRatio=true, |
| | 1680 | extent={{-100,-100},{100,100}}, |
| | 1681 | grid={1,1}))); |
| | 1682 | equation |
| | 1683 | frame_a.f = zeros(3); |
| | 1684 | frame_a.t = zeros(3); |
| | 1685 | frame_b.f = zeros(3); |
| | 1686 | frame_b.t = zeros(3); |
| | 1687 | end PartialRelativeSensor; |
| | 1688 | |
| | 1689 | model RelativePosition "Determine relative position" |
| | 1690 | import Modelica.Mechanics.MultiBody.Types.ResolveInFrame2; |
| | 1691 | extends PartialRelativeSensor; |
| | 1692 | Interfaces.Frame_resolve frame_resolve |
| | 1693 | annotation (Placement(transformation(extent={{84,44},{116,76}}), |
| | 1694 | iconTransformation(extent={{84,54},{116,86}}))); |
| | 1695 | Modelica.Blocks.Interfaces.RealOutput r_rel[3] |
| | 1696 | "Relative position vector, frame_b.r_0 - frame_a.r_0 resolved in frame defined by parameter resolveInFrame" |
| | 1697 | annotation (Placement(transformation( |
| | 1698 | origin={0,-110}, |
| | 1699 | extent={{-10,-10},{10,10}}, |
| | 1700 | rotation=270))); |
| | 1701 | |
| | 1702 | annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
| | 1703 | -100},{100,100}}), graphics={Text( |
| | 1704 | extent={{12,-76},{96,-106}}, |
| | 1705 | lineColor={0,0,0}, |
| | 1706 | textString="r_rel"), Line( |
| | 1707 | points={{36,60},{68,60},{68,70},{96,70}}, |
| | 1708 | color={0,0,0}, |
| | 1709 | smooth=Smooth.None, |
| | 1710 | pattern=LinePattern.Dot)}), |
| | 1711 | Diagram(coordinateSystem( |
| | 1712 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}), |
| | 1713 | graphics)); |
| | 1714 | equation |
| | 1715 | frame_resolve.f = zeros(3); |
| | 1716 | frame_resolve.t = zeros(3); |
| | 1717 | if resolveInFrame == ResolveInFrame2.frame_a then |
| | 1718 | r_rel = Frames.resolve2(frame_a.R, frame_b.r_0 - frame_a.r_0); |
| | 1719 | elseif resolveInFrame == ResolveInFrame2.frame_b then |
| | 1720 | r_rel = Frames.resolve2(frame_b.R, frame_b.r_0 - frame_a.r_0); |
| | 1721 | elseif resolveInFrame == ResolveInFrame2.world then |
| | 1722 | r_rel = frame_b.r_0 - frame_a.r_0; |
| | 1723 | else |
| | 1724 | r_rel = Frames.resolve2(frame_resolve.R, frame_b.r_0 - frame_a.r_0); |
| | 1725 | end if; |
| | 1726 | end RelativePosition; |
| | 1727 | |
| | 1728 | model RelativeAngles "Determine relative angles" |
| | 1729 | extends PartialRelativeSensor(final resolveInFrame = Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_a); |
| | 1730 | Modelica.Blocks.Interfaces.RealOutput angles[3] |
| | 1731 | "Angles to rotate frame_a into frame_b via 'sequence'" |
| | 1732 | annotation (Placement(transformation( |
| | 1733 | origin={0,-110}, |
| | 1734 | extent={{-10,-10},{10,10}}, |
| | 1735 | rotation=270))); |
| | 1736 | parameter Types.RotationSequence sequence( |
| | 1737 | min={1,1,1}, |
| | 1738 | max={3,3,3}) = {1,2,3} |
| | 1739 | "Angles are returned to rotate frame_a around axes sequence[1], sequence[2] and finally sequence[3] into frame_b" |
| | 1740 | annotation (Evaluate=true); |
| | 1741 | parameter SI.Angle guessAngle1=0 |
| | 1742 | "Select angles[1] such that abs(angles[1] - guessAngle1) is a minimum"; |
| | 1743 | Modelica.Mechanics.MultiBody.Frames.Orientation R_rel |
| | 1744 | "Relative orientation object from frame_a to frame_b"; |
| | 1745 | |
| | 1746 | annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
| | 1747 | -100},{100,100}}), graphics={Text( |
| | 1748 | extent={{0,-76},{110,-98}}, |
| | 1749 | lineColor={0,0,0}, |
| | 1750 | textString="angles")}),Diagram(coordinateSystem( |
| | 1751 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}), |
| | 1752 | graphics)); |
| | 1753 | equation |
| | 1754 | R_rel = Modelica.Mechanics.MultiBody.Frames.relativeRotation(frame_a.R, frame_b.R); |
| | 1755 | angles = Frames.axesRotationsAngles(R_rel, sequence, guessAngle1); |
| | 1756 | end RelativeAngles; |
| | 1757 | |
| | 1758 | model RelativeAngularVelocity "Determine relative angular velocity" |
| | 1759 | import Modelica.Mechanics.MultiBody.Frames; |
| | 1760 | extends PartialRelativeSensor; |
| | 1761 | Modelica.Blocks.Interfaces.RealOutput w_rel[3] |
| | 1762 | "Relative angular acceleration vector" |
| | 1763 | annotation (Placement(transformation( |
| | 1764 | origin={0,-110}, |
| | 1765 | extent={{-10,-10},{10,10}}, |
| | 1766 | rotation=270))); |
| | 1767 | |
| | 1768 | Modelica.Mechanics.MultiBody.Frames.Orientation R_rel |
| | 1769 | "Relative orientation object from frame_a to frame_b"; |
| | 1770 | |
| | 1771 | annotation (Icon(coordinateSystem(preserveAspectRatio=true, extent={{-100, |
| | 1772 | -100},{100,100}}), graphics={Text( |
| | 1773 | extent={{12,-76},{96,-106}}, |
| | 1774 | lineColor={0,0,0}, |
| | 1775 | textString="w_rel")}), Diagram(coordinateSystem( |
| | 1776 | preserveAspectRatio=false, extent={{-100,-100},{100,100}}), |
| | 1777 | graphics)); |
| | 1778 | equation |
| | 1779 | R_rel = Frames.relativeRotation(frame_a.R, frame_b.R); |
| | 1780 | if resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_a then |
| | 1781 | w_rel = Frames.angularVelocity1(R_rel); |
| | 1782 | elseif resolveInFrame == Modelica.Mechanics.MultiBody.Types.ResolveInFrame2.frame_b then |
| | 1783 | w_rel = Frames.angularVelocity2(R_rel); |
| | 1784 | else |
| | 1785 | w_rel = Frames.resolve1(frame_a.R, Frames.angularVelocity1(R_rel)); |
| | 1786 | end if; |
| | 1787 | end RelativeAngularVelocity; |
| | 1788 | end Internal; |