Workshop on the object oriented program library for LBS systems ...

ikb.weihenstephan.de

Workshop on the object oriented program library for LBS systems ...

ong>Workshopong> on the object oriented

program library for LBS systems

LBS-Lib

Dipl. Inf. Achim Spangler


Structure of the workshop:

1) History, Design and Development of LBS-Lib 10:00Uhr

--- LUNCH --- 11:00Uhr

2) ISO Integration in LBS-Lib 12:00Uhr

3) C++ Introduction 12:30Uhr

4) Design of some exemplary functional units in detail 13:30Uhr

5) Explanation of tutorial examples 14:00Uhr

--- COFFEE BREAK --- 15:00Uhr

6) Internet accessible resources 15:30Uhr

7) Introduction to development with ESX 16:00Uhr

8) Practical exercise 17:00Uhr

--- END OF FIRST DAY --- (“Bräustüberl”) 18:00Uhr

9) Future organisation of LBS-Lib project 09:00Uhr

10) Adoption to new ECU types 09:30Uhr

11) Future work to reach stable release of LBS-Lib 10:30Uhr

12) Open discussion and questions 11:30Uhr

Spangler

Auernhammer

The LBS-Program Library -

Structure of the ong>Workshopong>

Spa2000_81en.ppt


CAN - LBS

Tractor ECU Fertiliser ECU Task Controller GPS Receiver

physical

logical

speed

PTO

3-point linkage

application

rate

work width

GPS

physical device

service

connection to service

Spangler

Auernhammer

LBS -

An Open Network of Services

Spa2000_52en.ppt


CAN - LBS

Tractor ECU Fertiliser ECU Task Controller GPS Receiver

physical

logical

speed

PTO

3-point linkage

speed

PTO

3-point linkage

application

rate

work width

application

rate

work width

GPS

GPS

used services

provided services

physical device

provide information, accept setpoint

set setpoint, take information

logical connection

Spangler

Auernhammer

Providing and Using of Services

Spa2000_53en.ppt


physical

CAN - LBS

Furrow Press

ECU

Task Controller

Rotary Harrow

ECU

logical

compaction -

intensity

tilth-intensity

compaction intensity

tilth -

intensity

address to:

primary tillage


physical device

address

information

provided

services

used services

search

provide information, accept

setpoint

set setpoint, take information

Spangler

Auernhammer

Addressee Search for

Process Data

Spa2000_56en.ppt


CAN - LBS

Tractor ECU

phys

fertiliser

application

Fertiliser ECU

Task

Controller

log

Autonomous Intelligence

use: control strategy, internal states

external states

decide: setpoint acceptance, actor

control, publish interpreted

sensor values

SPEED

SPEED

APPL. RATE

APPL. RATE

information

information

information

information

control

control

control

control

remote service

local service

physical device

interaction induced by local intelligence

Interaction induced by remote device

Software implemented intelligence

Spangler

Auernhammer

Device as Autonomous Agent

Spa2000_54en.ppt


CAN - LBS

Tillage ECU Tractor ECU Fertiliser ECU Planter ECU

physical

logical

speed

PTO_F

PTO_B

speed

PTO_F

PTO_B

speed

speed

PTO_F

= n tractor_construction * PTO _B

PTO_F = m tillage,fertiliser * PTO_B

m = n ∧ speed tillage

∩ speed tillage

∩ speed tillage

≠ { }

m ≠ n ∨ speed tillage

∩ speed tillage

∩ speed tillage

= { }

physical device

provided services

used services

provide information, accept setpoint

set setpoint, take information

Spangler

Auernhammer

Process Data Setpoint

Interest Conflict

Spa2000_55en.ppt


LBS

network

open

distributed

dependencies

co-operative

units

unknown

attributes

(producer, model)

unknown

network

configuration

net of

states

no

master-slave

unknown

services

unknown

dependencies

Socrates: „I know only,

that I know nothing“

Spangler

Auernhammer

Summarised Demands of LBS

on Implementation

Spa2000_57en.ppt


CAN - LBS

exact setting of

PTO shift

Rotary

Harrow ECU

exact setting of

engine RPM

