Computational Geometry Algorithms for Animation

5 downloads 0 Views 822KB Size Report
than a monolithic one. To mimic the ... multiplication for translation and rotation movements. In addition, a ... transformations are translation, rotation and scaling.
Computational Geometry Algorithms for Animation of a Segmented Space Reflector Telescope YULU CHEN, CHARLES W. LIU, JANE DONG, HELEN BOUSSALIS, KHOSROW RAD, CHARALAMBOS POULLIS Electrical and Computer Engineering California State University Los Angeles, Los Angeles, CA 90032

Abstract: - This paper presents the ongoing development of a computer animation software package for a large space segmented telescope test-bed. The test-bed was developed to provide a platform for experiments related to the control of precision segmented reflectors. The software was developed using algorithms of computational geometry. The algorithms were optimized based on the common translation and rotation primitives provided by the graphic library, OpenGL. In addition, a user-friendly graphic interface was developed for the users to specify the parameters related to the system as well as the control algorithms in an interactive fashion. Window snapshots were shown in the paper to demonstrate the operation of the system as well as the results of the animation. Keywords : computational geometry algorithms, segmented telescope, 3-D animation

1 Introduction For future space-borne astronomical missions, a segmented space reflector telescope is preferred rather than a monolithic one. To mimic the optical properties of a monolithic telescope using a segmented one, an effective real-time control system has to be established for shape control and precision pointing. Funded by NASA, A segmented reflector test-bed has been built at the Structures Pointing And Control Engineering (SPACE) Laboratory at California State University, Los Angeles, based on which, several efficient algorithms have been developed to address the problems associated with the real-time control of a large segmented optical system. In this paper, a 3-D animation system for the segmented space telescope was developed. Such a system was used to demonstrate the effectiveness of the proposed control algorithms, such as PID (Proportional Integral Derivative) [1], H-infinity [2], among others, and to disseminate the knowledge obtained from our research activities; this system provides the audience with different professional background with the information of the Next Generation Space Telescope (NGST.) The physical model of the segmented telescope was imported into our software architecture. Algorithms based on computational geometry were developed to animate the movements of the panel segments of the telescope. Such algorithms can be performed by using the primitives of matrix

multiplication for translation and rotation movements. In addition, a user-friendly graphic interface was developed for the users to specify the parameters related to the system as well as the control algorithms in an interactive fashion. The 3-D animation software was implemented using OpenGL and Visual C++ in Windows platform. To facilitate the development and the maintenance of the animation system, we used a modulized design methodology so the animation system can be divided into four operational components – the viewer module, the 3-D-model module, the control interface module and the control algorithm module.[3] The rest of the paper is organized as follows: Chapter 2 introduces the physical model and the key components of the test-bed. Chapter 3 presents the 3D modeling methods of a peripheral segment of telescope. Chapter 4 indicates the implementaion of computational geometry algorithm. Chapter 5 shows the results we have been achieved, and Chapter 6 is conclusion.

2 Physical Model of the Telescope Test-Bed The Structures, Pointing and Control Engineering (SPACE) laboratory Test-bed in Figure 1 is a physical model of a segmented telescope. The test-bed was used to study in an integrated way problems associated with control of large, space-borne,

segmented optical telescopes such as modeling, identification, control of multi-input multi-output (MIMO) systems, structural dynamics, controlstructure interaction, and disturbance rejection. The structure of the segmented telescope test-bed consists of three main parts: a primary mirror, a secondary mirror, and a truss.

Fig. 1 Features of the telescope structure

Our animation tasks focused on the movement of the primary mirror. The primary mirror consists of seven hexagonal segments mounted on a lightweight flexible truss structure. There are six peripheral segments mounted around a fixed central segment. The central segment is locked to the isolation table. The six peripheral segments are each actively controlled in three degrees of freedom (DOF's), namely piston, tilt (pitch), and tip (roll) by linear electromagnetic precision actuators. The three degrees of freedom (DOF's) are graphically illustrated in Figure 2. Each peripheral segment is attached to the truss at three node points through its three actuators. By actively controlling the position and attitude of the six peripheral segments with reference to the stationary central segment, the actuators maintain the primary mirror shape close to the perfect parabolic surface.

Fig. 2 Panel movement in three degrees of freedom

3 The 3-D Animation of Segmented Telescope To implement the 3-D animation of segmented telescope, we built the 3-D model using OpenGL geometric primitives.[4][5] All complex objects of the system can be drawn using simple OpenGL primitives with given coordinates of their vertices. The 3-D structure of each object is composed of a number of polygons. The polygons represent the profile of the objects. Such objects can be drawn by filling the assembled polygons. This model can be used to implement the components of the segmented telescope. For instance, a peripheral segment of the primary mirror can be represented by a hexagonal panel mounted on three actuators with three I-flexures as shown in Figure 3. Two hexagonal polygons are used to represent the two surfaces of the hexagonal panel, while six rectangles are used to represent the edges of the panel. Likewise, an actuator object can be represented using cylinders and disks.

