1 Introduction

Robotic medicine may be the safe tool the world needs to avoid infections and overcome the Corona Virus. Consequently, there is an increasing importance of using robots and telemedicine technology to deal with patients especially having contagious diseases like Corona. Systems that give clinicians the ability to control mobile robots, understand and manipulate objects have come closer to being affordable [1,2,3]. Good-designed robotics may help mitigate risks for medical staff that are already extremely vulnerable to infectious in the workplace. It keeps time and provides comforts in fighting the infection while protective garments may be difficult for humans to wear for extended periods. In the case of a pandemic, it would be awesome to use robots and smart devices as force carrier for health care. Nowadays, telemedicine and robotics can replace official visits in infectious diseases regimen, elevated blood pressure and diagnosis of diabetes and stroke [2].

This paper proposes wireless medical robot to transmit vital signs including heart rate, blood pressure, and temperature, etc. remotely from dangerous places to doctors. To model the robot dynamics, an experimental test is carried out to measure its input/output responses. Then, system identification techniques are applied to model the robot dynamics and the validation of the obtained model is verified. The robot dynamics-model is identified using system identification (SI) methods considering transfer function (TF), state-space (SS), output error (OE), box-Jenkins (BJ), autoregressive exogeneous (ARX), autoregressive moving average exogeneous (ARMAX) models [3, 4]. Subsequently, the robot control is achieved using PID and FLC in conjunction with the obtained model towards good heading angle tracking.

The main contribution of this paper in three points: (1) Design and implementation of a medical robot with obtaining its transfer function for the controller design and simulation. (2) Stepwise identification procedure to estimate the dynamic transfer function. (3) Optimize the robot size and its cost by reducing the tools of measuring vital sings via using machine learning (ML) techniques where the BP is estimated from a PPG sensor as an example. Finally, several statistical analyses are applied and results are compared to achieve the best results.

The paper is planned as follows: Section 2 presents related works. Section-3 illustrates the structure of the wireless medical robot. Section 4 introduces system identification and dataset. Section-5 presents results and discussions for the system identification of the robot and its designed controller. Finally, Section 7 concludes the paper and presents future work.

2 Related Works

The wireless robots play important role in decreasing infection and rescue patients' safety. The main challenge in controller design of a robot is to accurately obtain a mathematical model for its dynamics. This challenge can be overcome by system identification (SI) techniques via observing input–output signals [4]. SI has been employed in modeling of robotic manipulators and kinematic problems [5] in addition to nonlinear modeling [6]. Further more, it is essential in adaptive control and neural network-based SI and estimation of inertial parameters [7, 8]. An online identification of dynamics-model for an autonomous underwater vehicle was introduced using an experimental test [9]. In addition, several modeling methods are discussed and models were sorted using SI like white-box, gray-box, black-box, parametric, and non-parametric SI [10].

The dynamic-model identification of wheeled mobile robot with a differential drive had been introduced in [11], where using multiple inputs and single-output (MISO) system. The controller’s development for autonomous vehicles has been studied by researchers widely in [12]. Among them is the Fuzzy Logic control (FLC) which may be a powerful for complex systems that is based on expert knowledge of human. FLC algorithms are accustomed to control autonomous systems in many engineering fields [13, 14]. The main advantages of using FLC involve better performance, efficient computation, and easy implementation [15].

An autonomous bay parking was developed using FLC, where the available parking space dimensions are investigated in conjunction with the kinetic model for low backward or forward speed [16]. Path-following algorithm based on FLC is introduced where the human driving behavior was emulated by the controller [16]. A controller is designed on a two-degree-of-freedom vehicle model for heading angle tracking of an UGV where the rotation boundaries of the steering wheel and rate of steering motor were considered for the design [17]. In addition, a scaled multi-wheeled combat vehicle was modeled using SI techniques where the controller was designed for heading angle tracking [18].

3 The Medical Robot Structure and Features

