EMBEDDED SYSTEMS BASICS WORKSHOP by ELC Skyward SKYWARD - - PowerPoint PPT Presentation

embedded systems basics
SMART_READER_LITE
LIVE PREVIEW

EMBEDDED SYSTEMS BASICS WORKSHOP by ELC Skyward SKYWARD - - PowerPoint PPT Presentation

EMBEDDED SYSTEMS BASICS WORKSHOP by ELC Skyward SKYWARD EXPERIMENTAL ROCKETRY SKYWARD EXPERIMENTAL ROCKETRY Who we are? SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS 2 Our Purpose Skyward Experimental Rocketry is an active student


slide-1
SLIDE 1

SKYWARD EXPERIMENTAL ROCKETRY

EMBEDDED SYSTEMS BASICS

WORKSHOP by ELC Skyward

slide-2
SLIDE 2

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

SKYWARD EXPERIMENTAL ROCKETRY

Who we are?

2

slide-3
SLIDE 3

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.

slide-4
SLIDE 4

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

  • f 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.

slide-5
SLIDE 5

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.

slide-6
SLIDE 6

SKYWARD EXPERIMENTAL ROCKETRY ROCKSANNE 2-ALPHA

Distributed System - Flowgraph

6

slide-7
SLIDE 7

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PHASE 0: BASICS

What is an embedded system?

7

slide-8
SLIDE 8

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

slide-9
SLIDE 9

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

slide-10
SLIDE 10

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Our Design Purpose - Air Conditioning System

10

SENSORS ACTUATORS MICROCONTROLLER

slide-11
SLIDE 11

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PHASE I : SPECIFICATIONS

Let’s define the proper hardware

11

slide-12
SLIDE 12

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]

slide-13
SLIDE 13

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Sensors Parameters

TRANSDUCER PROPERTIES

  • Range
  • Sensitivity
  • Resolution
  • Accuracy
  • Response time
  • Precision
  • Offset / Linearity / Hysteresis / Dynamic Linearity

13

slide-14
SLIDE 14

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

LM75 - temperature sensors

14

(125-(-55)) / 2^9 = 0.35 [°C] 1/300ms = 3.33 Hz

slide-15
SLIDE 15

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Sensors - Other Parameters

  • Supply Voltage (and current consumption)
  • Connectivity (Analog or I2C/SPI/UART)
  • Package

15

slide-16
SLIDE 16

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Sensor Connectivity - Digital Busses

16

  • UART
  • I2C
  • SPI

3 or 4 wire

slide-17
SLIDE 17

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Sensor Connectivity - Analog Front End

17

SENSORS GAIN + FILTER AMUX + ADC

slide-18
SLIDE 18

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Package - IC

18

THT: Through-Hole Technology SMT: Suface-Mount Technology

  • SIP: single in-line

DIP Lead pitch: 1inch = 2.54mm

  • QFN: Quad Flat No-leads
  • SOIC: Small outline IC

0.050 inch (1.27mm)

  • TSSOP: thin-shrink small
  • utline package

(pitch < 0.050 inch)

  • TQFP = thin-quad flat pack

( p about 0.5mm)

  • BGA: Ball Grid Array
slide-19
SLIDE 19

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Package - others

19

THT: Through-Hole Technology SMT: Suface-Mount Technology

slide-20
SLIDE 20

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

BME 280 - Humidity parameters

20

slide-21
SLIDE 21

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

BME280 - Electric Parameters

21

slide-22
SLIDE 22

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Microcontroller - PIC18F26K22

22

slide-23
SLIDE 23

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PHASE II : SCHEMATICS DESIGN

Let’s connect all the components

23

slide-24
SLIDE 24

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
slide-25
SLIDE 25

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 %

slide-26
SLIDE 26

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

slide-27
SLIDE 27

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

  • n the power pins to dip suddenly.
  • These capacitors are connected between

power and ground to help stabilize the voltage delivered to active digital devices..

slide-28
SLIDE 28

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Backup Capacitors

28

slide-29
SLIDE 29

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

slide-30
SLIDE 30

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Headers - connectors

30

RS485 STRAIN GAUGES THERMOCOUPLES MAIN POWER USB POWER ICSP GENERAL PURPOSE

slide-31
SLIDE 31

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

(many) LEDS

31

slide-32
SLIDE 32

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PHASE II : PCB DESIGN

Let’s define where to place these components

32

slide-33
SLIDE 33

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

slide-34
SLIDE 34

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PCB REALIZATION

With Altium Designer 16

34

slide-35
SLIDE 35

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Components Library Schematics PCB Design

What we will see...

35

slide-36
SLIDE 36

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Mask Realization

36

slide-37
SLIDE 37

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Etching

37

slide-38
SLIDE 38

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

PHASE V : FIRMWARE

Quick overview of Real Time Mission Critical Software

38

slide-39
SLIDE 39

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
slide-40
SLIDE 40

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

40

Real Time Mission Critical Software

+

RealTime Mission Critical

=

slide-41
SLIDE 41

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

41

Real Time Mission Critical Software

  • Car’s airbags
  • Space and Aviation navigation system
  • Military applications
slide-42
SLIDE 42

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.

slide-43
SLIDE 43

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Software Development Methodology

43

AGILE

slide-44
SLIDE 44

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Software Development Methodology

44

AGILE

slide-45
SLIDE 45

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

slide-46
SLIDE 46

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

Software Development Methodology

46

slide-47
SLIDE 47

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
slide-48
SLIDE 48

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)

slide-49
SLIDE 49

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEM BASICS

How a real time software looks like:

49

slide-50
SLIDE 50

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.

slide-51
SLIDE 51

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

slide-52
SLIDE 52

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.

slide-53
SLIDE 53

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)

slide-54
SLIDE 54

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.

slide-55
SLIDE 55

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!
slide-56
SLIDE 56

SKYWARD EXPERIMENTAL ROCKETRY EMBEDDED SYSTEMS BASICS

JOIN US!

WWW.SKYWARDER.EU

56