Вы находитесь на странице: 1из 27

rtdemo1

Design Description

OPAL-RT

rtdemo1: Design Description


OPAL-RT
Published 19-May-2014 19:17:46
Copyright 2014

Table of Contents
1. Model Version ........................................................................................................ 1
2. Root System ........................................................................................................... 2
1. Diagram ......................................................................................................... 2
2. Description ..................................................................................................... 2
3. Blocks ........................................................................................................... 2
3.1. Parameters ........................................................................................... 2
3.2. Block Execution Order ........................................................................... 9
3. Subsystems ........................................................................................................... 11
1. adjust reference ............................................................................................. 11
1.1. Diagram ............................................................................................ 11
1.2. Blocks ............................................................................................... 11
2. OpComm1 .................................................................................................... 12
2.1. Diagram ............................................................................................ 13
2.2. Blocks ............................................................................................... 13
2.3. Block Execution Order ......................................................................... 16
4. System Design Variables ......................................................................................... 18
5. Glossary .............................................................................................................. 19
6. About this Report .................................................................................................. 20
1. Report Overview ........................................................................................... 20
2. Root System Description ................................................................................. 20
3. Subsystem Descriptions .................................................................................. 21
4. State Chart Descriptions .................................................................................. 21

iv

List of Tables
2.1. "Actuator response time" Parameters ......................................................................... 2
2.2. "Derivative1" Parameters ........................................................................................ 3
2.3. "Gain" Parameters ................................................................................................. 3
2.4. "Gain Kd" Parameters ............................................................................................ 3
2.5. "Gain Ki" Parameters ............................................................................................. 4
2.6. "Gain Kp" Parameters ............................................................................................ 4
2.7. "Gain1" Parameters ............................................................................................... 5
2.8. "Gain2" Parameters ............................................................................................... 5
2.9. "Integrator1" Parameters ......................................................................................... 5
2.10. "Integrator2" Parameters ....................................................................................... 6
2.11. "Integrator3" Parameters ....................................................................................... 6
2.12. "Mux" Parameters ................................................................................................ 7
2.13. "one" Parameters ................................................................................................. 7
2.14. "OP5142EX1 AnalogOut" Parameters ..................................................................... 7
2.15. "OpCtrl OP5142EX1" Parameters ........................................................................... 8
2.16. "Sensor response time" Parameters ......................................................................... 8
2.17. "Sum1" Parameters .............................................................................................. 8
2.18. "Sum3" Parameters .............................................................................................. 9
3.1. "Slider Gain" Parameters ...................................................................................... 11
3.2. "u" Parameters .................................................................................................... 12
3.3. "y" Parameters .................................................................................................... 12
3.4. "Cte" Parameters ................................................................................................. 13
3.5. "In1" Parameters ................................................................................................. 13
3.6. "In2" Parameters ................................................................................................. 14
3.7. "In3" Parameters ................................................................................................. 14
3.8. "OpComm" Parameters ........................................................................................ 14
3.9. "Out1" Parameters ............................................................................................... 15
3.10. "Out2" Parameters ............................................................................................. 15
3.11. "Out3" Parameters ............................................................................................. 16

Chapter 1. Model Version


Version: 1.103
Last modified: Mon May 19 19:17:46 2014
Checksum: 3912881224 3819661705 3141616484 3679503321

Chapter 2. Root System


Table of Contents
1. Diagram ................................................................................................................. 2
2. Description ............................................................................................................. 2
3. Blocks ................................................................................................................... 2
3.1. Parameters ........................................................................................... 2
3.2. Block Execution Order ........................................................................... 9

1. Diagram

2. Description
Model of a simple control system for use iin training.

3. Blocks
3.1. Parameters
3.1.1. "Actuator response time" (TransportDelay)
Table 2.1. "Actuator response time" Parameters

Root System

Parameter

Value

Time delay

0.005

Initial output

Initial buffer size

1024

Use fixed buffer size

off

Direct feedthrough of off


input during linearization
Pade order (for linear- 0
ization)

3.1.2. "Derivative1" (Derivative)


Table 2.2. "Derivative1" Parameters
Parameter

Value

Linearization Time
Constant s/(Ns + 1)

inf

3.1.3. "Gain" (Gain)


Table 2.3. "Gain" Parameters
Parameter

Value

Gain

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)

3.1.4. "Gain Kd" (Gain)


Table 2.4. "Gain Kd" Parameters
Parameter

