Various levels of Simulation for Slybird MAV using Model Based Design
Kamali C*, Shikha Jain*, Vijeesh T$
Sujeendra M R&, Sharath R&
* Scientist, $ Technical Officer
& Project Assistant
Flight Mechanics and Control Division National Aerospace Laboratories, Bangalore
Autonomous and remotely controlled Micro Aerial Vehicles (MAVs) have gained a high level of popularity during the last decade both in civilian and military applications. National Aerospace Laboratories (NAL) has been carrying out research and development activities on various supporting technologies crucial for the development of MAVs thereby enhancing the performance of the vehicle to accomplish various missions. NAL Slybird is a mini-unmanned aerial vehicle (UAV) developed by NAL. Its primary users will be police and the military services. Design & implementation of an autopilot in such systems assumes the next priority in achieving an autonomously flying MAV. An essential requirement to achieve the above goal is through a suitable modeling & simulation platform. Thus, this presentation takes the audience through the strategies developed for performing various levels of MAV simulation. The following levels of simulation are performed for Slybird MAV using MATLAB/Simulink: • Open Loop Simulation (OLS) • Model In the Loop Simulation (MILS) • Software In the Loop Simulation (SILS) • Processor In the Loop Simulation (PILS) • Hardware In the Loop Simulation (HILS) The OLS responses are validated with actual flight data and results will be shown. The MILS and SILS include various subsystems such as estimator, path planning and control algorithms all developed in SIMULINK. Demonstration of PILS for Slybird MAV using open source mission planner software and ARDU autopilot (APM 2.6) will also be performed. The HILS architecture discussed in this presentation is a demonstration of rapid prototyping technique using RTWT and XPC Target.
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Various levels of Simulation for Sl bi d MAV i M d l B dSlybird MAV using Model Based
DesignKamali C
Shikha JainVijeesh T
Sujeendra MRSharath R
MotivationNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALMotivationIn order to design robust and reliable flight guidance and control systems, itg g g y ,
is essential to have mathematical models of the airframe dynamics and
other subsystems of adequate fidelity.
There is also a need to develop a simulation and testing framework that
enables seamless integration of onboard software from design to onboard
implementation.
Accurate modeling and simulation of aircraft achieves significant reduction
in flight testing time and hence is efficient.
Slybird MAVNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
• Slybird is an Micro Air Vehicle (MAV) developed byy ( ) p yNational Aerospace Laboratories with surveillance asthe main application.
Wind tunnel testingNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
• At HAL, Bangalore low speed wind tunnel Slybird 1:1 modeli d i ld h d i d i d f b ildiis tested to yield the aerodynamic data required for building upthe simulation.
• The data is subsequently modeled as multi dimensional lookThe data is subsequently modeled as multi dimensional lookup tables for making the aerodynamics block.
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Other data requirement
• RPM versus thrust data to model the propeller.• Mass CG Inertia data• Mass, CG, Inertia data.• Geometry data such as wing span, wing
f d d i h dsurface area and mean aerodynamic chord.
TrimmingNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALTrimming
Trimming is a condition where all state derivativesTrimming is a condition where all state derivativesare zero. This condition is essential to start thesimulation with proper initial conditions.s u at o w t p ope t a co d t o s.Numerical trim is performed using the linearizationtool This is optimization program whose costtool. This is optimization program whose costfunction is xdot=0.Here wings level trim is performed that solves forHere wings level trim is performed that solves forelevator, throttle, angle of attack.
Screen shot for trimmingNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
LinearizationNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALLinearization
Linearization tool is used to achieve thisLinearization tool is used to achieve this.
Linear analysis points are selected.
Linear models are generated as per the required trim values.
Based on the linear models, the control design is carried out.Based on the linear models, the control design is carried out.
Matlab code can be generated for trimming and linearization
f h l f b h ifrom the tool for batch processing.
Screen shot for linearization and M tl b d ti
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALMatlab code generation
Slybird - Closed loop architecture
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
E lEuler
A l
Aileron Command
Elevator Command
Slybird Closed loop architecture
Euler Angles and
Velocity
Position
AnglesSix DOF
Simulation Model
IMU and GPS Sensor Estimator
Elevator Command
Rudder Command
State E i
Position
os t o
Velocity
ModelThrottle Command
Heading Command
Estimates
Altitude Command
Path Planning
Outer Loop PID Controller
Inner Loop PID Controller
CONTROLLER
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Various levels of Simulation
• Open Loop Simulation• Model In the Loop Simulation (MILS)Model In the Loop Simulation (MILS)• Software In the Loop Simulation (SILS)
P I h L Si l i (PILS)• Processor In the Loop Simulation (PILS)• Hardware In the Loop Simulation (HILS)
Open Loop Simulation-Slybird
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
[x_State]
[xdot_State]
u0(1)
Flap
K[Elevator] 3
2
TAS[alpha]
[TAS]
airspeed
p p y
[bodyvel]-K-
0
-K-
[Elevator]
[Aileron]
[Rudder]
5
p
4
beta
3
alpha
[q]
[p]
[beta]servo_ear
1
caero
0[Rudder]
8
psi
7
r
6
q
[psi]
[r]
[q]
Demux[x_State]
From54
[mach]
Demux[ax]
11
10
phi
9
theta
psi
[phi]
[lat]
[theta]16
Mach14
QBAR
[qbar]
[mach]Demux-K-[Throttle]
throttle_controller Throttle_inThrottle_in
13
12
lon
lat
[HFT]
[lon]15
VCAS
Demux
[6x1]
Alt
[thrust]HFTvdot=1
SLYBIRD dynamicsd i
Autopilot ModesNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALAutopilot Modes
ManualManual
Stabilized
Return to launch
LoiterLoiter
Fly by wire
Auto (Take off, landing and way point navigation)
Model in the Loop Simulation
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALModel in the Loop Simulation• Here the aircraft OL model and the controller model run in theHere the aircraft OL model and the controller model run in the
same PC in offline mode.
Thi i l i i d d i h l id d• This simulation required to design the control guidance and
estimation algorithm.
RC control Simulink‐NRT
Aircraft 6 DOF model
Controller/Autopilot
Slybird - MILSNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALSlybird - SILSSlybird SILS
Compiled code is
incorporated into the
overall simulation
Required for evaluation ofRequired for evaluation of
onboard auto code
f i li i d i Ai f Controller/Autopilot
RC controlSimulink‐NRT
functionality in designer’s
desk .
Aircraft 6DOF model
Controller/Autopilot(C-code/S-function)
Rapid Control prototypingNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
HOST PC• The aircraft 6 DOF
This is intended to verify the onboard code on a generic target before burning the codeon the actual target hardware.
AIRCRAFT(6 DOF)
Packet Input
Position
Elevator
Rudder
Packet Output
Angular Rates
Accelerations
Aileron
HOST PC• The aircraft 6 DOFsimulation application willbe running in the windowsreal time environment
Throttle Velocity
User Wi d
• Controller simulationapplication will be runningin the xPC target
Datagram Protocol(UDP)
User Datagram Protocol(UDP)
WindowsReal Time
KernelReal Time
in the xPC targetenvironment.
• The data’s are exchangedb i UDP l
UDP SEND CONTROLLER
UDP RECEIVE
(UDP)
Position
Angular RatesAcceleratio
Aileron
Elevator
Rudder
TimeKernel
by using an UDP protocolin real time.
nsVelocityThrottle
TARGET PC
Results
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALResultsRCP
PILS
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
PILS• Aircraft model runs in the accelerated modeAircraft model runs in the accelerated mode.
• The controller runs on the target micro controller (autopilot
hardware)hardware)
• No input/output cards are used, a USB connection is used to
exchange data between the control system and the modelexchange data between the control system and the model.
• The purpose of this simulation is to test that all functionalities of the
controller are correctly computed in the target hardwarecontroller are correctly computed in the target hardware.
Architecture of PILS with ARDUPLANE
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Architecture of PILS with ARDUPLANE (APM 2.6) and Mission planner
MATLAB/SIMULINK
ARDUPLANEAutopilot (APM 2 6)
UDP protocol
USB Interface
MissionPlAircraft Model (APM 2.6)
XBEE
32 bit dual core/quad core desktop PC
Planner
PILS with APM 2.6 and Mission NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
planner
Mission Planner
Ai ft M d lAircraft Model
APM Board
NAL AutopilotNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
• Designed with four layer PCB fabrication
technology.
• Onboard IMU, onboard pressure sensor
• Data logging in micro SD card
Parameter Description Range
Processor ARM CortexM3 CPU core 32 ‐ Bits
Vdd Input Voltage 1.8 ‐ 3.3 Volt
Technical Specification
p g
Clock Operating Frequency 24 MHz
ROM Programmable memory 256 Kbyte
JTAG Connector Programming, debugging 10 Pin
I2C Interface 4 I2C Interface 100/400 Kbps
UART Interface 2 UART Port 9.6/57.6 Kbps NAL Autopilot Version 3 (APV3)UART Interface 2 UART Port 9.6/57.6 Kbps
SPI Interface 3 SPI Port >1 Mbps
PWM 16 Channels 3.3 V
Temperature Industrial temperature ‐40 to +85°C
Sensors 3 Axes (Gyro, Accelerometer, Magnetometer) + Static Pressure
NAL Autopilot Version 3 (APV3)
Magnetometer) + Static Pressure
Dimensions ‐‐‐ 50mm x 50mm
Weight ‐‐‐ 12.2 grams
Procedure to deploy auto code in to an
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Procedure to deploy auto code in to an Embedded Target
PILS with NAL Autopilot board and
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALPILS with NAL Autopilot board and Mission planner
Mission Planner
Aircraft Model
NAL Autopliot
HILS
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALHILS• Similar to PIL simulation, the autopilot runs onSimilar to PIL simulation, the autopilot runs on
the hardware.
• Now aircraft model runs in real time using
XPC target.
• M th i t t t d t i iti• Moreover the input-output data acquisition
cards are used to model the sensors and to
drive the actuators.
Slybird HILS setupNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALy pSchematic of Hardware in loop simulator
MATLAB/SimulinkReal Time flight
Host PC Via Ethernet
XPC Target(Slybird Model)
MAX 232
Real Time flight model
Quatech(RS-232)
Baseboard(RS-232)
MAX 232
Customized k t
Visualization PCMission Planner
MAX 232
J8J12
NAL Autopliot
wirelesspackets
XBEE
XBEE XBEE
Communication ProtocolNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
xPC Target
(Real Time OS)
Quatech PCI Driver
(QSC 100 F)
Interfaced to Mother Board
TotalCount Header Length
Data Length Payload Check Sum Terminator
Check Sum Range
1 byte 1 byte 1 byte Data Length 1 byte 1 byte
Protocol Data frame
Total Count= Datalength(byte)+5 bytes
Message ConstructionNATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Unpacking and Packing of data for the transmission
HILS with xPC Target and NAL NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Autopilot boardHost PC
XPC Target
Via Ethernet
Via Serial
Visualization PC NAL Autopliot
UART to USB
converter
HILS-NAL autopilot
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALHILS NAL autopilot
Visualization PC
XPC Target
Host PC
g
NAL Autopliot
Slybird Flight data comparison
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NALSlybird Flight data comparison20
22
y (m
/s)
0
0.5
m/s
2 )
0 2 4 6 8 1016
18
Time (sec)
Velo
city
0 2 4 6 8 10-0.5
0
Time (sec)
Ay (m
50
100
g) 50
100
g)
0 2 4 6 8 10-50
0
50
Time (sec)
Phi (
deg
0 2 4 6 8 10-50
0
50
Time (sec)
Psi (
deg
200/s) 100/s)
0 2 4 6 8 10-200
0
Time (sec)
Roll
rate
(deg
/
0 2 4 6 8 10-100
0
Time (sec)
Yaw
rate
(deg
/
20 0
0 2 4 6 8 10-20
0
20
Time (sec)
Aile
ron
(deg
)
0 2 4 6 8 10-50
0
50
Time (sec)
Rudd
er (d
eg)
Time (sec) Time (sec)Longitudinal Dynamics - Flight vs. Simulated OutputLateral Dynamics - Flight vs. Simulated Output
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
Future work proposed on HILSI2C ( 8 Channels)
SPI ( 4 Channels)
6DOF RT Target
OBC
(UUT)
UART I2C ( 4 Channels)
RS 232 ( 2 Channels)
CAN ( 2 Channels)
Systemg ( )
PWM ( 10 Channels)
ADC ( 16 Channels)
DAC ( 16 Channels)
DIO ( 16 Channels)
DIO ( 16 Channels)
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
AcknowledgementsOur sincere thanks to• Director, NAL• Dr. G. K Singh and his team• Dr. C M Ananda and his team• Dr. Jatinder Singh, Head FMCD• Dr. Abhay A Pashilkar, Group head, Flight Simulation
D R h G H d MAV it• Dr. Ramesh G, Head, MAV unit.
References1. C Kamali, Alexander Kale,” Development of Six DOF model for Class-I MAV”, OT 04-01, September, 2013.
NATIONAL
AEROSPACE
LABORATORIES
BANGALORE-560 017 INDIA
CSIR-NAL
2. “Preliminary test results on 1:1 scale UAV models” Report No. HAL/ARDC/UAV/WNT/001, July 2012.
3. Alexander Kale, Shikha Jain, C Kamali,” Simulation, Modal Analysis and Parameter Estimation of Class-I MAV”,OT 04-02, October 2013.
4. Shikha Jain, C Kamali,” Experimental Validation of NAL’s Class 1 MAV Simulation Model Using Flight Data”, OT04-04, December 2013.
5. Shikha Jain, C Kamali,” Software In the Loop Simulation (SILS) for NAL’s Class 1/Similar class MAV”, OT 04-06,June 2014.
6. Kamali C, Pranshu Basaniwal, Shikha Jain, Vijeesh T ,”Processor In the Loop Simulation (PILS) for NAL’s Class1/Similar class MAV”, OT 04-07, July 2014.
7. Sanketh Ailneni, Sudesh k. Kashyap & Shantha Kumar N, “Evaluation of EKF based Attitude and HeadingEstimation in Processor in the Loop Simulation (PILS) setup with ATMEGA 2560 (ArduPilotMega) Processor”,July 2013.
8 S j d K li C A dh P ll i “T j t T ki d P th F ll i Al ith f t8. Sujeendra, Kamali C, Andhe Pallavi, “Trajectory Tracking and Path Following Algorithm for autonomousnavigation of Micro Air Vehicle” National Conference on Recent Advance in Communication Networks, March2014.
9. Viswanathan S, Guruganesh R, “Design of Autopilot for Class I MAV using Classical Control”, November 2013., g , g p g ,
10. CM Ananda, Pankaj Akula, Sunil Prasad, Pavan Kumar KVVNSD, Design and Development of MiniatureIndigenous Digital Autopilot for Micro Air Vehicle (MAV), in: The 3rd International Conference on RecentAdvances in Design, Development and Operation of Micro Air Vehicles, Nov, 2014.
Th k YThank You