• Keine Ergebnisse gefunden

HiLDEGART Implementation Examples

5.2 HiLDE: HiL Design Environment

5.3.4 HiLDEGART Implementation Examples

Two of the implementation examples presented in the previous chapter are used here to demonstrate the use of the HiLDEGART framework to the design of FPGA-based controllers, including control-systems where dynamic hardware reconfiguration is used (cf. [6, 16].

Torque Control of a Synchronous AC Motor

This example was presented in section 4.4.4. In this section further measurements with HiLDEGART, which allow the verification of controllers, are presented.

When using dynamic reconfiguration to exchange controllers at run time it is relevant to make sure that all controllers work individually. HiLDEGART can be used for this purpose, allowing the monitoring and parametrisation of all controllers. An example of this are the measurement with the real motor presented in figure 5.24. The figure shows the q-current step response of a permanent magnet servo motor using three different controllers:

• FOC: The control output is only driven by the PI-Controller and the dynamic of the control loop is determined by the PI-Controller.

0 0.5 1 1.5 2 2.5 3 3.5

−0.5 0 0.5

d−current in A

0 0.5 1 1.5 2 2.5 3 3.5

−5 0 5

q−current in A

time in ms

FOC FOC−EMF FOC−EMF−DeC

Figure 5.24: q-current step response at 3000 rpm (Test bed: Controller at FPGA, Motor as EUT)

• FOC with Back-EMF compensation: The main part of the control output is generated by the Back-EMF compensation. The dynamics of the control loop improved (compared to FOC).

• FOC with Back-EMF compensation and decoupling: This control structure gives almost the same results as the prior controller. Only in case of transient currents and higher electrical frequencies the additional effort has an effect on the behavior of the control loop.

The results show a proper control behaviour of all three controllers. The plots are created by using HiLDEGART.

Controllers are typically embedded in an environment (e.g., a SoC), and it is equally important to verify the design when working in its final platform, specially when dynamic reconfiguration is used, since a reconfiguration should not affect the behaviour of the system, and therefore, monitoring is crucial to verify the design.

An example of this is shown in figure 5.25, where the switching between torque controllers is shown (cf. section 4.4.4).

The time of switching is marked by the signals in the first line. The graph corre-sponding to the control error shows no effects in the next 8 samples after the switching.

-1 0 1 x 10 -1

0 1 2

time in sec

switching signal

-1 0 1

x 10 -0.5

0 0.5

time in sec

d-current error in A

-1 0 1

x 10 -0.5

0 0.5

time in sec

q-current error in A

-1 0 1

x 10 -0.5

0 0.5

time in sec

line-current in A

-1 0 1

x 10 -1

0 1 2

time in sec

switching signal

-1 0 1

x 10 -0.5

0 0.5

time in sec

d-current error in A

-1 0 1

x 10 -0.5

0 0.5

time in sec

q-current error in A

-1 0 1

x 10 -0.5

0 0.5

time in sec

line-current in A

Figure 5.25: Switching between Control Schemes. Left: FOC to FOC-Back EMF-DeC. Right: FOC-Back EMF to FOC [7]

Considering these measurements it is shown that for the considered examples, the switching does not have a negative influence on the control loop, and has no direct disadvantage at the time of switching. The later behavior is determined by the dynamic features of the new control structure.

As explained in section 5.3.2, AR can be used to show more sophisticated an-notations (e.g., information about the motor) during operation. The use of the AR extension is presented in the next example.

Inverted pendulum

The inverted pendulum system was presented in section 4.4.3. In this section, the focus is on the support given by the HiLDEGART framework to the design and verification process.

The goal of a HiLDEGART test is to verify the function of a DUT in real-time, using a real environment. In the case of the inverted pendulum system, the controllers are executed in a complex system-on-chip (SoC) architecture, cf. 4.4.2. Therefore, a

monitoring system, which allow real-time debugging on-chip was important to fully test the control system.

0 10 20 30 40 50 60 70

0 5 10

Control Output (V)

Inverted Pendulum

0 10 20 30 40 50 60 70

−10 0 10

Pendulum Angle (rad)

0 10 20 30 40 50 60 70

−0.1 0 0.1

Cart Position (m)

0 10 20 30 40 50 60 70

0 1 2 3

time (s) Active Controller

Figure 5.26: HiLDEGART measurements of the inverted pendulum system. Several reconfiguration cycles are shown

The controllers are loaded into the reconfigurable areas (Tiles 1-4) of the SoC architecture based on a Xilinx Virtex-II Pro FPGA (XC2VP30), cf. figure 4.20. This SoC is composed of an embedded PowerPC processor (PPC) connected to dynamically reconfigurable resources (Tile 1 to 4), and to dedicated communication blocks, as well as a HiLDEGART interface. The Broadcast bus of the RAPTOR system is used to communicate values to the DB-MC board (cf. fig. 4.20), which in turn converts these values into voltages for the power electronics part of the pendulum. The angle and the position of the pendulum are gathered from incremental encoders, such that the digital I/Os of the FPGA board can be used to decode these values. The process of dynamic reconfiguration of controllers is supervised by a program on the PPC, which can access the inputs and outputs of the controllers. Once a suitable switching condition has been reached, the PPC can start reconfiguration. This process can be monitored by using HiLDEGART and the AR tool, enabling the validation and further test of the reconfiguration in the target environment.

Control signals, and the inputs and outputs of the plant are shown in figure 5.26.

The test presented in this section consisted on initializing the swing-up controller and then switch to the balance controller when the conditions are suitable (cf. section 4.4.3). The balance controller stays enable for some seconds, and then it is deactivated.

Therefore, the swing-up controller has to be activated again, completing the cycle, which is repeated several times. This iterations are shown in figure 5.26, where the last plot shows the currently selected controller. This process is also shown in the AR extension of HiLDEGART, as presented in figure 5.27.

Figure 5.27: HiLDEGART test of the inverted pendulum system using an Augmented Reality extension. Balance controller is active

The AR extension shows, in addition to the pendulum, context-sensitive information regarding the control unit, including a logical structure of all components and bus systems. The visualisation also shows the allocation of a controller to a certain Tile of the SoC architecture. Furthermore, the current angle of the pendulum and the force and direction of the movements of the cart are shown, as presented in figure 5.27.

This clarifies the mode of operation of the system, because annotations are shown in a visual context, which is familiar to the viewer (i.e., the physical context), and therefore, the interpretation of the annotations is easier. The AR extension can also be used in combination with a model of the pendulum, which is executed in real time. In

this case, outputs of the model can be visualised, in a way that the user can intuitively understand them [16].