id 021l: model based control design and auto-code generation using the r8c christopher myers...

39
ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version: 1.2

Upload: william-foster

Post on 18-Jan-2018

220 views

Category:

Documents


0 download

DESCRIPTION

3 Renesas Technology and Solution Portfolio Microcontrollers & Microprocessors #1 Market share worldwide * Analog and Power Devices #1 Market share in low-voltage MOSFET** Solutions for Innovation ASIC, ASSP & Memory Advanced and proven technologies * MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010 **Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).

TRANSCRIPT

Page 1: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

ID 021L: Model Based Control Design and Auto-Code Generation using the R8C

Christopher Myers

Director of Software Development

12 October 2010

Version: 1.2

Page 2: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

2

Christopher Myers [email protected]

Director of Software Development Responsible for designing and managing development

of SimuQuest product lines Lead Developer of QuantiPhi, a line of code generation

tools that bring a hardware interface into the Simulink modeling environment.

PREVIOUS EXPERIENCE: Working in the area of model-based development

using MATLAB / Simulink since 2003. Production automotive and consumer electronics

experience at Motorola since 2000 Designed high-performance network appliances

designed to provide unparalleled visibility into network usage at Arbor Networks, Inc.

MS, BS from the University of Michigan

Page 3: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

3

Renesas Technology and Solution Portfolio

Microcontrollers& Microprocessors

#1 Market shareworldwide *

Analog andPower Devices#1 Market share

in low-voltageMOSFET**

Solutionsfor

InnovationASIC, ASSP& Memory

Advanced and proven technologies

* MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010

** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).

Page 4: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

44

Renesas Technology and Solution Portfolio

Microcontrollers& Microprocessors

#1 Market shareworldwide *

Analog andPower Devices#1 Market share

in low-voltageMOSFET**

ASIC, ASSP& Memory

Advanced and proven technologies

* MCU: 31% revenue basis from Gartner "Semiconductor Applications Worldwide Annual Market Share: Database" 25 March 2010

** Power MOSFET: 17.1% on unit basis from Marketing Eye 2009 (17.1% on unit basis).

Solutionsfor

Innovation

Page 5: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

55

Microcontroller and Microprocessor Line-up

Superscalar, MMU, Multimedia Up to 1200 DMIPS, 45, 65 & 90nm process Video and audio processing on Linux Server, Industrial & Automotive

Up to 500 DMIPS, 150 & 90nm process 600uA/MHz, 1.5 uA standby Medical, Automotive & Industrial

Legacy Cores Next-generation migration to RX

High Performance CPU, FPU, DSC

Embedded Security

Up to 10 DMIPS, 130nm process350 uA/MHz, 1uA standbyCapacitive touch

Up to 25 DMIPS, 150nm process190 uA/MHz, 0.3uA standbyApplication-specific integration

Up to 25 DMIPS, 180, 90nm process 1mA/MHz, 100uA standby Crypto engine, Hardware security

Up to 165 DMIPS, 90nm process 500uA/MHz, 2.5 uA standby Ethernet, CAN, USB, Motor Control, TFT Display

High Performance CPU, Low Power

Ultra Low PowerGeneral Purpose

Page 6: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

66

Microcontroller and Microprocessor Line-up

Superscalar, MMU, Multimedia Up to 1200 DMIPS, 45, 65 & 90nm process Video and audio processing on Linux Server, Industrial & Automotive

Up to 500 DMIPS, 150 & 90nm process 600uA/MHz, 1.5 uA standby Medical, Automotive & Industrial

Legacy Cores Next-generation migration to RX

High Performance CPU, FPU, DSC

Embedded Security

Up to 10 DMIPS, 130nm process350 uA/MHz, 1uA standbyCapacitive touch

Up to 25 DMIPS, 150nm process190 uA/MHz, 0.3uA standbyApplication-specific integration

Up to 25 DMIPS, 180, 90nm process 1mA/MHz, 100uA standby Crypto engine, Hardware security

Up to 165 DMIPS, 90nm process 500uA/MHz, 2.5 uA standby Ethernet, CAN, USB, Motor Control, TFT Display

High Performance CPU, Low Power

Ultra Low PowerGeneral Purpose

R8C

16 Bit CISC Superb Noise PerformanceLow Power Consumption

Higher FunctionalityASSP Lineup

Low Pin Count Lineup

Page 7: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

7

Innovation: Innovate Faster

Page 8: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

8

Model-Based Design

Model-Based Design and Automatic Code Generation is the future of embedded controls. SimuQuest believes that as companies across all industries realize the innovation advantage that it provides, it will play a part in the design of nearly all embedded systems worldwide.

