code generation at mechatronics · philips innovation services, sasg oct 2011 6 dynamics, actuators...

35
Oct, 2011 Visit us at www.innovationservices.philips.com Code Generation at Mechatronics Philips Innovation Services

Upload: others

Post on 24-Sep-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Oct, 2011

Visit us at www.innovationservices.philips.com

Code Generation at Mechatronics

Philips Innovation Services

Page 2: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Contents

• Introduction Mechatronics

• Mechatronic design challenge

• Control-design ‘old-style’

• Control-design with code generation

• Code details

• Questions

2

Page 3: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Philips Innovation Services Position in Philips

Non-Philips

Customers

Healthcare Consumer

Lifestyle

Lighting

Royal Philips Electronics

Corporate

Technologies

IP&S

Research

Incubators

Philips

Innovation

Services

3

Page 4: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Philips Innovation Services

6 open access labs

> 15,000 electronic instruments

> 19,000 m2 laboratories

Incl. 9,500 m2 clean rooms

High Tech Campus

Eindhoven - NL

Green house

Prototyping & manufacturing

4

Materials

Analysis

Measurement Lab

RF

Thin Film

Clean room

Reliability lab Electronic

Prototyping

Systems

Engineering

Life Science

facility

Device Processing

Facilities

Photonics

Facility

Measurement &

instrumentation

Experience

lab

E-Science

Support

Mechatronics

Competence center

EMC

Center

Consulting Competence

Center

650 technical specialists / 50 consultants

Page 5: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 5

Mechatronics

• Provides its customers with drives,

control and mechanical construction for

smooth motion and high accuracy

positioning

• Is both active in equipment and

subsystem design, as well as in

supporting the development of consumer

and healthcare products.

• Staff: 150 Technical specialists,40 %

University degree / Ph.D.s, 50 %

Bachelors & Engineers, 10 % other

education

• Customers:

Page 6: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 6

Dynamics, Actuators & Control

Advanced System Design

High precision motion stages

Project management & supply chain

Healthcare systems

Robotics

System architecture

Vibro-Acoustics & Low

Noise Design

Electrical

Systems Design

Metrology

TEMS

Vacuum Mechatronics

Mechanical

Design

Control

Equipment

Design

Product

Development

Tribology/Air

bearings

Electro

Mechanics

Dynamics

Production

Systems

Mechatronics Competences

Motion Control

Software

G

KFB,x

SPGx

Kfay,x

KFB,y

Kfax,x

Kfsy,x

Kfsx,x

snap

acceleration

MIMO FF

Page 7: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Contents

• Introduction Mechatronics

• Mechatronic design challenge

• Control-design ‘old-style’

• Control-design with code generation

• Code details

• Questions

7

Page 8: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 8

Reflective electron beam lithography

Challenge

• Rotary stage 1.2 m diameter

• High Accuracy positioning

Results

• MagLev rotary stage

• Performance well within specification

• Prototypes installed at customer

Customer Benefits

• Competitive platform for introduction direct

write technology

• Throughput wph/footprint

• Low energy dissipation (low forces)

Page 9: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 9

Design Challenge: measure disc position

N

E

S

X

X

Z

Y

Reference and sensors

ZW

ZN/ZS

ZN

ZS

XE XW

YN

YS

XW XE

Page 10: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 10

Design Challenge: Sensor transformations

N

E

S

X

X

Z

Y

Reference and sensors

ZW

ZN/ZS

ZN

ZS

XE XW

YN

YS

XW XE 4 x sensor Axial

4 x sensor Radial

Transformation

5DOF 8 5

Page 11: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 11

Design Challenge: Sensor linearization required

4 x sensor Axial

4 x sensor Radial

Transformation

5DOF 8 5

Linearize Axi

Linearize Rad

Page 12: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 12

Design Challenge: Ref surface is not flat

4 x sensor Axial

4 x sensor Radial

Transformation

5DOF 8 5

Linearize Axi

Linearize Rad

N

E

S

X

Y

ZN

ZS

XE XW

YN

YS

1e-006

2e-006

3e-006

4e-006

30

210

60

240

90

270

120

300

150

330

180 0

Page 13: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 13

Design Challenge: Add calibration table

4 x sensor Axial

4 x sensor Radial

5DOF

Transformation

8 5

Linearize Axi

Linearize Rad

Axi Correction Table

Rad Correction Table

Angle Sensor

Page 14: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 14

Design Challenge: Angle linearization required

4 x sensor Axial

4 x sensor Radial

5DOF

Transformation

8 5

Linearize Axi

Linearize Rad

Axi Correction Table

Rad Correction Table

Angle Sensor Linearize Angle

Page 15: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 15

Design Challenge: Surfaces change with speed

6 x sensor Axial

6 x sensor Radial

5DOF

Transformation

8 5

Linearize Axi

Linearize Rad

Axi Correction Table

Rad Correction Table

Angle Sensor Linearize Angle

Periodic update Calc new

Corr tables

Page 16: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Implementation: measurement system

16

MAC_PosSensors

2

MAC_COG

1

cos0:0

sin0:0

SurfaceCorrection

DiskAngle SurfaceCorrection

MAC_Sensors

MAC_PosSensors

MAC_RadCor_Sensors

MAC_AxiCorSensors

Gain 1

gpMAC _M_SensorsToSRF * u

Gain

gpMAC _M_SRFtoCOG * u

zeros(3,1)

0:0

gpMAC _M_RotationPointShift0:0

gpMAC _SRF_Offsets0:0

