Anda di halaman 1dari 6

Proceedings of the 2011 IEEE

International Conference on Mechatronics and Automation


August 7 - 10, Beijing, China

A Simulation and Visualization Platform for Fractionated


Spacecraft Attitude Control System
Xueliang Bai and Xiaofeng Wu
School of Aerospace, Mechanical, and Mechatronic
Engineering
University of Sydney
Sydney, Australla
xbai9225@uni.sydney.edu.au

Abstract - In order to approach the proposed attitude communications and control design [6], as an Matlab/NS2
control process for space networking such as virtual and interface to proceed simulation. As an extension for NS2,
formation flying, a multiple spacecraft attitude simulation and PiccSIM provides an interface between Matlab simulink and
visualization technique was developed with Matlab/STK NS2, which allows further simulation expansion using
interface and Matlab/NS2 interface to provide a visualized Matlab and other software.
real-time control process, and instant data record for analysis. For the virtualization, STK is an outstanding solution for
In this work, the author integrated works of NS2 and STK, spacecraft visualized simulation. STK (Satellite Tool Kit) is
and presented a Matlab GUI (Graphic User Interface) as an commercial software provided by the AGI Company, which
interface to synchronize Matlab, NS2 and STK, to implement a
performs complex visualization animate scene and analysis
practical simulation platform for space network simulation
for multi-aircraft/spacecraft. It can provide accurate
and visualization. The simulation results showed that the time
delay of the control process of the simulation platform is within simulation for both 3D and 2D scene, and versatile interface
a reasonable range. With the virtue of high computing compatibility for incoming command and data output [7].
capability of Matlab, wireless simulation of NS2 and the Therefore, STK was widely use for a visualized spacecraft
animate scene of STK, this paper provided a simulation simulation [8][9].
platform for space network mission visualization and Such simulation by STK, however, was limited when
providing an integrity simulation data for further analysis processing complex control algorithm and real-time
purpose. communication. To solve this limitation, STK provides a
serious of already-made interface command and a connecting
Keywords- Matlab/Stk; NS2; PiccSIM; Real-time module STK/Connect. Using these command and connecting
simulation; module and a third-party software such as VC (Visual C++)
and VB (Visual Basic), a complex control algorithm based
I. INTRODUCTION control can be achieve [10] [11][12]. Among these studies,
The development of space network technology such as [12] performed a real-time based attitude control through
virtual satellite and formation flying made the simulation for STK/VC interface. However, these software were also
space missions these days are becoming harder to satisfy. limited when facing complex spacecraft modeling.
Multi-spacecraft attitude and coverage control simulation Meanwhile, a STK/Matlab based spacecraft simulation
system requires not only accurate spacecraft modeling and was also brought up [13][14]. Using Matlabs powerful
data analysis, but also a visualized space locating and component simulink, complex spacecraft modeling and
running information. Therefore, it is necessary to build a control algorithm can be performed in MATLAB control
real-time based wireless simulation platform with both algorithm and drive STK to do visualized simulation [15].
wireless communication analysis and visualized system for All the works in the above areas, to sum up, provides
designer and researcher an intuitionistic understand of the good potential for spacecraft mission simulation. In this
mission progress. work, the author integrated works of NS2 and STK, and
For the wireless simulation, NS2 (Network Simulation presented a Matlab GUI (Graphic User Interface) as an
version 2), which is well known as a generic network interface to synchronize Matlab, NS2 and STK, to
simulator, is used to achieve the simulation. NS2 is a discrete implement a practical simulation platform for space network
event simulator forcing on network research. It provides simulation and visualization. Part II and III introduce the
substantial support for simulation of Transmission Control implementation of wireless simulation and visualization.
Protocol (TCP), routing, and multicast protocols over wired Part includes an simulation example with small satellite
and wireless (local and satellite) networks [1]. Many works model and a 10k attitude real-time control task simulation
have been done to study the wireless simulation potential for and visualization. Part concludes the work.
NS2. [2] [3] introduced designs for Network simulation and
wireless simulation platform. And more study such as [4] II. WIRELESS SIMULATION
[5]trends to use NS2 directly for investigating the impact of
the statistical differences on network performance. Other A. Wireless simulation based on NS2
research choose PiccSIM provided by Helsinki University of
Technology, which stands for Platform for integrated

