A Simulation Framework for Robotic System Design

0 downloads 0 Views 439KB Size Report
David Wilkie∗. Rich Primerano†. William Regli∗†‡. ∗Department of Computer Science,. †Department of Electrical and Computer Engineering,. ‡Department of ...
Proceedings of the ASME 2007 International Design Engineering Technical Conferences & Computers and Information in Engineering Conference IDETC/CIE 2007 September 4-7, 2007, Las Vegas, Nevada, USA

DETC2007-35645

A SIMULATION FRAMEWORK FOR ROBOTIC SYSTEM DESIGN

David Wilkie∗

Rich Primerano†

William Regli∗†‡

∗Department

of Computer Science, of Electrical and Computer Engineering, ‡Department of Mechanical Engineering and Mechanics, College of Engineering, Drexel University, 3141 Chestnut Street, Philadelphia, PA 19104, USA. {wilkie, rap34, regli}@drexel.edu †Department

ABSTRACT This paper proposes a framework for the physically based modeling of robotic systems. The framework focuses on integrating a mechanical engineering assembly model with an electrical engineering controller model in a co-simulation. The simulated results can be used for the evaluation of robotic system designs. This paper surveys existing algorithms and software packages that could be used to implement the framework. The framework is illustrated using a biologically inspired robot as a case-study.

lar to those stated above. This paper is organized as follows. The section titled “demonstration system” discusses the nature of the robotic system used as a case study. The section titled “framework” discusses the framework for robotic system design and evaluation. The section titled “implementation approaches” discusses the possible combinations of tools that could be used to implement the framework. The section titled “case study” discusses the application of this framework to our demonstration robot. The section titled “conclusion” describes the challenges encountered in the case study.

INTRODUCTION Simulatable models of robotic systems offer roboticists a method of answering some design questions that is cheaper and faster than physical prototyping. For example, consider the case in which a designer is sizing actuators for a robotic device. The required motor size may be influenced by the robot’s mass, an attribute of the mechanism, or by a required step response, an attribute of the controller. As another example, a designer may want to control a multi-axis robot with several independent controllers. Co-simulation of mechanism and controller would reveal coupling between axes through higher order forces, requiring a more complex multi-axis controller. This framework focuses on going from a computer-aided design (CAD) model of a robotic system to a simulation with an integrated controller model. This simulation could be used to address problems simi-

DEMONSTRATION SYSTEM A biologically inspired mobile robot served as the demonstration system for this framework. This robot has a high number of degrees of freedom due to its snake-like backbone and numerous legs. This complexity makes the robot a good choice for the case-study. The robot was designed to achieve locomotion over rough terrain faster than current snake-like robot designs. The design includes a linkage of modular segments similar to what would be found in a snake-like robot. Additionally, each rib of the robot has two feet for locomotion. Figure 1(a) shows a rendering of the robotic snake. The robot contains fourteen ribs and is approximately 30” long. At the bottom of each rib is a pair of feet to 1

c 2007 by ASME Copyright

Ribs

Cam Tail Head Drive Motor

(a) Detailed Rendering.

One Segment

Processor Segment

Motor Segment Foot

Figure 2. Components found on a typical rib.

Articulating Motor

Feet

(b) A look at three adjacent ribs. Figure 1.

Robotic Snake.

propel the robot forward. Forward motion is powered by a drive motor located at the tail of the snake. Figure 1(b) shows a zoomed in view of three adjacent ribs. From this picture, it is clear that all fourteen ribs are not identical. The robot is composed of two types of ribs: the first contains two servo motors used for articulation, and the second contains a circuit board and batteries. These are named “motor ribs” and “processor ribs” respectively. Starting from the head of the snake, ribs alternate between motor and processor type. There are a total of seven motor ribs and seven processor ribs. The design is such that (referring to Figure 1) the motors located on a particular motor segment are driven by the circuitry located on the processor board immediately behind it. For this reason, addition and removal of ribs must be done in pairs. A pair of ribs, one motor rib and one processor rib, will be referred to as a segment. The robot uses two types of motors. The first is the drive motor (Figure 1) located at the rear of the snake. This motor transmits power to all upstream ribs to power a series of ”feet” on the bottom of the snake. Figure 2 shows the components responsible for this and how they are positioned on the robot’s rib. The basic function of this mechanism is to take rotary motion applied to the cam and convert it to orbital motion in the feet. Figure 3 shows six sequential frames that demonstrate the operation of the mechanism. The second type of motor found on the robot is for articulation (Figure 1). Each motor segment contains two such motors.

