Next Article in Journal
One-Step Synthesis of Functional Sulfonated Polynaphthoylenebenzimidazoles for Biosensing Applications
Next Article in Special Issue
Some Dynamic Aspects of a Sextic Galactic Potential in a Rotating Reference Frame
Previous Article in Journal
Antioxidant Properties of Selenium Nanoparticles Synthesized Using Tea and Herb Water Extracts
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Performance Improvement of an NMP Mini Segway Using Sample and Hold Inputs

Mechanical Engineering, Michigan State University, East Lansing, MI 48824, USA
*
Author to whom correspondence should be addressed.
Appl. Sci. 2023, 13(2), 1070; https://doi.org/10.3390/app13021070
Submission received: 22 December 2022 / Revised: 8 January 2023 / Accepted: 10 January 2023 / Published: 13 January 2023
(This article belongs to the Special Issue Recent Advances in Nonlinear Vibration and Control)

Abstract

:
Early analytical work showed that it is possible to discretize a continuous-time non-minimum phase (NMP) system using special sample and hold inputs (SHIs) and obtain a discrete-time minimum phase (MP) system with a higher sampling rate than that of conventional zero-order sample and hold. As a result, high-gain discrete-time control law can be used to further improve closed-loop system performance since the resulting discrete-time system is MP. In this paper, this technique is adopted for performance improvement on a mini-Segway (MS), a developed robot equipped with an extremely low-cost microcontroller (Arduino). A dual-loop control tuning method was developed to optimize the overall closed-loop system performance. The system performance improvement is demonstrated by the reduction of the mini-Segway oscillation magnitude under idle conditions. The experimental results show that the low-cost microcontroller can be used for the dual-loop SHI control scheme, and the MS cart displacement oscillation magnitude is significantly reduced by more than 65% over the baseline controller. The main contribution of this paper is implementing the proposed sample and hold input (SHI) scheme into an extremely low-cost micro-controller (Arduino) and demonstrating that low-cost microcontrollers can effectively utilize the proposed SHI.

1. Introduction

Non-minimum phase (NMP) systems refer to systems that have at least one unstable zero located in the open right half plane (in continuous-time domain) or outside of the unit circle (in discrete-time domain). Unstable zeros introduce additional phase lag [1] that limits stabilizing control gain and prevents further performance improvement. One way to avoid the NMP characteristics is to convert the continuous time NMP system to a discrete-time minimum phase (MP) system. Zero-order-hold (ZOH) was considered in [2] with a sufficiently large sampling period. The sampling period that results in a discrete-time MP system is called the feasible sampling period. However, the feasible sampling period of ZOH is often too large to capture the characteristics of a continuous-time system [3]; therefore, the technique using ZOH may not be feasible for control purposes. To find a feasible sampling period smaller than that of ZOH, other approaches were used, including impulse generator function [4], first order hold [5,6], and fraction order hold [7,8,9,10]. However, these approaches also have their limitations.
Based on the discrete equivalent (DE) system theory in [11], three sample and hold inputs (SHIs) were proposed and studied in [12], and they are square pulse sample and hold input (SPSHI), forward triangle sample and hold input (FTSHI), and backward triangle sample and hold input (BTSHI). These SHIs have two design parameters: duty cycle (p) and sampling period ( δ ). These three SHIs are capable of significantly reducing the smallest feasible sampling period over ZOH. Note that the DE system is a continuous-time system with the same state and output variables at sampling time instants as those of the original system, but the zero locations of the DE system depend on the selection of SHI parameters.
Experimental validations were performed in [13], using a Quanser single-inverted-pendulum (SIP) system with a prototype controller, to study the capability of the proposed SHIs. It was discovered that by selecting the sampling period and duty cycle within the feasible region, the discrete-time controller with selected SHI is able to improve the closed-loop system performance significantly. Since the controller was implemented into a very sophistic microcontroller, the feasibility of implementing the proposed SHIs into an extremely low-cost microprocessor remains an open question, which is the topic of this paper. To be specific, this paper studies the performance improvement of a mini-Segway (MS) robot with a low-cost microprocessor (Arduino) using a dual-loop control scheme, where the inner-loop continuous-time controller stabilizes the MS system, making it feasible to use the proposed SHI, and the outer-loop discrete-time controller further improves the MS system performance. The MS is a two-wheel self-balanced robot and is a multi-input–multi-output (MIMO) nonlinear system. It is NMP after linearizing about the upright equilibrium point. Due to its under-actuated nature, this platform is widely used for controller design and implementation studies, including PID controllers [14,15,16,17,18,19], fuzzy logic controllers [20,21,22], Fuzzy combined with PID [23], adaptive control [24], and linear quadratic regulation (LQR) control [19,25,26,27]. There are many articles that have investigated complex and strong control methodologies to NMP systems, such as [28].
In this study, the dual-loop control architecture, proposed in [13], was adopted. The continuous-time inner-loop LQR was implemented at a 100 Hz sample rate, and a discrete-time outer-loop LQR with the selected SHI was implemented at 5 Hz. The idea is to utilize the inner-loop controller to stabilize the MS system and convert the resulting NMP MS system into a discrete-time MP system with the help of proposed SHIs. Consequently, a high gain outer-loop can be used to further improve closed-loop system performance. It is obvious that the overall system performance is affected by both inner and outer-loop controllers. To study the interaction between two controllers, multiple inner-loop LQR controllers were designed with gains from low to high, and the outer-loop controller was optimized for each designed inner-loop controller. It was found that the inner-loop control gain should be properly chosen to have a decent closed-loop system performance without the outer-loop controller. When the inner-loop control gain is relatively low, the nonlinear Coulomb friction dominates the closed-loop system dynamics, leading to unstable system response, and while the inner-loop control gain is relatively high, the system nonlinearity could result in unwanted high-frequency oscillations.
The main contribution of this paper is two-fold. The first is the feasibility study of implementing the proposed SHI with dual-loop control scheme into an extremely low-cost microcontroller (Arduino) and demonstrating the performance improvement on an NMP MS system; the second is the study of a dual-loop control tuning process to optimize overall closed-loop system performance. An MS robot platform was developed in the lab with a low-cost microcontroller (Arduino). Analytical study shows that the selected SHI is able to reduce the feasible sampling period from 0.75 s (ZOH) to 0.1162 s (a 84.5% reduction), and experimental results show that the average cart oscillation magnitude, mainly caused by the system Coulomb friction, was reduced from 10.94 mm to 3.85 mm (a 64.8 % reduction).
The rest of the paper is organized as follows. The SHIs and DE system background are introduced in Section 2, and the MS system is modeled in Section 3. The dual-loop control architecture, along with analytical study, is discussed in Section 4, and Section 5 describes the hardware configuration of the MS system. Section 6 addresses the experimental implementation and dual-loop controller tuning processes, along with experimental results. Concluding remarks are provided in Section 7.

