A Co-Simulation Framework for Engine Control Applications Paolo - - PowerPoint PPT Presentation

a co simulation framework for engine control applications
SMART_READER_LITE
LIVE PREVIEW

A Co-Simulation Framework for Engine Control Applications Paolo - - PowerPoint PPT Presentation

A Co-Simulation Framework for Engine Control Applications Paolo Pazzaglia, Marco Di Natale, Giorgio Buttazzo Scuola Superiore Sant Anna, Pisa paolo.pazzaglia@santannapisa.it Roma, September 8th, 2017 The Diesel engine control problem


slide-1
SLIDE 1

A Co-Simulation Framework for Engine Control Applications

Paolo Pazzaglia, Marco Di Natale, Giorgio Buttazzo Scuola Superiore Sant’Anna, Pisa

paolo.pazzaglia@santannapisa.it

Roma, September 8th, 2017

slide-2
SLIDE 2

The Diesel engine control problem

  • Challenging CPS problem
  • Complex physical components
  • High number of electronic control components
  • Periodic, aperiodic and angular triggered tasks
  • Does not need hard real time constraints (resilient to deadline

misses)

  • …However perfomance sensitive to jitter and delays!

2

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Sensors Actuators

CPU

slide-3
SLIDE 3

3

  • Study the effects of scheduling policies and task design on

performance of control applications

  • Evaluation with simulation tools
  • Verify assumptions on the performance functions with respect to

timing Proposed solution:

  • Co-simulation framework developed on Simulink with a

scheduling simulator integrating:

  • Model of the engine
  • Model of the tasks and scheduler
  • Model of the functional controls
  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Objectives and framework

slide-4
SLIDE 4

Animation by Zephyris - Own work, CC BY-SA 3.0, https://commons.wikimedia.org/w/index.php?curid=10896588

  • Fuel quantity and timing vary with

engine conditions

  • Fuel injection must be precise to

assure optimal combustion process

  • Injection errors could compromise

engine functionality

4

  • Fuel injection is an example of task with temporal constraints
  • It is the main component of control
  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Injection problem in engine control

slide-5
SLIDE 5

Potential overload at high speeds!

  • Task managing the fuel

injection is an angular task:

  • Angular tasks are activated at

a specific crankshaft angle

  • The angular deadline and

period are fixed, but timing depends on engine speed

Deadline

Activation

Activation rate depends on crankshaft speed:

Period

Angular task

5

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-6
SLIDE 6

C3 C3 C3

  • Solution: Multiple control modes with WCET decreasing at high

speeds: Adaptive Variable Rate (AVR) task

  • Mode changes happen at particular switching speeds

6

Adaptive Variable Rate

C2 C2

C3

C1 C1

 1 2

C(1) C(2) C(3)

1 2 3

speed

time time

WCET

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-7
SLIDE 7

7

  • For the purposes of this work we model mode changes only varying the

number of injections

  • Multiple injections help controlling

combustion parameters

Triple injection Double injection Single injection WCET Engine speed

Adaptive Variable Rate

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-8
SLIDE 8

8

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

TPU and deadline misses

Sensors CPU

Engine ctrl

TPU ENGINE cranskhaft injectors 𝜄𝑔 , ∆𝑔 𝜄, 𝜕

Engine parameters

𝜄0

  • The Time Processing Unit (TPU) is a co-microcontroller that handles

the injection actuation in synchronous modality

  • Missing a deadline on the control task means that the actuation is

done with data of previous cycle

𝜐

slide-9
SLIDE 9

9

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

TPU and deadline misses

Sensors CPU

Engine ctrl

TPU ENGINE cranskhaft injectors 𝜄𝑔 , ∆𝑔 𝜄, 𝜕

Engine parameters

𝜄0 𝜐

Deadline misses can be penalizing if the conditions of the system changed (too much) from the previous iteration!

slide-10
SLIDE 10

Scheduling as design optimization

  • Performance is strictly related to timing, but its sensitivity varies

with status and its dynamics

  • Performance functions not independent from past!
  • Also, multiple performance indexes must be addressed (power,

efficiency, emissions, noise, fuel consumption…)

  • Scheduling in engine control problem should be a design
  • ptimization using performance functions

10

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-11
SLIDE 11

The co-simulation framework

Engine model Control Functions Scheduling simulator

Sensors Actuation

Control Unit

Simulink

11

T-RES

A co-simulation framework to test different scheduling and control strategies and their impact on performance

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Discrete events

Task implementation

  • f controls

Simulink Scheduler interface

Continuous time

slide-12
SLIDE 12
  • fi
  • fi

fi

flo

Simulink Simulation engine OMNeT++ NS−3 RTSim MetaSim

abstract network sim API

...

abstract scheduling sim API adaption layer

  • ther

adaption layer adaption layer extension extension

kernel network Simulink S−function API Custom blocks TRes library Standard blocks

Co−simulation framework

task message Plant Controller

fi fi fi fi

T-Res: a co-simulation framework

Custom blocks in model Abstract API Scheduling and network simulators

  • T-Res manages activation, termination and preemption of tasks
  • Inserts scheduling delays in the simulation

12

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-13
SLIDE 13

Functional (Control) model Scheduler and Task model

1 block for scheduler 1 block for each task

From and to physical model

T-Res: Adding scheduling to Simulink

13

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-14
SLIDE 14
  • Adding the “active mode” input
  • Every mode is constructed as a sequence of instructions (segments),

with different WCET

  • The deadline of the AVR task is dynamically updated as the speed of

the engine changes, and provided to RTSim

A Co-Simulation Framework for Engine Control Applications

  • P. Pazzaglia

Mode selector

14

T-Res: Custom block for AVR tasks

slide-15
SLIDE 15
  • An example of the implementation of an AVR task in T-Res

Current setting: Three fuel control modes:

  • 1. Triple injection [0-1500]
  • 2. Double injection [1200-3000]
  • 3. Single injection [2800-v_max]

A Co-Simulation Framework for Engine Control Applications

  • P. Pazzaglia

15

T-Res: AVR task implementation

slide-16
SLIDE 16

Matlab Simulink architecture

16

Simulink implementation: continuous+discrete simulation

Control Unit reads data from sensors and computes actuation commands

Physical structure Control Unit

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

slide-17
SLIDE 17

The engine model

17

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • Engine dynamics
  • Modeling multiple cylinders with a

general cylinder block

Cylinders dynamics Crankshaft torque generation

slide-18
SLIDE 18

In-cylinder dynamics

18

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

The cylinder block includes:

  • Mechanical model of valves, crank-rod

mechanism, torque generation and thermodynamic efficiency

  • Injector dynamics
  • Heat Release model of combustion
  • Semiempirical emission models of NOx and soot
slide-19
SLIDE 19

Engine Control

19

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

1 2 3 4

  • Injection angle control is formally split into two AVR tasks
  • Tasks activation every half crankshaft rotation
  • Phased by 90°
  • Control done with static maps

AVR task: TDC1, TDC4 AVR task: TDC3, TDC2 A1B3, A4B2 A3B1, A2B4

slide-20
SLIDE 20

20

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • Simulating specific patterns of input pedals:
  • Slow acceleration
  • Step acceleration
  • Studying the performance index as a function of control modes and

speed

  • Showing how the scheduling delays result in errors in the

angle/duration of the injection actuation and the corresponding loss in performance

Simulations

slide-21
SLIDE 21

21

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • Multiple injections reduce emissions:

Multiple injections and performance

slide-22
SLIDE 22

23

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • How thermodynamic efficiency changes with:
  • 1 deadline miss every two cycles
  • 2 deadline misses every two cycles

Studying how timing impacts performance

slide-23
SLIDE 23

24

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Studying how timing impacts performance

Sudden acceleration

slide-24
SLIDE 24

25

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • Co-simulation framework of engine and control for obtaining

more precise dependencies between timing and functionality

  • Promising first results when considering multiple injections with

respect to multiple performance metrics

  • Need even better engine models!
  • Need more accurate models of controls

Conclusion

slide-25
SLIDE 25

26

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

  • Better characterization of deadline miss impact on performance
  • Integrate everything in a workflow for improving design of

controller and scheduler

  • Extend TRes framework for multicore support
  • Include network model and memory access

Future work

slide-26
SLIDE 26

27

  • P. Pazzaglia

A Co-Simulation Framework for Engine Control Applications

Thank you!

Any questions?