A Hybrid Design Approach for Data Acquisition and Real Time Control of a Universal Motor Test Bench

The recent advances in technology have led to the development of a number of laboratories for motion control throughout the world. The increased Internet bandwidth allowed many of them to be used remotely by distant users. The benefit of using a motorised linear stage in the laboratory test bench is that it represents various industrial applications for precise position control. This paper presents a novel comprehensive flexible motion platform that can be a base for remote experimentations with Brushless DC (BLDC)/Permanent Magnet Synchronous motors (PMSM) and drives, single/multiple axes flexible mechanical systems with friction/backlash uncertainties, inverted pendulums, etc. A LabVIEW software environment has been utilised to gain from the advantages of the virtual instrumentation representation and data acquisition capabilities.


I. INTRODUCTION
The last decade is hallmarked with a remarkable growth of computerised laboratories for educational purposes, in particular those for motion control. They represent an ever expanding field in a variety of industrial applications and emerge as a valuable tool for performing real time experiments with usually expensive or unique laboratory equipment in a safe way. The development and constant improvement of software applications such as National Instruments LabVIEW and Mathworks MATLAB allow easy implementation of control algorithms and creation of user friendly interfaces with virtual instruments (VI).
Increased Internet speed and reliability of connection contribute to the expansion of remote laboratories where users can connect to the laboratory workbench from a distant location and perform an engineering experiment. This also allows laboratories to be shared between universities thus greatly increasing their economical sustainability. The ability of students to perform tasks in groups of 2 or 3 contributes to the development of their collaboration and cooperation skills. Some remote laboratories like the electrical circuit remote laboratory NetLab [1][2][3], developed at the University of South Australia, provide an environment for students to collaborate online.
Most of the laboratories discussed in this paper fall into the category of motion control. These laboratories provide teaching tools in a variety of courses in power electronics and electromotion areas. Being an integral part of engineering and applied science disciplines, control theory deals with the complex behaviour of dynamic systems. As such, it plays a fundamental role in the education of engineering students.
A conventional closed-loop motion control system with a cascade controller consists of three major components: a motion controller, a controlled device (motor) and feedback devices -for position, velocity and current measurement. The feedback devices convert the controlled output variables into feedback signals which are compared with the input control signals in error detection circuits. This way the controller determines the deviation of the signals and through control algorithms generates new control signals.
Firstly, this article reviews the existing motion control systems laboratories with a special focus on the applied hardware solutions and feedback devices. Then, a universal motion control platform with a hybrid design is presented.
II. RELATED WORK Although there are a large number of papers describing laboratories for motion control, here summarised are those presenting the hardware solutions used in the test bench, the feedback devices and the VI interfaces - Table I. Rapid development architectures are introduced in [4,5]. Power electronics experimentations are presented in [6,7]. A tele-operated BLDC and PMSM motor controllers are introduced in [8,9]. The theory and practice of Pulse-Width Modulation (PWM) principles, as part of the Electrical Drives and Power Electronics course, are discussed in [10]. A comprehensive platform with particular attention to a DC motor servo system with controlled motor load, is demonstrated in [11]. A work introducing experiments with feedback devices for motion control is described in [12] and [13]. A mechatronics motion control and hardware-in-the-loop simulations laboratory is presented in [14].
This review shows that there is a potential for further computerised laboratory developments in the field of mechatronics and power electronics. Moreover, these laboratories are always based on a test bench with a fixed mechanical structure, which results in increased cost of the equipment in order to cover a number of different experiments. In addition, experimentations with major components widely used in industrial machines (such as linear stages, linear scales, absolute encoders, resolvers), are rarely covered. SPECIAL FOCUS PAPER A HYBRID DESIGN APPROACH FOR DATA ACQUISITION AND REAL TIME CONTROL OF A UNIVERSAL MOTOR TEST BENCH Client and Server Java-based software "Circuit Builder", booking system.

