A Framework for Dynamically Configurable Embedded Controllers - PowerPoint PPT Presentation

1 / 62
About This Presentation
Title:

A Framework for Dynamically Configurable Embedded Controllers

Description:

Department of Automatic Control - Lund Institute of Technology ... The Register Idiom. Adding code to a framework without recompilation. ... – PowerPoint PPT presentation

Number of Views:43
Avg rating:3.0/5.0
Slides: 63
Provided by: johan77
Category:

less

Transcript and Presenter's Notes

Title: A Framework for Dynamically Configurable Embedded Controllers


1
A Framework for Dynamically Configurable Embedded
Controllers
  • Johan Eker

2
Outline
  • Introduction
  • PÃ¥lsjö
  • The PAL Language
  • The Framework
  • Patterns
  • Case Studies
  • Summary

3
Introduction
  • What is an embedded controller ?
  • How are they implemented ?
  • Which are the problems ?
  • What kind of tools do we need ?

4
Controller
Plant
5
Embedded Controllers
  • The controller is embedded in the system.
  • Parallel tasks.
  • The control loop.
  • User interaction.
  • Logging and displaying data
  • Real-time
  • The computer must react to inputs from the plant
    at a certain speed.
  • Deadlines, soft and hard.
  • Large and complex.

6
Implementation Today
  • Assembler, Forth
  • C/C, Modula-2 real-time kernel
  • ADA
  • Dedicated systems
  • PLC systems (SattLine).
  • Matlab/X-Math with code generators

7
Which are the problems?
  • C/C, Modula-2 or ADA
  • Dynamic and portable.
  • Long development time error prone.
  • Code Generators
  • Easy to use,but limited.
  • Can be used together with simulation tools.
  • Static configuration.
  • General problems
  • Hard to maintain and reuse.

8
What kind of tool did we need?
A rapid prototyping system that ...
  • is easy to use and reuse,
  • is portable, open and free,
  • is on-line configurable,
  • has supports algorithm libraries,
  • and gives total control of execution.

9
and what did we get ? - Pålsjö!
  • A framework for experiments in automatic control
    and embedded systems.
  • A set of C-classes.
  • PÃ¥lsjö Configuration Language - PCL.
  • A language for control algorithm description.
  • PÃ¥lsjö Algorithm Language - PAL Blomdell-97.

10
Outline
  • Introduction
  • PÃ¥lsjö
  • The Pal Language
  • The Framework
  • Patterns
  • Three New Patterns
  • Case Studies
  • Summary

11
Pålsjö ÈpùlÇSÎ
combines the advantages of the other approaches!
  • Algorithms coded off-line.
  • Block based language.
  • Systems configured on-line.
  • Creating, initializing, and connecting blocks.
  • Data types tailored for automatic control.
  • Matrices.
  • Polynomials.

12
  • Support for control algorithms.
  • Periodic and sequential algorithms.
  • A run-time system.
  • User interface.
  • Network interface.
  • Support for several platforms.
  • Open and free.
  • Automatic documentation.
  • Support for algorithm libraries.

13
Basic Ideas
  • Observations
  • Many controller implementations have a similar
    internal structure.
  • The actual control algorithm is usually just a
    fraction of the total code.
  • Solution
  • Gather the common features in a library.
  • Let the user only add the actual control
    algorithm.

14
The Pålsjö System
Function Libraries
User functions
PAL blocks
. . . . . . . .
Matrix functions
Polynomial function
15
On-line
Create blocks
Connect blocks
Real-time behavior
16
Outline
  • Introduction
  • PÃ¥lsjö
  • The PAL Language
  • The Framework
  • Patterns
  • Three New Patterns
  • Case Studies
  • Summary

17
PALPålsjö Algorithm Language
  • Block based imperative language
  • Signal and parameter interface
  • Algorithm description
  • Periodic and/or sequential.

