
Embedded Robotics (Thomas Braunl, 2 ed, 2006)
.pdf
13 Simulation Systems
13.7 Actuator and Sensor Models
Propulsion model The motor model (propulsion model) implemented in the simulation is based on the standard armature controlled DC motor model [Dorf, Bishop 2001]. The transfer function for the motor in terms of an input voltage (V) and output rotational speed (T) is:
T |
K |
--- |
----------------------------------------------------- |
V |
Js b Ls R K2 |
Where:
Jis the moment of inertia of the rotor, s is the complex Laplace parameter,
b is the damping ratio of the mechanical system,
Lis the rotor electrical inductance,
Ris the terminal electrical resistance,
Kis the electro-motive force constant.
Thruster model The default thruster model implemented is based on the lumped parameter dynamic thruster model developed by [Yoerger, Cook, Slotine 1991]. The thrust produced is governed by:
Thrust = Ct ·: · |:|
Where:
: is the propeller angular velocity, Ct is the proportionality constant.
Control surfaces Simulation of control surfaces (e.g. rudder) is required for AUV types such as USAL. The model used to determine the lift from diametrically opposite fins [Ridley, Fontan, Corke 2003] is given by:
L |
|
1 |
S |
|
G |
|
v |
2 |
fin |
--UC |
fin |
e |
e |
||||
|
2 |
LGf |
|
|
||||
Where: |
|
|
|
|
|
|
||
Lfin |
is the lift force, |
|
|
|
Uis the density,
is the rate of change of lift coefficient
with respect to fin effective angle of attack, is the fin platform area,
is the effective fin angle, is the effective fin velocity
SubSim also provides a much simpler model for the propulsion system in the form of an interpolated look-up table. This allows a user to experimentally collect input values and measure the resulting thrust force, applying these forces directly to the submarine model.
186

Actuator and Sensor Models
Sensor models
Environments
Error models
The PAL already simulates a number of sensors. Each sensor can be coupled with an error model to allow the user to simulate a sensor that returns data similar to the accuracy of the physical equipment they are trying to simulate. Many of the position and orientation sensors can be directly modeled from the data available from the lower level physics library. Every sensor is attached to a body that represents a physical component of an AUV.
The simulated inclinometer sensor calculates its orientation from the orientation of the body that it is attached to, relative to the inclinometers own initial orientation. Similarly, the simulated gyroscope calculates its orientation from the attached body’s angular velocity and its own axis of rotation. The velocimeter calculates the velocity in a given direction from its orientation axis and the velocity information from the attached body.
Contact sensors are simulated by querying the collision detection routines of the low-level physics library for the positions where collisions occurred. If the collisions queried occur within the domain of the contact sensors, then these collisions are recorded.
Distance measuring sensors, such as echo-sounders and Position Sensitive Devices (PSDs) are simulated by traditional ray casting techniques, provided the low level physics library supports the necessary data structures.
A realistic synthetic camera image is being generated by the simulation system as well. With this, user application programs can use image processing for navigating the simulated AUV. Camera user interface and implementation are similar to the EyeSim mobile robot simulation system.
Detailed modeling of the environment is necessary to recreate the complex tasks facing the simulated AUV. Dynamic conditions force the AUV to continually adjust its behavior. E.g. introducing (ocean) currents causes the submarine to permanently adapt its position, poor lighting and visibility decreases image quality and eventually adds noise to PSD and vision sensors. The terrain is an essential part of the environment as it defines the universe the simulation takes part in as well as physical obstacles the AUV may encounter.
Like all the other components of the simulation system, error models are provided as plug-in extensions. All models either apply characteristic, random, or statistically chosen noise to sensor readings or the actuators’ control signals. We can distinguish two different types of errors: Global errors and local errors. Global errors, such as voltage gain, affect all connected devices. Local errors only affect a certain device at a certain time. In general, local errors can be data dropouts, malfunctions or device specific errors that occur when the device constraints are violated. For example, the camera can be affected by a number of errors such as detector, Gaussian, and salt-and-pepper noise. Voltage gains (either constant or time dependent) can interfere with motor controls as well as sensor readings.
Also to be considered are any peculiarities of the simulated medium, e.g. refraction due to glass/water transitions and condensation due to temperature differences on optical instruments inside the hull.
187

