文件目录下。
nxtmouse.mdl is the main model file that includes a robot plant model and a virtual track model. The control strategy is modeled in nxtmouse_ctrl.mdl file and is referenced via a Model block in nxtmouse.mdl.
nxtmouse.mdl是主仿真模块文件,该模块包括Robot被控对象和虚拟轨迹模型。在nxtmouse_ctrl.mdl文件中创建控制测略模型,并且在nxtmouse.mdl模型模块中使用。
During simulation, a Virtual Reality Viewer window and an XY Map Graph figure come up to monitor behavior of the robot in a maze.
在仿真期间,一个虚拟视图窗口和XY地图图像组合完成监*控机器人在迷宫运动行为。
NXTmouse has the following specifications. A real NXTmouse can be built by using a LEGO Mindstorms NXT Educational Kit (and an additional Light Sensor), but detailed parts
construction is different from the model used in the Virtual Reality Viewer.
NXTmouse有下列细节。真正的NXTmouse可以由LEGO Mindstorms NXT教学套件搭建(附加一个光传感器),不过具体的组装部件不同于虚拟现实视图的模型。
Model-Based Design Experience with NXTmouse:
基于模型设计的NXTmouse设计经验:
Objective: Development of a maze solving robot
Maze solving algorithms have been a popular topic in autonomous robotics. In the web, there are many good examples (i.e. micro mouse:
http://micromouse.cannock.ac.uk/index.htm). So this objective allows readers to develop a maze solving robot. Maze solver requires handling matrix data to analyze the maze, so it is also a good application for MATLAB and Simulink. There are several hints that may help readers to develop a maze solving robot.
Hint-1: Make the robot recognize walls in three directions (front/right/left sides of the robot)
NXTmouse has two different types of sensors (one Ultrasonic Sensor and two Light Sensors) to detect the walls. Both of the Ultrasonic Sensor and the Light Sensor can detect the walls without contact; however each sensor has pros and cons, so please note the characteristics of each sensor.
“The Ultrasonic Sensor measures distance in centimeters and in inches. It is able to measure distances from 0 to 255 centimeters with a precision of +/- 3 cm.”
Therefore, we assume the Ultrasonic Sensor has the following specification:
Measurement range: 0 to 255 [cm]
(If the sensor was not ready for measurement, the sensor returns -1)
Measurement width: 160 [mm] (same as the width of the robot)
Measurement period: 50 [msec] (When ambient temperature is 20 [°C], speed of sound is 343.7 [m/s]; therefore, the elapsed time to measure the maximum distance is calculated as: 2.55*2/343.7 = 0.0148 [sec])
Measurement data by the Ultrasonic Sensor in the real world is not stable due to shape of the obstacles, sensor angle against the obstacles, and temperature…, therefore, noise data is mixed to mimic the real Ultrasonic Sensor during simulation. In the Virtual Reality graphics, the surfaces of the walls are drawn as flat. However, it may cause unstable Ultrasonic Sensor measurement depending on the sensor angle against the wall in reality.
Two Light Sensors are set to detect the walls that are located on the right and left sides of the robot. The Light Sensor value varies depending on the environment (under daylight, room light, color of the walls…) and does not have linear characteristics with respect to the distance to the walls, so new algorithms are required to detect the wall effectively during run-time.
Hint-2: Make the robot recognize position and rotation angle
The robot can recognize the Servo Motor revolutions angle in degrees by using 2 Revolution Sensors; therefore the robot can recognize the position and the rotation angle. To stop at the target position and angle, control algorithms (i.e. PI controller) may be needed. The maze consists of 6 x 6 cells, with the size of a cell being 30 x 30 [cm or pixels]. Initially the robot is located at [22 15] in the maze. This means that the robot is located at the center of the first cell. If the robot can recognize the position and the rotation angle, the robot will move around much more effectively and exit the maze more quickly.
目的:设计解迷宫问题的机器人
迷宫求解算法已公布在自动化机器人的热门话题上。在网站上,有很多很好的例子(例如微型老鼠:
http://micromouse.cannock.ac.uk/index.htm的)。因此,这些方法将帮助读者开发设计解迷宫问题的机器人。迷宫的求解需要通过处理矩阵数据来分析迷宫,所以它也是一个很好的MATLAB和Simulink的应用。有以下几个提示,可以帮助读者完成解迷宫机器人的设计开发。
提示1:让机器人识别墙壁的三个方向(前/左/右的机器人)测量范围:0到255 [厘米](如果没有准备好测量传感器,传感器将返回-1)
测量宽度:160 [毫米](同机器人的宽度相同)
测量周期:50 [毫秒]
(当环境温度为20°C时,声音的速度是343.7米/秒;因此,所用的时间测量的最大距离的计算公式为:2.55 * 2/343.7 = 0.0148 [秒])
在现实测量中的超声波传感器测量数据并不稳定,由于障碍物的形状,对障碍的角度传感器,温度......,因此,噪声数据混合到仿真模拟的过程中,以模仿真实的超声波传感器实际效果。在虚拟现实的绘制图形中,绘制墙壁表面是平坦的。然而,现实中的墙壁上测量传感器的角度不同,它可能会导致不稳定的超声波传感器测量数据。位于机器人的左,右两侧两个光传感器检测墙壁。光传感器的值取决于环境(日光下,室内光线,墙壁的颜色...),同墙壁的距离不具有线性特征,这样新的算法需要实时监测墙的反射效果。
提示2:机器人可以识别的位置和旋转角度
机器人可以通过使用2个旋转传感器来识别伺服电机旋转的角度,因此,该机器人可以识别的位置和旋转角度。为了停在目标的位置和角度,可能需要控制算法(即PI控制器)实现。迷宫由30×30厘米或像素单元尺寸的6×6单元组成。最初机器人位于迷宫的[22 15]点上。这意味着,机器人位于第一个单元格的中心。如果机器人可以识别的位置和旋转角度,机器人会走动更有效和更迅速地退出迷宫。