Skip to content
LIBRARY
tests.DrivingWheelSetTest.md

tests.DrivingWheelSetTest

Driving Wheel Set Test

Ported from the Multibody.jl DrivingWheelSet test (test_wheels.jl). Two sinusoidal torques drive a rolling wheelset; the wheelset carries a small body via a fixed translation. Smoke test that the no-slip rolling constraint integrates with the rotational drives.

Usage

MultibodyComponents.tests.DrivingWheelSetTest()

Behavior

Source

dyad
"""
# Driving Wheel Set Test

Ported from the Multibody.jl `DrivingWheelSet` test (test_wheels.jl).
Two sinusoidal torques drive a rolling wheelset; the wheelset carries a
small body via a fixed translation. Smoke test that the no-slip rolling
constraint integrates with the rotational drives.
"""
example component DrivingWheelSetTest
  world = MultibodyComponents.World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  wheels = MultibodyComponents.RollingWheelSet(radius = 0.1, m_wheel = 0.5, I_axis = 0.01, I_long = 0.02, track = 0.5, x(initial = 0.1), z(initial = 0.1)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 350, "x2": 550, "y2": 450, "rot": 0}
      },
      "tags": []
    }
  }
  bar = MultibodyComponents.FixedTranslation(r = [0.2, 0, 0]) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 570, "y1": 450, "x2": 670, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  body = MultibodyComponents.Body(m = 0.01) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 830, "y1": 450, "x2": 930, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  sine1 = BlockComponents.Sources.Sine(amplitude = 2, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 145, "y1": 25, "x2": 245, "y2": 125, "rot": 0}
      },
      "tags": []
    }
  }
  sine2 = BlockComponents.Sources.Sine(amplitude = 2, frequency = 1, phase = π / 2) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 940, "y1": 40, "x2": 840, "y2": 140, "rot": 0}
      },
      "tags": []
    }
  }
  torque1 = RotationalComponents.Sources.TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 280, "y1": 25, "x2": 380, "y2": 125, "rot": 0}
      },
      "tags": []
    }
  } # TODO: should be Torque2 but this is missing https://github.com/JuliaComputing/RotationalComponents/issues/124
  torque2 = RotationalComponents.Sources.TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 790, "y1": 40, "x2": 690, "y2": 140, "rot": 0}
      },
      "tags": []
    }
  } # TODO: should be Torque2 but this is missing https://github.com/JuliaComputing/RotationalComponents/issues/124
relations
  connect(sine1.y, torque1.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(sine2.y, torque2.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque1.spline, wheels.axis1) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 450, "y": 75}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(torque2.spline, wheels.axis2) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 550, "y": 90}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(wheels.frame_middle, bar.frame_a) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 500, "y": 500}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(bar.frame_b, body.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque1.support, wheels.support) {
    "Dyad": {
      "renderStyle": "standard",
      "edges": [{"S": 1, "M": [{"x": 330, "y": 244.5}, {"x": 500, "y": 244.5}], "E": 2}]
    }
  }
  connect(torque2.support, wheels.support) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 740, "y": 240}, {"x": 500, "y": 240}], "E": 2}],
      "renderStyle": "standard"
    }
  }
end
Flattened Source
dyad
"""
# Driving Wheel Set Test

Ported from the Multibody.jl `DrivingWheelSet` test (test_wheels.jl).
Two sinusoidal torques drive a rolling wheelset; the wheelset carries a
small body via a fixed translation. Smoke test that the no-slip rolling
constraint integrates with the rotational drives.
"""
example component DrivingWheelSetTest
  world = MultibodyComponents.World() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 20, "y1": 20, "x2": 120, "y2": 120, "rot": 0}
      },
      "tags": []
    }
  }
  wheels = MultibodyComponents.RollingWheelSet(radius = 0.1, m_wheel = 0.5, I_axis = 0.01, I_long = 0.02, track = 0.5, x(initial = 0.1), z(initial = 0.1)) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 450, "y1": 350, "x2": 550, "y2": 450, "rot": 0}
      },
      "tags": []
    }
  }
  bar = MultibodyComponents.FixedTranslation(r = [0.2, 0, 0]) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 570, "y1": 450, "x2": 670, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  body = MultibodyComponents.Body(m = 0.01) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 830, "y1": 450, "x2": 930, "y2": 550, "rot": 0}
      },
      "tags": []
    }
  }
  sine1 = BlockComponents.Sources.Sine(amplitude = 2, frequency = 1) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 145, "y1": 25, "x2": 245, "y2": 125, "rot": 0}
      },
      "tags": []
    }
  }
  sine2 = BlockComponents.Sources.Sine(amplitude = 2, frequency = 1, phase = π / 2) {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 940, "y1": 40, "x2": 840, "y2": 140, "rot": 0}
      },
      "tags": []
    }
  }
  torque1 = RotationalComponents.Sources.TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 280, "y1": 25, "x2": 380, "y2": 125, "rot": 0}
      },
      "tags": []
    }
  } # TODO: should be Torque2 but this is missing https://github.com/JuliaComputing/RotationalComponents/issues/124
  torque2 = RotationalComponents.Sources.TorqueSource() {
    "Dyad": {
      "placement": {
        "diagram": {"iconName": "default", "x1": 790, "y1": 40, "x2": 690, "y2": 140, "rot": 0}
      },
      "tags": []
    }
  } # TODO: should be Torque2 but this is missing https://github.com/JuliaComputing/RotationalComponents/issues/124
relations
  connect(sine1.y, torque1.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(sine2.y, torque2.tau) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque1.spline, wheels.axis1) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 450, "y": 75}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(torque2.spline, wheels.axis2) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 550, "y": 90}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(wheels.frame_middle, bar.frame_a) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 500, "y": 500}], "E": 2}],
      "renderStyle": "standard"
    }
  }
  connect(bar.frame_b, body.frame_a) {"Dyad": {"edges": [{"S": 1, "M": [], "E": 2}], "renderStyle": "standard"}}
  connect(torque1.support, wheels.support) {
    "Dyad": {
      "renderStyle": "standard",
      "edges": [{"S": 1, "M": [{"x": 330, "y": 244.5}, {"x": 500, "y": 244.5}], "E": 2}]
    }
  }
  connect(torque2.support, wheels.support) {
    "Dyad": {
      "edges": [{"S": 1, "M": [{"x": 740, "y": 240}, {"x": 500, "y": 240}], "E": 2}],
      "renderStyle": "standard"
    }
  }
metadata {}
end


Test Cases

No test cases defined.

  • Examples

  • Experiments

  • Analyses