978-1-4244-8115-6/11/$26.00 2011 IEEE 2033


NS2 is a well-known generic network simulator. It is PiccSIM includes two main parts. One is made by
widely used to simulate wireless communication networks. Matlab GUI (graphic user interface), which serve as an
Users can program wireless networks through an Object interface for Matlab and NS2. The other main part is an
Oriented Tcl (OTcl) script interpreter, which integrated event NS2-scriptor, which can define the node positions and
scheduler, network component object libraries and network generate a TCL Script for the simulation. There is also a
setup module libraries. The Architecture of NS2 PiccSIM library, which includes Simulink functional blocks.
implementation is shown as Fig.1 [6].

Fig. 2 Architecture of PiccSIM

In this work, all the work is presented in the same


computer using Matlab simulink as xPC target and a virtual
Fig. 1 Architecture of NS2 implementation machine installed with Linux and NS2 to simulate wireless
Network.
Network simulator emulator (NSE) is an extension III. MATLAB/STK SIMULATION
simulation tool for NS2. It provides basic functions for real-
time wireless communication simulation. In NSE, each A Matlab /STK based attitude control visualization is
wireless communication node can be defined with certain using the Matlab /STK interface to drive and communicate
parameters, protocol and locations, and then proceed the with STK to execute desired command. As shown in Fig.3,
simulation according to different parameters and expected through Matlab GUI, Matlab initialize and configure Matlab
locations. /STK interface, achieve simulation data from both user and
The function of NSE is capable of introducing live traffic STK animate simulation and then send desired attitude to
into the simulator and injecting traffic from the simulator STK to execute attitude control visualization.
into the live networks, which provide a possibility of
evaluating the performance of communication protocols in
real-time control systems and similarly test robustness and
performance properties of control and data fusion algorithms
in networked environments. Hence, it can be realized the
integration NS2 with other packets under the NSE mode.
[16]
B. PiccSIM and Matlab interface
As a versatile control design and simulation tool,
Matlab/simulink is chosen to complete the control part and Fig. 3 System Architecture
PiccSIM is used here to build interface between NS2 and
matlab simulink in this work. PiccSIM is developed by A. STK/Matlab initializaiton and configuration
Helsinki University of Technology (HUT) to integrate For the first time to setup STK/Matlab interface, the
communications and control design, simulation, StkInit (setup) command needs to be used to set the host
implementation and modeling with a real-time operating (localhost:5001 assumes that STK is running on the same
system. Fig.2 presents the internal architecture of PiccSIM, computer as Matlab ) and initialization file. After that, with
which links NS2 and Simulink with network[6]. Matlab and STK both open, typing stkinit can initialize the
As shown in Fig.2, two nodes in the architecture can send STK/Matlab interface.
and receive data respectively to perform a wireless MexConnect and AeroToolbox serve as already-made
simulation. A synchronizer is also presented to synchronize Matlab commands, which are stable and usually more
wireless Network Schduler. efficient to achieve the communication between Matlab and
STK. MexConnect includes common STK commands

2034
including create objects and set object properties. The program structure can be summed up to a flow chart
AeroToolbox includes relative coordinate conversions and that shown in Fig.4.
space object property operations. StkConnect, on the other
hand, provides basically all the functions of STK.
As mentioned above, the connection between STK and
Matlab is using a specified channel (5001 if Matlab and
STK are using the same Computer). Every time using the
stkconnect command, channel 5001 will be used. So the
channel may be blocked if the previous task have not
finished. That is also why the stkconnect command is less
reliable than mexconnect or aerotoolbox. When the
channel is blocked, Matlab will show the following
information:
??? Error using ==> mexConnect
mexConnect: stkOpen: The maximum number of connections has
been met - unable to open another.
Error in ==> stkOpen at 53
lhs = mexConnect('stkOpen', rhs)

Matlab can read the existing attitude by command


