SUGISAKAMASANORI

Journal of Advances in Artificial Life Robotics
Vol. 3(4); March (2023), pp. 250–253
ON LINE ISSN 2435-8061; ISSN-L 2435-8061
https://alife-robotics.org/jallr.html

Research Article

Proposal and prototype of an IoT self-tuning PI control device
using Wi-Fi
Shinichi Imai

Graduate school, Tokyo Gakugei University, 4-1-1, Nukuikita-machi, Koganei, Tokyo, 184-8501, Japan

ARTICLE I N FO
Article History
Received 14 October 2022
Accepted 30 July 2023
Keywords
Wi-Fi
IoTControl
Self-tuning
Prototype

ABSTRACTIn this paper, development of IoT control device using Wi-Fi. In recent years, IoT has been
attracting attention, and there are growing expectations in the industrial world for the utilizationof data obtained from many sensors. These data are stored in databases in real time throughcommunication between sensors and the cloud and communicating with the cloud. Meanwhile,
digital controllers are widely used in the process industry as general-purpose controllers. However,
it is difficult to incorporate AI, machine learning, and databases into general-purpose controllers
due to data memory limitations. Therefore, in this paper, we develop an IoT self-tuning controller
using Wi-Fi. As a result of experiments, the controller and computer were connected via Wi-Fi,
self-tuning was performed on the computer side, and the calculated PID gains could be sent to thecontroller to achieve control.