2. Background: SHIs, DE, and DT Systems

2.1. SHI and DE System

A zero-order hold (ZOH) input u z ( t ) is defined as
u z ( t ) = u ( t k ) , if t k < t t k + δ , k = 0 , 1 , 2 , . . .
where δ is the sampling period, and u ( t k ) is the sampled value of u ( t ) , which is a continuous-time input over the time interval ( t k , t k + δ ] . Similar to ZOH, three additional SHIs were proposed in [12], and they are square pulse sample and hold input (SPSHI), forward triangle sample and hold input (FTSHI), and backward triangle sample and hold input (BTSHI). Note that the BTSHI feasible region (leading to an MP discrete-time system) as a function of sample period and duty-cycle is normally smaller than the other two, and the feasible regions of FTSHI and SPSHI often cover the BTSHI. As a result, the BTSHI provides less freedom in terms of selecting the sampling period and duty-cycle for the later experiment study; therefore, it is not adopted in this study. According to [3], the FTSHI requires a sampling frequency at least three times faster than SPSHI to generate the signal, and the low-cost microcontroller prevents the implementation of the FTSHI signal. As a result, the FTSHI was not used in this paper.
The SPSHI is defined in the following equation and can also be found in Figure 1, where p ( 0 , 1 ] is the duty cycle of the switched input; p and δ are for SPSHI in this case and are referred to as SHI parameters later.
u s ( t ) = u ( t k ) / p , t k < t t k + p δ 0 , t k + p δ < t t k + δ
For the continuous time-invariant linear system
x ˙ ( t ) = A x ( t ) + B u ( t ) , x ( t 0 ) = x 0 y ( t ) = C x ( t )
with u ( t ) = u s ( t ) and the SPSHI defined in Equation (2), the system becomes
x ¯ ˙ ( t ) = A ¯ x ¯ ( t ) + B ¯ u s ( t ) , x ¯ ( t 0 ) = x 0 y ¯ ( t ) = C ¯ x ¯ ( t )
Systems (3) and (4) are discrete-equivalent (DE) [12] if the state variables of both systems are equivalent at sampling time instants t k ( k = 0 , 1 , 2 , . . . ). For the rest of the paper, Equation (4) is called the DE system of (3). The DE system matrix with SPSHI has A ¯ = A and C ¯ = C , but the system input matrices B ¯ and B are
B ¯ = [ I e δ A ] 1 [ I e δ p A ] B ,
Note that for the DE system, the system matrices A ¯ = A and C ¯ = C . Matrix B ¯ depends on the SHI parameter selections. When p = 1 , matrix B ¯ in SPSHI becomes B, and the SPSHI becomes ZOH. Therefore, ZOH is a special case of SPSHI. In order to keep the input energy unchanged, the peak magnitude of SPSHI is scaled by ( 1 / p ) ; see Equation (2). When p < 1 , the DE system input matrix B ¯ is different from the original input matrix B, so the zero locations of the DE system in (4) can be different from those of the original system in (3).

2.2. DE and DT Systems

The continuous-time DE system in (4) can be converted into a discrete-time (DT) system by sampling at time instants t k ( k = 0 , 1 , 2 , . . . ) below.
x d ( k + 1 ) = A d x ( k ) + B d u ( k ) , x d ( 0 ) = x 0 y ( k ) = C d x ( k )
where A d = e δ A , C d = C , and matrix B for SPSHI is
B ¯ d = A 1 ( e δ A I ) ( I e δ A ) ( I e δ p A ) B

3. Mini-Segway System Model

The mini-Segway (MS) is a two-wheel self-balanced robot. It utilizes a low-cost microcontroller (Arduino), two motor-wheel sets, and a cart body. The free body diagram of the MS system is shown in Figure 2, where two motors provide the torques ( τ L and τ R ) to prevent the cart body from falling and also to move the cart forward, backward, left, and right; x c a r t is the cart displacement in x c a r t direction; see Figure 2; and θ p and ϕ are the cart body pitch angle and cart yaw angle, respectively.