13 Simulation Systems
13.8 SubSim Application
The example in Program 13.4 is written using the high-level RoBIOS API (see Appendix B.5). It implements a simple wall following task for an AUV, swimming on the water surface. Only a single PSD sensor is used (PSD_LEFT) for wall following using a bang-bang controller (see Section 4.1). No obstacle detection is done in front of the AUV.
The Mako AUV first sets both forward motors to medium speed. In an endless loop, it then continuously evaluates its PSD sensor to the left and sets left/ right motor speeds accordingly, in order to avoid a wall collision.
Program 13.4: Sample AUV control program
1 #include <eyebot.h>
2
3int main(int argc, char* argv[])
4{ PSDHandle psd;
5int distance;
6MotorHandle left_motor;
7MotorHandle right_motor;
8psd = PSDInit(PSD_LEFT);
9PSDStart(psd, 1);
10left_motor = MOTORInit(MOTOR_LEFT);
11right_motor= MOTORInit(MOTOR_RIGHT);
12 |
MOTORDrive(right_motor, 50); |
/* medium speed */ |
13MOTORDrive(left_motor, 50);
14while(1) /* endless loop */
15 |
{ distance = PSDGet(psd); |
/* distance to left */ |
16if (distance < 100) MOTORDrive(left_motor, 90);
17else if (distance>200) MOTORDrive(right_motor, 90);
18else { MOTORDrive(right_motor, 50);
19 |
MOTORDrive(left_motor, 50); |
20}
21}
22}
The graphical user interface (GUI) is best demonstrated by screen shots of some simulation activity. Figure 13.7 shows Mako doing a pipeline inspection in ocean terrain, using vision feedback for detecting the pipeline. The controls of the main simulation window allow the user to rotate, pan, and zoom the scene, while it is also possible to link the user’s view to the submarine itself. The console window shows the EyeBot controller with the familiar buttons and LCD, where the application program’s output in text and graphics are displayed.
Figure 13.8 shows USAL hovering at the pool surface with sensor visualization switched on. The camera viewing direction and opening angle is shown as the viewing frustrum at the front end of the submarine. The PSD distance sensors are visualized by rays emitted from the submarine up to the next obstacle or pool wall (see also downward rays in pipeline example Figure 13.7).
188

SubSim Application
Figure 13.7: Mako pipeline following
Figure 13.8: USAL pool mission
189

13 Simulation Systems
13.9 SubSim Environment and Parameter Files
Simulation file SUB
XML (Extensible Markup Language) [Quin 2006] has been chosen as the basis for all parameter files in SubSim. These include parameter files for the overall simulation setup (.sub), the AUV and any passive objects in the scenery (.xml), and the environment/terrain itself (.xml).
The general simulation parameter file (.sub) is shown in Program 13.5. It specifies the environment to be used (inclusion of a world file), the submarine to be used for the simulation (here: link to Mako.xml), any passive objects in the simulation (here: buoy.xml), and a number of general simulator settings (here: physics, view, and visualize).
The file extension “.sub” is being entered in the Windows registry, so a double-click on this parameter file will automatically start SubSim and the associated application program.
Program 13.5: Overall simulation file (.sub)
1<Simulation>
2<Docu text="FloorFollowing Example"/>
3<World file="terrain.xml" />
4
5<WorldObjects>
6<Submarine file="./mako/mako.xml"
7 |
hdtfile="./mako/mako.hdt"> |
8<Client file="./floorfollowing.dll" />
9</Submarine>
10<WorldObject file="./buoy/buoy.xml" />
11</WorldObjects>
12
13<SimulatorSettings>
14<Physics noise="0.002" speed="40"/>
15<View rotx="0" roty="0" strafex="0" strafey="0"
16zoom="40" followobject="Mako AUV"/>
17<Visualize psd="dynamic"/>
18</SimulatorSettings>
19</Simulation>
Object file XML
The object xml file format (see Program 13.6) is being used for active objects, i.e. the AUV that is being controlled by a program, as well as inactive objects, e.g. floating buoys, submerged pipelines, or passive vessels.
The graphics section defines the AUV’s or object’s graphics appearance by linking to an ms3d graphics model, while the physics section deals with all simulation aspects of the object. Within the physics part, the primitives section specifies the object’s position, orientation, dimensions, and mass. The subsequent sections on sensors and actuators apply only to (active) AUVs. Here, relevant details about each of the AUV’s sensors and actuators are defined.
190