Figure 3. Sequence showing operation of foot mechanism.

These are responsible for articulating the segment on which they are located. These two motors provide two degrees of freedom per segment, enabling horizontal and vertical rotation with respect to the ground.

FRAMEWORK The framework, shown in Figure 4, focuses on modeling a robotic system. A robotic system here is comprised principally of a controller and a mechanism. The framework is presented as a UML activity diagram centered around the co-simulation of the two models for the purpose of carrying out some evaluation experiment. An unsatisfactory evaluation indicates that redesign or remodeling needs to be done. Part Modeling (PM). This activity involves the creation of geometric models with attributes representing physical properties. The resulting model consists of shape data, such as geometry, topology, and features, non-shape data, such as units and precision, design data, such as mass and finite element meshes, and manufacturing data, such as tolerances and process planning [1]. 2

c 2007 by ASME Copyright

Part Modeling

that allows one rotational degree of freedom around a specified axis. The specifying of these constraints is the second component of assembly modeling. Simulation Modeling (SM). The assembly model can be simplified or abstracted in order to reduce the computational cost of the simulation. This typically involves reducing the number of parts, the number of constraints, or the geometric complexity of the parts. Part models tessellation is a common example of simulation modeling. Controller Modeling (CM). Controllers, in this sense, include everything from the simple P controller to complex, multilayered architectures. In some manner, they map human specified objectives to actual motor commands. The controller model is typically some combination of logic, mathematics, and programming. Co-Simulation (CS). This activity consists of the simulation of forces applied to the simulation model. These forces arise from the environment, collisions, and from the simulated controller. Motors and sensors are captured implicitly in this process. In addition to the robot and controller models, the simulation needs an environment in which to take place. Robot Evaluation (RE). This function uses the data output from the simulator to determine if the robot design performed at a satisfactory level for some set of criteria. For example, the robot could be evaluated based on speed or power usage. Controller Evaluation (CE). The output of the simulation can also be used to judge the controller according to some criteria. This could indicate the success or failure of a control architecture’s attempt to achieve some behavior, or it could simply indicate that the controller needs to be tuned differently.

Controller Modeling

Assembly Modeling

Simulation Modeling

[unsatisfactory]

[unsatisfactory] Co-simulation

Mechanism Evaluation

Controller Evaluation

[satisfactory] [satisfactory]

Figure 4. Co-Simulation Design Activity Framework. This activity diagram shows how a design should progress under the framework.

IMPLEMENTATION APPROACHES This section presents existing tools and algorithms that could be used to implement the framework described in the previous section. Table 5 shows the activities of the framework as columns and the tools that can implement one or more activities as rows.

Assembly Modeling (AM). Assembly modeling combines two activities. First, the parts are copied into a common space. They are translated and rotated into the correct spatial arrangement. This process is similar to what is done during physical robot assembly. In the physical world, this would be the total assembly process. Joint behavior arises from parts applying forces to each other. In the digital world, and in analytical mechanics generally, there is a conceptual difference between the forces acting on the mechanism due to collisions and those due to mechanism connectivity. These latter forces are called constraints and are modeled by specifying the spatial freedom of movement, or degrees of freedom, between parts [2]. For example, a hinge joint would be modeled as a constraint between the two parts involved

Part Modeling In engineering, part modeling is typically done with computer-aided design tools (CAD). As defined in [1], CAD tools combine computer graphics, geometric modeling, and design tools. CAD tools are used to create highly detailed and accurate models that include information for manufacturing. Models of this detail are sometimes not needed. Simpler part modeling can be done within certain simulation tools. 3

c 2007 by ASME Copyright

CAD

PM X

AM X

SM

CM

CS

ABD

a, d

Collision Detection

a, d

Mesh Simplification

b

R MATLAB

Adaptive Dynamics

X

a, c

X

d, e

X

X

b

SW Controller

Figure 5.

CE

X

Visualization

ISE

RE

X

X

b

c, e

X

This chart shows the activities of the design framework and the

tools for implementing the activities. A checkmark signifies that the tool named at the beginning of the row can implement the activity listed at the top of the column. A letter indicates that the tools sharing the letter can act together to implement the activity. CAD is computer-aided design.

ABD is articulated-body dynamics. SW Controller is a controller that has been modeled as software. ISE is an integrated simulation environment, which consists of an articulated-body dynamics integrator, collision