Mini-Segway Robot Dynamic Equation

The MS equations of motion are shown in (8) below.
( m p + 2 I w r 2 + 2 m w ) x ¨ c a r t = 2 K τ K e m f R m r 2 x ˙ c a r t + K τ R m r ( u L + u R ) 2 K f x ˙ c a r t r 2 + m p l θ ˙ p 2 sin θ p m p l θ ¨ p cos θ p ( I p + m p l 2 ) θ ¨ p = m p l x ¨ c a r t cos θ p + m p l g sin θ p + 2 K τ K e m f R m r x ˙ c a r t K τ R m ( u L + u R ) + 2 K f r x ˙ c a r t ( I p z + 2 I w h 2 r 2 + 2 m w h 2 ) ϕ ¨ = 2 K τ K e m f h 2 R m r 2 ϕ ˙ + K τ h R m r ( u L u R ) 2 K f h r 2 ϕ ˙
where u L and u R are the left and right motor applied voltages, and they are considered as system control inputs. The MS system is balanced at its equilibrium point, the upright position ( θ p = 0 ). Small angle approximations of nonlinear functions are used as below:
cos θ p = 0 sin θ p = 1
The linearized MS state-space model is described in (10), and the state vector is x = [ x c a r t x ˙ c a r t θ p θ ˙ p ϕ ϕ ˙ ] T .
A = 0 1 0 0 0 0 0 α m p 2 l 2 g a b m p 2 l 2 0 0 0 0 0 0 1 0 0 0 β m p g l a a b m p 2 l 2 0 0 0 0 0 0 0 0 1 0 0 0 0 0 2 K τ K e m f h 2 2 K f h R m R m r 2 c B = 0 0 K τ ( b + m p l r ) R m r ( a b m p 2 l 2 ) K τ ( b + m p l r ) R m r ( a b m p 2 l 2 ) 0 0 K τ ( m p l + a r ) R m r ( a b m p 2 l 2 ) K τ ( m p l + a r ) R m r ( a b m p 2 l 2 ) 0 0 K τ h R m r c K τ h R m r c
where
a = m p + 2 m w + 2 I w r 2 b = I p + m p l 2 c = I p z + 2 I w r 2 h 2 + 2 m w h 2 α = 2 K τ K e m f ( m p l r + b ) 2 K f R m ( b + m p l r ) R m r 2 ( a b m p 2 l 2 ) β = 2 K τ K e m f ( r a + m p l ) + 2 K f R m ( r a + m p l ) R m r 2 ( a b m p 2 l 2 )
The MS system parameters are shown in Table 1.
With these parameter values defined in Table 1, the MS state-space model becomes
A = 0 1 0 0 0 0 0 6.8776 1.6517 0 0 0 0 0 0 1 0 0 0 156.8512 107.3635 0 0 0 0 0 0 0 0 1 0 0 0 0 0 26.4502 B = 0 0 2.4425 2.4425 0 0 55.7028 55.7028 0 0 19.3887 19.3887
The MS system is open-loop unstable due to a positive pole located at s = 9.5715 . In order to further improve the system performance experimentally, the plant dynamics shall be stabilized before the SHI scheme can be applied since the proposed SHI requires a stable plant.

4. Dual-Loop Control Architecture

4.1. Inner-Loop Controller Design

A dual-loop control architecture proposed in [13] is used for the MS system, where the inner-loop controller stabilizes the MS system, and the outer-loop controller with SHI further improves MS system performance. For this study, as shown in the dashed region of Figure 3, the inner-loop utilizes a continuous-time LQR (referred as LQR c ) implemented at 100 Hz.
For the inner-loop continuous-time stabilizing controller, the cost function for LQR c is
J c = 1 2 0 ( x ( t ) T Q c x ( t ) + v ( t ) T R c v ( t ) ) d t
where Q c 0 and R c > 0 are the weighting matrices. The inner-loop control output v in Figure 3 is in the form of v = K c x , where K c = R c 1 B T P c , and P c is the stabilizing solution of the following Ricatti equation:
P c A + A T P c + Q c P c B R c 1 B T P c = 0
For demonstration purpose, an initial set of LQR c weighting matrices Q c i and R c i was chosen as Q c i = d i a g [ 100 0.1 300 0.1 10 0.01 ] and R c i = d i a g [ 1 1 ] through an ad-hoc tuning process, and the corresponding control gain is
K c i = 7.07 9.49 14.64 0.91 2.24 0.08 7.07 9.49 14.64 0.91 2.24 0.08
With the initial LQR c , the MS system is stabilized, and the resulting closed-loop system remains NMP.

4.2. SHI Parameter Selection