The MR has four direct current (DC) Motors of which each two motors are fixed in one side of the robot and aligned and powered by one of the dual VNH2SP30 motor driver as shown in Fig. 1. The MR can turn right or left by differential steering velocity as shown in Fig. 2.

Fig. 1
figure 1

The power contribution for robots’ motors

Fig. 2
figure 2

The differential steering velocity

The proposed medical robot (MR) is implemented and experimental test where a radio frequency (RF) controller is used to control the robot movement. The system utilizes two microcontrollers: first is MEGA2560 for the drivers and the second is ATMega328 for the sensors. The MR has dual VNH2SP30 DC motor driver and each side of the MR has two DC motors derived by one channel. An inertial measurement unit (IMU) PMU-6050 is placed in front of the MR body and it should be centered as possible to detect the MR motion.

A digital compass (LSM303DLHC) is aligned with the IMU to detect heading and acceleration. An ultrasound sensor (HC-SR04) is placed on the forehead for obstacle avoidance via distance detection. An electronic DC-DC (Buck) converter is used to step down the voltage to supply all cards and sensors. MEGA2560-microcontroller is introduced to manage and control the MR via RF24L01 trans-receiver and calculates the corresponding commands to the motors. The connection between the microcontroller and the motors is established via VNH2SP30 motor-drive using pulse width modulation (PWM). The microcontroller is connected to IMU, digital compass, and the SD card to handle the data logging and pertinent processing. The whole MR system is shown in Fig. 3. The MR has a non-contact temperature sensor MLX90614 to indicate patient body temperature. The sensor measures the propagation of infrared (IR) energy emitted by patient body and converts it to the corresponding temperature.

Fig. 3
figure 3

a The four wheeled wireless medical robot system; b robot hardware components

Also, the MR has a simple optical sensor that can provide photo plethysmography (PPG) signal. The principle of the optical PPG sensor is illustrated in Fig. 4, where a light emitted diode (LED) is directed on human finger skin. The light enters the skin and then it is reflected from tissues, bones, and blood (in veins, and arteries). Only the reflected light from the blood is time-variant (AC) however all other components are time-invariant (DC). From the time-variant components, PPG signal can be detected.

Fig. 4
figure 4

The principle of optical HR

The design and development of PPG measuring device is presented in [19]. Many of vital signs can be estimated by PPG sensor, such as the respiratory rate [20], Blood Pressure [19, 21, 22], heart rate and body temperature [23]. These researches' result should be used in order to minimize the robot size and its measuring tools and consequently reduce complexity and cost. Thus, this paper gives an example of BP estimation from PPG sensor by extracting some features from PPG signals which analysed by using machine learning (ML). More than 2000 recorded PPG and BP signals provided by Physio Net organization is used [24]. Figure 5 shows the four features that are used including; first feature is heart rate that can be determined by peak-to-peak interval of the PPG signals. The second, is augmentation index (AI) which is defined as the measurement of the wave reflection on the arteries and is calculated by ratio of the diastolic peak relative to the systolic peak [21]. The third is large artery stiffness index (LASI) and it is measured as the time taken from the systolic peak to the diastolic peak. The fourth is inflection point area ratio (IPA) which calculated as the areas under the curve of the PPG at points S1, S2, S3 and S4 as shown in Fig. 5, but in this work the areas are considered as features.

Fig. 5
figure 5

Extracted features from PPG signals

For wireless communication, a Wi-Fi module “WEMOS-D-mini” is used to monitor the PPG in real-time is shown in Fig. 6. It is a mini-Wi-Fi board with 4 MB flash depends on ESP-8266EX and it has Protocols 802.11 b/g/n (HT20) operating at 2.4–2.5 GHz. Its operating voltage is 2.5–3.6 v, and its operating current is 80 mA (Low power consumption). The Wi-Fi Mode is Station/SoftAP/SoftAP + Station, Security WPA/WPA2 and Encryption WEP/TKIP/AES, and Network Protocols IPv4, TCP/UDP/HTTP. The Wi-Fi technology is characterized by its flexibility of deployment, economics, and its high transmit rates [25, 26].

