RT Box Architecture

This chapter describes the hardware architecture of the RT Box 1, 2, 3 and 4. Most of the following properties are common to all versions of the RT Box. Differences between versions are specifically mentioned in the following sections.

Front Panel

The front panel of the RT Box contains connectors for the analog and digital inputs and outputs (I/Os). For RT Box 1, 2 and 4 there are four of these connectors whereas the RT Box 3 has eight. The I/Os need to be connected by the user to the device-under-test (DUT). If the RT Box is employed for HIL simulations, the DUT is the real control hardware and the RT Box emulates the plant. If the RT Box is used for rapid control prototyping, the DUT is the real plant controlled by the RT Box.

All I/O connectors are 37 pin normal-density D subminiature (D-Sub) connectors. Male connectors are used for inputs while female ones are used for outputs.

In addition, the front panel of the RT Box 1 contains 4 LEDs to indicate the status of the box. For the RT Box 2, 3 and 4 the status of the box is shown in an interactive display.

Analog Inputs

The RT Box 1, 2 and 4 provide 16 analog input channels the RT Box 3 provides 32 thereof. The input voltage range can be set for all channels together to either \(\pm 10\,\textrm V\) or \(\pm 5\,\textrm V\). Each channel can be individually configured for differential or single-ended measurement.

The analog-to-digital converters (ADCs) inside the RT Box are specified for a maximum sampling rate of \(2\, \textrm{MSPS}\) with no-cycle latency for the RT Box 1 and a maximum sampling rate of \(5\, \textrm{MSPS}\) with 1 cycle latency for the RT Box 2, 3 and 4.

As the firmware of the RT Box currently limits the cycle time to a minimum of \(1\, \mu{\textrm s}\), a sampling rate of up to \(1\, \textrm{MSPS}\) can be realized when the ADC measurements are synchronized to the simulation step (default). Higher sampling rates are possible by configuring channel specific software or hardware triggers, which enables continuous ADC sampling. Linear interpolation of ADC values in hardware is then used for even finer resolution, as the analog inputs are still transferred once per simulation step only.

The analog inputs play an important role when the RT Box is used for rapid control prototyping. To allow instantaneous sampling of the input signals, the analog inputs do not have internal anti-aliasing filters. If the bandwidth of the input signal shall be limited, such filters must be added externally.

Differential measurement

The analog inputs are equipped for fully differential measurement. The measured voltage is the difference between the positive and the negative input. The full-scale differential input range is \(\pm 10\,{\textrm V}\) or \(\pm 5\,{\textrm V}\), depending on the configuration.

A ground connection between the DUT and the RT Box is required even in differential mode, because the inputs cannot float freely with respect to GND. For linear operation, the input voltages referenced to GND shall not exceed \(\pm 10.8\,{\textrm V}\). As a consequence, the acceptable common mode voltage range is \(\pm 5.8\,{\textrm V}\) (for \(\pm 10\,{\textrm V}\) operation) and \(\pm 8.3\,{\textrm V}\) (for \(\pm 5\,{\textrm V}\) operation).

Single-ended measurement

To configure an input channel for single-ended measurement, only the positive input is used for signal measurement while the corresponding negative input is clamped to GND. The full-scale input voltage range is either \(\pm 10\,{\textrm V}\) or \(\pm 5\,{\textrm V}\), depending on the configuration.

Analog Input Connector

../_images/DSub-male.svg
37 pin male D-Sub (front view)

Table 2 Pinout of the analog input connector. *The value in brackets (x) specifies the channel number for the second analog input connector of the RT Box 3.

Pin

Description*

Pin

Description

1

Analog input 0 (16) positive

20

Analog input 0 (16) negative

2

Analog input 1 (17) positive

21

Analog input 1 (17) negative

3

Analog input 2 (18) positive

22

Analog input 2 (18) negative

4

Analog input 3 (19) positive

23

Analog input 3 (19) negative

5

Analog input 4 (20) positive

24

Analog input 4 (20) negative

6

Analog input 5 (21) positive

25

Analog input 5 (21) negative

7

Analog input 6 (22) positive

26

Analog input 6 (22) negative

8

Analog input 7 (23) positive

27

Analog input 7 (23) negative

9