For δ ( 0 , 1 ] and p ( 0 , 1 ] , the zero locations of the K c i stabilized MS system can be calculated, and the SHI feasible region is shown with the shaded area in Figure 4, which is the common area formed by the sampling period and duty cycle resulting in an MP DT system for the closed-loop system with the inner-loop controller. Note that the feasible region was calculated by an exhaustive search of δ and p that resulted in an MP system.
The black horizontal line on the top of Figure 4 represents the feasible sampling periods of ZOH, a special case of SPSHI with p = 1 ( 100 % duty-cycle). The smallest feasible sampling period of ZOH is as large as 0.75 s. This sampling period can be reduced down to 0.1184 s using the SPSHI with an extremely small duty cycle. For example, if a sampling period of 0.2 s is selected, a wide range of duty cycles can be chosen between 0 and 0.6. Note that small sampling period is very important for improving closed-loop system performance using the outer-loop controller.
The normalized system bandwidths are calculated, and they are 1.3 Hz and 33.9 Hz for cart displacement and cart pitch angle, respectively. In order to ensure that the outer-loop controller sample frequency to is adequate to cover system dynamics for both outputs, the required sampling frequency is at least two times faster than the system dynamics [3], that is, 67.8 Hz for the outer-loop controller. In this case, it is impossible to have the outer-loop controller cover system dynamics for both outputs. Consequently, for the same reason, only the cart displacement output is considered since it requires a controller with the lowest sample frequency of 2.6 Hz [3].
Therefore, a small sampling period within the feasible region shown in Figure 4 is preferred. Due to the experimental validation result in [13], a small duty cycle leads to better performance. As a result, for the SPSHI, the outer-loop sampling period is chosen to be δ = 0.2 s, marked with the dashed line in Figure 4, and the implementation duty cycle is chosen as p = 0.2 ( 20 % duty-cycle).

4.3. Outer-Loop Design

Since the open-loop MS system is NMP, high gain control could destabilize the system. With the SHI parameters selected in the previous section, it is able to convert the continuous-time NMP MS system to a discrete-time MP system. In order to improve the stabilized MS system performance, the outer-loop controller, a discrete-time LQR (referred as LQR d ) with the SPSHI, was used (see Figure 3), and LQR d provides additional control effort for further performance improvement. The LQR d cost function is defined below.
J d = 1 2 k = 0 ( x T ( k ) Q d x ( k ) + ω S H I T ( k ) R d ω S H I ( k ) )
where ω S H I ( k ) is the outer-loop control output (see Figure 3). Note that the selection of LQR d weighting matrices ( Q d and R d ) is critical for this study, where an adequate control effort should be guaranteed while maintaining both actuators within their saturated input voltage of ±12 V.

5. Experimental Hardware

The target MS system is built with three main component groups: sensors, microcontrollers, and actuators.

5.1. Sensors

In order to balance the MS system about its upright equilibrium point, the measurement signals of the cart body pitch angle, pitch angular velocity, individual wheel displacement, and velocity are required.
Cart body pitch angle and velocity: An MPU-6050 sensor from IvenSense Inc. is used for reading cart body angular information. It contains a MEMS (microelectromechanical system) gyroscope and a MEMS accelerometer in a single chip. The gyroscope is a sensor that measures the angular velocity in roll, pitch, and yaw directions, and the accelerometer measures gravitational and motion accelerations in X, Y, and Z directions. After disabling the sleep mode of the chip in Simulink, the gyroscope and accelerometer readings are sent to the microcontroller via the Arduino I 2 C bus. The cart body pitch angular velocity is obtained directly from the gyroscope raw data. Theoretically, integrating the angular velocity yields the pitch angle, but the sensor noise and bias cause the integrated angle signal drift. Note that the pitch angle can also be obtained from the arc-tangent value of the X and Z direction gravitational accelerations from the accelerometer signals; however, the sensor noise and external forces could also affect its accuracy easily. Hence, a complementary filter, developed in [29], is used to have an accurate pitch angle signal; see the complementary filter in Figure 5. To compensate the gyroscope drift with the accelerator reading, it applies a low-pass filter and a high-pass filter to accelerometer and gyroscope signals, respectively. For the MS used in this paper, β = 0.98 was used for the filter.
Wheel displacement and velocity: The MS displacement is measured with two hall-effect rotary encoders mounted on the two motors. The motor encoders output digital signals of both motor shaft positions with a resolution of 1320 samples per revolution. The encoder readings can be converted into cart displacement and velocity based on gear ratio and wheel radius.

5.2. Microcontroller

For the purpose of balancing the MS system, the microcontroller speed has to be adequate for sampling sensor signals, communicating with the host computer via Wi-Fi, and generating control commands for both motors. For this study, the control algorithm was developed in MATLAB/Simulink, which requires additional throughput from the microcontroller to handle the communication between the Arduino microcontroller and real-time Simullink via Wi-Fi; see Figure 6 below. An Arduino MKR 1000 Wi-Fi is selected for this study due to its WiFi capability. It uses the microcontroller with a clock speed of 48 MHz that is capable of handling the sampling frequency of 100 Hz.
The communication between the host computer and MS system could have certain delay via Wi-Fi connection. However, with a private Wi-Fi router, the experimental data were sent to the host computer with barely no delay at a constant sampling period.

5.3. Actuators

Two 12 V DC motors with a 1:4 gear ratio are used, where the motor peak speed is 333 RPM and peak output power is 4.8 W. The motor torque parameter K τ is 0.23 Nm/A. The MKR motor carrier is used to drive both motors and process both encoder signals. It has an operating voltage of 5 to 12 V and uses a L 298 P motor driver. The maximum output current is 2 A/channel, which is lower than the motor maximum current of 6.5 A, meaning that the motors are protected from excess current.

5.4. Experimental Set Up