SubSim Environment and Parameter Files
Program 13.6: AUV object file for the Mako
1<?xml version="1.0"?>
2<Submarine name="Mako AUV">
3<Origin x="10" y="0" z="0"/>
4<Graphics>
5<Origin x="0" y="0" z="0"/>
6<Scale x="0.18" y="0.18" z="0.18" />
7<Modelfile="mako.ms3d" />
8</Graphics>
9<Noise>
10<WhiteNoise strength="5.0" connects="psd_down" />
11<WhiteNoise strength="0.5" connects="psd_front"/>
12</Noise>
13
14<Physics>
15<Primitives>
16<Box name="Mako AUV">
17<Position x="0" y="0" z="0" />
18<Dimensions width="1.8" height="0.5"
19 |
depth="0.5" /> |
20<Mass mass= "0.5"> </Mass>
21</Box>
22</Primitives>
23
24<Sensors>
25<Velocimeter name="vel0">
26<Axis x="1" y="0" z="0"></Axis>
27<Connection connects="Mako AUV">
28</Connection>
29</Velocimeter>
30...
31</Sensors>
32
33<Actuators>
34<ImpulseActuator name="fakeprop1">
35<Position x="0" y="0" z="0.25"></Position>
36<Axis x="1" y="0" z="0"></Axis>
37<Connection connects="Mako AUV"></Connection>
38</ImpulseActuator>
39...
40<Propeller name="prop0">
41<Position x="0" y="0" z="0.25"></Position>
42<Axis x="1" y="0" z="0"></Axis>
43<Connection connects="Mako AUV"></Connection>
44<Alpha lumped="0.05"></Alpha>
45</Propeller>
46...
47</Actuators>
48</Physics>
49</Submarine>
191

13 Simulation Systems
World file XML
The world xml file format (see Program 13.7) allows the specification of typical underwater scenarios, e.g. a swimming pool or a general subsea terrain with arbitrary depth profile.
The sections on physics and water set relevant simulation parameters. The terrain section sets the world’s dimensions and links to both a height map and a texture file for visualization. The visibility section affects both the graphics representation of the world, and the synthetic image that AUVs can see through their simulated on-board cameras. The optional section WorldObjects allows to specify passive objects that should always be present in this world setting (here a buoy). Individual objects can also be specified in the “.sub” simulation parameter file.
Program 13.7: World file for a swimming pool
1<?xml version="1.0"?>
2<World>
3<Environment>
4<Physics>
5<Engine engine="Newton" />
6<Gravity x="0" y="-9.81" z="0" />
7</Physics>
8 |
<Water density="1030.0"linear_viscosity="0.00120" |
9 |
|
10 |
angular_viscosity="0.00120"> |
11<Dimensions width="24" length="49" />
12<Texture file="water.bmp" />
13</Water>
14
15<Terrain>
16<Origin x="0" y="-3" z="0" />
17<Dimensions width="25" length="50" depth="4" />
18<Heightmap file="pool.bmp" />
19<Texture file="stone.bmp" />
20</Terrain>
21
22<Visibility>
23<Fog density="0.0" depth="100" />
24</Visibility>
25</Environment>
26
27<WorldObjects>
28<WorldObject file="buoy/buoy.xml" />
29</WorldObjects>
30</World>
192

