TorqueSensor

model TorqueSensor "Ideal sensor to measure the torque between two flanges (= flange_a.tau)"
    extends Rotational.Interfaces.PartialRelativeSensor;

    Modelica.Blocks.Interfaces.RealOutput tau(unit = "N.m") "Torque in flange flange_a and flange_b (tau = flange_a.tau = -flange_b.tau) as output signal"
        annotation (Placement(transformation(
            origin = {-80, -110},
            extent = {
                {10, -10}, 
                {-10, 10}},
            rotation = 90)));
equation
    flange_a.phi = flange_b.phi;
    flange_a.tau = tau;

    annotation (
        Documentation(info = "<html>\n<p>\nMeasures the <strong>cut-torque between two flanges</strong> in an ideal way\nand provides the result as output signal <strong>tau</strong>\n(to be further processed with blocks of the Modelica.Blocks library).\n</p>\n</html>"),
        Icon(
            coordinateSystem(
                preserveAspectRatio = true,
                extent = {
                    {-100, -100}, 
                    {100, 100}}),
            graphics = {
                Text(
                    extent = {
                        {-50, -120}, 
                        {50, -80}},
                    textString = "tau"), 
                Line(
                    points = {
                        {-80, -100}, 
                        {-80, 0}},
                    color = {0, 0, 127})}));
end TorqueSensor;