Tractor ECU

knows exact engine,

transmission and PTO

configuration of connected

tractor;

has to realise adoption

to changes of

environmental conditions;

no other device can

control PTO shift, engine

RPM and transmission

exact setting of

transmission

complete bound to

settings of rotary harrow

--> no dynamic

adaption to

environmental

conditions or

needs of other

devices

physical device

service

control flow

Spangler

Auernhammer

SAE J 1939 -

Control speed and PTO with very tight binding

Spa2000_81en.ppt


CAN - LBS

exact setting of

speed

Rotary

Harrow ECU

Tractor ECU

doesn't have to know

how tractor realises

wanted speed and PTO;

no other device can

control speed and PTO

exact setting of

PTO

motor management of

tractor can decide

how to realise wanted

speed and PTO

physical device

service

control flow

Spangler

Auernhammer

Process Data -

Control speed and PTO with tight binding

Spa2000_82en.ppt


CAN - LBS

MIN / MAX limits

for speed

Rotary

Harrow ECU

doesn't have to know how

tractor realises wanted

speed and PTO;

high probability that speed

and PTO requirements of

other devices are compatible

MIN / MAX limits

for relation

between speed

and PTO

Tractor ECU

motor management of

tractor can decide how to

realise wanted speed and

PTO;

free to choose suitable

settings that fullfill

wishes of all devices

physical device

service

control flow

Spangler

Auernhammer

Process Data -

Control speed and PTO with loose binding

Spa2000_83en.ppt


CAN - LBS

Fertiliser ECU

MIN / MAX limits

for speed

Rotary

Harrow ECU

Tractor ECU

doesn't have to know how

tractor realises wanted

speed and PTO;

high probability that speed

and PTO requirements of

other devices are

compatible

MIN / MAX limits

for speed

MIN / MAX limits

for relation

between speed

and PTO

motor management of

tractor can decide how to

realise wanted speed and

PTO;

free to choose suitable

settings that fulfil wishes

of all devices

physical device

service

control flow

Spangler

Auernhammer

Process Data -

Double Control with loose binding

Spa2000_84en.ppt


application specific software for ECU

update raw value

evaluate received

set-points

choose master

set-point

accept / reject

new master set-point

request single

value sub-types

select suitable

measure program

increments

start / stop

measure program

set

set-point

accepted

rejected

retreive actual

master set-point

measuring set-point

local own process data

measuring set-point

remote process data

hosted by other device

library with automasing of process data

Spangler

Automasing of Process Data

Interactions

Auernhammer Spa2000_85en.ppt


Office Software Developer

Windows

Mac-OS

UNIX A

UNIX B

Tower

PC

Desktop

PC

Server

PC

Macintosh

Workstation i

Mainframe j

LINUX

LINUX:

• Same API for different computers

• Open Source kernel adapted

by widespread community

Solution for Software Developer:

==> less adapting cost

==> lower price

==> better service quality

Spangler

Auernhammer

Standard Software needs

Standard Platform

Spa2000_58en.ppt


Operating System i

Operating System j

NO Operating System

Operating System k

NO Operating System

µProcessor A

µProcessor A

µProcessor A

µProcessor B

µProcessor B

Variety of Application Interfaces (API)

Adaption for every API and limited number of units

base development cost + base support cost + adoption cost + version specific support cost

(number of units / version)

TOO HIGH FOR COMMERCIAL SUCCESS !!

No commercial reference

implementation developed

Spangler

Auernhammer

Problems Caused by Diversity of

Embedded Devices

Spa2000_59en.ppt


DIN 9684 - LBS

70 % clearly defined

30 % ambiguous defined

Company A Company B Company C

Interpretation A

insufficient

communication

Interpretation B

insufficient

communication

Interpretation C

Implementation

Variant A

Implementation

Variant B

Implementation

Variant C

incompatible

devices

incompatible

devices

Spangler

Auernhammer

Compatibility Problems Caused

by Separate Implementations

Spa2000_60en.ppt


sensor

step 1

actor 1

actor n

intelligence

sensor 1

step 2

actor

remote state v

remote state u

local setpoint I

sensor m

intelligence