Constant

gpMAC _M_UseSurfaceCorrections0:0

CaptureCorSignals

EQCP Tracer

DiskAngle

1

gsMAC_M_RadCorSensors

gsMAC_M_AxiCorSensors

gsMAC_M_PosSensors gsMAC_M_SensorsAfterSurfCor

gsMAC_M_SurfaceCor

gsMAC_M_Position

Page 17: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Implementation: sensor linearization

17

MAC_AxiCorSensors

3

MAC_RadCor _Sensors

2

MAC_PosSensors

1

Terminate ZN ZE

Terminate XE XW YN

I_Rad330

AnalogIn

I_Rad020

AnalogIn

I_PosZW

AnalogIn

I_PosZS

AnalogIn

I_PosZN

AnalogIn

I_PosZE

AnalogIn

I_PosYS

AnalogIn

I_PosYN

AnalogIn

I_PosXW

AnalogIn

I_PosXE

AnalogIn

I_Axi330

AnalogIn

I_Axi020

AnalogIn

double

double

double

gpMAC _M_DiffSensorOffsets0:0

Ax9

0:0Ax8

0:0Ax7

0:0Ax6

0:0

Ax5

0:0Ax4

0:0

Ax3

0:0Ax2

0:0

Ax11

0:0Ax10

0:0

Ax1

0:0Ax

0:0

gsMAC_M_CorrectedDiff

Page 18: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Implementation: Ref correction

18

SurfaceCorrection

1

mod

mod

Lookup Radial

0:0

Lookup Axial

0:0

double

2*pi

0:0

gpMAC _M_RadSensorPositions0:0

gpMAC _M_AxiSensorPositions0:0

Enable

DiskAngle

1

Page 19: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Contents

• Introduction Mechatronics

• Mechatronic design challenge

• Control-design ‘old-style’

• Control-design with code generation

• Code details

• Questions

19

Page 20: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 20

Motion Control Design flow ‘old-style’

Mech Designer Control Designer

User Spec

Concept design

and analysis Control design

Page 21: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 21

Motion Control Design flow ‘old-style’

Control model

Signal ▬ PID

Sensor Xform

Plant Filter

Page 22: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 22

Motion Control Design flow ‘old-style’

Mech Designer Control Designer

User Spec

Software Spec

Software Designer

Main()

{

doit();

}

Signal

P

I

D

Sensor

Xfor

m

Plant

F

i

l

t

e

r

Page 23: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 23

Motion Control Design flow ‘old-style’

Mech Designer Control Designer

User Spec

Software Spec

Software Designer

Main()

{

doit();

}

Language

Barrier!

Signal

P

I

D

Sensor

Xfor

m

Plant

F

i

l

t

e

r

Page 24: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Contents

• Introduction Mechatronics

• Mechatronic design challenge

• Control-design ‘old-style’

• Control-design with code generation

• Code details

• Questions

24

Page 25: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 25

Motion Control Design flow using code generation

Mech Designer Control Designer

User Spec

Concept design

and analysis Control design

Page 26: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 26

Motion Control Design flow using code generation

Control model

Signal ▬ PID

Sensor Xform

Plant Filter

Page 27: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 27

Motion Control Design flow using code generation

Mech Designer Control Designer

User Spec

Software Spec + mdl

Software Designer

Signal

P

I

D

Sensor

Xfor

m

Plant

F

i

l

t

e

r

Signal ▬

PID

Sensor

Xform

Plant

Filter

Main()

{

doit();

}

Page 28: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 28

Motion Control Design flow using code generation

Mech Designer Control Designer

User Spec

Software Spec + mdl

Software Designer

Signal ▬

PID

Sensor

Xform

Plant

Filter

Main()

{

doit();

}

Same

Language

Page 29: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011 29

Motion Control Design flow using code generation

Mech Designer Control Designer

User Spec

Software Spec + mdl

Software Designer

Main()

{

doit();

}

Same model

Allows fast

iterations Signal ▬

PID

Sensor

Xform

Plant

Filter

Page 30: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Contents

• Introduction Mechatronics

• Mechatronic design challenge

• Control-design ‘old-style’

• Control-design with code generation

• Code details

• Questions

30

Page 31: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Code details

• Used in 10+ projects, various applications (RobotArm … REBL)

– Sample rates 500Hz … 20kHz

– # controlled axes 1 – 15

– No defects found yet!

• Control models only, no state diagrams

– General Matlab/Simulink blocks from library

– Hardware inputs and output blocks are custom designed

– Some custom blocks to interface with C++ code

31

Page 32: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Code details

– Efficiency of the generated code:

• Double precision math by default

• Simulink blocks that are not enabled are not evaluated

• 30k lines at 4kHz on 2.8GHz P4.

– RTW-generated code is not nice to read

• Each block in the model becomes a little code-block

• The program is an ‘endless’ list of code-blocks

• A signal with a name becomes a variable with same name

32

Page 33: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Code details: conclusion

• Pros

– No language barrier with other mechatronic disciplines

– Fast iterations in integration phase

– No bugs

• Cons

– Toolchain licensing

– Testing

– In Simulink variable scope is flat: use naming convention

• Note

• Some effort required for creating custom IO blocks

33

Page 34: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011

Questions

?

34

Page 35: Code Generation at Mechatronics · Philips Innovation Services, SASG Oct 2011 6 Dynamics, Actuators & ControlTEMS Advanced System Design High precision motion stages Project management

Philips Innovation Services, SASG Oct 2011