The MS robot (see Figure 7) and its detailed hardware configuration is shown in Figure 6. The rectangular box represents the MS cart. All the sensor signals are fed into the Arduino MKR 1000 and sent to the host computer via Wi-Fi. The host computer then generates control signals in MATLAB/Simulink and sends them back to the microcontroller to drive the motors using the MKR motor shield.

6. Experimental Implementation

6.1. Inner-Loop LQR Controller Tuning

After the MS system platform was developed, the inner-loop LQR c was implemented to stabilize the MS system. A baseline system performance was established based on Q c i and R c i , which are the initial LQR c weighting matrices. Starting from this baseline controller with the Q c i matrix fixed, the weighting matrix R c was tuned by introducing a gain G R c such that R c = G R c R c i . Experiments were conducted with G R c from 0.6 to 1.2 with an increment of 0.1 . The cart displacement and pitch angle are shown in Figure 8a,b. The corresponding control voltage is shown in Figure 8c.
The mean absolute values of the cart oscillation magnitude ( | x c a r t | a v g ), pitch angle ( | θ p | a v g ), and the corresponding control voltage ( | v | a v g ) for each G R c are shown in Table 2, and the data are plotted in Figure 9.
From Figure 8, when G R c is 0.6 , the resulting LQR control gain is high, and the MS system outputs (pitch angle and displacement) oscillate with very high frequencies. When G R c = 0.7 with a reduced control gain, the cart oscillation magnitude is reduced but is still unstable. As a result, these two G R c values are not feasible since they do not result in feasible LQR c controllers for stabilization purposes. For G R c = 0.8 , the closed-loop system takes about 5 s to stabilize; as a result, the closed-loop MS system transits from unstable with G R c = 0.7 to stable with G R c = 0.8 (as shown in Figure 9). The closed-loop system performance is further improved with G R c = 0.9 , and the cart is also stabilized with G R c = 1.0 but with an increased oscillation magnitude. When G R c reaches 1.1 , the closed-loop system has an unbounded oscillation magnitude for cart displacement, indicating an unstable system. The data in Table 2 are plotted in Figure 9. In spite of the undesired range and unstable range, the feasible (stabilizing) G R c is between 0.8 and 1.0 .

6.2. Outer-Loop Controller Tuning

For each stabilizing G R c designed for the inner-loop LQR c , the outer-loop LQR d controller was tuned accordingly to achieve the optimal performance. A “baseline” LQR d was designed first using weighting matrices Q d i = diag [ 100 0.1 80 0.1 10 0.01 ] and R d i = diag [ 1 1 ] . With the feasible LQR c controllers, the dual-loop feasible regions are shown in Figure 10. The smallest feasible sampling periods are 0.1136 s, 0.1162 s, and 0.1184 s for G R c , equal to 0.8 , 0.9 , and 1.0 , respectively. Since the feasible regions of the closed-loop systems with SPSHI in Figure 4 and Figure 10 are barely changed, the SHI parameter selection remains unchanged at p = 0.2 and δ = 0.2 s.
For the purpose of tuning, G R d was introduced so that R d = G R d R d i , and G R d ranges from 0.3 to 1.1 with an increment of 0.2 while the Q d i matrix is fixed. Smaller G R d values, such as 0.1 and 0.2 , were tested, but the corresponding LQR d gains were too large for the MS system, resulting in an unstable closed-loop MS system. From the system bandwidths of 1.3 Hz for the cart displacement and 33.9 Hz for the body pitch angle, the outer-loop controller sampled at 5 Hz can only cover the cart displacement performance. Therefore, control gain tuning is used to minimize cart oscillation magnitude, and the results for each G R c are shown in Table 3 below.
It is clear that when G R c = 0.9 , the best improvement was achieved, where the oscillation magnitude with inner-loop control only was 12.17 mm and dual-loop was 3.83 mm, a 68.4 % improvement. It was 28.3 % and 60.0 % for G R c = 0.8 and 1.0 , respectively). The outer-loop tuning result for G R c = 0.9 is shown in Figure 11.
The experimental results in Figure 11 are divided into six segments. Segment I corresponds to the responses with inner-loop controller only from the previous section and used as the baseline controller. Between segments II and VI, G R d increases from 0.3 to 1.1 with a 0.2 increment.
The dual-loop experimental results with SPSHI in Figure 11a show that the outer-loop LQR d with G R d = 0.3 reduces the cart displacement magnitude significantly. However, the cart body pitch angle (shown in Figure 11b) is barely affected due to the aforementioned inadequate control sample frequency. From segments II to VI, with increased G R d , the cart displacement magnitude increases while the SHI control effort decreases.
The overall control, u, and SPSHI control ω are shown in Figure 11c,d, respectively. The SPSHI signal is 0 in segment I since only LQR R c is active. The outer-loop is activated, starting from segment II. As G R d increases, the SPSHI control decreases and cart displacement magnitude increases. The mean absolute values of the cart displacement, overall control input voltage, and SHI voltage in Figure 11 are summarized in Table 4. The data in Table 4 are plotted in Figure 12.
The best cart displacement is boxed in the table. From the trend shown in Figure 12a, when G R d = 0.3 , the cart oscillation magnitude reaches the local minimum; meanwhile, the cart pitch angle is slightly higher than the single loop case. The numerical results show that the inner-loop mean absolute cart displacement amplitude is reduced from 12.17 mm to 3.85 mm with G R d = 0.3 , which is a 68.3 % reduction. Note that even though the SPSHI signal in Figure 11d ranges from 1 to 1 V, it does not increase the overall control voltage in Figure 11c. From Figure 12d, it can be observed that dual-loop control does not increase the overall control magnitude.