local setpoint J

sensor

step n

actor

remote setpoint

intelligence

local state B

local state A

standard control circuit

with known parts in closed system

dependency on services, states, interactions of

local/remote services, with dynamic constellation of

partners in open system

Software:

•switch-case

•loop

•well defined configuration

Software:

•abstraction

•flexibility of interactions

•state based

•standard methods for different services

Spangler

Auernhammer

Service Interaction Enforces New

Software Modelling

Spa2000_61en.ppt


Automatic Gathering of Process Data based on LBS

* simple Implement Indicator (IMI) to represent thumb implement

* IMI with integration of sensor signals

* georeferenced recording (GPS)

* gather sensor signals from tractor

* central storing with Task Controller

But:

Most of the needed devices and development tools doesn‘t exist.

Decision:

* develop software for missing devices

* create program library as base tool

Future:

Publish program library as Open Source to stimulate commercial

development of LBS devices to ease future research.

Spangler

Auernhammer

Research Group IKB-Dürnast

Spa2000_62en.ppt


• implement the demanded functionality

• realise capability and flexibility with

enough reserve for upcoming challenges

• prefer suitable concept and programming language to restrictions of

to simple hardware (e.g. disregard 8 bit µProcessor if no C++

available)

• ease adaption to different hardware conditions

• make distributed code maintainance possible

with strict modularised design

Spangler

Auernhammer

Open Source Program Library LBS-Lib -

Main Purpose

Spa2000_63en.ppt


• analyse LBS (DIN9684) standard

• settle unclear elements in co-operation with standardising

group (e.g. mean process data value, system announce)

• create worst-case scenarios for extreme conditions

• acquire modularised design of LBS-Lib and test it against scenarios

• select suitable programming language

• implement and test LBS-Lib

Spangler

Auernhammer

Open Source Program Library LBS-Lib -

Proceeding Overview

Spa2000_64en.ppt


Hardware

Driver

LBS

Device

Communication

Divide in Subtasks

CAN

sensor

actor

local

member

list

global

member

list

strategy,

logic

global

service

list

format

CAN msg

base

data

system

management

management

process

data

manage

nodes

node

actions

Spangler

Auernhammer

announce alive alive statistics store name

Divide Et Impera

Spa2000_65en.ppt


Communication

Layer

standard unique implementation

with identical software

==> compatibility

==> combined development

==> parallel test

increases stability

==> result > input 1

+

input 2

+ ... +

input n

Hardware

Abstraction

Layer

Abstraction

1

Abstraction

2

Abstraction

n

Hardware

Adaption

Layer

OS +

µProc

Adaption

1

Operating

System i

µProc A

Adaption

2

No Operating

System

µProc A

Adaption

n

Operating

System m

µProc K

==> common strategy for

adoption to different

target systems

==> distributed adoption

open to everybody

Spangler

Auernhammer

Power of Open Source

Spa2000_66en.ppt


LBS_System:

LBS_Base:

LBS_Process:

LBS_Terminal:

LBS:

* manage functional components

* access to LBS interactions

not to be change

implementation of

standard

conformant

communication

hardware access

via interfaces

System:

* uniform access on hardware

uniform

interfaces

CAN_IO

EEPROM_IO

Aktor_O

Sensor_I

RS232_IO

different hardware

necessiate

adaptions

Spangler

Auernhammer

Modular structure of the

LBS program library LBS-Lib

Spa2000_67en.ppt


System Management with LBS_System

Monitor lists for members and services deliver detailed

informations about the running system. Tasks for local

members and services can be implemented

automatically.

Example: announce local member

// variable (instance) lbs of central LBS object

LBS lbs;

// variable with GETY_POS code of local machine

byte b_my_gtp;

// variable with name of local machine

byte str_my_name[8];

// tell LBS e lement-object LBS_System to announce

// a local member

lbs. lbs_system() . create_identity(& b_my_gtp,

str_my_name)

;

LBS

lbs_system()


LBS_System

create_identity(byte& rrefb_gtp, byte pb_name[8])


Process Base Data with LBS_Base

Mangement of LBS base data for active sending or

passive receiving systems. Easy update (active) and

