Main Content

创建具有接口和需求链接的体系结构模型

使用System Composer™创建机器人组的架构模型。定义端口上的接口和组件上的链接要求。一个万博1manbetx®需求™需要许可才能管理要求。完成步骤后,您将创建一个完整的模型。

机器人臂结构模型

打开由传感器,运动执行器和计划算法组成的机器人组的建筑模型。您可以使用系统作曲家查看界面并管理此模型的要求。

视觉代表系统

实现架构设计始于使用组件及其连接以视觉表示系统。创建一个体系结构模型,表示系统组件,并在它们之间绘制连接。

创建体系结构模型

  1. 在matlab中®命令Window, type:

    SystemComposer

    Simu万博1manbetxlink启动页面将打开到系统作曲家。

  2. 点击体系结构模型

    从Simulink启动页面访问新的系统作曲家体系结构模型。万博1manbetx

    一个新的空白体系结构模型帆布打开。您可以通过左下角的徽章和左侧的组件调色板识别架构模型。

    一个new untitled architecture model in System Composer.

  3. 双击架构模型标题并更改无标题机器人。The name of the model generally reflects the system whose architecture you are building.

    更名为“机器人”的建筑模型。

  4. 保存模型。

绘制组件

设计一个移动机器人臂,其中传感器感应位置和轨迹计划可以计算通往机器人需要使用运动需要达到的位置的路径。这种系统的架构模型可以由三个主要组件组成:传感器,,,,轨迹计划,,,,and运动。您可以使用三个零件blocks.

  1. 点击and drag a零件从左侧调色板。

    单击并从左侧调色板中拖动组件以将其添加到体系结构模型中。

  2. 将组件重命名为传感器

  3. 添加轨迹计划and运动成分。

    带有三个组件的称为“机器人”的架构模型

创建端口和连接

您可以通过描述功率,能源,数据或任何其他代表性信息来开始在组件之间创建连接性。在提供或消耗绑定两个组件端口的信息和连接器的组件上创建端口,以表示信息流。

您可以在任何一侧添加一个端口,并且端口可以具有输入方向或输出方向。要创建一个端口,请在组件侧暂停光标。单击并发布以查看端口选项。选择输入,,,,输出, 或者身体的创建一个端口。使用代表流过该端口的信息的名称重命名端口。

  1. 在传感器组件的底部创建输出端口。重命名Sensordata

    “机器人”体系结构模型在“传感器”组件下方的“传感器数据”下方的下向下朝下的输出端口。

  2. 单击并从Sensordata输出端口到运动零件。当您看到在组件端创建的输入端口时,请释放鼠标按钮。默认情况下,此新端口的名称与源端口相同。

  3. 停在角落Sensordata线直到看到分支图标。右键单击并将分支线拖到轨迹计划零件。

    带有“传感器数据”连接的“机器人”体系结构模型,从“传感器”组件输出到“轨迹计划”和“运动”组件的两个端口。

  4. Complete the connections as shown in this figure.

    “机器人”的体系结构模型,添加一个“运动Command' connection from the 'Trajectory Planning' component to the 'Motion' component, and an 'Encoder' connection from the 'Motion' component to the 'Sensors' component.

The root level of the architecture model can also have ports that describe the interaction of the system with its environment. In this example, the target position for the robot is provided by a computer external to the robot itself. Represent this relationship with an input port.

  1. 单击架构模型的左边缘并输入端口名称目标位置

  2. 通过从目标位置input port to the轨迹计划零件。与架构端口的连接或来自架构端口的连接显示为标签。

    最终的“机器人”模型具有从“轨迹计划”组件连接到“目标位置”输入端口的体系结构端口。

Edit Data Interfaces

您可以定义数据接口以完全指定连接及其关联的端口。数据接口可以由具有各种维度,单位和数据类型的多个数据元素组成。要检查连接端口时的一致性,您还可以在组件设计期间将接口与未连接的端口相关联。