Fig. 3 Components of a peripheral segment

Two main features of the component of the peripheral segment should be addressed; the material property and the motion due to the actuator displacements. The segment position actuators are identical linear electromagnetic force actuators which enforce the required displacements of the panel segments for the shape control. The actuator controls panel’s movement by shifting a shaft up and down. The hexagonal panel is defined as a rigid body. The behavior of an I-flexure is like an elastic column. We used OpenGL’s modeling transformations to implement the animated effect. Three key programming primitives employed for modeling transformations are translation, rotation and scaling. These primitives provide model-view matrices for transforming coordinate system. The vertices of the geometrical shapes are used as a single-column matrix. This matrix is multiplied by the model-view matrix to generate the newly transformed coordinates for animation.

As shown in Figure 4, an actuator can push or pull the panel along the Z-axis. When one of the three actuators is activated, it drives the movement of the hexagonal panel and bends the attached I-flexures. The stroke of an actuator is +/-2.5mm, resulting in a 5mm maximum displacement of the panel. Based on the measurement, the displacement of the I-flexure can be ignored.

Fig. 4 The movement of an actuator

The movements of the six peripheral segments are determined by the control algorithm, such as PID (Proportional Integral Derivative) [1], H-infinity[2]. In each iteration of processing, the control algorithm is performed based on the errors, the measures of the deviation of each panel segment, received from the sensors. Then, the real-time control algorithm generates the state changes on each of the peripheral segments. Based on the closed-loop system generates the computational displacements of each actuator to mimic the physical behavior of the test-bed. Such displacements are sent to our 3-D animation system as an array of input data. In our animation, we used an array of displacement data to redraw the position of each of the panels for animation. If the displacements are large, interpolation was used to draw a number of intermediate positions before the panel reaches its final position. The control algorithm only gives the displacements of actuators but the movements of panels have to be modeled based on the kinematics property of the physical system. Since the scale of displacement is very small relative to the dimension of hexagonal panel, computational geometry model were used instead to simplify the animation process. The simplified process for animation of the movement of a peripheral segment is illustrated in Figure 5. Assume that the three actuators, A, B, C, of a peripheral segment receive displacements, D0, D1, D2, respectively, to move the panel from plane p to

plane p’. The computational steps are described as follows: Step 1: Triangle ∆a0 b0 c0 is translated to Triangle ∆a1b1c1 with the displacement of D0, where D0 = a 0 a1 = b0 b1 = c0 c1 . This step is shown in Figure 6. Step 2: Move Triangle ∆a1b1c1 to Triangle ∆a1b2′ c1 by rotating this triangle with respect to axis a1c1 . This rotation should follow the curve b1b2′ , so the area of Triangle ∆a1b2′ c1 is equal to it of Triangle ∆a 0 b0 c 0 . The newly transformed triangle will be mapped onto the plane of Triangle ∆a1b2 c1 . This step is shown in Figure 7. Step 3: Move Triangle ∆a1b2′ c1 to Triangle ∆a1b2′ c ′2 by rotating this triangle with respect to axis a1b2 . This rotation should follow the curve c1c 2′ , the Triangle ∆a1b2′ c ′2 is equal to it of Triangle ∆a 0 b0 c 0 . The newly transformed triangle will be mapped onto the plane of Triangle ∆a1b2 c 2 . This step is shown in Figure 8. The next section will describe the implementation of this simplified animation using OpenGL transformation commands.

Fig. 5 The geometric movement of a peripheral segment

Fig. 6 Implement 3-D animation – step 1

Fig. 7 Implement 3-D animation – step 2

of this hexagonal panel. To implement the simplified animation of the movement of a peripheral segment described in previous section, two degrees of freedom were introduced; the hexagonal panel rotates around a 0 b0 or a 0 c 0 in the two different steps. By using the glRotatef() primitive, such rotations have to be performed by temporarily transforming the hexagonal panel, so that the line, a 0 b0 ( a 0 c 0 ), will be aligned to one of the coordinate axis. Such a transformation is performed on the XY-plane and it is orthogonal to the Z-axis. After the two rotations steps have been completed, necessary counterpart transformations with respect to the XY-plane will be performed to cancel out the cumulative deviations induced by the previous temporary transformations.

Fig. 8 Implement 3-D animation – step 3

4 Implementation of Computational Geometry Algorithms The OpenGL routines for modeling transformations used in the computational geometry algorithms include translating glTranslatef() and rotating glRotatef(). These commands produce appropriate transformations by matrix multiplications.[4][5] The summaries of OpenGL commands glTranslatef() and glRotatef() are shown as follow:[4][5] void glTranslatef (float x, float y, float z); Multiplies the current matrix by a translation matrix that moves an object by the given x, y, z values. void glRotatef (float angle, float x, float y, float z); Multiplies the current matrix by a rotation matrix that performs a counterclockwise rotation around a directional vector that passes from the origin (0, 0, 0) through the point (x, y, z). The angle specifies the angle of rotation in degrees.