stkAttitudeCBF (CBF: Central Body Fixed coordinates).
The data returns as matrix [time, quats, cb1], in which time
is a 1xN vector and quats is a 4xN vector represent the
quaternion of the object data.
Similarly, desired attitude quaternion data can be
imported to STK through command stkSetAttitudeCBF Fig. 4 Stk/Matlab interface Programming structure
(Central Body Fixed coordinates) as a 4xN matrix. Such
attitude quaternion data can be calculated by Matlab through D. Synchronous correction in the simulation
certain transfer function.
The time delay for acquiring animate, however small due
B. Real-time attitude control realization to the fast speed of computer, was considered in the
In the above attitude control, the control time has to set to visualization process. The following factors will affect the
a certain time. The format of command stkSetAttitudeCBF difference between desired simulation time and the actual
is stkSetAttitudeCBF (objPath, cb, time, quats). This STK simulation:
command can input an attitude data quat matrix(in Attitude data required form the user interface
quaternion format) at specified time matrix to an object path The process time for the input data including control
in STK as the attitude data for this the specified time period. algorithm processing time
To achieve a synchronous attitude control visualization, The time required to clean communicate channel
the animation time need to be read form STK using The data receive time by windows Sockets
StkConnect through the following commands: The processing time that required by STK after the
Timestring=stkConnect (conid,'GetAnimTime', 'Scenario attitude received
root'). Then the time data can be returned to Timestring as
string format. The above time delays are relatively hard to determine.
The format of Timestring is date month year hour: However, since the PC performance these days can achieve a
min: sec, for example 1 Oct 2009 02:19:34.000. In this high level. And for visualization purpose, the synchrony is
string, numbers can be separated by regexp command and not as important as physical modeling simulation. During the
then converted these numbers into a matrix in Matlab and programming process, assuming that a time delay within 0.1
name it as animate-time. Using this animate-time (in second is acceptable for visualization, most time delay that
seconds) to minus the launch time (in seconds), the mentioned above can be acceptable. Moreover, since the
difference of these two numbers can be used as the time attitude data in the simulation process is sent to STK as a
matrix that needed in command stkSetAttitudeCBF matrix of quaternion with time segment, all the quaternion
value will be sent into the STK attitude data at the desired
C. Programming structure
time no matter how the visualization process will be display.
Therefore, during the control process, when attitude set However, during the testing process, the time required to
point is sent to the user interface, the program can acquire clean communicate channel is quiet significant for the
the animate time from STK, and then send the attitude set synchronous control simulation. The stkclose command
point with this animate time. Assuming that the time for this take about 2 seconds (experimental value, depending on the
process is neglectable, STK will receive the attitude data for computer speed) to accomplish the channel clean job. In this
the current attitude, and response to desired position. visualization case, the oscillating control process is relatively
important. So the Stkclose command was carefully

2035
associated after the StkConnect commannd to make sure the set point is determined in GUUI, Matlab Simulink and
time delay will not affect the attitude visualizing animation. Piccsim can run synchronously to prrocess the data.
If, however, channel block still happpens during the
simulation process, users can input stkclose(all)
command manually in Matlab to clean the channel and redo
the simulation. This command can be integrated in Matlab
GUI design as a push button, which will bbe more convince
for users to deal with this problem.
E. Matlab GUI design
The GUI (Graphic User Interface) ffor the real-time
attitude control is aiming to create a friendlyy environment for
users who do not necessarily understand tthe theory of the
simulation process but only want to use the software to
simulate certain tasks. As an integrated compponent, users can
use the GUI and STK 3D animation winddow together and
observing the attitude change while changging the attitude
value, which make the simulation process m much easier.
In this GUI, multi-satellite was createed independently, Fig. 5 Simulation platforrm structure
and applied real-time control individually too achieve certain
attitude coverage. Certain environment pparameters were When Simulink and PiccSIM sttart running, attitude data
fixed inside the component, so users cann get a neat and will be processed and sent from node
n 0 to node 1, which
efficient graphic interface. performed as a wireless simulatiion by NS2. The data
The conversion from Yaw-Pitch-Roll (YPR) angles to received from node 1 will press thrrough the dynamic model
Quaternion was also integrated in this GU UI design. As the and then feedback from node 2 to o node 3 to complete a
default setting of STK, quaternion is arguabbly an appropriate close-loop control. The output put data will be sent to STK
choice for representing object rotations inteernally. However, through the Matlab/STK interface, to drive the visualizing
presenting quaternion in the user interfaace is generally scenario operate in real-time.
inappropriate since it cannot be expected tthat all users are B. Satellite modeling
familiar with such complex coordinate conccept. Euler angles
are generally much more familiar to users, and their values To test the simulation platform, a cube satellite coverage
are a more intuitive and predictable. mission is demonstrated in this work. The simulation
An easy conversion between YPR anglee and Quaternion performed based on the cube satelliite mission developed by
can be achieved by the atbYprToQuat(yprrVec, sequence). the University of Sydney. In thiis mission, three cubes
command, where yprVec is 3 by 1 yaw--pitch-roll vector, satellites serve as slave satellite and controlled by one master
and sequence is 3 digit integer definning the rotation satellite. For demonstration purposee, one of the satellites is
order(1-Roll, 2-Pitch, 3-Yaw). taken here to perform the wireless attitude control and with
After the configuration of the control syystem, the Matlab relative data listed in table 1.
GUI can be integrated into Matlab Simulinkk as the input data A rigid-body satellite without wheels is used in this
can be achieved from the GUI, and then proccessed by Matlab application as to simulate the slav ve satellite. The dynamic
Simulink and NS2. The output will be sent to STK to model of the satellite took the id dea of [17]. The linear
perform the visualization. satellite dynamic model can be exprressed as (1):

IV. SIMULATION RESULTS    

A. Simmulation platform intergration where J is the satellite inertia matrix expressed in the body
frame; Td and Tc are disturbance and control torque
The simulation structure for the simulattion platform can respectively
be expressed as Fig.5:
In the simulation, Matlab plays as an innterface for NS2    
   
and STK, which bring wireless into thee simulation and
   

utilized STK to visualize the simulation. First, in Matlab




GUI component, a STK scenario is lunched, and all the

satellites for the space network mission w will be sent with
specified parameter. Run the scenario aand wait till the The state vector is given with    .
specified time to set attitude control dataa. Meanwhile, in Td is disturbance torque in this sim mulation, Tc is the control
PiccSIM, the TCL code can be generatted by choosing

different network parameters. Set PiccSIM M tool chain and torque where , , .

NS2 ready and wait for the attitude control set point. Once

2036
scenario, and then take the attitu ude data from STK and
feedback to the controller in Sim mulink. Fig.7 shows the
angular acceleration of the rolling angle.
a The sampling rate
is 10Hz.

Fig.7 Attitude control Simulation resu


ult (angler acceleration)

It is can be seen that, even with


w noise applied in the
control system, NS2 can still perform
m an acceptable feedback
between each node. The time delay y is acceptable since the
transmit distance was set to 10km. Then the rolling angle is
Table 1 Parameters for simulationn shown as follow:
The input in the model is in [Nm], whicch means all kind
of input regardless if it is a commandded torque or a
disturbance. With all noise and disturbance integrated in the
system, then the Matlab/simulink configuraation is shown in
Fig.5.
As shown in Fig.6, the upper part presents a controller,
which located on master satellite. The loweer part presents a
dynamic model for a slave satellite. The ddata will transmit
from the controller to the dynamic, and the feedback to
complete the control loop. There are four nnodes, as two on
the master satellite and two on the slave, which perform
transceivers for each satellite respectivelyy. To achieve a
coverage attitude, three pairs of such contrrol loop will be
built separately. One of the control data w will be analyzed
here for as a demonstration.
Fig.8 Attitude control simu
ulation (angle)

D. GUI compoment and system visu ualization.


After integrating Matlab GUI in nto the control system, a
visualized real-time simulation platfform can be achieved.
As shown in Fig.9, the attitude of three satellites can be
adjusted along with the attitu ude control operation.
Meanwhile, the attitude data has beeen record in Simulink for
further analysis purpose.
During the testing process, it can
c be observed that the
attitude of each satellite presents go
ood real-time response for
each attitude value reset. Channel block problem is rarely
happened during the test process. AndA if happened (Matlab
return warning massage), users can n press the reset button
Fig.6 Matlab Simulink configuratioon to invoke Stkclose command to o clear the channel and
continue the simulation without stop p the simulation running.
C. Wireless Attitude control simulation.
In the configuration, the satellite attitudee is calculated by
the controller and taken to drive satellite models in STK

2037
its merit, and relatively easy to achieve. The simulation
demonstration showed that the attitude control component
for STK can fully satisfied the requirement
r of real-time
attitude control visualized simulatio
on for multiple Spacecraft
attitude control mission.
REFERENCE
ES
[1] The network simulator http://www.isi.edu/nsnam/ns/
[2] Zhang Weiwei, Wang Jun, Qin Linlin and Wu Gang, Design of the
Simulation Platform in WSN Using NS2, Electronic Technology,
2009-10
[3] Wang Yu and Zhao Qianchuan, IP P NETWORK SIMULATION
BASED ON NS2, Computer Applicattions and Software, 2003-03
[4] Jeff McDougall, Scott Miller , Sen nsitivity of Wireless Network
Simulations to a Two-State Markov Model
M Channel Approximation
Global Telecommunications Conferen nce, 2003. [GLOBECOM '03.
IEEE, 697 - 701 Vol.2. Dec. 2003]
(a) Environmental parameters configurration
[5] Wang Jianping ns-2 Tutorial 4, Multtimedia Networking Group, the
Department of Computer Science, UVA A, 2004.
[6] Nethi, Shekar and Mikael Pohjola, PiccSIM Manual, Helsinki
University of Technology, 2009
[7] STK Flyer, STK product Support Website.
http://www.stk.com/downloads/supporrt/productSupport/literature/pdf
s/Products/STK_Flyer.pdf
[8] CHEN Xijun , LI Ren. Simulation tecchnology of satellite flight orbit
based on STK. Journa l of Harbin University
U of Commerce Vol. 24
No. 3 Jun. 2008
[9] Yang ying and Wangqi, The appllication of STK in computer
simulation P277. Jan 2005
[10] ZHANG Wan peng, CHEN Jing, SHEN S Lin cheng, A Visual
Simulation System for Spaceflight Mission
M Based on STK/VO,
Computer simulation Vol. 22 No. 10 Ju
un. 2005
[11] HUANG Jie, DANG Tong xin, ZHAO O Yong jun An approach for
integrating VC with STK and its appliication in simulation, Institute
of Information Engineering, Information Engineering University,
Zhengzhou Henan, China, 2009.
(b) Desired satellite attitude control visuaalizaiton [12] DU Yaoke, Design of STK-Based Reall-time Visualization Simulation
System for Satellites, Aerospace Conntrol and Application, Vol. 35
Fig. 9 Real-time attitude control demonsstration No. 2 April. 2009
[13] Shawn B. McCamish and Marcello Ro omano Simulations of Relative
During the test process, STK providedd good real-time Multiple Spacecraft Dynamics and Co ontrol with MATLAB-Simulink
response with the GUI component, and thee control process and Satellite Tool Kit US Naval Postgraduate School (NPS),
can be clearly showed in the animation window. Three Monterey, CA 2005.
satellites can be controlled individually wiith desired order. [14] Wang XinJin Hu STK/MATLAB and Application in Setting llp
All the data processed by Matlab and NS2 can be recorded the Scenario of the Communication n Satellite HeFei Electronic
Engneering Institute, 2006.
for further research analysis. So the task of multiple satellite
real-time attitude control visualized simuulation has been [15] Shawn B. McCamish DISTR RIBUTED AUTONOMOUS
CONTROL OF MULTIPLE SPAC CECRAFT DURING CLOSE
achieved. PROXIMITY OPERATIONS, Decem mber 2007
.CONCLUSION [16] Fall, Kevin & Kannan Varadhan, T The ns Manual, 336-341 UC
Berkeley, LBL, USC/ISI, and Xerox PAARC, 2000.
In this paper, the author proposed a practical way to [17] M. L. Psiaki, "Magnetic Torquer Atttitude Control via Asymptotic
implement a real-time space network sim mulation platform Periodic Linear Quadratic Regulaation," In AIAA Guidance,
Navigation, and Control Conference, Denver,
D Colorado, USA, 2000.
using Matlab, STK and NS2. This design inntegrated all these
three software, which allows NS2, Matlab annd STK can exert

2038

Anda mungkin juga menyukai