7. Conclusions

A mini-Segway (MS) platform was developed for implementing sample and hold input (SHI), converting a non-minimum phase (NMP) continuous-time system into a minimum-phase (MP) discrete-time system, to study the feasibility of using a low-cost microcontroller (Arduino). The inner-loop controller is a continuous-time linear quadratic regulator (LQR) implemented at a 100 Hz sample rate, and the outer-loop discrete-time LQR uses the square pulse sample and hold input (SPSHI) with a 5 Hz sampling rate. The SPSHI is used to convert the stabilized NMP system using the inner-loop LQR to a discrete-time MP system, meaning that the outer-loop high-gain LQR can further improve the performance. It is shown that both inner and outer-loop controllers affect the overall MS system performance. In order to optimize the dual-loop control scheme, a set of feasible inner-loop continuous-time LQRs (linear quadratic regulators) with guaranteed stability was obtained by varying the control weighting, and the best dual-loop controller was found by tuning the discrete outer-loop LQR controller to minimize the cart displacement magnitude. The exhaustive search found that selecting proper inner and outer-loop LQR control weightings is the key to optimizing overall MS system performance. Experiments were conducted to validate the analytical results for the controller tuning processes. With the dual-loop control scheme, the average cart displacement magnitude is reduced by more than 65 % using the SPSHI. Note that even though the inner-loop LQR was optimized for the best performance prior to implementing the outer-loop controller, a significant performance improvement can still be achieved by using the outer-loop control with SHI. The main contribution of this paper is to demonstrate that the proposed sample and hold input scheme is capable of significantly improving system performance without utilizing expensive control hardware. Note that the main disadvantage of utilizing SPSHI is that it increases the required actuator size due to a magnified pulsive control signal. It is important to balance the SPSHI duty-cycle and resulting MP system property. There are many existing control approaches dealing with NMP systems using advanced control algorithms, which require relatively expensive control hardware; however, the proposed SHI scheme can be applied to NMP systems without expensive hardware. Future work in this area will be to compare its system performance improvement with other control schemes.

Author Contributions

Conceptualization, G.Z. and Y.W.; methodology, G.Z. and Y.W.; software, Y.W.; validation, Y.W.; formal analysis, Y.W.; investigation, G.Z. and Y.W.; resources, G.Z.; data curation, Y.W.; writing—original draft preparation, Y.W.; writing—review and editing, G.Z.; visualization, Y.W.; supervision, G.Z.; project administration, G.Z. All authors have read and agreed to the published version of the manuscript.

Funding

This research received no external funding.

Data Availability Statement

Not applicable.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
BTSHI  Backward triangle sample and hold input
DE  Discrete equivalent
FTSHI  Forward triangle sample and hold input
LQR  Linear quadratic regulation
MP  Minimum phase
MEMS  Micro-electro mechanical system
MS  Mini-Segway
NMP  Non-minimum phase
SHI  Sample and hold input
SIP  Single inverted pendulum
SPSHI  Square pulse sample and hold input
ZOH  Zero order holder

