when hard realtime matters: software for complex...

25
Dokumentname > 23.11.2004 When Hard Realtime Matters: Software for Complex Mechatronic Systems Berthold Bäuml and Gerd Hirzinger Institute of Robotics and Mechatronics DLR – German Aerospace Center [email protected]

Upload: buingoc

Post on 12-Apr-2018

217 views

Category:

Documents


3 download

TRANSCRIPT

Dokumentname > 23.11.2004

When Hard Realtime Matters:Software for Complex Mechatronic Systems

Berthold Bäuml and Gerd Hirzinger

Institute of Robotics and MechatronicsDLR – German Aerospace Center

[email protected]

Dokumentname > 23.11.2004

Mechatronic Systems

o “Mechanics in the loop”o demands hard realtime

(= short latencies and determinism)o to prevent injury and damage !

Dokumentname > 23.11.2004

New Level of Complexityo complex single robotic component

(DLR-Hand-II: 13DOF, 100 sensors)o compound systems with tightly interacting parts

(Justin: 43 DOF, 250 sensors)o rates of up to 3kHz over all DOF

(up to 10kHz in next generation)o sophisticated control algorithms

(e.g. gravity compensation, impedance)o tight coupling to non-realtime modules for

user interaction, perception and planning

o Heterogenous team of experts developing software (~ 10 members) o Iterative, flexible and adaptive development flow (esp. for research prototypes)

Challenges:o “modern” software paradigms for complex systems:

o modularity (“component based software engineering”)o concurrent execution (“services”)o distributed execution (“multi core, multi CPU, networked clusters”)

o but under hard realtime constraints.

Dokumentname > 23.11.2004

“Decentral net of functional blocks and communication links”

Software concept has to providean abstract, functional viewSoftware concept has to providean abstract, functional view and the mapping to a concrete hardware setup.

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

EditCompileDebug

MonitoringConfiguration

torso JC (3x)0.3msdev TC

1msPC

1msipol3ms

invkin6ms

cartesianimpedance

1msstate

machine

arm JC (7x)0.3msdev AC

1ms

hand JC (3x4x)1msdev FC (4x)

1ms ipol1ms

invkin1ms

collisionavoidance

3ms

LinuxLinux

Linux

Linux

VxWorks

VxWorks

QNX

Linux/Windows

hand dev

REALTIME

CPU 1CPU 2

Dokumentname > 23.11.2004

Robot MiddlewareORCA (Brooks et al. 2005) MARIE (Cote et.al. 2004)MIRO (Utz et al. 2002)Player (Vaughan et al. 2003)

used in mobile roboticssoft realtime in the 100Hz range