Based on the operations of these two transformation primitives, an object can be translated to a new position with the relative displacements in the three dimensions. Also, an object can be rotated a certain degree with respect to the vector defined from the origin (0, 0, 0) through a point (x, y, z). Figure 9 shows the dimensions of a hexagonal panel. We defined the origin (0, 0, 0) to be the center

Fig. 9 Dimensions of a hexgonal panel

The order of transformations is critical. For example, in Figure 10, the rotation-followed-bytranslation approach (See Figure 10 (1)) will result in different transformation to it with a reversed order of transformation (See Figure 10 (2)). In the previous section, we simplify the animation by translating three points to the first position in Step 1. Then, in Steps 2 and 3, we rotate the second point, and then the third point of the corresponding triangles after each transformation. Such an order can be reversed when we derived the computational geometry algorithm to further simplify the computational process. Note that the rotation is performed based on a directional vector from the origin. If we first translate the panel with a displacement of D0, then rotate the plane around the line, a 0 c 0 , a wrong transformation will occur as shown in Figure 10 (2). To correct the transformation, we performed the rotations based on Steps 2 and 3 first, then translate the plane based on Step 1.

Step 8, 9: Move the panel back to original position. Step 10: Finally, translate the panel to first positions a1 , b1 , c1 (Figure 11) with displacement D1 which is the stroke of actuator A.

Fig. 10 The order of transformation

Computational geometry algorithms were developed to perform the transformation. We used nine steps to perform the rotations Step 2 and Step 3, and one step to perform the translation Step 1 in previous section. The steps of our implementation are described below: Step 1, 2: These two steps move a 0 b0 to Y-axis by rotating − 60 o counterclockwise around Z-axis and translate -0.2m along X-axis. Step 3: Rotate panel with angle θ 2 , the angle between ∆a1b2 c1 and ∆a1b2 c 2 , around Y-axis as shown Figure 12. The angle θ 2 can be calculated by the following formulas: θ2 =

180

π

⋅ cos −1

A2 + B 2 − C 2 2 AB

D′   A = 0.6 2 +  D 2′ − 1  2    D′  B = 0.6 2 +  1   2 

Fig. 11 Computational geometry algorithms

(1)

2

(2)

2

(3) (4) (5) (6)

C = D 2′ D 2′ = D 2 − D0 D1′ = D1 − D0

Fig. 12 Calculate rotate angle θ2

Step 4, 5, 6: These three steps move a 0 c 0 to Xaxis. Step 7: Rotate panel with angle θ1 the angle between ∆a1b2 c1 and ∆a1b1c1 , around X-axis. θ1 =

180

π

⋅ tan −1

D′1 0.6

(7) Fig. 13 Calculate rotate angle θ1

5 Implementation and Results

6 Conclusion

Figure 14 is a 3-D model of a peripheral segment shown on the viewing window with three slider bars which control three actuators. When slider bars are moved, the actuators drive the panel to new position (Figure 15).

This paper presents the design and implementation of a 3-D animation of a large space segmented telescope. The 3-D animation software was implemented using OpenGL and Visual C++ in windows platform. OpenGL provides powerful computational geometric primitives, modeling transformation and rendering effects to support the development of our 3-D animation. To animate the 3-D model of telescope, we first bring up a simplified process for animation of the movement of a peripheral segment. For performing the animation using OpenGL, we develop the computational geometry algorithms based on the simplified process. Finally, we show the result implemented by the computational geometry algorithms. Our future research will focus on embedding the 3-D animation software to the SPACE test-bed.

Fig. 14 A peripheral segment on the viewing interface

References: [1] H. Boussalis, M. Mirmirani, Z. Wei, Decentralization and PID Controller Design for Large-Spaceborn Telescopes, IASTED International Conference on Application Modeling, Simulation and Optimization, Pittsburgh, 1995. [2] H. Boussalis, M. Raghavender, The Application of H-infinity Control Law to a Decentralized Segmented Reflector, IASTED/SCS Conf., Australia, 1996. [3] Y. Chen, C. Liu, H. Boussalis, et al., 3-D Animation for a Segmented Space Reflector Telescope, the 7th World Multiconference on Systemics, Cybernetics and Informatics (SCI 2003), Orlando, USA, in July 27-30, 2003. [4] OpenGL Architecture Review Board, OpenGL Programming Guide: The Official Guide to Learning OpenGL, Version 1.2, 3rd Edition, Addison-Wesley Pub Co, 1999. [5] R. Wright Jr., M. Sweet, OpenGL SuperBible, 2nd Edition, Waite Group Pr, 1999.

Fig. 15 Slider bars control the movement of the panel