request (passive) of values on any desired

timestamp.

Example: update and request measured value

// variable (instance) lbs of central LBS object

LBS lbs;

// variable for measured value of the radar sensor

long l_radar_sensor_speed;

// update the radar speed of the LBS element-object

// LBS_Base (activ sending ECU)

lbs. lbs_base() . set_speed_real(l_radar_sensor_speed) ;

// variable for “real speed”

long l_speed_real;

// request actual value (receiving ECU)

l_speed_real = lbs. lbs_base() . speed_real() ;

LBS

lbs_base()


LBS_Base

set_speed_real(long rl_speed)

lspeed_real()


Spangler

Auernhammer

Example use of the objects

Spa2000_68en.ppt


Control and Watch Systems with Process

Data by LBS_Process

LBS process data enable a flexible control

mechanism by sending of exact, minimal or maximal

set points. Measuring programs can communicate

measured, medium or integral values in time-,

distance proportional or value related intervals.

Example: start measuring program on remote ECU

// variable (instance) lbs of central LBS object

LBS lbs;

// pointer to instance of remote process data-object

// with value type:

// LIS 0, GETY 2, WERT 1, INST 0, ZAEHLNUM 255, POS 0

LBS_Process_Data_Remote

pc_imi_workstate= lbs. lbs_process() .

insert_proc_data_remote(0,2,1,0,255,

0,16,&b_my_gtp) ;

// start measuring program:

// measured value, target

// message, send timeprop.

// every 1sec.

pc_imi_workstate-> prog() .

add_subprog(Proc::target,

Proc::time_prop,

1000) ;

LBS_Process_

pc_imi_workstate Data_Remote

-> start(Proc::target, prog()

Proc::time_prop, start(t_prog_type,

Proc::do_val) ; t_type, t_do_send)

LBS

lbs_process()


LBS_Process

insert_proc_data_remote(

byte, byte, byte, byte, byte,

byte, byte, byte&)


Measure_Prog_

Remote

add_subprog(

t_prog_type,

t_type,long)


Interaction with Driver via Virtual

Terminal with LBS_Terminal

Agricultural machine manufactors can control the

interaction with the driver independent of single

terminals via the virtual terminal of LBS. LBS_Terminal

enables easy combination of display elements like

text and lines. Update of displayed elements and

(de)activation of components is handled.

Example: create basic display and insert a text

// variable (instance) lbs of central LBS object

LBS lbs;

// create terminal display

Terminal_Item* deXterm =

lbs. lbs_terminal() .

create_terminal(& b_my_gtp)

;

// insert display area

// in the terminal

tr_Static_Field* deXsf = deXterm

-> create_StaticField(0, 0) ;

// insert text

deXsf-> insert_text(”Hello World”) ;

tr_StaticField

insert_text

(char* rpc_text)


LBS

lbs_terminal()


LBS_Terminal

create_terminal

(byte* rpb_local_gtp)


Terminal_Item

create_StaticField(

int ri_xpos,

int ri_ypos)


Spangler

Auernhammer

Example use of the objects

Spa2000_74en.ppt


Store Values in EEPROM with EEPROM_IO

EEPROM_IO enables easy read and write of variables of any type in the EEPROM (permanent memory

for configuration informations, etc.).

Example: read machine ident from EEPROM and store measured values in EEPROM

// variable (instance) hardware of central System object

System hardware;

// set read position in EEPROM to begin of machine ident

hardware. eeprom() . setg(ADR_IDENT_NAME) ;

// read machine ident

byte pb_my_name[8];

System

hardware. eeprom() . read_string(pb_my_name, 7) ;

eeprom()


// store measured value in EEPROM

long l_wert_x1;

word w_wert_x2;

hardware. eeprom() . setp(ADR_WERT_XY) ;

hardware. eeprom()


Lunch Break till 12:00


system init

announce machine at LBS

wait

no

announced

yes

determine work state from base data:

* 3-point linkage position

* front/back PTO

* theoretic/real speed

no

working

yes

update:

* whole time

* whole distance

* wheelslip

* working state

update:

* work time

* work distance

* work area

no

LBS End