Interface Description Algorithm Description
18
Interface Description
  • Variables declared with a data type and an
    interface modifier.
  • The interface modifier defines how the variable
    may interact with the environment
  • Input, Output, State, Parameter
  • name ltinterface modifiergt ltdata typegt

19
Data types
  • Integers, floats.
  • Strings
  • Arrays
  • Dimensions
  • Integer variable used to specify dimensions for
    aggregate data types.

i input integer s parameter string a1
integer array1..3 of real a2 array0..2
of input real d 1 dimension a3
array1..d of integer
20
Data types
  • Matrices
  • Polynomials

d1 2 dimension, d2 2 dimension M
matrix1..d1,1..d2 of real deg1 3
dimension P1 output polynomial1..deg1 of
real P2 input polynomial1..deg12 of real
21
Periodic Algorithms
  • Two special procedures
  • Calculate() - Calculates output signals.
  • Update() - Updates states.
  • Example A PI-Controller

22
Module Module1 block PI y, yref, v input
real u output real K, Ti, Tr
parameter real P, I 0.0, e real h
sampling interval bi hK/Ti, br
h/Tr calculate begin e yref - y
P K e u P I end
calculate update begin I I bi
e br (v - u) end update end PI end
Module1.

Interface section

Algorithm section
23
Why two sweeps?
  • Necessary in order to update states correctly
    when signals are limited.
  • Keep the time delay from input to output at a
    minimum.

24
Sequential Algorithms
  • Grafcet (IEC-1131)
  • Textual representation for steps, actions and
    transitions

Initial step Init pulse activate Action1 end
Init step Step2 activate Action2 end Step2
action Action1 u . step Action1
transition from Init to Step2 when true
25
Outline
  • Introduction
  • PÃ¥lsjö
  • The PAL Language
  • The Framework
  • Patterns
  • Case Studies
  • Summary

26
The Framework
  • Contains classes for block administration, user
    interaction, network communication etc.
  • A skeleton application.
  • Main loop lies within the framework.

27
The Internal Structure
  • Allows edits on a running system.
  • Edits made on shadow configuration.
  • Edits monitored and scanned for errors.
  • States copied before swap.

28
Reflection
  • Autonomous blocks
  • Contain name, type, owner variable set info
  • Functions for cloning and copying itself
  • Autonomous variables
  • Contain name, type, owner connections
  • Functions for cloning and copying itself
  • Plug-in objects
  • String interface
  • Data type will parse themselves
  • C wrapper

29
Running the System
  • PCL - PÃ¥lsjö Configuration Language
  • Create, connect and execute blocks
  • Reconfigure on the fly
  • Text interface
  • Network interface
  • Setup
  • Host - Target
  • Single PC

30
The Interface
31
Outline
  • Introduction
  • PÃ¥lsjö
  • The PAL Language
  • The Framework
  • Patterns
  • Case Studies
  • Summary

32
The Pattern Concept
  • Package informal information.
  • Document traditional solutions.
  • Originates from architecture.
  • Patterns
  • A set of cooperating classes for a well defined
    problem.
  • Problem definition, solution idea, participants,
    interaction,inheritance, sample code, known uses.

33
Three New Patterns
  • The Calculate-Update pattern.
  • Execution of block diagrams.
  • The Parameter-Swap pattern.
  • Assigning parameters to critical processes.
  • The Register Idiom.
  • Adding code to a framework without recompilation.

34
Parameter-Swap Pattern
  • A real-time pattern that deals with the problem
    of updating controller parameters in a fast and
    consistent way.
  • Scenario
  • Several low-priority write processes
  • One critical read process - the control loop.
  • Design a structure which allows parameter
    assignment without blocking of the control loop.

35
  • c is an indirect parameter.
  • Calculation of indirect parameters may be
    expensive.
  • Solution
  • Use two parameter set.
  • Let the writer process do all calculations.
  • Use pointer-swap to change parameter set.

