Introducing a robust multitasking operating system for real-time - - PowerPoint PPT Presentation

introducing a robust multitasking operating system for
SMART_READER_LITE
LIVE PREVIEW

Introducing a robust multitasking operating system for real-time - - PowerPoint PPT Presentation

Introducing a robust multitasking operating system for real-time demands 06.05.2013 Introducing a robust multitasking OS Michael Fritscher 1 Agenda Introduction Architecture Function tests Benchmarks Conclusion


slide-1
SLIDE 1

Introducing a robust multitasking OS 06.05.2013 1 Michael Fritscher

Introducing a robust multitasking operating system for real-time demands

slide-2
SLIDE 2

Introducing a robust multitasking OS 06.05.2013 2 Michael Fritscher

Agenda

  • Introduction
  • Architecture
  • Function tests
  • Benchmarks
  • Conclusion
  • Outlook
slide-3
SLIDE 3

Introducing a robust multitasking OS 06.05.2013 3 Michael Fritscher

Introduction

  • Robot platform (Merlin) existent
  • New Microcontroller (XE167) and the IDE already working
  • BUT: The used OS had neither the performance nor the support functions which were

needed by many tasks

Status before

slide-4
SLIDE 4

Introducing a robust multitasking OS 06.05.2013 4 Michael Fritscher

Introduction

Design and Implementation of a new foundation for many different applications for the future Needed attributes:

  • Containment and abstraction
  • Preemptive multitasking
  • Real time
  • Detection and Reaction of error states
  • Easy to develop with (It will be used by students)

Goals

slide-5
SLIDE 5

Introducing a robust multitasking OS 06.05.2013 5 Michael Fritscher

Tasks

Task prototype: „Sensing-Processing-Reaction“

Wait for signals (releasing control) Get the control back Which signals were fired? Prozess the signals React

Signals fired

slide-6
SLIDE 6

Introducing a robust multitasking OS 06.05.2013 6 Michael Fritscher

Architecture

Communication Task 1 Task … Task n IPC Frameworks (actuators, sensors, streams) I2C Data pre/post processing Common data structures Scheduler / Stacks Signals Heap Drivers

Overview

Memory (Stack, Page pointers, MPU) RTC Timer / Counters IRQs UART (COM, I2C, SPI) CAN A/D Convertors Digital I/O XE167 Core

slide-7
SLIDE 7

Introducing a robust multitasking OS 06.05.2013 7 Michael Fritscher

Architecture: Scheduler

Normal operation

Task1

(preempted by scheduler)

Task2

(release control by itself)

skipped Task …

(waiting for event)

Task n Scheduler

Get control Loose control Get control Release control

slide-8
SLIDE 8

Introducing a robust multitasking OS 06.05.2013 8 Michael Fritscher

Architecture: Scheduler

Incoming signal

Task1

(preempted by scheduler)

Task2

(release control by itself)

Task …

(waiting for event which fired)

Task n Scheduler

Loose control Get control

slide-9
SLIDE 9

Introducing a robust multitasking OS 06.05.2013 9 Michael Fritscher

Architecture: Memory

  • Stack
  • Heap

Stack 2

Checksum Canary

Stack n

Checksum Canary

… Stack 1

Checksum Canary

Object 1

  • Obj. n

Bitmap

empty

Canary Canary

3 … … End 1 End

slide-10
SLIDE 10

Introducing a robust multitasking OS 06.05.2013 10 Michael Fritscher

Architecture: IPC

Inter Process Communication

IPC management list List 1 List n List … List 2 IPC message list Signal Size Number Msg 1 Msg n Msg … Msg 2 „double linked lists“

slide-11
SLIDE 11

Introducing a robust multitasking OS 06.05.2013 11 Michael Fritscher

Architecture: Frameworks

Task Framework Filter Driver Hardware

Sensors, Actuators, Streams, I2C

Task Framework Filter Driver Hardware Task Framework Driver FIFO Hardware Task Framework Device driver I2C driver Hardware

Sensors Actuators Streams I2C

slide-12
SLIDE 12

Introducing a robust multitasking OS 06.05.2013 12 Michael Fritscher

Architecture

  • Connection to the outside world
  • Normal task
  • Uses the IPC system
  • Connection orientated (with keep alives)
  • Every packet is acked
  • CRC-16
  • No escaping of the payload

Communications task

slide-13
SLIDE 13