MS Robotics Studio(msdn.microsoft.com/robotics

WindowsXP -> non realtime, WindowsCE ?

OROCOS (www.orocos.org)

hard realtime, >500Hz for two 6DOF armsmore complex systems, distributed computation ?

OpenHRP(Kanehiro et al. 2004)

RT-Middleware, based on CORBAin applications hard realtime part in monolithic modules with proprietary communication

MCA (www.mca2.org)

used in humanoid robots ARMARhard realtime on one node, but TCP/IP

YARP (Metta et al. 2006)

used in complex robots like “Domo”, but there the hard realtime parts run on DSP boards supports QNX and based on ACE -> distributed hard realtimeexecution possible ?

MIRPA hard realtime, distributed executionperformance when many DOF ?

Dokumentname > 23.11.2004

Pragmatic Approach

o None of the existing middleware concepts seemed to fit our main needs:hard realtime, scalable computing resources, easy to use.

o How far can we go, when doing it as simple as possible ?

o Hardware constraints ? o D/A- and A/D-conversion in the robotso fast buses up to 1GBit/s to the robotso CPU clocks > 3GHz, Multi-Core and Multi-CPU

(e.g. Quad-DualCore Opteron >50GFLOPS)o fast communication with low delay (1GBit: 1.5KByte in 15us)o configurable infrastructure: eg. switched Ethernet or P2P links

No !

Dokumentname > 23.11.2004

Pragmatic considerations

What is essential ?o deterministic, concurrent executiono fast, deterministic communicationo standarized interfaces for communicationo mechanisms for system configuration, startup and shutdown

and what is not ?o dynamic reconfiguration at runtimeo higher levels of abstractions (e.g abstract “range sensor”)

What can we get from a realtime OS ?o Processeso Shm on one PCo Fast, deterministic drivers to (multiple) network cards

What has to be done ourselves ?o standardized interfaceso abstraction of distributed communicationo system handling

Dokumentname > 23.11.2004

1. aRDnet-suite: lightweight (~3000 lines)o aRDnet-library (C/C++): implementation of block’s ports o ardnet block: bridge between blocks on different PCs

Implementation of aRD-concept(“agile Robot Development”)

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

EditCompileDebug

MonitoringConfiguration

torso JC (3x)0.3msdev TC

1msPC

1msipol3ms

invkin6ms

cartesianimpedance

1msstate

machine

arm JC (7x)0.3msdev AC

1ms

hand JC (3x4x)1msdev FC (4x)

1ms ipol1ms

invkin1ms

collisionavoidance

3ms

Linux

LinuxLinux

Linux

VxWorks

VxWorks

QNX

Linux/Windows

hand dev

REALTIME

CPU 1CPU 2

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

EditCompileDebug

MonitoringConfiguration

torso JC (3x)0.3msdev TC

1msPC

1msipol3ms

invkin6ms

cartesianimpedance

1msstate

machine

arm JC (7x)0.3msdev AC

1ms

hand JC (3x4x)1msdev FC (4x)

1ms ipol1ms

invkin1ms

collisionavoidance

3ms

Linux

LinuxLinux

Linux

VxWorks

VxWorks

QNX

Linux/Windows

hand dev

REALTIME

CPU 1CPU 2

Dokumentname > 23.11.2004

1. aRDnet-suite: lightweight (~3000 lines)o aRDnet-library (C/C++): implementation of block’s portso ardnet block: (UDP)-bridge between blocks on different PCso Unix-like hierarchical startup and shutdown of distributed system,

with detailed configuration of QoS for communication2. Matlab/Simulink-toolchain

o standard tool for control design o Automatic code generation with RTWo Parallelizing with RTLab from OpalRT (www.opal-rt.com)o stubs for interfacing aRDnet-blocks

Implementation of aRD-concept

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

EditCompileDebug

MonitoringConfiguration

torso JC (3x)0.3msdev TC

1msPC

1msipol3ms

invkin6ms

cartesianimpedance

1msstate

machine

arm JC (7x)0.3msdev AC

1ms

hand JC (3x4x)1msdev FC (4x)

1ms ipol1ms

invkin1ms

collisionavoidance

3ms

Linux

LinuxLinux

Linux

VxWorks

VxWorks

QNX

Linux/Windows

hand dev

REALTIME

CPU 1CPU 2

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

MonitoringConfiguration

torso dev

statemachine

arm dev

hand dev

Linux

LinuxLinux

Linux

VxWorks

VxWorks

Linux/Windows

EditCompileDebug

QNX

REALTIME

CPU 1CPU 2

Dokumentname > 23.11.2004

1. aRDnet-suite: lightweight (~3000 lines)o aRDnet-library (C/C++): implementation of block’s portso ardnet block: (UDP)-bridge between blocks on different PCso Unix-like hierarchical startup and shutdown of distributed system,

with detailed configuration of QoS of communication links2. Matlab/Simulink-toolchain

o standard tool for control design o Automatic code generation with RTWo stubs for interfacing aRDnet-blocks

Key decision: QNX for realtime and Linux for non-realtime(limited support for VxWorks and Windows)

Implementation of aRD-concept

Dokumentname > 23.11.2004

1. send4. rec

QNX

Performance:

QNX-PC with Core2Duo, 2.8GHz

roundtrip of packet of 1kByte size between two standalone blocks

o on one QNX-PC: 20us in worst caseo on two QNX-PCs with ardnet-bridge (UDP) over P2P 1GB-Ethernet link:

200us in worst case (160us on average)

1. send4. rec

QNX

2. rec3. send

QNX

eth

IP

IP

eth

1GBit / UDP

aRDnet performance

Dokumentname > 23.11.2004

QNX

Performance:High Rate

Simulink-HIL-setup: reading analog values and writing them to harddisk

o Rates > 50 KHz without drop-outs possible o At 30 KHz system overhead is less than 10 % cpu-time

AD HDworld

Dokumentname > 23.11.2004

Applications: (July 2005)Preliminary study for Two-Hand-Arm-System

Dokumentname > 23.11.2004

hand dev

VxWorks/Intel

IP

eth

ethI

P eth

hand dev

VxWorks/PPC

IP

eth

ethI

P eth

arm dev

VxWorks/PPC

IP

eth

ethI

P eth

arm dev

VxWorks/PPC

IP

eth

ethI

P eth

control1ms

Windows

IP

eth

Linux

IP

eth

DebugMonitorProfile

switch

eth

IP

eth

IP

(from VxWorks)QNX

1kHz

1kHz

1kHz

1kHz

Dokumentname > 23.11.2004

Applications: (May 2006)Two-Hand-Arm-Torso Justin

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

torso dev

statemachine

arm dev

hand dev

Linux

LinuxLinux

QNX

Linux/Windows

REALTIME

arm dev

hand dev

CPU 1CPU 2

Dokumentname > 23.11.2004

vision

world model

devcamera GUI

ECpath planning

devinput device

3Dviewer

statemachine

hand dev

Linux

LinuxLinux

Linux

QNX

Linux/Windows

REALTIME

hand dev

torso dev

arm dev

VxWorks

arm dev

VxWorks

Dokumentname > 23.11.2004

Two-Hand-Arm-Torso Justin

Dokumentname > 23.11.2004

Applications

o Two-Hand-Arm-Torso Justino Virtual reality with haptic feedbacko Telepresence/Telemanipulationo Medical roboticso Brain/Muscle-Interface-Groupo Teststands

o Fingero Armo Micro-surgical deviceso …

o Dynamics simulatorso Ball catchingo …

o …~ 15 “aRD-seats” at our intsitute

Dokumentname > 23.11.2004

Conclusions

o hard realtime is a must, when mechanics is in the loopo increasing complexity of mechatronic systems demands for modern

software concepts also there, namely: modularity, concurrent execution, distributed execution

o an “operating system for robotics” has to provide hard realtimeo our pragmatic and lightweight aRD concept proved the feasibility even on

“cheap” PC based computing hardware byo introducing only a thin layer of abstraction above the realtime OSo allowing to configure the QoS of all communication

Hope, that a perfect operating systems for robotics will emerge soon, so that we can again work on that, what roboticists love to do …

Dokumentname > 23.11.2004

Justin Serving Tea …