Remote Motor Control

10 downloads 25245 Views 900KB Size Report
A new approach for remote control experiment development is presented. The described solution is based on custom developed motor control hardware and ...
Remote Motor Control Darko Hercog, Bojan Gergič, Vojko Matko, Karel Jezernik Faculty of Electrical Engineering and Computer Science, Maribor, Slovenia

Key words: Remote Control, Remote Experiments, Motor Control, DSP, LabVIEW, MATLAB/Simulink.

Abstract: A new approach for remote control experiment development is presented. The described solution is based on custom developed motor control hardware and two commercially available software packages i.e. MATLAB/Simulink and LabVIEW. MATLAB/Simulink is used for experiment control algorithm development and the LabVIEW for graphical user interface creation and remote operation. A combination of the presented hardware and software solutions enables quick and easy development of different remote control experiments. This article is supplemented with an example of a remote DC motor control.

1 Introduction Classical hands-on laboratories are usually fully occupied therefore students have to conclude their research in the time offered for experimental work. This problem can be reduced using remote experiments. When using remote experiments students operate with the real system although they are not physically present in the laboratory. Such a solution presents a cost effective way of opening up a laboratory for students 24 hours a day. Although remote experiments seem to be very useful, a lot of hard work is needed when setting them up. Designers must be acquainted with web servers operation, Java programming, CGI scripts, etc. In contrast, using the solution described in this present article, remote experiments can be developed quickly and with minimal effort. The presented solution relies on a DSP-2 motor controller developed by the Faculty of Electrical Engineering and Computer Science (FERI) Maribor, and two of the electrical engineering world’s leading software packages, i.e. Matlab/Simulink from MathWorks Inc. and LabVIEW from National Instruments. Simulink is used for control algorithm development and LabVIEW for graphical user interface creation and remote control operation. Following one from the first remote laboratory developed in 1992 by SCiL (Stansford Center for Innovations in Learning), a variety of different approaches have been proposed for developing remote experiments or a remote laboratory. In many cases, the authors spent a lot of energy finding a simple solution, where only a standard web browser is needed by the remote user in order to perform remote experiments [1], [2]. In some others existing solutions the user must download special programmes that enable remote control [3]. In the majority of available remote experiments, remote users can run an experiment and adjust process or controller parameters from a set of predefined parameters. An interesting and advance remote laboratory has been presented by the members of Siena University [1]. Using an Automatic Control Telelab (ACT), the remote users can design a custom controller and reference signal on a local PC in Matlab/Simulink. After successful simulation, the remote user can download the designed controller to the ACT server, and also verify it on the real process. Although presented solution doesn’t enable custom controller verification it has other qualities for example powerful DSP based controller, capability of rapid remote experiment development and real time operation. 1

This present article is divided into 5 sections. Section 2 contains a description of the DSP-2 motor controller, the programming possibilities using MATLAB/Simulink and an overview of the LabVIEW virtual instrument for the mentioned controller. Section 3 deals with the Remote Panels technology, which enables remote control of the LabVIEW programmes using a standard web browser. Section 4 contains an example of the remote DC motor control experiment, whilst in section 5 summarize the preference and weakness of described remote experiment solution.

2 Hardware and software components Section contains an overview of hardware and software components used in remote motor control experiment. 2.1 DSP-2 motor controller DSP-2 motor controller [4] was developed at FERI for the research of torque, speed and positon control of electrical motors. The main components of the afore mentioned controller are the Texas Instruments (TI) TMS320C32 floating point processor which is used for motor control algorithm's execution, and the Xilinx FPGA of the Spartan family, which implements the 3 phase pulse width modulator (PWM), and the peripheral interfaces (Figure 1). In addition to the afore mentioned components, the DSP-2 controller contains all the necessary peripheral for AC and DC motor control i.e. it contains A/D and D/A converters, a pulse width modulator (PWM), an optically isolated digital I/O, connector for incremental encoder, RAM, FLASH ROM, CAN controller (Figure 1). Power supply supervisor

32

DSP TM S320C32-60

EEPROM 4...256kb

RS232 interface

LTC485

RS485 interface Boundary Scan Logic

H/W INTERLOCK MIN. DEADTIME

PERIOD

XilinX XCS40PQ240

A/D interface

A/D A/D A/D A/D 400kS/s 12bit 12bit 12bit 12bit

INCR. ENC. interface

D/A interface

RS422

I/O

D/A D/A 12bit 12bit

INVERTER

ADM232A

XDS510 MPSD Port DT

EEPROM interface

CAN interface

JTAG

SAE81C90

RS232

16

10 GP I/O PINS INC.ENC.

2 I C

RS485

CAN 16 GP I/O

SRAM 0WS 128K x 32

8

SERIAL PORT

FLASH 256 x 8

MUX LPF

LPF

LPF

0... 4V ± 2V ± 2V

LPF 8x ± 2V

+-

0..4V -4..4V 0..4V

3xIN 1xOUT

Figure 1: block scheme of the DSP-2 motor controller