Analog input 8 (24) positive

28

Analog input 8 (24) negative

10

Analog input 9 (25) positive

29

Analog input 9 (25) negative

11

Analog input 10 (26) positive

30

Analog input 10 (26) negative

12

Analog input 11 (27) positive

31

Analog input 11 (27) negative

13

Analog input 12 (28) positive

32

Analog input 12 (28) negative

14

Analog input 13 (29) positive

33

Analog input 13 (29) negative

15

Analog input 14 (30) positive

34

Analog input 14 (30) negative

16

Analog input 15 (31) positive

35

Analog input 15 (31) negative

17

n/c

36

n/c

18

n/c

37

GND

19

n/c

Shield

PE

Note

For the RT Box CE, analog input positive-negative channel pair from number 8 to 15 are not connected (n/c).

Analog Outputs

The 16 analog output channels of the RT Box are heavily used for HIL simulations. The analog outputs provide the voltage signals from sensors inside the simulated plant and need to be connected to the analog inputs of the controller.

The full-scale voltage range of the outputs can be set to \(\pm 10\,{\textrm V}\), \(0 \dots 10\,{\textrm V}\), \(\pm 5\,{\textrm V}\) and \(0 \dots 5\,{\textrm V}\).

For testing purposes, the analog outputs can be connected with the analog inputs of the same or a different RT Box using a 37 pin D-Sub extension cable.

Analog Output Connector

../_images/DSub-female.svg
37 pin female D-Sub (front view)

Table 3 Pinout of the analog output connector. *The value in brackets (x) specifies the channel number for the second analog output connector of the RT Box 3.

Pin

Description*

Pin

Description

1

Analog output 0 (16)

20

GND

2

Analog output 1 (17)

21

GND

3

Analog output 2 (18)

22

GND

4

Analog output 3 (19)

23

GND

5

Analog output 4 (20)

24

GND

6

Analog output 5 (21)

25

GND

7

Analog output 6 (22)

26

GND

8

Analog output 7 (23)

27

GND

9

Analog output 8 (24)

28

GND

10

Analog output 9 (25)

29

GND

11

Analog output 10 (26)

30

GND

12

Analog output 11 (27)

31

GND

13

Analog output 12 (28)

32

GND

14

Analog output 13 (29)

33

GND

15

Analog output 14 (30)

34

GND

16

Analog output 15 (31)

35

GND

17

n/c

36

n/c

18

n/c

37

GND

19

n/c

Shield

PE

Digital Inputs

Active bus hold circuitry holds unused or floating data inputs at a valid logic level. If a specific logic level is required for high-impedance inputs, pull-down or pull-up resistors must be connected externally.

Digital Input Connector

../_images/DSub-male.svg
37 pin male D-Sub (front view)

Table 4 Pinout of the digital input connector. *The value in brackets (x) specifies the channel number for the second digital input connector of the RT Box 3.

Pin

Description*

Pin

Description

1

Digital input 0 (32)

20

Digital input 1 (33)

2

Digital input 2 (34)

21

Digital input 3 (35)

3

Digital input 4 (36)

22

Digital input 5 (37)

4

Digital input 6 (38)

23

Digital input 7 (39)

5

GND

24

Digital input 8 (40)

6

Digital input 9 (41)

25

Digital input 10 (42)

7

Digital input 11 (43)

26

Digital input 12 (44)

8

Digital input 13 (45)

27

Digital input 14 (46)

9

Digital input 15 (47)

28

GND

10

Digital input 16 (48)

29

Digital input 17 (49)

11

Digital input 18 (50)

30

Digital input 19 (51)

12

Digital input 20 (52)

31

Digital input 21 (53)

13

Digital input 22 (54)

32

Digital input 23 (55)

14

GND

33

Digital input 24 (56)

15

Digital input 25 (57)

34

Digital input 26 (58)

16

Digital input 27 (59)

35

Digital input 28 (60)

17

Digital input 29 (61)

36

Digital input 30 (62)

18

Digital input 31 (63)

37

GND

19

5 V, 1.5 A max.

Shield

PE

Digital Outputs

Digital Output Connector

../_images/DSub-female.svg
37 pin female D-Sub (front view)