Value

Gain

Multiplication

Element-wise(K.*u)

Parameter minimum

[]
3

Root System

Parameter

Value

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)

3.1.5. "Gain Ki" (Gain)


Table 2.5. "Gain Ki" Parameters
Parameter

Value

Gain

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)

3.1.6. "Gain Kp" (Gain)


Table 2.6. "Gain Kp" Parameters
Parameter

Value

Gain

20

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)

3.1.7. "Gain1" (Gain)


4

Root System

Table 2.7. "Gain1" Parameters


Parameter

Value

Gain

-1

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)

3.1.8. "Gain2" (Gain)


Table 2.8. "Gain2" Parameters
Parameter

Value

Gain

15/100

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Inherit via internal rule

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Inherit via internal rule

Sample time (-1 for in- -1


herited)

3.1.9. "Integrator1" (Integrator)


Table 2.9. "Integrator1" Parameters
Parameter

Value

External reset

none

Initial condition
source

internal

Initial condition

Limit output

off

Upper saturation limit inf


Lower saturation limit -inf
5

Root System

Parameter

Value

Show saturation port

off

Show state port

off

Ignore limit and reset


when linearizing

off

Enable zero-crossing
detection

on

State Name (e.g., 'posi- ''


tion')

3.1.10. "Integrator2" (Integrator)


Table 2.10. "Integrator2" Parameters
Parameter

Value

External reset

none

Initial condition
source

internal

Initial condition

Limit output

off

Upper saturation limit inf


Lower saturation limit -inf
Show saturation port

off

Show state port

off

Ignore limit and reset


when linearizing

off

Enable zero-crossing
detection

on

State Name (e.g., 'posi- ''


tion')

3.1.11. "Integrator3" (Integrator)


Table 2.11. "Integrator3" Parameters
Parameter

Value

External reset

none

Initial condition
source

internal

Initial condition

Limit output

on

Upper saturation limit 200


Lower saturation limit 0
Show saturation port

off
6

Root System

Parameter

Value

Show state port

off

Ignore limit and reset


when linearizing

off

Enable zero-crossing
detection

on

State Name (e.g., 'posi- ''


tion')

3.1.12. "Mux" (Mux)


Table 2.12. "Mux" Parameters
Parameter

Value

Number of inputs

Display option

bar

3.1.13. "one" (Constant)


Table 2.13. "one" Parameters
Parameter

Value

Constant value

Interpret vector parameters as 1-D

on

Sampling mode

Sample based

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Inherit from 'Constant value'

Sample time

inf

Frame period

inf

3.1.14. "OP5142EX1 AnalogOut" (S-Function)


Table 2.14. "OP5142EX1 AnalogOut" Parameters
Parameter

Value

Controller Name

'OP5142EX1 Ctrl'

DataIn Port number

Slot infos

Slot 1 Module A Subsection 1

Maximum number of
AOut channels controlled by this block

Root System

Parameter

Value

Number of AOut
channels

Set Voltage Range


from input port

off

Voltage range

[-16 ... 16]

3.1.15. "OpCtrl OP5142EX1" (S-Function)


Table 2.15. "OpCtrl OP5142EX1" Parameters
Parameter

Value

Controller Name

'OP5142EX1 Ctrl'

Board ID

Bitstream FileName

OP5142_1-EX-0000-2_1_3_57-OP5142_8DIO_8TSDIO_6QEIO_16AIO-01-0
1.bin

Configuration Number -1
Synchronization mode Master
Generate External
Clock

off

Sample Time (s)

3.1.16. "Sensor response time" (TransportDelay)


Table 2.16. "Sensor response time" Parameters
Parameter

Value

Time delay

0.005

Initial output

Initial buffer size

1024

Use fixed buffer size

off

Direct feedthrough of off


input during linearization
Pade order (for linear- 0
ization)

3.1.17. "Sum1" (Sum)


Table 2.17. "Sum1" Parameters
Parameter

Value

Icon shape

round

List of signs

+++
8

Root System

Parameter

Value

Sum over

All dimensions

Dimension

Require all inputs to


have the same data
type

on

Accumulator data type Inherit: Inherit via internal rule


Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as first input

Sample time (-1 for in- -1


herited)

3.1.18. "Sum3" (Sum)


Table 2.18. "Sum3" Parameters
Parameter

Value

Icon shape

round

List of signs

|+-

Sum over

All dimensions

Dimension

Require all inputs to


have the same data
type

on

Accumulator data type Inherit: Inherit via internal rule


Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as first input

Sample time (-1 for in- -1


herited)

3.1.19. "Terminator" (Terminator)


3.1.20. "Terminator1" (Terminator)
3.1.21. "Terminator2" (Terminator)

3.2. Block Execution Order


1.
2.
3.
4.
5.

one (Constant)
Slider Gain (Gain)
OpComm
Integrator3 (Integrator)
Sensor response time (TransportDelay)
9

Root System

6. Sum3 (Sum)
7. Gain Kp (Gain)
8. Integrator1 (Integrator)
9. Gain Ki (Gain)
10 Gain1 (Gain)
. Derivative1 (Derivative)
11
. Gain Kd (Gain)
12
. Sum1 (Sum)
13
. OpComm1
14
. control signal (Scope)
15
. reference & plant response (Scope)
16
. Actuator response time (TransportDelay)
17
. Gain (Gain)
18
. Gain2 (Gain)
19
. Integrator2 (Integrator)
20
. OP5142EX1 AnalogOut (S-Function)
21
. OpCtrl OP5142EX1 (S-Function)
22
.

10

Chapter 3. Subsystems
Table of Contents
1. adjust reference ..................................................................................................... 11
1.1. Diagram ............................................................................................ 11
1.2. Blocks ............................................................................................... 11
2. OpComm1 ............................................................................................................ 12
2.1. Diagram ............................................................................................ 13
2.2. Blocks ............................................................................................... 13
2.3. Block Execution Order ......................................................................... 16

1. adjust reference
Path: rtdemo1/adjust reference

1.1. Diagram

1.2. Blocks
1.2.1. Parameters
1.2.1.1. "Slider Gain" (Gain)
Table 3.1. "Slider Gain" Parameters
Parameter

Value

Gain

gain

Multiplication

Element-wise(K.*u)

Parameter minimum

[]

Parameter maximum

[]

Parameter data type

Inherit: Same as input

Output minimum

[]

Output maximum

[]

Output data type

Inherit: Same as input

Sample time (-1 for in- -1


herited)
11

Subsystems

1.2.1.2. "u" (Inport)


Table 3.2. "u" Parameters
Parameter

Value

Port number

Port dimensions (-1


for inherited)

-1

Sample time (-1 for in- -1


herited)
Minimum

[]

Maximum

[]

1.2.1.3. "y" (Outport)


Table 3.3. "y" Parameters
Parameter

Value

Port number

Icon display

Port number

Specify properties via off


bus object
Bus object for validat- BusObject
ing input bus
Output as nonvirtual
bus in parent model

off

Port dimensions (-1


for inherited)

-1

Variable-size signal

Inherit

Sample time (-1 for in- -1


herited)
Minimum

[]

Maximum

[]

Data type

Inherit: auto

Source of initial output Dialog


value
Output when disabled held
Initial output

[]

2. OpComm1
Path: rtdemo1/OpComm1
Checksum: 4118599933 1914710065 3880330287 3643722946
12

Subsystems

2.1. Diagram

2.2. Blocks
2.2.1. Parameters
2.2.1.1. "Cte" (DigitalClock)
Table 3.4. "Cte" Parameters
Parameter

Value

Sample time

1.0000000000000001e-005

2.2.1.2. "In1" (Inport)


Table 3.5. "In1" Parameters
Parameter

Value

Port number

Port dimensions (-1

-1
13

Subsystems

Parameter

Value

for inherited)
Sample time (-1 for in- 1.0000000000000001e-005
herited)
Minimum

[]

Maximum

[]

2.2.1.3. "In2" (Inport)


Table 3.6. "In2" Parameters
Parameter

Value

Port number

Port dimensions (-1


for inherited)

-1

Sample time (-1 for in- 1.0000000000000001e-005


herited)
Minimum

[]

Maximum

[]

2.2.1.4. "In3" (Inport)


Table 3.7. "In3" Parameters
Parameter

Value

Port number

Port dimensions (-1


for inherited)

-1

Sample time (-1 for in- 1.0000000000000001e-005


herited)
Minimum

[]

Maximum

[]

2.2.1.5. "OpComm" (S-Function)


Table 3.8. "OpComm" Parameters
Parameter

Value

S-function name

sfun_rtlab_comm

S-function parameters nbport,


st,groupe_acq,Missed_Data,Offset,Sim_Time,Samples,subsys_rate,dynSigOut,
from_console
S-function modules

''

14

Subsystems

2.2.1.6. "Out1" (Outport)


Table 3.9. "Out1" Parameters
Parameter

Value

Port number

Icon display

Port number

Specify properties via off


bus object
Bus object for validat- BusObject
ing input bus
Output as nonvirtual
bus in parent model

off

Port dimensions (-1


for inherited)

-1

Variable-size signal

Inherit

Sample time (-1 for in- -1


herited)
Minimum

[]

Maximum

[]

Data type

Inherit: auto

Source of initial output Dialog


value
Output when disabled held
Initial output

[]

2.2.1.7. "Out2" (Outport)


Table 3.10. "Out2" Parameters
Parameter

Value

Port number

Icon display

Port number

Specify properties via off


bus object
Bus object for validat- BusObject
ing input bus
Output as nonvirtual
bus in parent model

off

Port dimensions (-1


for inherited)

-1

Variable-size signal

Inherit

Sample time (-1 for in- -1


herited)
Minimum

[]
15

Subsystems

Parameter

Value

Maximum

[]

Data type

Inherit: auto

Source of initial output Dialog


value
Output when disabled held
Initial output

[]

2.2.1.8. "Out3" (Outport)


Table 3.11. "Out3" Parameters
Parameter

Value

Port number

Icon display

Port number

Specify properties via off


bus object
Bus object for validat- BusObject
ing input bus
Output as nonvirtual
bus in parent model

off

Port dimensions (-1


for inherited)

-1

Variable-size signal

Inherit

Sample time (-1 for in- -1


herited)
Minimum

[]

Maximum

[]

Data type

Inherit: auto

Source of initial output Dialog


value
Output when disabled held
Initial output

[]

2.2.1.9. "Term1" (Terminator)


2.2.1.10. "Term2" (Terminator)
2.2.1.11. "Term3" (Terminator)
2.2.1.12. "Term4" (Terminator)
2.2.1.13. "Term5" (Terminator)

2.3. Block Execution Order


16

Subsystems

1.
2.
3.
4.
5.

In1 (Inport)
In2 (Inport)
In3 (Inport)
Cte (DigitalClock)
OpComm (S-Function)

17

Chapter 4. System Design Variables


This section describes design variables that determine the output of specific instances of blocks that
make up the rtdemo1 system, for example, the gain parameter of a Gain block. The system may, depending on the block, use the value of the design variable as the value of a block parameter or may use the
variable to compute the value of the block parameter. This section contains two tables. The first table
describes the design variables. The second table lists MATLAB functions used to compute computed
block parameters during simulation of the system. The system will use equivalent implementation-specific functions to compute the values of computed parameters.

18

Chapter 5. Glossary
Atomic Subsystem. A subsystem treated as a unit by an implementation of the design documented in
this report. The implementation computes the outputs of all the blocks in the atomic subsystem before
computing the next block in the parent system's block execution order (sorted list).
Block Diagram. A Simulink block diagram represents a set of simultaneous equations that relate a system or subsystem's inputs to its outputs as a function of time. Each block in the diagram represents an
equation of the form y = f(t, x, u) where t is the current time, u is a block input, y is a block output, and x
is a system state (see the Simulink documentation for information on the functions represented by the
various types of blocks that make up the diagram). Lines connecting the blocks represent dependencies
amonng the blocks, i.e., inputs whose current values are the outputs of other blocks. An implementation
of a design described in this document computes a root or atomic system's outputs at each time step by
computing the outputs of the blocks in an order determined by block input/output dependencies.
Block Parameter. A variable that determines the output of a block along with its inputs, for example,
the gain parameter of a Gain block.
Block Execution Order. The order in which Simulink evaluates blocks during simulation of a model.
The block execution order determined by Simulink ensures that a block executes only after all blocks on
whose outputs it depends are executed.
Checksum. A number that indicates whether different versions of a model or atomic subsystem differ
functionally or only cosmetically. Different checksums for different versions of the same model or subsystem indicate that the versions differ functionally.
Design Variable. A symbolic (MATLAB) variable or expression used as the value of a block parameter. Design variables allow the behavior of the model to be altered by altering the value of the design
variable.
Signal. A block output, so-called because block outputs typically vary with time.
Virtual Subsystem. A subsystem that is purely graphical, i.e., is intended to reduce the visual complexity of the block diagram of which it is a subsystem. An implementation of the design treats the blocks in
the subsystem as part of the first nonvirtual ancestor of the virtual subsystem (see Atomic Subsystem).

19

Chapter 6. About this Report


Table of Contents
1. Report Overview ................................................................................................... 20
2. Root System Description ......................................................................................... 20
3. Subsystem Descriptions .......................................................................................... 21
4. State Chart Descriptions .......................................................................................... 21

1. Report Overview
This report describes the design of the rtdemo1 system. The report was generated automatically from a
Simulink model used to validate the design. It contains the following sections:
- Model Version. Specifies information about the version of the model from which this design description was generated. Includes the model checksum, a number that indicates whether different versions of
the model differ functionally or only cosmetically. Different checksums for different versions indicate
that the versions differ functionally.
- Root System. Describes the design's root system.
-- Subsystems. Describes each of the design's subsystems.
- Design Variables. Describes system design variables, MATLAB variables and expressions used as
block parameter values.
- Requirements Traceability. Shows design requirements associated with elements of the design model.
This section appears only if the design model contains requirements links.
- Glossary. Defines Simulink terms used in this report.

2. Root System Description


This section describes a design's root system. It contains the following sections:
- Diagram. Simulink block diagram that represents the algorithm used to compute the root system's outputs.
- Description. Description of the root system. This section appears only if the model's root system has a
Documentation property or a Doc block.
- Interface. Name, data type, width, and other properties of the root system's input and output signals.
The number of the block port that outputs the signal appears in angle brackets appended to the signal
name. This section appears only if the root system has input or output ports.
- Blocks. This section has two subsections:
-- Parameters. Describes key parameters of blocks in the root system. This section also includes graphical and/or tabular representations of lookup table data used by lookup table blocks, i.e., blocks that use
lookup tables to compute their outputs.

20

About this Report

-- Block Execution Order. Order in which blocks must be executed at each time step in order to ensure
that each block's inputs are available when it executes.
- State Charts. Describes state charts used in the root system. This section appears only if the root system
contains Stateflow blocks.

3. Subsystem Descriptions
This section describes a design's subsystems. Each subsystem description contains the following sections:
-Path. The path of the subsystem in the model. The path indicates the subsystem's location in the subsystem hierarchy.
- Checksum. This section appears only if the subsystem is an atomic subsystem. The checksum indicates
whether the version of the model subsystem used to generate this report differs functionally from other
versions of the model subsystem. If two model checksums differ, the corresponding versions of the
model differ functionally.
- Diagram. Simulink block diagram that graphically represents the algorithm used to compute the subsystem's outputs.
- Description. Description of the subsystem. This section appears only if the subsystem has a Documentation property or contains a Doc block.
- Interface. Name, data type, width, and other properties of the subsystem's input and output signals. The
number of the block port that outputs the signal appears in angle brackets appended to the signal name.
This section appears only if the subsystem is atomic and has input or output ports.
- Blocks. Blocks that this subsystem contains. This section has two subsections:
-- Parameters. Key parameters of blocks in the subsystem. This section also includes graphical and/or
tabular representations of lookup table data used by lookup table blocks, blocks that use lookup tables to
compute their outputs.
-- Block Execution Order. Order in which the subsystem's blocks must be executed at each time step in
order to ensure that each block's inputs are available when the block executes .This section appears only
if the subsystem is atomic.
- State Charts. Describes state charts used in the subsystem. This section appears only if the root system
contains Stateflow blocks.

4. State Chart Descriptions


This section describes the state machines used by Stateflow blocks to compute their outputs, i.e., Stateflow blocks. Each state machine description contains the following sections:
- Chart. Diagram representing the state machine.
- States. Describes the state machine's states. Each state description includes the state's diagram if it has
content and a table giving the values of key state properties.
- Transitions. Transitions between the state machine's states. Each transition description specifies the
values of key transition properties. Appears only if a transition has properties that do not appear on the
chart.
- Junctions. Transition junctions. Each junction description specifies the values of key junction proper21

About this Report

ties. Appears only if a junction has properties that do not appear on the chart.
- Events. Events that trigger state transitions. Each event description specifies the values of key event
properties.
- Data. Data types and other properties of the Stateflow block's inputs, outputs, and other state machine
data.
- Targets. Executable implementations of the state machine used to compute the outputs of the corresponding Stateflow block.

22

Вам также может понравиться