Experiment Setup for Focused Learning of Advanced Servo Control of DC-Motors

Remote laboratories are normally developed for giving students and others remote access to physical laboratory facilities. In contradiction to this, the main objective of the setup presented in this paper is to create a controlled environment where unwanted side activities like hardware setup, driver problems, troubleshooting faulty components, and struggles with special software for configuring DSP systems, are removed as much as possible, in order for the students to have their full focus on the tasks that is considered relevant for the module: modeling of non-linear systems, synthetisation of controllers, and stability and performance analysis. A secondary objective is to significantly reduce the setup and maintenance cost associated with complex laboratory setups involving DSPs and expensive hard-


I. INTRODUCTION
One of the challenges in modern engineering education is creating a learning environment where the students are given the opportunity of working on real world physical problems, as stated by educational governments in Norway [1] and at the same time to have an experiment which focuses the training in specific areas, leaving out other challenges often found in real world experiments. This has previously been demonstrated in [2,3]. The performance of experiments in advanced control theory involves using high performance digital processors in order to execute the control loop algorithms, as is shown in [4].
The implementation of the control loop requires the use of a variety of hardware and software components, often very specialised to fit the specific combination of modules used in a particular setup. Examples of this is given in [5,6]. The students are often faced with two sets of challenges. The first challenge is the development or synthetisation of the controller for the control loop, as described in [7]. This is part of the desired activities because it gives the students training in parts of the control loop implementation which is common for most implementations of this type. The skills gained here are important in the majority of tasks the students will perform in their professional career, and are in this context relevant for the module.
The second set of challenges is related to what are regarded as side-activities of the laboratory exercise. Doing connections of various components for interfacing between the DSP and the process, creating support system for the DSP, power supplies, setting up sensors for measurements on the process, and the design and setup of ac-tuators for manipulating the process, are all in this setting regarded as outside the scope of the exercise. Training in these activities will be taken care of either in other exercises in the same module, or in other modules. The argument for this is that the authors have observed that these side activities seem to confuse and get in the way of theoretical understanding. Since laboratory setup offers us the opportunity to limit the number of different, simultaneous challenges the students face during the same laboratory exercise, we elected to take advantage of this.
Another activity that falls into this group is the use of specific hardware and software tools for a particular laboratory setup, i.e. the hardware/software combination selected from a specific company or group of companies. Any type of tool-specific skills are more or less likely to be used in a future professional career, as each company have a tendency of using proprietary tools tailored for the specific hardware used, and so the number of different tools is relatively large. On the other hand, the effort needed to utilise such tools is relatively low. Even if the effort put into learning the tools is relatively low, it will in the authors' opinion often obfuscate the aim of the exercise, especially for students in a phase of learning and therefore hinder the students learning. It is therefore a desire to remove the problems and effort associated with the use of these specific tools in the laboratory assignments, so that the students can have their full attention on the learning and the challenges which are the purpose of the laboratory assignment: The creation of a controller which is able to stabilise the system, and at the same time having a certain level of performance. A primary goal for the development of the laboratory is therefore to allow the users to focus only on a limited set of challenges, leaving out other challenges considered less relevant for the learning objectives of the module for which the laboratory should be used.
Giving the students a feel for real industrial type problems is a major factor in engaging and motivating the students in addition to giving them insight into real world problems necessary to be able to function as engineers once they venture into the real world at the completion of their degree. Combining training in advanced control theory with practical experience in an assignment of this type will, in the author's opinion have a great advantage on the performance of the students. The authors' experience is that the students in general put far more effort into the assignment when it involves manipulating physical objects through control algorithms, then they do when the assignments nature is pure theoretical or done using simulation tools. It is a well known fact that students learn more, and enjoys themselves more, when they are actively involved, rather than just passive listeners. Passive mode PAPER EXPERIMENT SETUP FOR FOCUSED LEARNING OF ADVANCED SERVO CONTROL OF DC-MOTORS learning may seem the easy option for the students in the short run, everything is prepared and you just sit back and let it wash over you. Students who are not brought out of this passive state will usually learn little of the material thus presented, and will then tend to blame the tutor, for their lack of understanding. One of the secondary goals for the development of the laboratory is then to create a laboratory environment that is attractive and inspiring for the students, and keeps them active.
The assignment described in this paper is part of the laboratory work performed by students in a module in control engineering at Buskerud University College. The module is intended to give the students training in elements often requested by industry in cooperation meetings [8]: The ability to understand, synthetisise and maintain advanced state feedback tracking controllers for servo quality control of electric machines [13], for use in applications where strict control of the movement is crucial for the environment the motor will be installed into, e.g. motors used in satellite and aircrafts, where the magnitude of acceleration as well as its derivative and possibly higher order derivatives, must be kept within strict limits. This is important as jerks, sudden speed change or stops of motors will have a negative impact on the dynamic movement and stability of the satellite or aircraft in which the motor is mounted. Reducing the magnitude of jerks sufficiently will reduce this impact to an acceptable level. This is further described in section IV.
The main challenge of setting up and maintaining controllers of this type is the complexity of the control algorithms, and the difficulty of analysing stability and performance characteristics of the closed loop controller [7]. State feedback tracking controllers are normally not part of a module on classic control theory, and hence, a control engineer in general does not necessarily master this topic. Another secondary goal is then to actually allow the students to work on the development of state feedback tracking controllers in the laboratory, and giving them the ability to assess the performance and stability of the controller with the parameters the students found for the controller.