References
13.10 References
BRÄUNL, T. Research Relevance of Mobile Robot Competitions, IEEE Robotics and Automation Magazine, vol. 6, no. 4, Dec. 1999, pp. 32-37 (6)
BRÄUNL, T., STOLZ, H. Mobile Robot Simulation with Sonar Sensors and Cameras, Simulation, vol. 69, no. 5, Nov. 1997, pp. 277-282 (6)
BRÄUNL, T. KOESTLER, A. WAGGERSHAUSER, A. Mobile Robots between Sim-
ulation & Reality, Servo Magazine, vol. 3, no. 1, Jan. 2005, pp. 43-50
(8)
COIN3D, The Coin Source, http://www.Coin3D.org, 2006
DORF, R. BISHOP, R. Modern Control Systems, Prentice-Hall, Englewood Cliffs NJ, Ch. 4, 2001, pp 174-223 (50)
KOESTLER, A., BRÄUNL, T., Mobile Robot Simulation with Realistic Error Models, International Conference on Autonomous Robots and Agents, ICARA 2004, Dec. 2004, Palmerston North, New Zealand, pp. 46-51
(6)
KONOLIGE, K. Saphira Version 6.2 Manual, [originally: Internal Report, SRI, Stanford CA, 1998], http://www.ai.sri.com/~konolige/ saphira/, 2001
KUFFNER, J., LATOMBE, J.-C. Fast Synthetic Vision, Memory, and Learning Models for Virtual Humans, Proceedings of Computer Animation, IEEE, 1999, pp. 118-127 (10)
LECLERCQ, P., BRÄUNL, T. A Color Segmentation Algorithm for Real-Time Object Localization on Small Embedded Systems, in R. Klette, S. Peleg, G. Sommer (Eds.), Robot Vision 2001, Lecture Notes in Computer Science, no. 1998, Springer-Verlag, Berlin Heidelberg, 2001, pp. 6976 (8)
MATSUMOTO, Y., MIYAZAKI, T., INABA, M., INOUE, H. View Simulation Sys-
tem: A Mobile Robot Simulator using VR Technology, Proceedings of the International Conference on Intelligent Robots and Systems, IEEE/ RSJ, 1999, pp. 936-941 (6)
MILKSHAPE, Milkshape 3D, http://www.swissquake.ch/chumbalum-soft, 2006
NEWTON, Newton Game Dynamics, http://www.physicsengine.com, 2006 QUIN, L., Extensible Markup Language (XML), W3C Architecture Domain,
http://www.w3.org/XML/, 2006
RIDLEY, P., FONTAN, J., CORKE, P. Submarine Dynamic Modeling, Australasian Conference on Robotics and Automation, CD-ROM Proceedings, 2003, pp. (6)
TINYXML, tinyxml, http://tinyxml.sourceforge.net, 2006
193

13 Simulation Systems
TRIEB, R. Simulation as a tool for design and optimization of autonomous mobile robots (in German), Ph.D. Thesis, Univ. Kaiserslautern, 1996
WANG, L., TAN, K., PRAHLAD, V. Developing Khepera Robot Applications in a Webots Environment, 2000 International Symposium on Micromechatronics and Human Science, IEEE, 2000, pp. 71-76 (6)
WXWIDGETS, wxWidgets, the open source, cross-platform native UI framework, http://www.wxwidgets.org, 2006
YOERGER, D., COOKE, J, SLOTINE, J. The Influence of Thruster Dynamics on Underwater Vehicle Behaviours and their Incorporation into Control System Design, IEEE Journal on Oceanic Engineering, vol. 15, no. 3, 1991, pp. 167-178 (12)
194
PART III:
MOBILE ROBOT APPLICATIONS
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .. .. .. .. .
195