---
title: "Remote control of real system with two electric motors"
url: "https://maker.wiznet.io/Sushma_WIZnet/projects/remote-control-of-real-system-with-two-electric-motors/"
markdown_url: "https://maker.wiznet.io/Sushma_WIZnet/projects/remote-control-of-real-system-with-two-electric-motors/md"
type: "UCC: User Created Content"
author: "Sushma_WIZnet"
author_url: "https://maker.wiznet.io/Sushma_WIZnet/"
original_author: "Pavol Folvarcik"
original_url: "https://ieeexplore.ieee.org/document/6059602"
published: "2022-09-20"
language: "en"
likes: 5
views: 1506
comments: 1
source: "WIZnet Makers (https://maker.wiznet.io/)"
---

# Remote control of real system with two electric motors

> This Project is developing intended for remote control of the real system with two electric motors, which is a part of a remote laboratory.

Original author: Pavol Folvarcik (source: https://ieeexplore.ieee.org/document/6059602)

## Article

Abstract

This paper focuses on developing hardware and software application intended for remote control of the real system with two electric motors, which is a part of a remote laboratory. These applications were developed to improve educational process. In the same time it enables students to acquire not only theoretical but also practical experience in process control. In the first part we describe the real system and its electronic parts. In the second part we describe the communication between real system and client application.

INTRODUCTION

Learning efficiency increased when student can apply the theoretical knowledge in practice. One option is building laboratories where students can verify their knowledge on real systems. If each student on course should have an access for to the same real system, we will find two major barriers. The first is that we need to provide enough space for teaching, where all these systems are placed. The second is the high price of some real systems. Both of these barriers can be partly solved. One solution is to build remote laboratories. This article describes the implementation of solutions for communication between the real system (server) and client application via internet. Most real systems that are currently used for remote control in educational purposes use a computer as communications and control equipment. It can communicate with real systems through appropriate application software and also it is used as a server to communicate with the client (remote) application. This solution has its advantages and disadvantages. The biggest disadvantage is its price.

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307229%2Epng)

Each real system is connected to the computer, thus increasing financial demands of system, thereby reducing the availability of real system for schools. Cheaper solution is to control the real system using a microprocessor, which is connected with module to communication via the Internet. This solution also removes restrictions there can be caused in computer operating system or hardware equipment. The situation when the computer processor will be busy with other processes of various applications, which can significantly delay the communication and process control can become easily.

II. DESCRIPTION OF SERVER APPLICATION

A. Real plant with two electric motors We used for our tele-experiments a real system with two electric motors, which are connected with shafts (Fig. 2). The first on is primary, which serves as the drive of system. The second is secondary and that can spin in either direction of the primary motor. We can change control voltage on secondary motor and then we can simulate an error. On the shaft is connected a constant load for the engine. The IRC sensor is used to measure shaft speed.

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307283%2Epng)

B. Control electronics Control device consists of three basic parts:

1. Microcontroller unit Arduino Duemilanove (Fig. 3).

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. The Arduino Duemilanove is a microcontroller board based on ATmega328. It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16 MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset button. It contains everything needed to support the microcontroller; simply connect it to a computer with a USB cable or power it with a AC-to-DC adapter or battery to get started. It can sense the environment by receiving input from a variety of sensors and can affect its surroundings by controlling lights, motors, and other actuators. The microcontroller on the board is programmed using the Arduino programming language (based on Wiring) and the Arduino development environment (based on Processing). Arduino projects can be stand-alone or they can communicate with software running on a computer (e.g. Flash, Processing, MaxMSP). [4]

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307335%2Epng)

2. Power driver shield for arduino (Fig. 4).

This shield allows using a computer power supply (or other power source) to use Arduino to switch high current. Power part is based on MOSFET transistors, which operate in switching mode. The microprocessor sends a PWM signal (pulse width modulation), which we use for motor control. The task of power part is to amplify the control signal received from the microprocessor to power supplying the motors.

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307390%2Epng)

3. Arduino Ethernet Shield (Fig. 5).

The Arduino Ethernet Shield allows an Arduino board to connect to the internet. It is based on the Wiznet W5100 ethernet chip. The Wiznet W5100 provides a network (IP) stack capable of both TCP and UDP. It supports up to four simultaneous socket connections. The ethernet shield connects to an Arduino board using long wire-wrap headers which extend through the shield. This keeps the pin layout intact and allows another shield to be stacked on top. The latest revision of the shield adds a micro-SD card slot, which can be used to store files for serving over the network. Arduino communicates with the W5100 and SD card using the SPI bus (through the ICSP header). Pin 10 is used to select the W5100 and pin 4 for the SD card. These pins cannot be used for general i/o. [5]

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307442%2Epng)

C. Server description

Program running on the server is programmed in a program language based on language Wiring. It is a language similar to C++. Used variables are initialized after turning on the server. Then starts the function setupO which sets the used inputs and outputs of microcontroller and start the server. To engine control we use pin 3 and pin 6. Settings are executed by commands: pinMode(6, OUTPUT); pinMode(3, OUTPUT); Ethernet.begin(mac, ip); server.beginO;

III. DESCRIPTION OF CLIENT APPLICATION

The client application is developed in Java. It allows us to connect to the server via the Internet, run the simulation and set the basic parameters of the simulation. It is designed as a Java applet, so it is easy to run on any computer with installed JVM (Java Virtual Machine) and is independent of operating system. It has any limits for user and it becomes more accessible.

A. Graphical user interface

Application window (Fig. 6) is divided into several parts:

1. Input window - it allows users to specify input parameters of simulation. In this section, the user sets the values of the parameters of the simulation. These are: PID controller parameters, desired value, sample time, simulation time, the URL address of the server, file name to store the measured data, time for error and its value.

2. Output window - displays massages of applications and the measured data in text format. 3. Graphical output- displays measured data in animation and chart.

B. Start the simulation

After the starting of application, are loaded the default parameters of the simulation, which can be changed by user.

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307584%2Epng)

Enable buttons are only "Run" and "Clear", smce the simulation has not yet been launched.

After setting the desired values, click "Run" button to run the simulation. It creates a connection with server, which waits for client connection. Client sends the required parameters of the simulation to the server. When the parameters are sent client is waiting for confirmation of receipt (receive control string "OK"). In output window is displayed message "Connected'. If the server is unavailable or busy, displays the message "Could not connect to remote host". If an error occurs during the connection, displays the message "Network error during communication."

If the connection is active, it waiting for the measured data. Server sets the simulation parameters and interrupt of the timer, which is set to a sampling time Ts. It also sets the handler function callbackO: Timerl.initialize(Ts* 1 000000); Timerl.attachInterrupt( callback);

This function runs every time Ts. Its task is to calculate the control output and send it to the system. At the same time it sends the measured data to the client. These are shown in the chart and the actual speed is displayed in animation. To create graphical elements is used JFreeChart library. JFreeChart is a free Java chart library that makes it easy for developers to display professional quality charts in their applications. JFreeChart's extensive feature set includes:

• a consistent and well-documented API, supporting a wide range of chart types;

• a flexible design that is easy to extend, and targets both server-side and client-side applications;

• support for many output types, including Swing components, image files (including PNG and JPEG), and vector graphics file formats (including PDF, EPS and SVG);

• JFreeChart is "open source" or, more specifically, free software.

It is distributed under the terms of the GNU Lesser General Public License (LGPL), which permits use in proprietary applications. [6] Actually is on the server programmed PID controller in velocity form.

D u(t) = u(t -1) + P[e(t) - e(t -1)] + IT,e(t) + Ts [e(t) - 2e(t -1) + e(t - 2)]

It can be reprogrammed to any other controller. In Figure 7 you can see application window after the simulation. The user can see the behavior of the system without error (Fig. 7) or choose the value of error and time of beginning the error (Fig. 8 and Fig 9). After the simulation server is waiting for start of a new simulation.

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307723%2Epng)

![](https://maker.wiznet.io/upload/ckeditor5/285980416%5F1664307747%2Epng)

C. Save the measured data

After the end of simulation, it is possible to save measured data, and then continue in work with them, for example in MATLAB. Measured data are saved every time in handler function. Data are stored on the memory card placed on Ethernet shield and it can be accessed through the SD Library. When the client is connected, the server creates file called outputtxt on memory card. In this file are saved the measured data, If it receives command to send measured data at the end of simulation, it opens the file and sends all saved data to the client. Client application receives them and saves them to a chosen location on the disk. It saves them in *. mat file, and thus can be easily imported into the MA TLAB workspace and then user can work with them.

IV. CONCLUSION

This paper was focused to the possibility of control of real systems via Internet. We also explore the possibility of using microcontroller instead of Pc. This solution is allowing a cheaper alternative to build remote laboratories. Also reduces the demand on space, maintenance and fault prone, This method of control of real systems has also negative sides, There is limited memory to save code of the server application and also the clock frequency of microcontroller. In the future, we will look towards to changing the microprocessor, which can operate at a higher clock frequency and it has more memory to store source code of server application. This change should help with more complicated control algorithms and also with working with the system with a sampling time less than 0.01 seconds.

---

Source: https://maker.wiznet.io/Sushma_WIZnet/projects/remote-control-of-real-system-with-two-electric-motors/
