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
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)
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.
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