yes

system stop

Spangler

Auernhammer

Process Chart of an Example

Application with the LBS-Lib

Spa2000_69en.ppt


• Implementation and test on pure PC system with simulated ECU

BIOS

• adaption to the BIOSes of the ECU ESX and the prototype of

“Implement Indicator” from “Sensortechnik Wiedemann” (STW,

http://www.sensor-technik.de/) with intensive tests in laboratory

with testbed

massive field test with georeferenced data recording for more than

100h

Spangler

Auernhammer

Open Source Program Library LBS-Lib -

Test Phases

Spa2000_70en.ppt


LBS Testfacility


Process data acquisition


Use of LBS_Terminal for virtual terminal


* System Management

- announce local member as:

+ only DIN 9684

+ only ISO 11783

+ DIN and ISO (if DIN is used with 250kbit/s if no 125kbit/s DIN is active)

- access device informations with key:

(device class, lower 3 bit of device class instance) == (GETY, POS)

of DIN and / or ISO monitor list

* Base Information

information PGN equivalent to DIN Base Data in same place

* Process Data:

- exact 8 data byte string format as DIN used

(reject changes in ISO: elimination of LIS, change of data type, etc.)

- local or remote host of process data equivalent to DIN identified by (GETY, POS)

- dynamic detection which protocol to use for interaction with device (GETY, POS)

==> application doesn't have to worry about right protocol if own device is

announced at both protocols

Spangler

Auernhammer

State of ISO 11783 Integration

in LBS-Lib

Spa2000_86en.ppt


C++ Introduction


LBS

LBS_System

CAN_Customer

Service_Monitor

Member_Monitor

System_Pkg

CAN_Pkg

Service_Item

Member_Item

Ident_Item

format

system

msg

format

general CAN

msg

object

statistical information

about all services

and management of

local services

statistical informations

about all members

and management of

local members

manage local

member and ensure

unique GETY_POS

before announce

description

has a element

is_a / inherit to

has list of

description

Spangler

Auernhammer

Internal Object Structure for

LBS System Management

Spa2000_76en.ppt


iLBS

iLBS_System

iService_Item

iMember_Item

iIdent_Item

statistical information

about all services

and management of

local services

statistical information's

about all members

and management of

local members

manage local

member and ensure

unique GETY_POS

before announce

object

description

has list of

description

Spangler

Auernhammer

Interface Object Structure for

LBS System Management

Spa2000_87en.ppt


LBS

LBS_Base

CAN_Customer

Base_Pkg

CAN_Pkg

connection

to CAN_IO

Filter_Box

which receives

LBS Base data

msg

manage:

dist real/theor,

pto rear/front,

speed real/theor,

hour, minute, second,

year, month, day,

hitch rear/front,

engine

format

base data

msg

format

general CAN

msg

object

description

has a element

is_a / inherit to

has list of

description

Spangler

Auernhammer

Internal Object Structure for

LBS Base Data

Spa2000_77en.ppt


iLBS

iLBS_Base

manage:

dist real/theor,

pto rear/front,

speed real/theor,

hour, minute, second,

year, month, day,

hitch rear/front,

engine

object

description

has a element

description

Spangler

Auernhammer

Interface Object Structure for

LBS Base Data

Spa2000_88en.ppt


LBS

CAN_Customer

LBS_Process

LBS_Process_

Data_Local

LBS_Process_

Data_Remote

Process_Pkg

CAN_Pkg

Measure_Prog_

Local

Setpoint_

Local

Measure_Prog_

Remote

Setpoint_

Remote

format

process data

msg

format

general CAN

msg

manage

subprog

values

Measure_Prog_

Base

Setpoint_

Base

Setpoint_

Register

object

description

has a element

per increment

entry

Measure_

Subprog

manage

setpoint

values

store one

setpoint with

manage inform.

is_a / inherit to

has list of

description

Spangler

Auernhammer

Internal Object Structure for

LBS Process Data

Spa2000_78en.ppt


iLBS

iLBS_Process

iLBS_Process_

Data_Local

iLBS_Process_

Data_Remote

manage one started

measuring program

iSetpoint_

Local

iMeasure_Prog_

Remote

iSetpoint_

Remote

manage sent

set-point

manage all received

set-points

iSetpoint_

Register

store one

setpoint with

manage inform.

object

description

has a element

has list of

description

Spangler

Auernhammer

Interface Object Structure for

LBS Process Data

Spa2000_89en.ppt


Basic interactions between

objects of the LBS program library


Explanation of Tutorials


Development

Standard

conformance

testing (by DLG)

Test

Agricultural engineering

companies

LBS-Library

+ Documentation

+ Examples

Spangler

Bulletin board

for discussion

Central project

management and co-ordination

at the Institut für Landtechnik

of TUM

Development Analysis Test

Interested researchers

and users

Spangler

Auernhammer

Cycles for development of

Open-Source LBS-Lib

Spa2000_71en.ppt


HTML

Documentation of

API and examples

(online or

download)

Sourcecode with

stable and

experimental

revision

Bulletin Board with

Mailing List for

discussion and

interacting support

(no guarantee for

response time of

software authors)

Concurrent

version

management of

source code with

WWW access

Handbook with

general and

porting

information

Possible free of charge services financed

by related project or sponsoring

Possible services available for fee

LBS-Lib

ong>Workshopong> and

training at TUM or

in place of

interested

company

Project

development

meetings

Response time

limits for treating

problem reports

or questions

Spangler

Auernhammer

Open Source Program Library LBS-Lib -

Possible Future Organisation

Spa2000_72en.ppt


* Add new system define

add new SYSTEM_XX in

lbs_library/lgpl_src/Application_Config/lbs_lib_config.h according to

existant settings

* BIOS header files of new ECU

- new subdirectory __LBS_Lib/HwBIOS/bios_xx with BIOS headers

- create new header __LBS_Lib/HwBIOS/bios_namespace_xx.h

- adopt based on existing bios_namespace_pc.h the function mapping

- create __LBS_Lib/HwBIOS/bios_xx/bios_extenders.c/.h for complex

map

- add suitable typedefs to map special BIOS types to standard

namespace

- set #defines to map BIOS error return codes to BIOS_xx error codes

Spangler

Auernhammer

LBS-Lib Adoption to new ECU type

according to http://ikb.weihenstephan.de/LBS-

Lib/handbook/

Spa2000_90en.ppt


* Add new config file

add __LBS_Lib/HwConfig/config_xx.h as copy from existing one

and edit

* Adopt relevant parts in HwYY directories

search source for "#if defined(SYSTEM_PC) ..." and "#endif" and

add new part as "#elif defined(SYSTEM_XX)" part, where the BIOS

data type is accessed in an appropriate manner

* Publish adoption back

share and optimise adoptions in co-operation with other users

(request for co-ordination in bulletin board before beginning)

Spangler

Auernhammer

LBS-Lib Adoption to new ECU type

according to http://ikb.weihenstephan.de/LBS-

Lib/handbook/

Spa2000_91en.ppt


* adoption to different ECU types to enlarge

testing base

* perform co-ordinated tests for specific

functional parts of LBS-Lib

* post problems and questions to the bulletin

board to enable co-ordinated search for bug

fixes or clarifications in documentation

* complete and refine „LBS+“ and ISO 11783

integration

Spangler

Auernhammer

Future work to be done to reach

LBS-Lib revision 1.0 (stable)

Spa2000_92en.ppt


* optimise process data interactions

- interpreted measurement information like change speed and

acceleration, frequency

- set-point prereservation to check operability of wanted set-point

(combination)

- possibility to answer compromise set-point if commanded set-point can‘t

be realised

* extensions of LBS-Lib like configurable policies for automatic

solving of set-point interest conflicts

* instantiate standard policies for application developers to avoid

set-point conflicts

* support open group for maintaining open source reference

implementation available for all standard ECU types to avoid

compatibility problems caused by different implementations

Spangler

Auernhammer

Future work to be done to enable

capable LBS systems based on LBS-Lib

Spa2000_93en.ppt


Spangler

Auernhammer

Open Questions

Open Discussion

Spa2000_70.ppt

More magazines by this user
Similar magazines