Table 5 Pinout of the digital output connector. *The value in brackets (x) specifies the channel number for the second digital output connector of the RT Box 3.

Pin

Description*

Pin

Description

1

Digital output 0 (32)

20

Digital output 1 (33)

2

Digital output 2 (34)

21

Digital output 3 (35)

3

Digital output 4 (36)

22

Digital output 5 (37)

4

Digital output 6 (38)

23

Digital output 7 (39)

5

GND

24

Digital output 8 (40)

6

Digital output 9 (41)

25

Digital output 10 (42)

7

Digital output 11 (43)

26

Digital output 12 (44)

8

Digital output 13 (45)

27

Digital output 14 (46)

9

Digital output 15 (47)

28

GND

10

Digital output 16 (48)

29

Digital output 17 (49)

11

Digital output 18 (50)

30

Digital output 19 (51)

12

Digital output 20 (52)

31

Digital output 21 (53)

13

Digital output 22 (54)

32

Digital output 23 (55)

14

GND

33

Digital output 24 (56)

15

Digital output 25 (57)

34

Digital output 26 (58)

16

Digital output 27 (59)

35

Digital output 28 (60)

17

Digital output 29 (61)

36

Digital output 30 (62)

18

Digital output 31 (63)

37

GND

19

n/c

Shield

PE

Resolver

The RT Box 2, 3 and 4 provide a resolver interface that can be used for Hardware-in-the-loop (HIL) and Rapid Control Prototyping (RCP) applications.

Resolver In Connector (RCP)

../_images/DSub-male9.svg
9 pin male D-Sub (front view)

Table 6 Pinout of Resolver In connector

Pin

Description

1

GND

2

+COSIN

3

+SININ

4

+EXCOUT

5

GND

6

-COSIN

7

-SININ

8

GND

9

-EXCOUT

Resolver Out Connector (HIL)

../_images/DSub-female9.svg
9 pin female D-Sub (front view)

Table 7 Pinout of Resolver Out connector

Pin

Description

1

GND

2

+COSOUT

3

+SINOUT

4

+EXCIN

5

GND

6

-COSOUT

7

-SINOUT

8

GND

9

-EXCIN

Nanostep Out

The Nanostep Out is available on RT Box 4 and provides a fast analog output from a Nanostep signal source.

Nanostep Out BNC Sockets

../_images/nanodacbnc.svg
6 BNC sockets (front view)

Table 8 Pinout of Nanostep Out BNC sockets. (Outer conductor is connected to GND and not to PE.)

Inner conductor

Outer conductor

Nanostep Out 0

GND

Nanostep Out 1

GND

Nanostep Out 2

GND

Nanostep Out 3

GND

Nanostep Out 4

GND

Nanostep Out 5

GND

Nanostep Out D-Sub Connector

../_images/DSub-female.svg
37 pin female D-Sub (front view)

Table 9 Pinout of Nanostep Out D-Sub connector. (Depending on the voltage range setting, the D-Sub has a voltage reference of either 0V or 2V on pin 16.)

Pin

Description

Pin

Description

1

Nanostep Out 0

20

GND

2

Nanostep Out 1

21

GND

3

Nanostep Out 2

22

GND

4

Nanostep Out 3

23

GND

5

Nanostep Out 4

24

GND

6

Nanostep Out 5

25

GND

7

n/c

26

GND

8

n/c

27

GND

9

n/c

28

GND

10

n/c

29

GND

11

n/c

30

GND

12

n/c

31

GND

13

n/c

32

GND

14

n/c

33

GND

15

n/c

34

GND

16

D-Sub ref. (0 / 2V)

35

GND

17

n/c

36

n/c

18

n/c

37

GND

19

n/c

Shield

PE

Rear Panel

CAN

The CAN connector is available on RT Box 2, 3, 4 and hardware revision 1.2 of the RT Box 1.

CAN Connector

../_images/DSub-male9.svg
9 pin male D-Sub (front view)

Table 10 Pinout of CAN connector

Pin

Description

1

n/c

2

CAN_L channel 1

3

GND

4

CAN_L channel 2

5

n/c

6

n/c

7

CAN_H channel 1

8

CAN_H channel 2

9

n/c

The CAN connector is electrically isolated from the rest of the RT Box.

UART