Rapid Control Prototyping System (RCP) DSP-2 [4]
TI TMS320C32 floating point processor, Xilinx FPGA, motor control set-up, including PWM generator, A/D and D/A converters, CAN bus.
MATLAB/ Simulink for the development of control algorithms and simulations, as well as LabVIEW VIs and a server. Variety of control experiments. The conceptual approach allows rapid prototyping of new engineering systems.

Rapid Development System PACM [5]
dSPACE real-time simulated and hardware environment.
MATLAB/ Simulink platform for modeling conducts a variety of online tests and analysis of control algorithms (PID, fuzzy logic and neural network) for a BLDC motor.

Remote Laboratory for Multilevel Power Converters [6]
Line-side converter with direct vector and synchronous current control, Sinusoidal, Space-vector or Third harmonic PWM.
PI parameters for adjustment of the DC-bus and current controllers, PLL. Conducted experiments: control without passive load, reactive power compensation and control with passive load.

Remote Laboratory for Teaching PWM Techniques [10]
Practical experiments with the three-phase Insulated-Gate Bipolar Transistor (IGBT) inverter.
Multimedia presentations and simulations of carrier-based PWM and space-vector modulation for two-level converters.

Tele-operated BLDC Controller [8]
Symmetrical PWM with Synchronous Sampling (SPSS); full four-quadrant control and phase switching of the IGBT bridge.
Control of a tele-operated robot for manual driving of a nuclear fuel handling machine.

Virtual Laboratory for Low Power Electrical Drives [11]
Three test benches for control of DC, BLDC and stepper servomotors; feedback devices: incremental optical encoder, absolute encoder, DC tacho-generator and rotor position device. NI PCI-7534.
LabVIEW environment for implementation of a motion control system using the FlexMotion library. PID and PIV servo control topologies.

Distant Laboratory for Teaching Industrial Electronics [12, 13]
Working principle of the resolver as a rotor position measuring device and the phase relationship between excitation input signal and Sin/Cos output signals.
Calibration of resolver -resolver alignment to the rotor magnets d-axis of PMSM motor; appropriate graphics represent the alignment of the current phasor and d-axis.

Web-accessible control of PMSM [9]
Direct torque FPGA controller with soft PSU; PMSM motor. Java applet for the control panel and for remote control.

Power Engineering and Motion Control Web Laboratory [14]
TI TMS320C32 floating point processor, Xilinx FPGA, motor control set-up, including PWM generator, A/D and D/A converters, CAN bus.
Identification, modeling and analysing of a mechatronic control system. MATLAB/ Simulink simulated dynamic model. Experiments, represented with LabVIEW VIs. PD and Computed torque controller designs in an experiment of mechanism with spring.

Power Electronics Laboratory [7]
Mobile power electronics test beds; electronic devices and sensors, needed to study motion control circuit design and control strategies; range of instrumentation devices, NI DAQ.
Data analysis, waveform generation, signal observation and formula calculations with LabVIEW VIs. MATLAB software tools for simulation and analysis.
SPECIAL FOCUS PAPER A HYBRID DESIGN APPROACH FOR DATA ACQUISITION AND REAL TIME CONTROL OF A UNIVERSAL MOTOR TEST BENCH This chapter describes the hardware structure, the motion control diagnostic screen and the graphical user interface (GUI) created with Virtual Instruments in LabVIEW environment.