Block par in input real out output
real s state real a, b parameter real
c a b calculate out end
calculate update begin s end
update end par
36
The Run-time Behavior
37
The Classes
  • The super classes encapsulated the relation
    between the block, the parameters and the
    environment.

38
Outline
  • Introduction
  • The PAL Language
  • The Framework
  • Patterns
  • Case Studies
  • Summary

39
Case Studies
  • Inverted pendulum - standalone and on the robot.
  • Code reuse and scaling.
  • A hybrid tank controller
  • Combining periodic and sequential algorithms.
  • An adaptive servo controller
  • Polynomials, external function and global
    dimensions
  • A fault-tolerant scheme
  • On-line configuration.

40
The Inverted Pendulum
  • Swing up and stabilize.
  • Equation of motion
  • Measure the angle ?.
  • Estimate the angular velocity.

41
The Controller
  • Three sub-controllers
  • Swing-up
  • Catch
  • Stabilize
  • Good estimates for the angular velocity
    necessary!

42
A Nonlinear Observer
  • The observer
  • Analysis ? stability conditions.
  • Design guidelines.

43
Experiments
44
Pendulum on the Robot
45
Outline
  • Introduction
  • PÃ¥lsjö
  • The PAL Language
  • The Framework
  • Patterns
  • Case Studies
  • Summary

46
Summary
  • PÃ¥lsjö
  • A tool for real-time control experiments
  • A new dedicated language - PAL
  • NT, Solaris, m68k-VME, and PowerPC-VME.
  • Future Plans
  • New mechanisms for hybrid systems.
  • Java GUI.
  • Improved support for on-line algorithm update.
  • Simulation support.

47
Simulation
  • SIMART-A French simulation package for CACSD
  • PAL blocks may execute in SIMART
  • Experiments made with SIMULINK

48
Related Work
49
Contributions
  • Design and implementation of the PÃ¥lsjö software
    environment.
  • Three generic software patterns have been
    identified and documented.
  • A novel nonlinear observer for the inverted
    pendulum.
  • A new hybrid controller for a double tank system.

50
Papers and Reports
  • Johan Eker and Karl Johan Ã…ström (1996) -
  • A Nonlinear Observer for the Inverted
    Pendulum.
  • Johan Eker and Anders Blomdell (1996) -
  • A Structured Interactive Approach to
    Embedded Control .
  • Jörgen Malmborg and Johan Eker (1997) -
  • Hybrid Control of a Double Tank System.
  • Johan Eker and Anders Blomdell (1997) -
  • Patterns in Embedded Control Systems.

51
Inheritance Structure
52
System Blocks
  • The Periodic block
  • Executes its child block periodically.
  • Built-in scheduler.
  • The Sporadic block
  • Executes its child blocks sporadically.
  • Useful for tasks such as interrupt handling.
  • An Algorithm block must belong to a Periodic or a
    Sporadic block to be executed.

53
Example of a Configuration
  • Down-sampled measurement signal.
  • Two sampling rates.
  • ? Use two Periodic blocks.

54
(No Transcript)
55
Simulations
56
A Hybrid Tank Controller
  • Control the level of the lower tank.
  • One controller for set-point changes.
  • One controller for steady-state.

57
PID
Time Optimal
58
  • Gain scheduled PID controller
  • Time Optimal Controller
  • Feedback using switching
    curves
  • Switching PID ? Time Optimal using Lyapunov
    functions.

Level tank 2 (m)
Level tank 1(m)
59
Simulation
60
Experiments
61
Functions Procedures
procedure F(var1 input real var2 output
integer) begin . end
function F(var1 input real var2 output
integer) integer begin . result 1.0
end
62
A Typical Control System
  • Several parallel tasks
  • The control loop
  • Read values from the plant,
  • Calculate new control signals
  • Write control signal to actuator.
  • User interaction.
  • Logging and displaying data
Write a Comment
User Comments (0)
About PowerShow.com