通过与属性配置数据接口,指定各个组件之间的信息流。数据接口可以像发送整数值一样简单,但是它也可以是一组数字,一组枚举,数字和字符串组合,或一包其他预定义的接口。

考虑数据接口传感器运动成分。传感器数据包括:

  • 来自两个电动机的位置数据

  • 来自两个传感器的障碍物接近数据

  • 捕获数据新鲜度的时间戳

数据具有这些规格。

姓名 Data Type 单元
时间戳 双倍的
置于电动机1的位置1 双倍的 学位
电动机2的位置2 双倍的 学位
传感器1的距离1 双倍的 meters
传感器1方向1 双倍的 学位
传感器2的距离2 双倍的 meters
方向2传感器2 双倍的 学位
  1. 导航造型>设计>Interface Editor打开接口编辑器。

  2. 点击add interfacebutton to add a data interface. Name the interfaceSensordata

    数据接口被命名并与组件端口分开定义,然后分配给端口。

  3. 点击Sensordata输出端口传感器零件。在接口编辑器中,右键单击Sensordata并选择分配选定的端口

    如果您单击Sensordata再次,三个Sensordataports are highlighted, indicating the ports are associated with that interface.

    带有紫色的三个“传感器数据”端口的模型。

  4. 将数据元素添加到选定的数据接口。点击添加数据元素按钮添加数据元素并命名时间戳

  5. 继续按单击“添加数据元素”按钮指定的数据界面添加数据元素。

  6. 编辑接口编辑器中数据元素的属性。单击与表中的数据元素相对应的单元格,并添加单位,如规范所示。

    单击旁边的下拉下拉button to save the data interface to a data dictionary. A data dictionary allows you to collectively manage and share a set of interfaces among models. For instance, later in the design, if you choose to model the external computer as a separate architecture model, then this model and the机器人模型可以共享相同的数据字典。在这里,词典被保存为机器人

    机器人DD字典带有名为“传感器数据”的接口和界面元素,名为“时间戳记”,“方向1”,方向2',距离1',距离2','位置1'和'位置2。

分解组件

每个组件可以具有自己的架构。双击组件将其分解为子组件。

  1. 双击轨迹计划零件。The title or模型浏览器指示组件在模型层次结构中的位置。

    “轨迹计划”组件的内部显示了三个称为“目标位置,“传感器数据”和“运动命令”的体系结构端口。

    该组件首先使用的电动位置数据是Sensordata接口计算理想位置和速度命令。然后,它处理同一接口中的障碍距离信息,以根据某些安全规则调节该运动命令。

  2. 添加运动控制and安全守则components as part of the轨迹计划建筑学。

    拖动目标位置端口到达运动控制零件。添加一个命令输出端口到运动控制,然后将一条线拖到安全守则零件。dragSensordata端口到达运动控制and安全守则成分。

    “轨迹计划”组件的端口连接。

管理需求链接

Requirements are integral to the systems engineering process. Some requirements relate to the functionality of the overall system, and some relate to aspects of performance such as power, size, and weight. Decomposing high-level requirements into low-level requirements and deriving additional requirements is crucial to defining the architecture of the overall system. For instance, the overall power consumption of the robot determines the requirement for the power consumption of the robot controller.

To allocate and trace requirements with system elements, System Composer fully integrates with万博1manbetxSimulink要求。To derive appropriate requirements, you must sometimes analyze and specify properties (such as power) for elements of the system including components, ports, or connectors. For example, if the total cost of the system is a concern, a单价属性是必要的。

从系统作曲家的需求角度来管理需求万博1manbetxSimulink要求。导航应用>需求经理

Requirements perspective showing requirement list and requirement links on components in the model.

为了提高要求的可追溯性,将要求与建筑组件和端口联系起来。当您在需求角度单击组件时,突出显示了链接的要求。相反,当您单击一个要求时,显示链接的组件。要直接创建链接,请将需求拖到组件或端口上。

Related Topics