© 2022 The Author. Published by Sugisaka Masanori at ALife Robotics Corporation Ltd.
This is an open access article distributed under the CC BY-NC 4.0 license(http://creativecommons.org/licenses/by-nc/4.0/).

However, data-driven control is difficult to implementwith the capacity of conventional controllers because it
determines control parameters by accumulating a large
amount of data in a database. In addition, ordinarycontrollers are very small, and it is also difficult to installa personal computer for calculation in a limited spacesuch as a factory. Therefore, in this paper, we develop aWi-Fi-based IoT self-tuning controller. Specifically, amicrocontroller called ESP-WROOM-02 will be usedinstead of a conventional controller; ESP-WROOM-02 isvery compact and can replace conventional controllers. Italso has built-in Wi-Fi and Bluetooth. The ESPWROOM-02 is connected to a personal computer via WiFi, the personal computerP performs calculations todetermine control parameters, and the calculated control
parameters are sent to the ESP-WROOM-02 controller.
This avoids the controller's data memory problem.

1. Introduction
In recent years, the use of advanced technologies such as
IoT and AI has been remarkable. In particular, IoT[1],[2],[3],[4],[5] is attracting attention, and there are
growing expectations in industry for the use of dataobtained from the many sensors installed in the system.
These data are stored in a database in real time throughcommunication between the sensors and the cloud. On
the other hand, digital controllers are widely used in theprocess industry as general-purpose controls. In order toobtain the desired control performance, the control
parameters must be appropriately calculated according to
the characteristics of the control target, but most actual
control targets have nonlinearities and fixed control.
Therefore, it often happens that the parameters do notprovide sufficient control performance. Therefore, selftuning methods, in which control parameters are changed
sequentially according to the control characteristics, havebeen proposed as data-driven control methods [6].

2. ESP-WROOM-02

Corresponding author’s E-mail: shimai@u-gakugei.ac.jp URL: http://www.u-gakugei.ac.jp/250

ESP-WROOM-02 incorporates Espressif ESP8266EX,
which integrates a Tensilica 32-bit RISC(reducedinstruction set computer) processor with ultra-low power
consumption and reaches a maximum clock speed of160MHz. A real-time operating system (RTOS) and WiFi stack allow 80% of the processing power to be usedfor programming and development of user applications.
The module also incorporates an antenna switch, RFbalun, power amplifier, low-noise receiver amplifier,filter, and power management module at the SoC level,
and its small size allows for easy integration into spaceconstrained devices. The external dimensions of themodule are 18 x 20 mm. The type of flash used in thismodule is SPI flash with package size SOP8-150mil. The
antenna applied to this module is a 3DBi PCB on-board
antenna. Fig.1 shows ESP-WROOM-02. Table 1 shows
the specifications of the ESP-WROOM-02.

Table 1 Specifications of ESP-WROOM-02.

Supply voltage

3.0-3.6V

Current Consumption

Average 80mA

Supported WiFi Protocols

802.11b/g/n(2.4GHz)Size

18mm×20mm×3mm

Wi-Fi mode

stationsoftAP
SoftAP+station

Security

WPA/WPA2

Encryption

WEP/TKIP/AES

3. IoT system
This IoT system consists of a "sensing system" that
acquires numerical values with sensors and sends them
to a computer, and an "adaptive system" that performs
self-tuning based on the input and output data of thesensing system. The calculated parameters are sent to thecontrol controller. Data is transmitted over Wi-Fi
between the three systems. ESP-WROOM-02 is used fordata transfer. Fig.2 shows a conceptual diagram of theIoT system.
Used by connecting to Arduino to communicate withESP-WROOM-02. Fig.3 shows the circuit configuration.
Arduino works with 5V. ESP-WROOM-02 cannot bedirectly connected to Arduino because it operates at 3.3V.
Therefore, different signal levels are switched byattaching a level conversion IC. The current consumptionof ESP-WROOM-02 is about 80mA. Arduino 3.3V
terminal can only output 50mA and cannot be used.
Therefore, it is necessary to prepare a 5V power supply
and a 3.3V power supply in separate systems.
Use the Arduino input port to capture the inputs, outputs,
and deviations of your experimental setup. It also sends
PI parameters to the controller through the output port.
The controller only updates PI parameters. Calculation ofPI parameters is performed on a computer via Wi-Fi.

Fig.1 ESP-WROOM-02

ServerNetwork
User interface
Computer

Controller

Fig.2 IoT IoT system conceptual diagram

251

Computer

PID Parameter Calculation
WiFi

WiFi
WiFi

WiFi
ESP-02r+-ESP-02
e

PID Controller（Arduino）

uESP-02

Plate andmagnet

yLaser Sensor

Fig.6 Block diagram
flowing through an electromagnet (coil) or the voltage
across the coil. In the following, the magnetic body to belevitated is called the levitation body. This experimental
device consists of a magnetic levitation device, anelectromagnet amplifier, and a control device. Controller
uses Arduino to send input/output data to anothercomputer through ESP-WROOM-02. The server used a
virtual server. The communication speed is 115200 bps.
In addition, the displacement of the levitation body ismeasured using a laser displacement sensor. Fig.6 showsa block diagram of the magnetic levitation device.
Control input u(t) is the voltage applied to the coil, andcontrol output y(t) is the gap length (the distance between
the sensor and the upper surface of the levitation body).
In addition, the coil voltage is controlled by a PWM(Pulse Width Modulation) signal with a duty ratio
corresponding to the control input. Therefore, the control
input u(t) in this experiment is assumed to be the duty
ratio (0 to 100%) of the PWM signal. Also, thisexperimental device can only start from u(0)=100 due toits specifications. In addition, the vibration of about
17.6m/s^2 is given to the levitation body to prevent thelevitation body from being caught by the effect of friction.
First, the target value r(t) is given as follows.
⎧ 11.5 (0 ≤ 𝑡𝑡 < 100)
⎪ 8.0 (100 ≤ 𝑡𝑡 < 200)𝑟𝑟(𝑡𝑡) =⎨10.0 (200 ≤ 𝑡𝑡 < 300)⎪⎩ 7.0 (300 ≤ 𝑡𝑡 < 400)
The parameters in the design polynomial and 𝑃𝑃(𝑧𝑧 −1 ) resigma=1, delta=0, and the sampling interval isTs=0.1[sec].
At this time, 𝑃𝑃(𝑧𝑧 −1 ) is obtained as the following
equation.
𝑃𝑃(𝑧𝑧 −1 ) = 1 − 1.6375𝑧𝑧 −1 + 0.6703𝑧𝑧 −2
Furthermore, let 𝑛𝑛𝑢𝑢 =1 and 𝑘𝑘𝑚𝑚 =0. The experimental
results are shown in Fig.7. Fig. 8 shows the temporal

Fig.3 Circuit configuration

DeviceCircuit

Processing computer

Fig.4 Outline of experimental apparatus
Laser sensor

Levitation body

Electromagnet

Fig.5 Experimental device
4.

Experiment

A self-tuning [7] PID control is used for the experiment.
An overall view of the experimental setup system isshown in Fig.4. In addition, a magnetic levitation device
is used in the experimental device. Fig.5 shows themagnetic levitation device. A magnetic levitation device
levitates a magnetic body by controlling the current
252

Referenceschange of the PI parameter. From the experimentalresults, the PI parameters change appropriately according
to the characteristics of the system. This result shows that
the PI parameters calculated by the personal computer arecommunicated through Wi-Fi.
5.

1. S. N. Swamy and S. R. Kota, "An Empirical Study on
System Level Aspects of Internet of Things (IoT)," IEEEAccess, pp188082-188134, October 2020.
2. T. Lan, J. Duan, B. Zhang, D. Shi, and Z. Wang, “AIBased Autonomous Line Flow Control via Topology
Adjustment for Maximizing Time-Series ATCs,” 2020
IEEE Power & Energy Society General Meeting(PESGM), August 2020.
3. A. K. Gupta and R. Johari, "IOT based Electrical Device
Surveillance and Control System," 2019 4th International
Conference on Internet of Things: Smart Innovation andUsages (IoT-SIU), April 2019.
4. Kuan-Chu Lu, I-Hsien Liu, Jia-Wei Liao, Shao-Chun Wu,Zong-Chao Liu, Jung-Shian Li, Chu-Fen Li, "Evaluation
and Build to honeypot System about SCADA Security forLarge-Scale IoT Devices", Journal of Robotics,
Networking and Artificial Life, Vol.6, Issue.3 pp.157-161(2019)
5. Seyed Mahmood Hashemi, Jingsha He, "LA-BasedApproach for IoT Security", Journal of Robotics,
Networking and Artificial Life, Vol.3 Issue.4, pp.240-248(2013)
6. Y. Okubo, Y. Ashida, T. Kinoshita and T. Yamamoto,"Construction of a Data-Driven Control Platform using an
Electronic Thermal Regulator", IEEJ, CT18026 (2018)(inJapanese)
7. S. Omatsu, T. Yamamoto, “Self-tuning control”,
CORONA PUBLISHING (1996)

Conclusion

In this study, an IoT self-tuning controller using Wi-Fi
was developed. As a result, the controller and computerwere connected by IoT technology, the PID tuning
calculation was executed on the computer side, and thecalculated PID gain was sent to the controller. In addition,
the effectiveness of the system was verified throughexperiments. Future experiments will be conducted toevaluate the delay. We also plan to adapt the system tomemory-intensive systems.

Authors Introduction
Dr. Shinichi ImaiHe graduated doctor course atdepartment of engineering inHiroshima University. He
works at department ofeducation in Tokyo Gakugei
University. His research area
is about control systemdesign,educationalengineering.

Fig.7 Experimental result

Fig.8 Changes in PI parameters

253