Fig. 6
figure 6

Real-time PPG monitoring

The medical sensors are connected to an Atmega328 microcontroller for signal processing and analysis complemented by an optical camera towards visual communication. The analysis of sensors data is done using a Laptop and BP is estimated from PPG signal by using machine learning (ML). The LCD monitor is utilized in displaying the sensors data.

4 System Identification and Dataset

Systems' Identification is the way of modeling system dynamics based on experimental measuring of input and output signals. It can provide mathematical model of the system dynamics accurately. Figure 7 shows the system identification (SI) approach flowchart, which has five steps [3, 27]. The first step is the experimental design followed by the step of collecting data. Then, an algorithm is designed and executed for parameters' estimation with SI-model selection followed by model validation via the data-set. Finally, the model is implemented when the validation step is successful.

Fig. 7
figure 7

System identification algorithm

However, if the model validation test showed that the SI model is not capable of representing the actual system dynamics, the algorithm goes to step three and repeated until the desired accuracy is achieved. SI using parametric identification techniques has a specific model structure including ARX, ARMAX, BJ, OE, SS and TF [4, 18, 28]. Considering the model structure and acquiring the input with output data, the system dynamic parameters can be estimated [29].

System Identification (SI) consists of seven steps as shown by the flowchart in Fig. 8.

Fig. 8
figure 8

SI data set implementation

  • Step 1: The input and output signals are record from the robot.

  • Step-2: Look at the data and select valuable portions of the original data.

  • Step-3: Gauge input delay to pick up a better understanding of the dynamics by means of getting the impulse response of the system.

  • Step-4: Select and characterize the suitable identification model structure within which the system-model can be obtained.

  • Step-5: Select the best model structure comparing to the input/output data and the given fit to the estimation criterion.

  • Step-6: Test the properties of obtained model's (pole-zero configurations).

  • Step-7: If the chosen model represents the identified system well enough, at that point halt, else return to phase-four to attempt another model. Probably, in the 5th step, try a new estimation approach or delve further into the input-output data obtained in the 1st and 2ndsteps.

5 Results and Dissuction

Figure 9 illustrates the experimental setup of the road test robot, where the digital compass (HCLM303) will be interfaced with Mega2560 microcontroller to obtain input–output signals data and save it on a secure digital SD memory card during the test. The road test of the MR was carried out on the pavement surface. The robot heading angle is controlled in an open-loop test via a preprogrammed path. To acquire reliable data, the heading angle of the MR should be changed continuously during the maneuver.

Fig. 9
figure 9

Experimental setup of the road test robot

This test is repeated five times to make sure that the recorded input/output signals are accurate when applying the SI technique.The robot input and output data are recorded and analyzed to estimate the appropriate MR model. The PWM represents the input and the heading angle is the output as shown in Fig. 10. Then, a system identification experiment is conducted using the MATLAB® software to develop the MR model [29]. The robot model consists of two identification sides; left and right sides.

Fig. 10
figure 10

Measured input–output signal of left channel (blue color) and right channel (red color); a input and b output

5.1 The Left-Side Identification

The left-side input–output measured signals (Fig. 10) with blue color which represents the MR input/output relations. Different identification methods are used, as clarified before, and the best results are selected and tested with various intervals as shown in Fig. 11. Inputs from the validation data set are applied to the models whose output is plotted in black. The step response of the identified TF is shown in Fig. 12, where the rise time is about 4.4 s and 4.6% overshoot. Table 1 clarifies the results of estimated transfer functions and their fitting ratio to the validation data of the Left side for various intervals. The FIT criterion is defined in Eq. (1) as:

$${\text{FIT}} = \frac{{1 - \left\| {Y - \hat{Y}} \right\|}}{{\left\| {Y - \bar{Y}} \right\|}}$$
(1)
Fig. 11
figure 11

Left side estimated TF for 3rd validation interval using several methods

Fig. 12
figure 12

Step response of the identified left side transfer function

Since Y represent the measured output, \(\widehat{Y}\) represent the predicted model output, and  \(\overline{Y }\) is the mean of the measured output Y. Some identification methods are used as clarified before to identify the MR dynamics and the best results are selected and tested with various intervals validated data.

The ARX-model is used to estimate the MR dynamics with fitting ratio between 65 and 80%; see Fig. 11. Also, the ARMAX-model estimates the system dynamics with 66% to 80%, while SS-model estimates with 72% to 81% and the transfer function model estimates with 66 to 86%.

The SI experiment is conducted with the pre-specified data-set and the models are obtained from which the best one has the following form;

$$Gp_{L} = \frac{ 1.176}{{S^{5} + 5.669S^{4} + 10.3S^{3} + 11.84S^{2} + 8.971 S + 2.68}}$$
(2)

5.2 The Right-Side Identification

The right-side input–output measured signals are shown in Fig. 10 with which some identification methods are used as clarified before to identify the MR dynamics. The best results are selected and tested with various intervals and the real measured output is displayed in Fig. 13. The transfer function output is 83.6%, i.e. the best result, while the ARMAX and ARX are 65% and 67%, respectively. Figure 13 clarifies that the best validation result is accomplished by TF model for the input data. Therefore, it is applied to the MR system as SISO where the model achieves about 81% of the output data and consequently it is appropriate to identify the MR model. The first estimated transfer function is obtained as,

$$G_{pR} = \frac{0.1175}{{S^{2} + \;0.8889S + \; 0.4068}}$$
(3)
Fig. 13
figure 13

Right-side estimated TF for 3rd validation interval by using several methods

Figure 14 shows the step response of the best identified right-side transfer function.

Fig. 14
figure 14

Step response of the identified right-side transfer function

The total output of the MR is illustrated in Fig. 15, where the solid green curve represents the measured heading output of the MR while the dashed blue curve is the simulated output of the MR. The overall model is obtained using Eq. (4),

$$Gp(s)_{{{\text{Total}}}} = G_{pR} \left( s \right)u_{R} + G_{pL} \left( s \right)u_{L}$$
(4)
Fig. 15
figure 15

The total output of the MR

5.3 Results of Controller Design

This section utilizes the best result of the MR identified system for the left/right side to design the necessary controller. Then, the two sides are summed together and output is tested as shown in Fig. 16. The objective for controller design is to enhance the rise time and the steady-state error.

Fig. 16
figure 16

Heading angle control block diagram

5.3.1 Closed Loop PID Controller Design

The best estimated transfer function (Eq. 2) for left side is considered as it fits to estimation data 86.21% (stability enforced), with Akaike’s Final Prediction Error for estimated model FPE = 6.493 and mean square error MSE = 5.393. The PID controller Gc is determined using Eq. (5);

$$G_{C} = \left( {P + I\frac{1}{S} + D\frac{N}{{1 + N\frac{1}{S}}}} \right)$$
(5)

The PID design parameters are P = 1.5, I = 0.7, D = 4, and N = 100. The designed PID controller yields closed loop step response with the peak time enhanced to 6.83 [sec], rise time to 2.93 [sec], and settling time to 12.2 [sec], compared to the open loop step response that has peak time = 11.2 [sec], rise time 2.68 [sec], settling time 9.57 [sec], and steady state error = 0.289.

In addition, the best estimated transfer function for right side (Eq. 3) is utilized as it fits to estimation data 86.31% (stability enforced), with FPE: = 6.9, and MSE = 5.317. The designed PID parameters are P = 93, I = 27, D = 73, and N = 990. This designed PID controller is implemented in closed loop configuration where the step response shows that the peak time is enhanced to 0.64 [sec], rise time to 0.229 [sec], and settling time to 0.678 [sec].

The total transfer function (\(G_{T} = G_{L} + G_{R}\)) can be simulated with the designed PID controllers as shown in Fig. 17 and the system response shown in Fig. 18.

Fig. 17
figure 17

SIMULINK diagram for heading angle with PID controller

Fig. 18
figure 18

Closed- and open-loop step responses with PID controller

5.3.2 Fuzzy Logic Controller Design

This section is devoted to the controller design based on the Mamdani-fuzzy approach. This controller allows the MR to follow the desired heading angle globally. Proper fuzzy rules and membership functions that based on MR behaviour are required to design an FLC [30]. Therefore, FLCs are developed to control the steering of the MR to follow the desired heading angle. The MR heading angle error is the controller input, while the PWM for the wheels is the controller output (control signals or commands). The MATLAB Simulink diagram is shown in Fig. 19. The appropriate FLC rules are defined by the help of the recorded input–output data shown in Fig. 10. The input–output variables are defined using triangular and trapezoidal membership functions. The input–output variables for each controller are defined by some membership functions. The membership functions are negative big (NB), negative (N), zero (Z), positive (P), and positive big (PB) as shown in Fig. 20.

Fig. 19
figure 19

Simulink diagram for heading angle with FL controller

Fig. 20
figure 20

a Fuzzy membership function for the input heading angle. b: Fuzzy output membership function

The closed-loop system (with the MR model) response is shown in Fig. 21, where the steady-state error reaches zero and the settling time is about 1.5 [sec], the peak time is 0.37 [sec], and the rise time is 0.6 [sec]. A predefined heading angle path manoeuvre is proposed as an input to the system for evaluating the controller. Subsequently, the developed FLCs based on the identified model calculates the appropriate control signal to track the desired heading.

Fig. 21
figure 21

a Step response of MR system with FLC and PID controllers. b: Heading angle tracking with controllers

To compare the two approaches for controller design, the obtained results are shown in Fig. 21 which clarifies that the proposed FLC can follow the desired heading angle with a small error and faster response compared to open loop system but slower than the PID which yields faster and easier implementation as clarified in Table 1.

Table 1 Time response characteristics for the MR system

5.4 Blood Pressure Estimation Results

Table 2 introduces the literature and the obtained results of the proposed model, where the estimation of BP based on the pulse transit time (PTT) is developed by M. Kachuee [21] and N.Maher [19] using machine learning techniques. The proposed results of MAE and STD are 4.77 mmHg and 6.06 mmHg for SP, respectively. These results are better than the literature [19, 21] as the MAE and STD of the DP are 4.8 and 6.56 mmHg which meet international organization for standardization (ISO). Number of samples which are used in this work is more than two thousand and the result of regression model is shown in Fig. 22. The three Fit curves for training, is closed to the dashed ideal curve (Y = T), where the deviation rate (R) is 0.931, 0.923, and 0.912 for training, validation, and testing, respectively.

Table 2 Blood pressure estimation results
Fig. 22
figure 22

Results of the regression model

6 Conclusion

This paper discussed the development and modelling of a remotely operated medical robot (MR) using system identification (SI) techniques. The MR model is used to simulate and analyse the performance characteristics of the system. It has four wheels which are independently driven by electric motors, and it can be steered on multiple surfaces with high manoeuvrability. An experimental test is carried out in open-loop configuration for measuring the input/output signals, upon which some SI models are applied in terms of TF, SS, ARX, ARMAX, OE, and BJ. The validation of the obtained SI model is verified using real data and achieved 88.44% of the output data. Based on the SI model, PID and FLC controllers are designed and implemented to control the MR heading angle via the speed of the four wheels. The results illustrated the efficiency of the MR to follow the desired heading angle.

By measuring the PPG signal (using on-board sensors), the BP is estimated using machine learning with mean absolute error (MAE) 4.77 mmHg in diastolic and 6.06 mmHg in systolic which is better than some of the literature work that used both ECG and PPG together. So, an improvement of 30.5% and 65% for systolic and diastolic are achieved and meet the ISO requirement. This MR can be used in helping physicians to communicate with patients who have contagious diseases and measure the vital signals without risk of infection and with short tracking time and can diagnose diseases remotely and avoid infection especially in hazard environment. The authors plan to find way to clean and develop the non-contacting sensors for measuring vital signs with estimating more diseases in the near future.