A. Hardware Structure
The hardware structure of the system is depicted in Figure 2. Its major components are: 12 inch linear stage -NEMA 23 standard motor mounting with Helical flexible coupling and anti-backlash lead-screw assembly.
Precision linear scale -provides the linear stage position feedback via incremental encoder interface.
Rotor Excited Resolver -as an analogue feedback device (a rotary electrical transformer) it gives the angular position and velocity of the rotor of the motor. It has an input winding with sinusoidal excitation and output twophase windings with sinusoidal and cosinusoidal. In order to evaluate the output signals, a resolver-to-digital converter has been used.
AD2S1210 -a complete 10-bit to 16-bit resolution tracking resolver-to-digital converter, integrating an on-board programmable sinusoidal oscillator that provides sinusoidal wave excitation for resolvers [15]. It can emulate an incremental quadrature encoder, and output data for the angular position or velocity.
AS5134 -a contactless magnetic rotary encoder for accurate angular measurement over a full turn of 360° [16]. It can emulate: an incremental quadrature encoder and BLDC commutation interface; output an analogue voltage or digital data for the angular position.
MC73110 -an FPGA based, high-performance motion control IC, which incorporates all the needed internal blocks to work as a stand-alone servo controller [17]. In addition, online programming is available by means of RS232 or Synchronous Serial Input (SPI) interfaces. It can control either BLDC motors (trapezoidal control) or PMSM motors (sinusoidal control) and has 3 inputs for velocity and position feedback signals: a DC tachogenerator, a rotor position Hall sensor and an incremental encoder signals. The operational modes are completed with Field Oriented Control.
NI 9516 -precise motion control servo drive interface for torque/position control, including separate processor for spline interpolation, PID and PID feed-forward control with 50µs loop rate; dual-encoder interface; support for end-limit and home switches [20]. SPECIAL FOCUS PAPER A HYBRID DESIGN APPROACH FOR DATA ACQUISITION AND REAL TIME CONTROL OF A UNIVERSAL MOTOR TEST BENCH

B. LabVIEW Servo System Diagnostic Windows
Since the high-performance motion controller MC73110 is relatively new for the market there are a limited number of papers presenting its functionality. Paper [21] describes an application for control of BLDC motor, based on the GUI "Pro-Motion" from PMD Corporation [17] and covers the teaching topics for electric machine control and power electronic courses.
The manufacturer of MC73110 have provided Clibraries for developing of control applications but in order to have independent flexible and highly integrable online control, a new LabVIEW virtual instrument has been developed. A part of its code is shown in Figure 3. It utilises more than 130 intelligent profile commands, which allow the parameters of the system to be setup and tuned and valuable diagnostic information to be read during the motion control experiment.
For this purpose a separate diagnostic and setup screen has been created in the LabVIEW environment. It is divided into separate diagnostic windows, according to their purpose and use. The most important are: Serial Communication-provides complete information about the MC73110 serial communication via the RS232 and SPI ports ( PWM adjustment-provides information about how the inverter bridge is controlled ( Figure 6): Bridge control mode -to avoid an excessive current during switching the high and low IGBTs in full bridge configuration, a 6 signals control with dead time has been implemented. Another possible modes are: control with 3 signals (one signal per phase) and 6 signals control in special 3 rd leg floating mode (improved control with floating phase and dead time when commutation is realised with Hall sensors);  PWM frequency -20kHz or 40kHz;  PWM dead time -in this case it is adjusted to 3.2µs (parameter 40);  Other -Duty cycle, Sample time, Sense mask. (Figure 7):  Current Loop -PI control with integration limit;

Feedback loops PID parameters
During the procedure for current loop adjustment and optimisation the following parameters were achieved: Kp=300 and Ki=500;  Velocity Loop -PI control with integration limit;  Velocity Integrator Loop -a special feature which allows high precision PID control with 32-bit velocity profile; During the procedure for velocity integrator loop adjustment and optimisation the following parameters were achieved: Kp=50, Ki=10 and Kd=0.

Activity Status with limits-provides information about (Figure 8):
 Measured DC bus status -voltage, under-voltage and overvoltage limits and alarms;  Board temperature -current temperature, overtemperature limit and alarm;  Other. (Figure 9) -provides visual information about:

Signal Sensing
 Hall sensors phases-all three phases;  Incremental encoder signals -phases A and B, index Z;  Amplifier and PWM output activation;  Emergency Stop indication;  Signal sense mask -how the levels of the signals are interpreted. (Figure 10) -provides visual information about:

 Occurrence of Motion or Programmable Amplifier
Errors;  Occurrence of an EEPROM/Flash processing command Error;  Occurrence of an Encoder Position Wrapping (maximum to minimum or inversely);  Occurrence of a Position Capture; Analogue Signals Status (Figure 11) -displays the value of the analogue voltage, captured on some of the analogue inputs:  Analogue Command;  Tachometer;  Motor Currents -phases A and B; Condition Mask ( Figure 12) -displays the masks which are applied to certain status registers to activate/ deactivate specific states:  Amplifier Error;  Amplifier Disable;  PWM Disable;

C. LabVIEW Motion Control Interface
Although the LabVIEW programming environment provides all the tools needed to build a versatile graphical interface, it is not an easy task to organise and fit the essential controls and indicators into the front panel screen. Having in mind the necessity of realism in representation of the laboratory experiment, a virtual moving linear stage has been created as shown in Figure  13.
It visualises in real time the movements of the moving table and shows its current position with respect to the center of the stage. Two indicators show the emergency end limit positions detected by inductive proximity switches. In addition, several other areas could be identified: MC73110 Command and Control Area -provides the functionality of the system by means of drop-down menus. The following events could be triggered:  Servo Drive Initialisation -uploads all the parameters into the servo drive and checks if it is ready to be activated;  Servo Drive Diagnostics -opens additional diagnostics window which was discussed above. Allows comprehensive analysis of the condition of the system to be performed and future adjustments to be conducted;  Motor ON/OFF -manually activates/deactivates the control of the motor;  Axes Homing procedure -automatically moves the table in order to find the index signal of the linear scale and calibrates the current position according to this index; finds the coordinates of the emergency end limit switches and sets software limits distanced at 10mm before them;  Manual Linear Stage Control -provides functionality for basic manual positioning of the linear stage;  Automatic Linear Stage Control -allows programmable motion control to be performed, depending on the task: data acquisition and graphical representation of important currents and voltages in the system; a number of pre-selected step responses of the dynamic system; Signal Graph Window -displays the graphical data from the current experiment. Currently the following tasks are implemented:  Resolver Signals -visualises the relationship between the signals of the resolver (excitation 10kHz, sine and cosine generated signals) and the emulated incremental 1024-line encoder signals (phases A and B) - Figure 14;  IGBT Gate Control Signals -visualises the relationship between the control gate signals of the IGBT bridge;  Motor Currents -visualises the motor currents in phase A or B, compared to the stimulus signal - Figure 15;  Step Response -visualises the step response of different parts of the dynamic system in conjunction with a number of preparative initial conditions - Figure 16. An application of Savitzky-Golay finite impulse response (FIR) filter [22] shows the advantages of this type of filter compared to other FIR filters;  Control Systems Experiments -a future work is to be conducted in relation to the development of suitable experiments.
The structure and functionality of the presented interface have been carefully developed after analysing similar work presented in papers throughout the world. The aim of this experimental workbench is to provide a learner with a broad range of experiments in circuit theory, power electronics, mechatronics, motion control, feedback devices and control systems engineering. SPECIAL FOCUS PAPER A HYBRID DESIGN APPROACH FOR DATA ACQUISITION AND REAL TIME CONTROL OF A UNIVERSAL MOTOR TEST BENCH IV. CONCLUSIONS AND FUTURE WORK In this paper, the hardware components used to build a universal test bench for motion control have been presented. They include a high performance motion controller and BLDC motor coupled with a linear stage, a linear scale, a tracking resolver-to-digital converter and a contactless magnetic rotary encoder. Novel software tools for communication, diagnostics, control and data acquisition, based on LabVIEW virtual instruments, have been also described. The utilisation of NI cRIO FPGAbased hard-real time controller and advanced data acquisition board provides an optimal combination of hardware tools for motion control and signal monitoring.
The platform can be used for experimentation with various types of flexible mechanical systems, since the interfaces of five feedback devices, used widely in industry, are included: a linear scale, a resolver, an incremental encoder, an absolute encoder and Hall sensors commutation. It can serve as a platform for experimentation with a number of control algorithms in the presence of parametric model uncertainties, mechanical disturbances and noise. Thus this platform could be a valuable learning tool for undergraduate and postgraduate students, and industrial practitioners.
Currently, a distant control in the LabVIEW environment is under development, which will transform the workbench into a fully functional remote laboratory for motion control. At the same time, experiments with a number of control strategies will be implemented.