Page 9: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

9

Agenda

Introduction to modeling and auto-code generation Introduction to MATLAB / Simulink / Stateflow Lab: Modeling controls in Simulink / Stateflow Discussion of auto-code generation for a target Lab: Generating code for an R8C controller Q&A

Page 10: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

10

Key Takeaways

Models helps define requirements Models can be simulated Models can be auto-coded Auto-coding saves you time Auto-coding is powerful!

Page 11: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

11

Idea #1

Page 12: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

12

Idea #2

QuantiPhi REfor R8C/3X

Model C Code Target

Page 13: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

13

What is a Model?

Model = Abstraction

Real World

Outside

Software

Inside

Plant

Controller

Page 14: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

14

PlantPlantModelModel

ControlControlModelModel

plant outputcontrol outputcontrol input

Page 15: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

15

ControlControlModelModel

Page 16: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

16

Example: Engine Controller

Page 17: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

17

Plant

Our Ambient Lighting System

Tri-Color LEDs

E8a

Controller

Page 18: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

18

PlantPlantModelModel

ControlControlModelModel

plant output• momentary switch + noise • LED colors

control outputPWMs x6

control inputinput switch state

• Process input switches• LED Color? Intensity?• What frequency? Duty cycle?

• Model the input switches• Model PWM to RGB

Page 19: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

19

Lab Procedure - Phase 1

InputInputSwitchesSwitches DebounceDebounce LogicLogicNoiseNoise LEDsLEDs

Page 20: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

20

Lab Procedure - Phase 2

DebounceDebounce LogicLogicQuantiPhiQuantiPhi

PWMPWMOutputOutput

QuantiPhiQuantiPhiScheduling, Clock Configuration + BuildScheduling, Clock Configuration + Build

QuantiPhiQuantiPhiDigital Digital InputsInputs

Page 21: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

21

Our Auto-Coding Toolbox

MATLAB

QuantiPhiRTW Embedded Coder

Simulink & Stateflow

Base computing platform

Modeling platform

Auto-code generation Provides MCU configuration and device drivers.

Page 22: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

22

Questions?

Page 23: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

23

Start the Lab

Keep your dice turned to the section of the lab you are on. (Instructionsare provided in the lab handout)

Please refer to the Lab Handout and let’s get started!

Page 24: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

24

Checking Progress

We are using the die to keep track of where everyone is in the lab. Make sure to update it as you change sections.

When done with the lab, your die will have the 6 pointing up as shown here.

Page 25: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

25

Lab Phase 2

Page 26: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

26

Typical Auto-Coding Methodologies

Feature Effort =

Page 27: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

27

Typical Auto-Coding Methodologies

Feature 1

Feature n

“Application Layer”

Effort =

Page 28: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

28

Typical Auto-Coding Methodologies

Feature 1

Feature n

HardwareInterface

Effort =

Page 29: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

29

Interfacing With Hardware

InputInputSwitchesSwitches DebounceDebounce LogicLogicNoiseNoise LEDsLEDs

Page 30: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

30

Interfacing With Hardware

DebounceDebounce LogicLogicQuantiPhiQuantiPhi

PWMPWMOutputOutput

QuantiPhiQuantiPhiScheduling, Clock Configuration + BuildScheduling, Clock Configuration + Build

QuantiPhiQuantiPhiDigital Digital InputsInputs

SW4 pwm6

Page 31: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

31

Another Hardware Abstraction Layer Example

Example of analog counts to engineering units:

Page 32: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

32

R8C/3X Code-Gen Considerations

Don’t use floating point! (double, single)

Natural “int” size is 16 bits

Don’t run tasks too quickly (< 1ms for example)

Page 33: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

33

Start the Lab – Phase 2

Keep your dice turned to the section of the lab you are on. (Instructionsare provided in the lab handout)

Please refer to the Lab Handout and let’s get started!

Page 34: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

34

Checking Progress

We are using the die to keep track of where everyone is in the lab. Make sure to update it as you change sections.

When done with the lab, your die will have the 6 pointing up as shown here.

Page 35: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

35

Key Takeaways (Revisited)

Models helps define requirements Models can be simulated Models can be auto-coded Auto-coding saves you time Auto-coding is powerful!

Page 36: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

36

Innovation: Innovate Faster

Page 37: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

37

Questions?

Page 38: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version:

38

Thank You!

Page 39: ID 021L: Model Based Control Design and Auto-Code Generation using the R8C Christopher Myers Director of Software Development 12 October 2010 Version: