找回密码
 马上注册

QQ登录

只需一步,快速开始

查看: 5655|回复: 1

ECRobotNXT向导(4)(中英文对照)

[复制链接]
发表于 2012-5-23 18:25:36 | 显示全部楼层 |阅读模式
本帖最后由 旭日东升 于 2012-6-15 09:49 编辑

ECRobot NXT modeling guidelines
ECRobot NXT 模型导引
In the last couple of years, many new features have been added to Simulink, Stateflow, Real-Time Workshop, and Real-Time Workshop Embedded Coder products. These tools are core products for Model-Based Design. This ECRobot NXTBlockset and demo models are designed under modeling guidelines that are based on the new features of the latest MathWorks products.
在近一两年内,许多新功能加入到Simulink,Stateflow,Real-Time Workshop和Real-Time Workshop Embedded Coder产品中。这些工具是基于模型设计核心产品。ECRobot NXTBlockset和演示模型建模是基于最新的MathWorks产品新功能模块下实现。
Separation of plant and controller by Model Reference:
分离的控制对象和控制器的模型参考设计:
ECRobot NXT demo uses the Model Reference feature to split the controller and plant parts into different Simulink model files. This modeling approach allows a parallel development process for controller design and physical plant design. Simulink Buses and Bus Objects are used to keep the interface between the controller model and plant model.
ECRobot NXT的demo使用参考模型功能模块拆分成不同的Simulink模型文件,包括控制器和被控对象。这种建模方法使控制器的设计和被控对象设计并行开发设计。 Simulink的总线及其总线对象是用来保持的控制器模型同被控对象模型之间的接口联接。
10.JPG
Software environment and application architecture in controller model:
控制器模型的软件环境和应用架构
In the software industry, separation of software environment (i.e. RTOS, device API…) and target independent application software is a common technique to achieve reusability of software components and support large-scale team based development. This proven technique also can be used for Simulink controller modeling. In the ECRobot NXT controller model, the software environment (scheduler) and application Subsystem are clearly separated. Additionally, external interfaces (NXT sensors, motors, and communication device) are represented by specific interface blocks. Inside of an application Subsystem, there are Function-Call Subsystems that are executed by an Exported Function-Calls Scheduler block. The architecture of the ECRobot NXT controller model follows a real embedded software architecture, and is thus a highly readable NXT controller model that serves as an executable specification.
   在软件行业,软件环境(即实时操作系统,设备API)和独立的目标设备应用软件独立分开是一种常见的技术,以实现可重用软件组件和支持大型团队为基础的开发设计。这种成熟的技术也可用于Simulink的控制器建模。在的ECRobot NXT的控制器模型,软件环境(调度)和应用子系统明确分开。此外,外部接口(NXT的传感器,电机,通信设备)代表特定的接口模块。应用子系统内部有函数调用呼叫函数调用调度模块执行子系统。ECRobot NXT控制器模型的体系结构遵从真正的嵌入式软件架构,因而是高度可读作为NXT控制器可执行的规范模型。
55.JPG
Exported Function-Calls Scheduler controls execution timing of application Subsystems:
执行应用调度时序子系统导出函数调度控制
In general, execution of a Function-Call Subsystem is controlled by a Function-Call Generator or a Stateflow Event. Especially, Stateflow allows users to design a complex scheduler system. In ECRobot NXT, an alternative approach is introduced to control the execution timing using Function-Call Subsystems.
    在一般情况下,执行函数调用子系统控制由函数调用发生器或Stateflow事件控制。尤其是,Stateflow允许用户设计复杂的调度系统。在ECRobot NXT,另一种方法是介绍使用函数调用子系统控制的执行时机。
56.JPG
Exported Function-Calls Scheduler block is a C MEX S-Function based custom block. It provides a Block Parameters dialog to specify the necessary information for controlling the execution timing of Function-Call Subsystems. Since R2006a, Simulink and Real-Time Workshop Embedded Coder have provided an „Exporting Function-Call Subsystem code generation‟ feature that enables one to generate highly efficient void-void C functions from Function-Call Subsystems.
    导出的函数调用调度模块是C MEX S函数的自定义块。它提供了模块的参数“对话框,指定必要的参数信息完成控制函数调用子系统的执行时机。自R2006a,Simulink和Real-Time嵌入式编码器提供了“导出函数调用子系统的代码生成”功能,从而可以由函数调用子系统产生高效void-void模型的C函数。
57.JPG




Inter Function-Call Subsystems communication via Data Store Read/Write blocks:
Function-Call Subsystem is a unique feature in terms of Simulink modeling semantics. In general, execution order of each block in Simulink model is determined by its context (i.e. connection of signal lines). However, Function-Call Subsystem itself has no context for execution timing and the execution is always controlled by its caller (i.e. Stateflow Event). These characteristics sometimes lead to difficulty regarding data transfers between Function-Call Subsystems. For more detailed information, please type the following command in MATLAB command window.
>>sl_subsys_semantics
In the ECRobot NXT demo, inter Function-Call Subsystems communication has to be done by Data Store Read/Write blocks. ECRobot device blocks like Light Sensor Interface/Light Sensor Read blocks are actually masked Data Store Read/Write blocks and the block identifiers are resolved by custom NXT Signal Objects during model update. Use of Data Store Read/Write blocks solves potential issues laid down on Function-Call Subsystems communication. However, there is one thing to be reminded when using Data Store Read/Write block. Data Store Read/Write blocks cut off signal flow between the blocks; therefore, Simulink may determine an unexpected execution order for the blocks, thus users may need to explicitly specify the execution priority for each Data Store Read/Write block in block property dialog.
函数间调用子系统通过数据存储的通信读/写模块:
函数调用子系统是在Simulink建模语义方面的独特功能。一般情况下,在Simulink模型中的每个块的执行顺序取决于它的上下文(即信号线连接)。但是,函数调用子系统本身有没有执行定时的上下文和执行始终是控制它的调用者(即Stateflow的事件)。这些特点,有时会导致函数调用子系统之间的数据传输困难。如需详细资讯,请在MATLAB命令窗口中键入下面的命令。
>> sl_subsys_semantics
在ECRobot NXT的演示,函数调用间子系统通信需要通过数据存储读/写模块完成。实际上封装好的ECRobot例如光传感器接口/光传感器读取的模块设备的模块数据存储读/写模块和模块标识符由NXT的信号对象的模型在更新过程中解决。使用的数据存储读/写模块解决了函数调用子系统通信的潜在问题。然而,数据存储读/写模块保存仅仅是其中一件事情。数据存储读/写模块切断信号在模块之间的流动,因此,可确定的Simulink可以确定模块意想不到的执行顺序,因此,用户可能需要在属性对话框明确指定执行每个数据存储读/写模块优先级。
nxtconfig API for setting configuration parameters:
nxtconfig API is an M function and this API sets all necessary configuration parameters for the ECRobot NXT controller model. This kind of automation is also a significant factor for large scale Model-Based Design process, especially for Production Code Generation use cases using Real-Time Workshop Embedded Coder.
nxtconfig API用于设置配置参数:
nxtconfig API是M函数,这个API集的包含所有ECRobot NXT控制器模型的必要的配置参数。这种自动化技术也是大型的基于模型的设计过程的重要因素,特别是在使用Real-Time的嵌入式编码器作为产品开发的代码生成情况下。

70.JPG

Since the initial release of ECRobot NXT demo, a lot of feedbacks have been received and most of users are in academic area and academic users may want to use more variety types of blocks and floating-point data types. Therefore, ECRobot NXT V3.03 supports not only fixed-point/integer code generation, but also floating-point code generation (both of single and double). nxtconfig API turns off support of „floating-point numbers‟ in Real-Time Workshop option pane, therefore, user needs to turn on this option manually when doing floating-point code generation. TestFloatingPoint.mdl in samples directory is an example of floating-point code generation.
    由于ECRobot NXT的最初演示版本,已收到了很多用户反馈,这些用户大多数在学术领域和学术应用的用户可能想使用多种类型的模块和浮点数据类型。因此,ECRobot NXTV3.03不仅支持定点数据类型/整数的代码生成,而且支持浮点代码生成(single double数据类型)。nxtconfigAPI不支持Real-Time Workshop选项窗格的浮点数的支持,因此,用户需要实现浮点代码生成时需要手动开启这个选项。 TestFloatingPoint.mdl范例目录是浮点代码生成的例子。

71.JPG

72.JPG

ATMEL AT91SAM7S256 (ARM7 CPU core) in the NXT does not have Floating Point Unit and some math function blocks require C math library in the generated code, therefore please remind that floating-point code generation consumes more memory and has less performance compared to fixed-point/integer code generation.
ATMEL公司的AT91SAM7S256在NXT(ARM7 CPU核心)不具备浮点单元,在生成的代码时,部分数学函数功能处理需要C函数库文件支持,因此提醒生成浮点数的代码同定点/整数代码相比较需要消耗更多的内存和更低的性能。


如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
发表于 2012-5-23 20:25:20 | 显示全部楼层
不错的东西
如果您觉得我的帖子对您有用,请不吝给我一个“赞”!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 马上注册

本版积分规则

手机版|中文乐高 ( 桂ICP备13001575号-7 )

GMT+8, 2024-12-22 11:09 , Processed in 0.102764 second(s), 21 queries .

Powered by Discuz! X3.5

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表