Simulation Modeling The majority of tools suitable for simulation modeling are geometric simplifiers. Geometric simplification is the process of finding surrogate geometric models to represent parts. This can be done by simplifying the part models directly or by replacing them with some simpler geometry. For example, a cam part could be replaced by a convex hull or bounding shape. Or the part could be tessellated and then simplified with a mesh simplification algorithm. Mesh simplification is the process of reducing the number of polygons used to represent a shape. This reduction implies that fewer geometric primitives need to be considered during collision detection, reducing the computational cost of a simulation. A vast number of algorithms for mesh simplification exist of many different types. A detailed survey of algorithms can be found in [3]. A shorter, more abstract survey can be found in [4]. A recent survey aimed toward developers can be found in [5]. And a comparison of simplification algorithms can be found in [6]. Even if the highest fidelity simulation is desired, mesh simplification is useful for CAD data. CAD programs often tessellate their part models excessively, as mentioned in [5]: areas such as flat surfaces could be represented by far more polygons than needed due to the tessellation algorithm used. Mesh simplification can remove excess polygons without modifying the mesh’s geometry. There are three ways mesh simplification is typically done [4]: (1) Vertex clustering. Rossignac and Borrel [7] proposed the vertex clustering technique for mesh simplification: it consists of recursively partitioning the space encompassing the mesh and joining all mesh vertices that share a partition into a new vertex. (2) Vertex decimation. Schroeder et al. [8] proposed the technique of vertex decimation: it consists of deleting a vertex and its dependent faces and retessellate the hole created. (3) Edge collapse. This is a popular mesh reduction strategy in which two vertices are selected and joined to create a new vertex at some in-between point. Garland [9] proposed using the quadric error metric, which efficiently measures the simplification error in terms of the distances to a set of planes to guide the selection of vertices to join. Figure 6 shows Garland’s algorithm applied to a segment of the demonstration robot.

detection, visualization, and some level of geometric modeling. An ISE would also have a rudimentary controller model, but this was considered too simple to suffice for controller modeling. PM is part modeling. AM is assembly modeling. SM is simulation modeling. CM is controller modeling. CS is co-simulation. RE is robot evaluation. CE is controller evaluation.

Assembly Modeling CAD tools now have the ability to do assembly modeling as well as part modeling. However, assembly models created in CAD can be difficult to map to assembly models appropriate for simulation. In CAD, parts are represented in a solid representation. Therefore, the constraints between parts can be described in terms of features of the solid representation. For example, if a CAD system is using boundary representations for its parts, a constraint could be between a face and an edge [1]. However, these features will not be explicit in the polygonal mesh geometries used in simulation models.

A non-geometric approach to simulation model simplification is adaptive dynamics, proposed in [10]. Adaptive dynamics is the process of using an error metric to automatically reduce the number of degrees of freedom active in a simulation. Those joints that contribute the least to the overall motion of the mechanism are rigidified, reducing the model’s complexity. A simulation model can also be created by replacing the assembly model with a simpler assembly model that approximates

Alternatively, assembly modeling can be done within a simulation program by either importing the part models or creating them locally and then specifying their spatial relations and constraints. 4

c 2007 by ASME Copyright

els. Most articulated-body dynamics simulators are solely concerned with rigid bodies, parts in which every pair of points maintains their distance from each other throughout the computation. A survey of robot dynamics algorithms can be found in [11]. Featherstone, the co-author of the survey, also devised the Divide-and-Conquer algorithm for rigid-body dynamics [12]. Numerous libraries, commercial and open source, exist that implement rigid-body dynamics algorithms. Some popular libraries include PhysxTM2 , a commercial library which is used in numerous video games and in the Microsoft Robotics Studio3 , HaR another commercial library used for many video games, vok4 , Open Dynamics EngineTM, the de facto standard open source rigid-body dynamics library, and BulletTM5 , a more recent open source rigid-body dynamics library. A survey of some of these libraries can be found in [13]. The commercial program Adams6 is a widely used simulation package capable of articulated-body dynamics as well as part and assembly modeling. Articulated-body dynamics algorithms handle the physical aspects of the simulation. To capture the geometric aspects of a simulation, collision detection libraries are needed. Collision detection is the determination of whether geometries interfere as they translate and rotate through space and time. The contacts found by a collision detection process are incorporated into the simulation, resulting in forces and torques on the robot. CAD data and mobile robotics pose specific challenges. CAD parts are generally in a non-polygonal format and need to be tessellated. The geometry of a robot’s components are also likely to be non-convex, implying that a convex decomposition preprocessing step is needed for many collision detection algorithms to be applicable. Collisions need to be calculated to a high degree of accuracy for mobile robots as their trajectory and behavior depends upon these contacts. A recent survey of collision detection algorithms [14] characterized the algorithms into four categories based on how each tests for collisions in a dynamic environment.

vi vj

vi

Figure 6. Mesh simplification via Edge Collapse. A segment of the robot with 33,984 triangles is simplified to 3,492 triangles.

the original. This substitution reduces the degrees of freedom, number of bodies, or complexity of joints in the system and thus reduces the computational cost1 . The authors were not aware of any tool to automatically create or validate substitutions of this type.

Space-Time Volume Intersection. This class of algorithms checks for intersections between the extruded volumes of the objects of concern. These extruded volumes are spatiotemporal points representing the area moved through by the objects over time. For a 3D scene, 4D volumes need to be generated. This technique is too computationally costly for practical application. Swept Volume Interference. These algorithms check for intersections between swept volumes, which are the set of points an object moves through over some time period. These differ from extruded volumes as they are purely spatial: a swept volume of a 3D sphere is a 3D structure containing all the

Controller Modeling R a powerController modeling can be done in MATLAB , ful numerical computation program. The Simulink addition to R allows the creation of controllers through a graphMATLAB ical interface and connectivity to simulation software such as Adams as well. Controllers can also be modeled in a programming language. The resulting program would have to interact with the simulation in real time, unless an open-looped controller was used. Co-Simulation The core component of robotic co-simulation is articulatedbody dynamics. Articulated-body dynamics encompasses the computation of forward and inverse dynamics for assembly mod-

2 http://www.ageia.com/physx/index.html 3 http://msdn2.microsoft.com/en-us/robotics/default.aspx 4 http://www.havok.com/ 5 http://www.continuousphysics.com/Bullet/

1 http://ode.org/ode-latest-userguide.html

6 http://www.mscsoftware.com/products/adams.cfm

5

c 2007 by ASME Copyright

points the sphere moved through. Multiple Interference. The most computationally efficient approach to collision detection in dynamic scenes is what the authors of [14] called multiple interference. This class of algorithms is based on sampling the time over which collisions are being checked for and stepping back to the point of contact when a collision is found. This reduces the problem to a series of static interference checks, but can miss collisions that are very brief. Trajectory Parameterization. These are approaches to collision detection in which the trajectories of each object are expressed in terms of a function of time.

Figure 7.

Simulation Modeling. An exported Parasolid format assembly initially served as the simulation model. Once imported into Adams, the constraints between the parts had to be redefined. Internal to Adams, these models were tessellated to reduce the computational cost of collision detection. The model that was simulated consisted of only four connected segments. This was done in order to limit computational time. Simulating just four segments over a three second run took over half an hour. Controller Modeling. A series of uncoupled PID motor controllers served as the controller model. This was created in R with the Simulink addition. The drive motor MATLAB was given a fixed rate of two revolutions per second. Co-Simulation. The co-simulation process is depicted in FigR acted as the controller, passing ure 7. Here, MATLAB torque values to Adams. At each time step, Adams took these torque inputs and numerically solved the system of equations that model the mechanism. Adams then checked for collisions that had occurred and incorporated these into its equations. At the end of the simulation time step, senR which updated sor data was passed back to MATLAB , the applied torque values and began another simulation time step. This process continued until the simulation time had elapsed. Robot Evaluation. The co-simulation calculated the robot’s velocity at 3.71 cm/sec. This speed would compare favorably to snake-like robots relying on a crawling gate. However, the question of whether this speed is fast enough is mission specific. Controller Evaluation. The controller used was sufficient for the task at hand: it kept the robot going straight. It is clearly too simple for advanced activity. For behaviors such as line following, additional layers of control need to be added.

Collision detection algorithms also differ in the techniques they use to limit the number of objects being considered as possibly colliding. These techniques typically involve either bounding the objects in a hierarchical way or subdividing the space. Robot and Controller Evaluation Evaluation of the robot and controller depends upon values calculated by the co-simulation process. For simple analysis, inspection of these values suffices. In this case, the tool needed is simply the simulator that was used for the co-simulation process. For more complex analysis, the data can be imported into a numerical computation program. Visualization tools are also useful for evaluating the performance of a robot. CASE STUDY This section describes the application of the framework to the robot described in the “demonstration system” section. The robot’s design objectives included (1) a small body diameter, (2) a modular design, and (3) the ability to achieve fast rectilinear movement. The modular design and small body diameter objectives could be verified by inspection. The experiment undertaken within this framework was to calculate the robot’s simulated velocity. Part Modeling. The robot’s parts were modeled in R This collection of parts contained only Pro/ENGINEER7 . unique parts, which were not located in a common space. Assembly Modeling. The robot assembly model was created R Subassemblies were created for the in Pro/ENGINEER . feet, the rocker, and other components by referencing parts from the collection mentioned above, positioning and orienting these parts in space, and specifying the constraints between the parts. These subassemblies were combined into assemblies for the board rib and the motor rib, which were combined into an assembly for a full segment. The full robot assembly contains fourteen instances of this segment assembly.

