Upload
others
View
26
Download
0
Embed Size (px)
Citation preview
SKYWARD EXPERIMENTAL ROCKETRY
EMBEDDED SYSTEMS BASICSWORKSHOP by ELC Skyward
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
SKYWARD EXPERIMENTAL ROCKETRY
Who we are?
2
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 3
Our Purpose
Skyward Experimental Rocketry is an active student association operating
inside Politecnico di Milano, it was born in 2012 with the ambitious goal of
designing and realizing small and medium sized experimental sounding
rockets. Our project takes on from the passion of its founders and their desire
to challenge other similar associations active in Europe. The context we are
in is very competitive and stimulating: our goal is to beat the altitude record
achieved by an experimental rocket (32300m – HyEND – University of
Stuttgart, Germany), and to do this we are following a program divided in
different steps, each one involving new development and technological
solutions.
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 4
Our Workgroup: ELS
The electronic system has been designed and
assembled entirely within the association, and
will handle real-time recording and transmission
of data during launch.
The electronic system consists of a motherboard,
which will coordinate all subsystems, each of
which is controlled by a series of dedicated
daughter-boards.
The firmware on the microprocessors has been
developed by our software engineers and it is
designed to make the most of the hardware
redundancy present onboard.
SKYWARD EXPERIMENTAL ROCKETRY ROCKSANNE 2-ALPHA
Anakin Board Stormtrooper Array
Distributed System
5
The whole system has been designed in the aim of modularity and flexibility.
SKYWARD EXPERIMENTAL ROCKETRY ROCKSANNE 2-ALPHA
Distributed System - Flowgraph
6
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PHASE 0: BASICSWhat is an embedded system?
7
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Why Embedded Systems ?
● HW / SW for Special Purpose
○ Optimized for specific tasks
○ Sensors/ Microprocessor/ Actuators
● Specific Constraints
○ Real Time / High Efficiency
○ Failsafe
○ Power Consumption
○ Structural
8
GPS
IMU
LCD
ALARM
GPS
IMU
MOTORS
LEDS
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Embedded System - Nosecone Array
9
POWER SYSTEM
PRESSURE
GPS THERMAL CUTTER
CORE SYSTEM
GSM
TEMPERATURE
STRAIN GAUGES
SENSORS ACTUATORS
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Our Design Purpose - Air Conditioning System
10
SENSORS ACTUATORS
MICROCONTROLLER
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PHASE I : SPECIFICATIONSLet’s define the proper hardware
11
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Our Requirements
12
TEMPERATURE HUMIDITY
FSR 0 - 40 [°C] 0 - 100 [%]
RESOLUTION 1 [°C] 1 [%]
ACCURACY 2 [°C] 5 [%]
SAMPLING FREQUENCY 0.1 [Hz] 0.1 [Hz]
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Sensors Parameters
TRANSDUCER PROPERTIES
● Range
● Sensitivity
● Resolution
● Accuracy
● Response time
● Precision
● Offset / Linearity / Hysteresis / Dynamic Linearity
13
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
LM75 - temperature sensors
14
(125-(-55)) / 2^9 = 0.35 [°C]
1/300ms = 3.33 Hz
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Sensors - Other Parameters
● Supply Voltage (and current consumption)
● Connectivity (Analog or I2C/SPI/UART)
● Package
15
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Sensor Connectivity - Digital Busses
16
● UART
● I2C
● SPI3 or 4 wire
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Sensor Connectivity - Analog Front End
17
SENSORS
GAIN + FILTER
AMUX + ADC
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Package - IC
18
THT: Through-Hole Technology SMT: Suface-Mount Technology
● SIP: single in-line DIPLead pitch: 1inch = 2.54mm
● QFN: Quad Flat No-leads
● SOIC: Small outline IC0.050 inch (1.27mm)
● TSSOP: thin-shrink small outline package(pitch < 0.050 inch)
● TQFP = thin-quad flat pack( p about 0.5mm)
● BGA: Ball Grid Array
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Package - others
19
THT: Through-Hole Technology SMT: Suface-Mount Technology
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
BME 280 - Humidity parameters
20
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
BME280 - Electric Parameters
21
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Microcontroller - PIC18F26K22
22
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PHASE II : SCHEMATICS DESIGN
Let’s connect all the components
23
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Power Section - RT9080
24
● LDO: Low Dropout Voltage ● Fixed Output / Adjustable
RT9080:● Vout Fixed: 3.3V● MAX Input Voltage Range: 1.5V - 5.5V
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Other Voltage Regulator - DC:DC converter
25
LDO DC:DC
Accuracy High Low
Linearity High Noisy
Efficiency P = Iout (Vin-Vout) 80 - 95 %
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
● Uses the mechanical resonance of a vibrating
crystal to create an electrical signal with
precise frequency
● External / Built-in
● Special Layout needed
Oscillator
26
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Decoupling\Bypass Capacitors
27
● Transient in current drawn by a particular
device, decoupling capacitors provide a local
source of charge so that current can be
supplied quickly without causing the voltage
on the power pins to dip suddenly.
● These capacitors are connected between
power and ground to help stabilize the
voltage delivered to active digital devices..
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Backup Capacitors
28
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Pull-up/Pull-down Resistors An old wise man once told us: "I've never saw a resistor being afflicted by segmentation fault"
29
● Ensure the right logic level even if the
devices are in Hi-Z state or disconnected
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Headers - connectors
30
RS485
STRAIN GAUGES
THERMOCOUPLES
MAIN POWER
USB POWERICSP
GENERAL PURPOSE
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
(many) LEDS
31
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PHASE II : PCB DESIGNLet’s define where to place these components
32
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
● Make the electrical interconnections between
components
● Mechanical Supports for components
● Many layers:
○ Metal (signal and power)
○ Dielectrics (separation)
PCB: Printed Circuit Board
33
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PCB REALIZATIONWith Altium Designer 16
34
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Components Library Schematics PCB Design
What we will see...
35
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Mask Realization
36
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Etching
37
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
PHASE V : FIRMWAREQuick overview of Real Time Mission Critical Software
38
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 39
Real Time Mission Critical Software
RealTime: software which fails if a timing deadline is not met.
● Digital audio system
● Control application
Mission Critical: software whose failure might cause catastrophic consequences (death, damage to property, financial losses, etc.)
● Medical radiation device
● Nuclear reactor safety system
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 40
Real Time Mission Critical Software
+RealTime Mission Critical
=
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 41
Real Time Mission Critical Software
● Car’s airbags
● Space and Aviation navigation system
● Military applications
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Real Time Mission Critical Software
42
● A control software for a Nuclear Power Plan need to sample the temperature of the core and maintain it at the required set point.
● The temperature may be sampled at fixed ratio and need to be processed as soon as possible.
● Many other sensor need to be monitored in order to discriminate
● False Positive and Real Emergencies.
● Redundancy are even in software for example different control algorithm to perform the calculation and a voting system to thrust the results.
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Software Development Methodology
43
AGILE
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Software Development Methodology
44
AGILE
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Software Development Methodology
45
● Agile doesn’t fit very well for this
● All requirements need to be covered
● Usually is not possible or not safe to patch a released system
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Software Development Methodology
46
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
How a real time software looks like:
47
● Limited Time/Memory Task
● Real Time Scheduler
● Low level Driver
● Interrupts
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
How a real time software looks like:
48
Scheduler
● Periodic and Aperiodic Task
● Many strategy (Rate-monotonic, EDF, Round Robin etc)
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
How a real time software looks like:
49
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Common problems
50
Producer Consumer
● One or more source of data (for example sensors)
● FIFO queue storing temporary data waiting to be processed.
● Asynchronous flow
Skyward use case:We use this solution because some boards are interconnected via CanBus. There is no master/slave so two or more boards can try to send data at the same time. If a collision occurs the second board will try a retransmission as soon as the bus is free. Using a queue we can buffer data and send it later.
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Common problems
51
Memory Fragmentation
● NO MALLOC (at least after the initialization phase)
● Dynamic allocation causes memory fragmentation
● Long running programs can suffer
● Non deterministic defragmentation
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Common problems
52
Memory Fragmentation Solution: Memory Pools
● Fixed size queues
● Deterministic behaviour (what to do if the queue is full?)
Skyward use case:Fixed queues. Avoid dynamic allocation.
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Common problems
53
● Can be > 1s
● Even on good SD card
● Need to minimize the number of write access
Slow I/O (Example SD Card)
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Common problems
54
● One buffer is filled
● The other is processed
● When the second is empty just swap
Slow I/O Solution: Double Buffer
Skyward use case:We use double buffering for logging our sensors to SD card on our main board.
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS
Conclusions
55
● Rigorous specification and continuous review and team communications
● Keep it simple ( less code => less tests => less bugs)
● Ask to yourself multiple times: How things can fail? How can I prevent and if not what I can do to recover from failure?
● Good specification => Good design => Good product
● It doesn’t matter if you are making a rocket, a car or an air conditioner… have fun!
SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEMS BASICS
JOIN US! WWW.SKYWARDER.EU
56