II. LABORATORY SETUP DESCRIPTION
The equipment required for running a hands-on physical laboratory like the one described in this paper requires a large number of components assembled in a somewhat complex installation. Such a setup is made up of a DSP, I/O system, actuators and sensors, power supplies, etc:

A. The DSP system
An example of a DSP system is the dSPACE [15] system, which include DSP processor board, software interface for Matlab/Simulink and I/O system with a number of ready-made interfaces for common standards, such as the incremental encoder interface. This system, like others, also allows for monitoring of the complete system online, which in turn gives the user the opportunity of running the system "hardware-in-the-loop" (HIL). The importance of this cannot be underestimated in a prototyping context. A computer is needed for installing the processor board, and for running the monitor software and the Matlab/Simulink software system.

B. Sensors and actuators
Sensors for measurement of current and voltages in the motor must be connected to the DSP system. Interfaces for this must be adapted to the I/O system of the I/O system. Noise from the motors is also an issue in this context, and a decision normally taken by the tutors is the distribution between the filtering that should be done in hardware, outside the DSP system, and the part that should be done in software as part of the control loop. An incremental encoder must be connected to the motor shaft in order to have a precise feedback of the movement of the rotor. For most DSP systems, this type of interface is made ready, and only a simple connection of wires and power supply for the encoder is needed. The actuator system will in this laboratory be the power converter between the DSP output and the motor, as the motor is part of the process to be controlled.

C. Process to be controlled
The process will in this case be the motor with the clock-hand connected via some gears, for reducing the speed of the clock-hand to a speed more realistic then the motor shaft speed. The construction of the half-functional clock is made from LEGO, as this allows for rapid, robust and low cost construction of a prototype model. Some adjustments must be performed to allow for the installation of the incremental encoder, but apart from that, there are no special needs for more than very simple construction details.

D. Power supplies and power converter
A small number of power supplies are needed in this installation. The DSP processor board will get its power from the PC power supply. Voltage and current transducers may need isolated, dual power supplies of low power, while the incremental encoder needs a simple power supply. The power converter for the motor would require a simple, possibly unregulated power supply from the net to the main capacitor before the H-bridge in the power converter. All parts here will be relative low power, as the current drawn by the motor is less than 1 ampere.
When setting up these as separate experiments for running laboratory exercises on groups of students, estimated costs exceed 30.000 Euros per station. To have a setup in the laboratory for 50 students would require a large amount of stations and is not achievable for the authors' institution due to both installation cost and the maintenance cost associated with this type of equipment. In an effort to address the objectives of focused training and cost efficiency at the same time, it is suggested to use a remote laboratory. The main objective of offering a remote laboratory to the students is not to allow students to work at home, but rather as stated previously in this paper: To separate the training elements of the laboratory exercise.

III. THE REMOTE LABORATORY
A remote laboratory installation [9][10][11][12] is a physical installation including circuits and machinery with signal sources and measurement units connected. In the case of the laboratory setup for the state feedback tracking controller of the electric machine presented in this paper, all the physical installations are readily set up for the students, and all parts of the hardware and software related to measurements of signals, signal conditioning and the driver circuits for the motor are pre-configured for the student. This is further described in section V: The laboratory setup.

PAPER EXPERIMENT SETUP FOR FOCUSED LEARNING OF ADVANCED SERVO CONTROL OF DC-MOTORS
In the setup presented, there is no scheduling service implemented, so the experiment is run on a strictly first come first served basis. The running time of the experiment is expected to be around 10-60 seconds. As the time spent on the synthetisation of the controller algorithms is expected to be far longer than this, the probability of any students having to wait more than a few minutes is very small.
The users will be able to change parameters by interacting with a web interface, which gives them the opportunity of running the experiment several times in just minutes, allowing for very deep investigation of the effect of different parameter values. The students are given access to the system by logging into a webpage, where they are presented with an interface to the remote laboratory. The students can then do the exercise as instructed, changing parameter values and taking measurements in order to further investigate how the circuit reacts when exposed to different parameter changes.

IV. PROBLEM DESCRIPTION FOR THE STUDENTS
A short description of electric machines is in order to understand the problem, as presented to the students: An electric motor works by generating torque between the rotor and the stator. This torque is used to create rotational movement of the shaft, and all mechanical parts connected to this. The stator is, as its name indicates, mounted on the more or less stationary parts of the installation. The phrase "more or less" is used with intent: All movement is relative to the other parts, and so is the torque, meaning that a sudden change in movement on the moving parts will also have an impact on the stationary parts. This is of little concern when fixed installations found on the ground, as the weight of any rotating part most often is negligible when compared to the weight of the earth. Problem arises when the two objects are disconnected from a heavyweight base, meaning that a sudden movement will have an impact on both objects. This leads to the need for limitations on the amount of impact such a change in movement is allowed to have on the otherwise stationary parts of the installation. For clarification: It is the change in forces exerted between moving parts that represents the problem; static forces can normally be compensated by controlling the other actuators in the satellite or aircraft, while rapid changes in movement or forces is difficult to compensate for sufficiently fast. . This problem is largely solved by using a state feedback tracking controller, as presented in [13], where the movement of the rotor is set to accurately follow a precalculated path, which allows the designer to keep acceleration and possibly its higher order derivatives within specified limits.
The control algorithms used for the control of the hand is somewhat complex. A fixed controller structure means that the students only have to specify the parameters for the controller and the observer. This makes it realistic for the students to implement the controller within the timeframe of the exercise program of the module.
The algorithm is based on the standard state feedback tracking controller given in [13], and the development of the equations is largely taken from this book. The motor is described by where it is assumed permanent magnets in the stator part of the DC-motor, which corresponds to the construction of the LEGO-motor. For position and speed feedback of the motor, it is used an incremental encoder, and in order to filter the quantisation noise generated in the speed measurement, an observer is given as where it is assumed no load torque, an assumption that will adversely affect the performance of the observer when the weight of the clock hand is added to the motor.
The parameters 1 l and 2 l should be optimised to let the observer converge to the real system sufficiently fast. In order to let the hand move while maintaining control of the magnitude of acceleration and its derivatives, a trajectory for the movement of the rotor of the motor has to be created. Using the rotor position or the rotor position is a question of scaling, and as such more irrelevant. This trajectory will have to be generated dynamically, or point wise, as the reference signal for the position changes. A typical trajectory is given as shown in figure 1 below, where the speed and position is given as functions of time. In the case shown below, it is assumed a fixed reference after time When the trajectory has been created, the state feedback tracking controller is utilised to keep the movement of the rotor as close as possible to the given trajectory, and for this purpose three error functions are set up, and the parameters for these must be found so that the actual movement of the rotor always converges towards the created trajectory. Figure 1.
Angle of clock hand relative to time PAPER EXPERIMENT SETUP FOR FOCUSED LEARNING OF ADVANCED SERVO CONTROL OF DC-MOTORS V. THE LABORATORY SETUP Primary and secondary goals for the laboratory setup are given in section I and repeated here:  Allow the users to focus only on a limited set of challenges, leaving out other challenges considered less relevant for the learning objectives.  To create a laboratory environment that is attractive and inspiring for the students.  Allow the students to work on the development of state feedback tracking controllers in the laboratory, and giving them the ability to assess the performance and stability of the controller with the parameters the students found for the controller Other requirements for the laboratory are:  Within specifications, the controller and the components around must be completely reconfigurable through the web interface.  If using a none fixed controller structure, the control loop algorithms must be possible to download to the DSP processor after compilation and must be set to run in the processor as part of the control loop.  If using a fixed controller structure, all parameters for the controller must be configurable through the web interface.  The laboratory must be made from low-cost components, unless higher cost components allows for much more rapid development of the laboratory, and the maintenance cost must be kept low.  It must be impossible to destroy or otherwise damage the remote laboratory equipment using the web interface.  The results of the experiment must be transmitted (preferable live) to the remote user.
Based on these requirements it is decided to construct the laboratory using LEGO motors and other building blocks. In order to make the laboratory fairly interesting as well as easily understandable to the users, while still being complex, the task of the laboratory assignment is set to be the movement control of one of the hands of a clock. This hand will be constructed using LEGO, and a standard LEGO motor [14] (of the old type) will be used to drive the hand around. The movement of the hand can be monitored by the user via a web camera mounted in front of the installation. The hand will be made disregarding the normal counter weight balancing, meaning that moving the hand upwards will require far more torque from the motor than moving the hand down. This is done on purpose to make the task a bit more complex. In addition, the hand is only allowed to move in one direction, which means that any overshoot in the controller output would lead to failure of the algorithm.
The motor is supplied by an electric power converter, which in turn is controlled by the DSP. The DSP chosen is from dSPACE [15]. This system is developed for rapid prototyping and facilitates the concept of hardware-in-theloop (HIL) control. This means that the internal values of the controller can be monitored during the control sequence, giving valuable insight into the behaviour of the controller. The controller parameters can also be altered without downloading new control software into the DSP. This is very useful for monitoring the performance of the controller, and these data can be logged for offline analysis after the experiment is run.
There are two alternatives to the design of the interface of the remote laboratory. One option is to select a static controller structure, meaning that the students should calculate the controller parameters. In this case, the only elements that need to be transferred to the remote laboratory is the controller parameters. This allows for a very simple web interface, with quick access to each trial. Once the parameters are transferred, a predetermined sequence of movements are given to the control system, and the result can be seen on the web camera image, as well as data series transferred via files to the user.
The other option is to let the user choose the controller structure. This gives the user larger freedom, but also makes the interface design far more complex. The limiting factor is that the user must have an installation of Matlab/Simulink on the computer. The controller is then designed using this software, and C-code is generated together with a number of configuration files. These are then transferred to the remote laboratory, and compiled/linked into machine code ready for the DSP. When this code is downloaded to the DSP, the same sequence of movements as in the previous section is run.
Both of these options is doable using dSPACE, however, in either case a number of security measures must be taken in order for the user not to be able to damage the equipment by faulty design or bad choice of controller parameters. These include over-current, over-voltage and over-temperature protection, which is easily implemented in hardware.
In the first implementation it was decided to implement the first option as a first version of the remote laboratory, and the more complex option when this is first version is completed and feedback has been gathered from user trials.
It can be argued that the same could be achieved using simulations instead of a remote laboratory. The main challenge that prohibits this as an alternative is the fact that the controller is based on a model of the process. This model is an approximation of the true, physical system, and is only able to predict the behaviour of the real system to a certain extent. This, in turn, means that a controller that is designed for, and behaves perfect with the nominal model, and all known perturbations of this, can actually fail completely in the presence of perturbations not predicted by the simulation designer.

VI. TASK FOR THE STUDENTS
The students are supposed to find the parameters for the observer, error functions, the internal PI-controller of the motor, and the function for creating the trajectory reference for the rotor. When these parameters have been found, the values can be transferred to the remote laboratory, through the web interface.
When the values have been transferred, the experiment is run with the given parameters a number of iterations. The number of iterations should be large enough to discover the performance and stability properties of the controller in different position of the clock hand. It should also be limited in order to keep running time short, allowing more users access to the remote laboratory per hours. PAPER EXPERIMENT SETUP FOR FOCUSED LEARNING OF ADVANCED SERVO CONTROL OF DC-MOTORS After the trials has been performed, the complete log of measurements available is transferred to the user, and he or she can then display graphs and do other analysis in order to assess the performance of the controller. It is also possible to use an automated pass/fail-function for telling the user when the result is good enough. This latter point is important as it in theory exist infinitely many different controllers that can stabilise the system and keep the performance within specified limits.
VII. CONCLUSION In this paper it has been presented a remote laboratory setup for advanced servo control of electric machines. The use of a remote controlled installation removes some of the obstacles associated with traditional laboratory, like setup of hardware components and their connections, troubleshooting problems caused by faulty components or connections, and general use of specialised software for the control system, all of which are regarded as unwanted side-activities that obfuscate the real aim of the laboratory exercise: Modelling of physical systems controlled by motors, and the synthesis and analysis of stabile and robust state feedback tracking controllers. Another advantage of using remote laboratories is the reduction of instalment costs and maintenance costs, where the latter stems from designing the laboratory so that it is not possible to destroy or damage the installation from a remote location.