7 http://www.ptc.com

Co-simulation.

CONCLUSION Importing a CAD model of a robotic system into a software package capable of co-simulation proved to be a complicated process. The simulation software adopted for the case study, MSC Adams, had the ability to import an assembly as a Para6

c 2007 by ASME Copyright

solid, but the constraints had to be redefined. There was no support for importing an assembly of polygonal mesh geometries. To use polygonal mesh geometries, Adams command scripts had to be written that replaced the Parasolid parts with polygonal meshes. MSC Adams also had poor support for collision detection. The software relies on the RAPID library [15], an efficient pairwise interference detection package. This package, while efficient at pair-wise interference detection, is not suited for a large number of bodies that could possibly collide. The user interface for the collision detection system was difficult to use: for every object x, the user needed to specify every object y with which x could collide. There were no collisions by default. The computational cost of the simulation was very high. The three second simultation took over half an hour to compute.

[9] Garland, M., and Heckbert, P., 1997. “Surface simplification using quadric error metrics”. In International Conference on Computer Graphics and Interactive Techniques (SIGGRAPH proc.), ACM Press/Addison-Wesley Publishing Co. New York, NY, USA, pp. 206–216. [10] Lin, M., Redon, S., and Galoppo, N., 2005. “Adaptive dynamics of articulated bodies”. In International Conference on Computer Graphics and Interactive Techniques (SIGGRAPH proc.), pp. 936–945. [11] Featherstone, R., and Orin, D., 2000. “Robot dynamics: Equations and algorithms”. IEEE International Conference on Robotics and Automation, 1, pp. 826–834. [12] Featherstone, R., 1999. “A divie-and-conquer articulatedbody algorithm for parallel o(log(n)) calculation of rigidbody dynamics. part 1: Basic algorithm”. The International Journal of Robotics Research, 18(9), pp. 867–875. [13] Seuling, A., and Rolin, M., 2006. “Evaluation of physics engines and implementation of a physics module in a 3dauthoring tool”. Master’s thesis, Umea University. [14] Jimenez, P., Thomas, F., and Torras, C., 2001. “3d collision deteciton: A survey”. Computers and Graphics, 25(2), pp. 269–285. [15] Gottschalk, S., Lin, M. C., and Manocha, D., 1996. “Obbtree: a hierarchical structure for rapid interference detection”. In International Conference on Computer Graphics and Interactive Techniques (SIGGRAPH proc.), pp. 171– 180.

ACKNOWLEDGMENT This work was supported in part by National Science Foundation (NSF) Office of Cyber-Infrastructure Grants OCI0636235 and SCI-0537370. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the National Science Foundation or the other supporting government and corporate organizations.

REFERENCES [1] Zeid, I., 1991. CAD/CAM Theory and Practice. McGrawHill. [2] Torretti, R., 1999. The Philosophy of Physics. Cambridge University Press. [3] Heckbert, P., and Garland, M., 1997. “Survey of polygonal surface simplification algorithms”. SIGGRAPH 97 Course Notes, 25. [4] Garland, M., 1999. “Multiresolution modeling: Survey & future opportunities”. In Eurographics ’99 – State of the Art Reports, pp. 111–113. [5] Luebke, D., 2001. “A developer’s survey of polygonal simplification algorithms”. Computer Graphics and Applications, IEEE, 21(3), pp. 24–35. [6] Cignoni, P., Montani, C., Scopigno, R., et al., 1998. “A comparison of mesh simplification algorithms”. Computers & Graphics, 22(1), pp. 37–54. [7] Rossignac, J., and Borrel, P., 1993. “Multi-resolution 3d approximations for rendering complex scenes”. Geometric Modeling in Computer Graphics: Methods and Applications, pp. 455–465. [8] Schroeder, W., Zarge, J., and Lorensen, W., 1992. “Decimation of triangle meshes”. In International Conference on Computer Graphics and Interactive Techniques (SIGGRAPH proc.), pp. 65–70. 7

c 2007 by ASME Copyright