DSP-2 pedagogic aids (Figure 6) have been developed, based on the DSP-2 motor controller. These aids are used in different control courses that are performed at FERI, and also in remote DC motor control experiment, described in a subsequent article. 2.2 Programming possibilities of the DSP-2 motor controller A set of Simulink blocks so-called the DSP-2 Library for Simulink [5] has been developed for the purpose of easy programming of the DSP-2 controller. DSP-2 Simulink library is composed of a few subsystems, the most important being the DSP-2 blocks (Figure 2). This subsystem contains input and output blocks (DSP-2 blocks) for the DSP-2 controller which, by using a Real-Time Workshop and Code Composer for the TI signal processors, enables 2

programming of the DSP-2 controller using the Simulink [5]. The DSP-2 blocks subsystem contains three types of DSP-2 blocks i.e. DSP-2 source blocks, DSP-2 sink blocks and the transformation blocks (Figure 2). The majority of these have their own graphical user interfaces (GUI), where additional parameters can be customized which are specific to each block.

Figure 2: Simulink DSP-2 blocks

Almost any type of control or signal processing algorithm can be created under the Simulink frame by using the DSP-2 blocks and Simulink built-in blocks. Followings successful simulation, the Simulink model is converted to binary executable code, appropriate for the DSP-2 motor controller [5]. While the generated binary code is executing in real time on the embedded target i.e. on the DSP-2 controller, DSP-2 variable monitoring and parameter tuning is achieved using the DSP Terminal [7]. 2.3 LabVIEW virtual instrument for the DSP-2 controller The DSP Terminal [7] monitoring programme is a very simple and easy to use programme. However, the DSP Terminal has some weaknesses, for example the user cannot accommodate GUI to the customized needs, limitation of parameter range is impossible and DSP-2 variables can only be displayed on one graph. A decision was made to develop a LabVIEW virtual instrument (VI) named ‘ComVIEW’, which would eliminate the majority of the stated limitations. ComVIEW is an advanced LabVIEW virtual instrument composed of the main VI and a library of approximately 70 VI’s. ComVIEW VI has been developed so that, only a basic knowledge of the G language is necessary when using it. This simplicity was achieved using the DSP Connection Manager window (Figure 3). The DSP Connection Manager appears immediately after the binary code starts executing on the DSP-2 controller. All information about the DSP-2 input variables, DSP-2 parameters and DSP-2 output variables, as well as all information about VI scalar controls and the indicators of front panel window, appear in the afore mentioned window (Figure 3). Using mouse clicks, the user can create links between the front panel indicators and the DSP-2 output variables, and links between the front panel controls and the DSP-2 input variable or DSP-2 parameter. When these links are made, the newly set control value of the front panel is immediately transferred from the PC to the DSP-2 controller. At the same time, all arrived DSP-2 output variables are read from the PC serial port and displayed in an appropriate indicator or graph. In addition to the DSP Connection Manager, ComVIEW contains a run time menu (Figure 9), where additional online options take place. These menu options enable the storing and loading 3

of current control vales to/from the file, setting the trigger signal, trigger level, trigger slope, and defining the signals to be captured.

Figure 3: DSP Connection Manager

The ComVIEW virtual instrument comes with an empty front panel and fully functional block diagram, which already contains all the necessary functions needed for correct operation. These functions implement VI initialization, executable code download to the DSP-2 controller, functions for receiving and transmitting messages between PC and the DSP-2 controller, etc. The user can fully accommodate the ComVIEW VI front panel and block diagram to the customized needs and, in such a way, take full advantage of the LabVIEW environment.

Figure 4: block diagram of the ComVIEW VI

4

3 Remote Control Remote Panels technology developed by National Instruments enables the viewing and controlling of LabVIEW virtual instruments over the Internet. The LabVIEW VI can be published on the internet with no additional programming. The remote user can observe or control remote experiments by using only the standard web browser (Figure 9). Remote experiments can be developed in approximately one hour by using the hardware and software components described in the previous section, and the Remote Panels technology. Figure 5 presents the block scheme of such a remote control experiment. A DSP-2 motor controller, connected to the server through the serial port, implements a control algorithm developed using Simulink and, through the analog and digital I/O, drives the real process. ComVIEW VI and the LabVIEW server run on the server machine for the purpose of enabling the remote control of an experiment. ComVIEW VI performs communication between server and the DSP-2 controller and enables DSP-2 variable monitoring and parameter tuning, while the LabVIEW server enables remote operation of the ComVIEW VI. Remote users, connected to the server through the internet, must have a “LabVIEW Run-Time Engine” installed on the PC in order to perform remote experiments.

Figure 5: block scheme of remote experiment using DSP-2 motor controller

The user registration procedure is added to the programme, when ComVIEW is used as a Remote Panel. The user name and an e-mail address are required by the log-in window, when the remote user gains control over the VI. During the experiment, the remote user can adjust the controller or process parameters and send him experimental results via email.

4 Experiment: Remote DC Motor Control This section presents the realization of remote DC motor control using Simulink, ComVIEW VI DSP-2 motor controller and Remote Panels. The experimental system is shown in Figure 6. System is composed of the DSP-2 pedagogic aid, H-bridge and commercially available DC motor. 4.1 DC motor control algorithm Figure 7 presents a Simulink model of the DC motor cascade control. The Simulink model contains current, speed and position control loops, a position reference generator, and the DSP-2 DC motor interface subsystem. A proportional-integral (PI) controller is used in the current and speed control loop, whilst the position control loop is realized by using a proportional (P) controller. 5

Figure 6: DSP-2 pedagogic aid with the H-bridge and the DC motor

Figure 7: Simulink model of current, speed and position control of the DC motor DC motor Interface subsystem (Figure 8) contains an algorithm for the armature current measurement, current offset compensation, speed and position of the motor shaft calculation, speed measurement filter, PWM signal generation, and the DC link voltage measurement. Afore mentioned subsystem is realized using DSP-2 blocks (these blocks are shaded in Figure 8), and the Simulink built-in blocks. An executable code is automatically generated from the Simulink model and downloaded to the DSP-2 motor controller [5] using Real-Time Workshop and the TI Code Composer. Next, the ComVIEW VI template is used for experiment GUI development.

6

Figure 8: Simulink DC motor DSP-2 Interface subsystem 4.2

Remote DC motor control

Figure 8 shows the GUI of the DC motor experiment. GUI was developed using the ComVIEW and by Remote Panels published on the internet. During remote operation, the remote user can start/stop the DC motor, set position reference, adjust current, speed and position controller parameters, reinitialize all parameters to the default values, observe DSP-2 variables in numerical or graphical view, select which DSP-2 variables will be captured and shown in a graph, select the trigger signal, trigger level, trigger slope, number of pre-samples and send results of remote operation via email. The e-mail attachment contains experimental results in a format appropriate for further offline analysis in MATLAB. The described experiment is accessible via the DSP-2 page [8].

Figure 9: Remote DC motor control user interface in a standard web browser

7

5 Conclusion Hardware and software solutions have been presented for developing remote control experiments. This solution represents an open architecture which can easily be adopted to the different remote experiments. Using the presented solution the developers don’t need to waste time publishing remote experiments on the internet, therefore they can direct their energies to the experiment control algorithm design. In contrast to some existing remote experiment solutions, where only the “pure” web browser is needed by the remote user in order to perform experiment, the presented solution requires “LabVIEW Run-Time Engine” installed on the client computer. The described remote DC motor control experiment is currently in the test phase. Following this, variety of different remote experiments are intended to be developed which will serve as supplements to the classical laboratory exercises.

References: [1] Marco Casini, Domenico Prattichizzo, Antonio Vicino: The Automatic Control Telelab, IEEE Control System Magazine, June 2004, Volume 24, Number 3, pages 36-44, ISSN 0272-1708; [2] Jose Sanchez, Sebastian Dormido, Rafael Pastor, Fernando Morilla: A Java/Matlab-Based Environment for Remote Control System Laboratories: Illustrated With an Inverted Pendulum, IEEE Transaction on Education, August 2004, Volume 47, Number 3, pages 321-329, ISSN 0018-9359; [3] Ingvar Gustavsson: LABORATORY EXPERIMENTS IN DISTANCE LEARNING, International Conference on Engineering Education, Oslo, Norway, August 6-10 2001, 8B1 pages 14-18; [4] Milan Čurkovič: DSP-2 User’s Manual, version t3, March 2001, Institute of Robotics, FERI Maribor; [5] Darko Hercog: DSP-2 Library for Simulink User's Manual, May 2004, Institute of Robotics, FERI Maribor; [6] Darko Hercog, Milan Čurkovič, Gregor Edelbaher, Evgen Urlep: Programming of the DSP2 board with the Matlab/Simulink, International conference on industrial technology [also] IEEE ICIT 2003, Hotel Habakuk Maribor, Slovenia, December 10-12, 2003. Proceedings. Piscataway: IEEE, 2003, str. 709-713; [7] Evgen Urlep: DSP Terminal User’s Manual, May 2004, Institute of Robotics, FERI Maribor; [8] DSP-2 web page: wwww.ro.feri.uni-mb.si/projekti/dsp2

Authors: Darko Hercog, B. Sc. Faculty of Electrical Engineering and Computer Science, Laboratory for Electrical Measurement Smetanova ulica 17, 2000 Maribor, Slovenia [email protected] Bojan Gergič, Ph.D. Faculty of Electrical Engineering and Computer Science, Laboratory for Electrical Measurement Smetanova ulica 17, 2000 Maribor, Slovenia [email protected] Vojko Matko, Ph.D. Faculty of Electrical Engineering and Computer Science, Laboratory for Electrical Measurement Smetanova ulica 17, 2000 Maribor, Slovenia [email protected] 8

Karel Jezernik, Ph.D. Faculty of Electrical Engineering and Computer Science, Institute of Robotics Smetanova ulica 17, 2000 Maribor, Slovenia [email protected]

9