The UART Interface is only available on the RT Box 2, 3 and 4.

RS-232/422/485 Connector

../_images/DSub-male9.svg
9 pin male D-Sub (front view)

Table 11 Pinout of RS-232/422/485 connector

Pin

RS-232

RS-422

RS-485

1

RXD channel 2

Rx+ channel 2

n/c

2

RXD channel 1

Rx+ channel 1

n/c

3

TXD channel 1

Tx+ channel 1

TRx+ channel 1

4

TXD channel 2

Tx+ channel 2

TRx+ channel 2

5

GND

GND

GND

6

RTS channel 2

Tx- channel 2

TRx- channel 2

7

RTS channel 1

Tx- channel 1

TRx- channel 1

8

CTS channel 1

Rx- channel 1

n/c

9

CTS channel 2

Rx- channel 2

n/c

The RS-232/422/485 connector is electrically isolated from the rest of the RT Box.

Displayport

A displayport connector is only available on the RT Box 2, 3 and 4. There is currently no software implementation in the RT Box target support package for this interface.

Displayport Connector

../_images/displayport.svg
Displayport connector (front view)

Industrial Ethernet

Two Industrial Ethernet ports are available on the RT Box 2, 3 and 4. The EtherCAT fieldbus interface is available via this port on RT Box 2 and RT Box 3 with hardware revision 1.2 and newer, and also on the RT Box 4.

Industrial Ethernet Connector

../_images/ethernet.svg
Industrial Ethernet connector (front view)

Grounding Concept

Inside the RT Box, signal Ground (GND) and Protective Earth (PE) are not connected direcly. Instead, GND and PE are loosly coupled by means of a high impedance RC network, consisting of a \(1\,\textrm M\Omega\) resistor, a \(1\, \mu\textrm F\) capacitor and a 5V zener diode (SMAJ5.0CA), all connected in parallel. This configuration avoids ground loops that might otherwise occur if the device-under-test (DUT) used single-ended analog measurement and provided a low-impedance connection between GND and PE.

As the communication lines of both the Ethernet port and the SFP+ modules are AC coupled, multiple RT Boxes can be connected with each other and to a host computer without creating ground loops. At the RT Box, the shields of those lines are connected to PE. The service port is also referenced to PE and isolated from GND of the RT Box.

At the rear panel, only the SD card slot and the USB A receptable are referenced to GND of the RT Box. Mass storage devices such as SD cards and USB memory sticks usually do not have a PE connection, so they can be used at these ports without creating ground loops. However, care should be taken when using externally powered USB devices with a PE connection, such as printers.

The CAN connector (only available on certain versions of the RT Box) and the RS-232/422/485 connector (only available on RT Box 2, 3 and 4) are electrically isolated from the rest of the RT Box.

Principle of Operation

The basic building blocks of the RT Box are shown in Fig. 2.

../_images/RTBoxArch.svg

Fig. 2 RT Box Overview

The RT Box uses two ARM cores. The first core is responsible for communication, both directly with PLECS or through the web interface of the RT Box.

The second ARM core is dedicated to the real-time application. It has direct access to the different peripheral blocks. Digital Out signals can be set either directly or through the PWM Generator or Encoder unit. Digital Inputs can be sampled by the PWM capture block which allows for high accuracy duty cycle measurement. The Digital Inputs can also be read directly.

Execution of the Real-time Application

After the real-time application has been initialized, its step function is called in fixed periodic intervals, \(t_{Cycle}\). The cycle time must be chosen large enough to ensure that the step function is always executed completely before a new cycle is started.

../_images/RTBoxTrigScheme.svg

Fig. 3 Input / output timing

Unsafe Math Operations

The C standard specifies that the result of the divide operators “/” or “%” is undefined if the second operand is zero. PLECS does not add extra checks when generating code which uses a divide operator. For this reason it is the responsibility of the model creator to ensure that a division-by-zero condition does not occur.

In most cases, a floating point division-by-zero results in a floating point value of NaN (Not a Number) or \(\pm\infty\), whereas an integer division-by-zero results in immediate program termination. However, this behavior should not be relied upon.

The same applies to other math operations that are undefined, e.g. \(tan(\pi/2)\), \(asin(2)\) etc.