References

  1. Zhou, K.; Doyle, J.C. Essentials of Robust Control; Prentice Hall: Upper Saddle River, NJ, USA, 1998. [Google Scholar]
  2. Åström, K.J.; Hagander, P.; Sternby, J. Zeros of sampled systems. Automatica 1984, 20, 31–38. [Google Scholar] [CrossRef]
  3. Shannon, C.E. Communication in the presence of noise. Proc. IRE 1949, 37, 10–21. [Google Scholar] [CrossRef]
  4. Bai, E.W.; Wu, Y.Q. Limiting zero distribution of sampled systems. Automatica 2002, 38, 843–851. [Google Scholar] [CrossRef]
  5. Hagiwara, T.; Yuasa, T.; Araki, M. Limiting properties of the zeros of sampled-data systems with zero-and first-order holds. In Proceedings of the 31st IEEE Conference on Decision and Control, Tuscon, AZ, USA, 16–18 December 1992; pp. 1949–1954. [Google Scholar]
  6. Hagiwara, T.; Yuasa, T.; Araki, M. Stability of the limiting zeros of sampled-data systems with zero- and first-order holds. Int. J. Control. 1993, 58, 1325–1346. [Google Scholar] [CrossRef]
  7. Passino, K.M.; Antsaklis, P.J. Inversestablesampledlow-pass systems. Int. J. Control. 1988, 47, 1905–1913. [Google Scholar] [CrossRef]
  8. Ishitobi, M. Stability of zeros of sampled system with frac- tional order hold. Proc. Control. Theory Appl. 1996, 143, 296–300. [Google Scholar] [CrossRef]
  9. Bárcena, R.; Etxebarria, A. Sufficient conditions for the attainment of sampled systems without nonminimum-phase zeros. Int. J. Control. Autom. Syst. 2010, 8, 244–249. [Google Scholar] [CrossRef]
  10. Ishitobi, M.; Zhu, Q. Zeros of sampled systems with fractional order hold implemented by zero order hold. In Proceedings of the IEEE 1997 International Conference on Intelligent Processing Systems, Beijing, China, 28–31 October 1997; pp. 698–702. [Google Scholar]
  11. Das, T.; Mukherjee, R. Shared-sensing and control using re- versible transducers. IEEE Trans. Control. Syst. Technol. 2009, 17, 242–248. [Google Scholar] [CrossRef]
  12. Wang, Y.; Jafari, R.; Zhu, G.G.; Mukherjee, R. Sample-and- Hold Inputs for Minimum-Phase Behavior of Nonminimum-Phase Systems. IEEE Trans. Control. Syst. Technol. 2016, 24, 2103–2111. [Google Scholar] [CrossRef]
  13. Wang, Y.; Zhu, G.G.; Mukherjee, R. Experimental study of nmp sample and hold input using an inverted pendulum. In Proceedings of the ASME 2018 Dynamic Systems and Control Conference, Atlanta, GA, USA, 30 September–3 October 2018; p. V001T01A004. [Google Scholar]
  14. Juang, H.S.; Lurrr, K.Y. Design and control of a two-wheel self-balancing robot using the arduino microcontroller board. In Proceedings of the 2013 10th IEEE International Conference on Control and Automation (ICCA), Hangzhou, China, 12–14 June 2013; pp. 634–639. [Google Scholar]
  15. Thao, N.G.M.; Nghia, D.H.; Phuc, N.H. A pid backstepping controller for two-wheeled self-balancing robot. In Proceedings of the 2010 IEEE International Forum on Strategic Technology 2010, Ulsan, Republic of Korea, 13–15 October 2010; pp. 76–81. [Google Scholar]
  16. Unluturk, A.; Aydogdu, O.; Guner, U. Design and PID control of two wheeled autonomous balance robot. In Proceedings of the IEEE: 2013 International Conference on Electronics, Computer and Computation (ICECCO), Ankara, Turkey, 7–9 November 2013; pp. 260–264. [Google Scholar]
  17. Ren, T.J.; Chen, T.C.; Chen, C.J. Motion control for a two-wheeled vehicle using a self-tuning pid controller. Control. Eng. Pract. 2008, 16, 365–375. [Google Scholar] [CrossRef]
  18. Liu, K.; Bai, M.; Ni, Y. Two-wheel self-balanced car based on kalman filtering and pid algorithm. In Proceedings of the IEEE 18th (2011) International Conference on Industrial Engineering and Engineering Management, Changchun, China, 3–5 September 2011; pp. 281–285. [Google Scholar]
  19. An, W.; Li, Y. Simulation and control of a two-wheeled self- balancing robot. In Proceedings of the 2013 IEEE International Conference on Robotics and Biomimetics (ROBIO), Shenzhen, China, 12–14 December 2013; pp. 456–461. [Google Scholar]
  20. Yong, Q.; Yanlong, L.; Xizhe, Z.; Ji, L. Balance control of two-wheeled self-balancing mobile robot based on its fuzzy model. In Proceedings of the 6th (2011) International Forum on Strategic Technology, Harbin, China, 22–24 August 2011; pp. 406–409. [Google Scholar]
  21. Ruan, X.; Cai, J. Fuzzy backstepping controllers for two-wheeled self-balancing robot. In Proceedings of the IEEE 2009 International Asia Conference on Informatics in Control, Automation and Robotics, Bangkok, Thailand, 1–2 February 2009; pp. 166–169. [Google Scholar]
  22. Ruan, X.; Cai, J.; Chen, J. Learning to control two-wheeled self-balancing robot using reinforcement learning rules and fuzzy neural networks. In Proceedings of the 2008 IEEE Fourth International Conference on Natural Computation, Jinan, China, 18–20 October 2008; pp. 395–398. [Google Scholar]
  23. Wu, W.; Ma, X.; Wang, J. Intelligent control in two-wheel self-balanced robot. In Proceedings of the IEEE 2010 International Conference on Computer, Mechatronics, Control and Electronic Engineering, Changchun, China, 24–26 August 2010; pp. 470–473. [Google Scholar]
  24. Wasif, A.; Raza, D.; Rasheed, W.; Farooq, Z.; Ali, S.Q. Design and implementation of a two wheel self balancing robot with a two level adaptive control. In Proceedings of the IEEE Eighth International Conference on Digital Information Management (ICDIM 2013), Islamabad, Pakistan, 10–12 September 2013; pp. 187–193. [Google Scholar]
  25. Sun, C.; Lu, T.; Yuan, K. Balance control of two-wheeled self-balancing robot based on linear quadratic regulator and neural network. In Proceedings of the IEEE 2013 Fourth International Conference on Intelligent Control and Information Processing (ICICIP), Beijing, China, 9–11 June 2013; pp. 862–867. [Google Scholar]
  26. Junfeng, W.; Wanying, Z. Research on control method of two-wheeled self-balancing robot. In Proceedings of the IEEE 2011 Fourth International Conference on Intelligent Computation Technology and Automation, Shenzhen, China, 28–29 March 2011; pp. 476–479. [Google Scholar]
  27. Xu, C.; Li, M.; Pan, F. The system design and lqr control of a two-wheels self-balancing mobile robot. In Proceedings of the IEEE 2011 International Conference on Electrical and Control Engineering, Yichang, China, 16–18 September 2011; pp. 2786–2789. [Google Scholar]
  28. Fujimoto, H.; Yao, B. Multirate adaptive robust control for discrete-time non-minimum phase systems and application to linear motors. IEEE/ASME Trans. Mechatron 2005, 10, 371–377. [Google Scholar] [CrossRef]
  29. Baerveldt, A.J.; Klang, R. A low-cost and low-weight attitude estimation system for an autonomous helicopter. In Proceedings of the IEEE 1997 International Conference on Intelligent Engineering Systems, Budapest, Hungary, 15–17 September 1997; pp. 391–395. [Google Scholar]