Introducing a robust multitasking OS 06.05.2013 13 Michael Fritscher

  • Integrity tests: During the normal operation

– Helps a lot against programmer’s mistakes

  • Initialization tests: During booting

– Tests almost every component very thoroughly (almost no time issue here) – Helps a lot against regressions or undesired side effects of alterations

  • System tests: Manually triggered

– Performance & usably tests

Function tests

Overview

slide-14
SLIDE 14

Introducing a robust multitasking OS 06.05.2013 14 Michael Fritscher

Function tests: Integrity

  • During the normal operation
  • Crucial components: Scheduler, Memory, IRQ-Handlers
  • “Test as much as possible and feasible regarding performance”
  • Helps a lot against programmer's failures

– Invalid parameters – Invalid memory access (despite of having only a simple MMU!) – Abuse of system functions

 Reactions: Useful error messages, restart to regain a safe state or halt

slide-15
SLIDE 15

Introducing a robust multitasking OS 06.05.2013 15 Michael Fritscher

Function tests: during initialization

  • During booting
  • Very thoroughly test of all components of the system

– Heap/Stack – Queues – Scheduler – also with a set of test tasks

  • Detection of hardware failures, regressions and undesired side effects of alterations
  • Duration: 3 seconds
slide-16
SLIDE 16

Introducing a robust multitasking OS 06.05.2013 16 Michael Fritscher

Function tests: The whole system

  • Synthetic tests

– Test the interaction between the components – Complex test tasks, which interact with each other (directly or timely) – Only the board and optionally an oscilloscope required

  • Realistic Test

– Use-case which could occur in normal use – Tests the suitability of the API and the system – Chosen scenario:

  • Learn and retrace a way path with obstacle avoidance
  • Control with ultrasonic sensors

Overview

slide-17
SLIDE 17

Introducing a robust multitasking OS 06.05.2013 17 Michael Fritscher

  • Two tasks
  • Large set of tasks

Real time characteristics (delays of incoming signals): Results

Benchmarks

Without Delay in milliseconds Delay in milliseconds Distribution Distribution

slide-18
SLIDE 18

Introducing a robust multitasking OS 06.05.2013 18 Michael Fritscher

  • Impact of the integrity tests
  • IPC: 90k-172k messages per second
  • Stability over longer runtime
  • Context switches: 40-800µs (depends on

the amount of integrity tests)

Results ff.

Benchmarks

Calc packets per second Calc packets per second

Without any

Time in s

slide-19
SLIDE 19

Introducing a robust multitasking OS 06.05.2013 19 Michael Fritscher

Benchmarks

  • No crashes or bad behavior
  • Delays: Exactly as estimated, no spikes, even with complex scenarios
  • Performance: Without the integrity tests near the maximum (IRQ-Handlers etc. need

to be into consideration)

  • Very fair to the tasks
  • No complex and bug-provoking search of parameters for the scheduler
  • Context switches are fairly fast (~ 3k cycles)

Summery

slide-20
SLIDE 20

Introducing a robust multitasking OS 06.05.2013 20 Michael Fritscher

  • Task: Learn and retrace a way path with
  • bstacle avoidance – control with

ultrasonic sensors

  • Method: save the relative timestamps

and the commandos

  • Tests:

– Duration of the implementation  2 days! – Stability / reliability – Accurateness (measured using iSpace from Nikon)

Realistic test

Tests of the whole system

Taught Retraced Retraced, with obstacles

slide-21
SLIDE 21

Introducing a robust multitasking OS 06.05.2013 21 Michael Fritscher

Conclusion

  • A Operating System was designed and implemented, with following reached goals:

– Robustness – Multitasking – Real time facility – Easy usage – can be used by students as well as scientific officers

  • Also frameworks and drivers for several devices
  • Lots of tests which prove both the performance and the suitability

=> Creation of a sustainable basis for many applications in the field of robotics

slide-22
SLIDE 22

Introducing a robust multitasking OS 06.05.2013 22 Michael Fritscher

Outlook

  • Adaption to several other robots – like the Scooter (Fit4Age)
  • Several drivers – including more tests for external components
  • Implementing more schedule algorithms
  • Adaption to ROS (Robot Operating System)
  • Multi microcontroller systems
slide-23
SLIDE 23

Introducing a robust multitasking OS 06.05.2013 23 Michael Fritscher

Thanks for your attention!