Figure 1. Signal sampled by SPSHI.
Figure 1. Signal sampled by SPSHI.
Applsci 13 01070 g001
Figure 2. Free body diagram of the mini-Segway robot.
Figure 2. Free body diagram of the mini-Segway robot.
Applsci 13 01070 g002
Figure 3. Dual-loop control architecture for the MS system.
Figure 3. Dual-loop control architecture for the MS system.
Applsci 13 01070 g003
Figure 4. The feasible sampling period (in s) of ZOH that results in an MP DT system and the p- δ feasible regions of SPSHI.
Figure 4. The feasible sampling period (in s) of ZOH that results in an MP DT system and the p- δ feasible regions of SPSHI.
Applsci 13 01070 g004
Figure 5. The complementary filter.
Figure 5. The complementary filter.
Applsci 13 01070 g005
Figure 6. The MS system hardware configuration.
Figure 6. The MS system hardware configuration.
Applsci 13 01070 g006
Figure 7. MS robot.
Figure 7. MS robot.
Applsci 13 01070 g007
Figure 8. The experimental result for inner-loop LQR c optimization.
Figure 8. The experimental result for inner-loop LQR c optimization.
Applsci 13 01070 g008
Figure 9. LQR c tuning data plot.
Figure 9. LQR c tuning data plot.
Applsci 13 01070 g009
Figure 10. The feasible region of the closed-loop MS system with SPSHI.
Figure 10. The feasible region of the closed-loop MS system with SPSHI.
Applsci 13 01070 g010
Figure 11. Experimental results for Dual-loop Controller with SPSHI.
Figure 11. Experimental results for Dual-loop Controller with SPSHI.
Applsci 13 01070 g011
Figure 12. LQR d tuning data plot.
Figure 12. LQR d tuning data plot.
Applsci 13 01070 g012
Table 1. Mini-Segway parameters.
Table 1. Mini-Segway parameters.
SymbolDescriptionValue/Unit
K e m f Motor EMF constant0.027  V·s/rad
K τ Motor torque constant0.23  N·m/A
R m Motor internal resistance4.8  Ω
K f Motor shaft friction coefficient0.001  N·s/rad
I w Wheel moment of inertia0.0000409  kgm 2
I p Cart body moment of inertia0.0012  kgm 2
lDistance between cart body0.02  m
center of mass and y-axis
m w Wheel mass0.0492  kg
m p Cart body mass0.7197  kg
rWheel radius0.034  m
hHalf cart width0.086  m
Table 2. Mean absolute values of cart displacement and control voltage with inner-loop LQR c only.
Table 2. Mean absolute values of cart displacement and control voltage with inner-loop LQR c only.
G Rc 0.60.70.80.91.01.1
| x c a r t | a v g (mm) 19.35 15.32 18.63 12.17 16.58
   | θ p | a v g   (mm) 4.31 2.56 1.08 0.85 0.89
| v | a v g (V) 3.96 2.44 1.16 1.00 1.10
Table 3. Mean absolute values of outer-loop LQR d .
Table 3. Mean absolute values of outer-loop LQR d .
G Rd Value
  N/A  0.3  0.5  0.7  0.9  1.1
     | x c a r t | a v g (mm)
G R c = 0.8
   18.83    13.50    15.46    15.64    16.89    15.51
     | x c a r t | a v g (mm)
G R c = 0.9
   12.17    3.85    5.39    6.29    6.84    7.36
     | x c a r t | a v g (mm)
G R c = 1.0
   16.58    6.63    8.00    10.55    12.07    13.29
Table 4. The mean absolute values of outer-loop LQR d tuning data.
Table 4. The mean absolute values of outer-loop LQR d tuning data.
G Rd Value
  N/A  0.3  0.5  0.7  0.9  1.1
| x c a r t | a v g
(mm)
    12.17     3.85     5.39     6.29     6.84     7.36
   | θ p | a v g
  (mm)
    0.95     0.98     1.00     0.99     1.08     1.11
    | u | a v g
  (V)
    0.69     0.47     0.52     0.55     0.56     0.57
    | ω | a v g
  (V)
   0    0.047     0.04     0.03     0.027     0.023
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Wang, Y.; Zhu, G. Performance Improvement of an NMP Mini Segway Using Sample and Hold Inputs. Appl. Sci. 2023, 13, 1070. https://doi.org/10.3390/app13021070

AMA Style

Wang Y, Zhu G. Performance Improvement of an NMP Mini Segway Using Sample and Hold Inputs. Applied Sciences. 2023; 13(2):1070. https://doi.org/10.3390/app13021070

Chicago/Turabian Style

Wang, Yingxu, and Guoming Zhu. 2023. "Performance Improvement of an NMP Mini Segway Using Sample and Hold Inputs" Applied Sciences 13, no. 2: 1070. https://doi.org/10.3390/app13021070

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop