Opening the book…
Chapters 2 through 7 addressed technologies used in mechatronic system design, control, and optimization. These include mechatronic system modelling and control, signal processing in both continuous- and discrete-time domains, mechatronic system actuators and sensors, and the control system architecture from both a hardware and software point of view. This chapter now introduces the first example of mechatronic systems—a mini-Segway system—from its modelling to control to simulation studies to experimental studies. Figure 8.1 shows how this chapter’s eight sections are structured. Section 8.1 presents a mini-Segway mathematical model with both motor and sensor dynamics. Then Sections 8.2, 8.3, and 8.4 present three control methodologies for the mini-Segway. These are, respectively, model-free control, model-based control with zero-order sample and hold input, and model-based control with special sample and hold input for improved system performance. Next, these control methods are validated in software-in-the-loop (SiL) simulation studies (Sections 8.5 and 8.6). Finally, Sections 8.7 and 8.8 validate both model-free and model-based control methodologies experimentally. Model-based control validation focuses on special sample and hold input method discussed in Section 8.4.
Section 8.1 models a custom-built mini-Segway system, using the modeling techniques from Chapter 2. Mechanically, the mini-Segway is an inverted-pendulum on a cart [1], [2] with a relatively heavy pendulum. Therefore, in many ways, the mini-Segway can be modeled in similar fashion. This section models both motor electric characteristics and hall-effect sensor signals in detail. The mechanical dynamics of the mini-Segway system are based on Newton’s law. The nonlinear mini-Segway model is implemented in MATLAB and Simulink with the Coulomb friction model. Closed-loop dual-PID (proportional-integral- derivative) [4] control of the mini-Segway, a model-free (MF) approach, is conducted in simulation studies in Section 8.5 utilizing the developed strategy, and in experimental studies in Section 8.7.
With the model developed, Section 8.2 proposes a control architecture, using two independent PID controllers [3], [4], [5]. One PID controller stabilizes the mini-Segway pendulum position, maintaining it at an upright position. The other controls the mini-Segway forward and backward motions in cart \(x\) direction. The coupling dynamics of pendulum angular displacement, and forward/backward and turning motions, are not considered (see Problems P8.2 and P8.4). To ensure that the integrators of the two PID controllers do not fight each other, which could lead to unbounded integration values, the integration gain of the PID controller for stabilizing the mini-Segway pendulum at the upright position is set to zero. The effect of this action is moderate due to the slow action of the integration operation.
Section 8.3 builds on Section 3.5 to address the model-based control design process for the mini-Segway, modeled in Section 8.1. It utilizes LQR (linear quadratic regulation) [6], [7], [8], [9] and LQTI (linear quadratic tracking with integral) [10], [11]. To apply model-based control design methodologies, we develop a linearized state-space mini-Segway model with respect to its normal operation condition. This model’s parameters are then populated using the values in Table 8.1. Next, we design an LQR regulator, a model-based (MB) controller, for stabilizing the mini-Segway pendulum to keep the mini-Segway pendulum at its upright position. Last, we add an error integral state of mini-Segway cart speed to the state-space model [10]. An LQTI controller is designed to track the mini-Segway cart speed with its pendulum position regulated at its upright position. The LQTI control strategy is a model-based one comparable with the dual-PID strategy discussed in Section 8.2, where the mini-Segway turning is controlled in an open loop.
Section 8.4 discusses control design for a discrete-time controller with a sample and hold input different from a conventional zero-order sample and hold. The square-pulse sample and hold input system is introduced, along with its state-space modeling methods. The mini-Segway system is non-minimal phase (NMP). At least one zero is located in the open right-half complex plan, which limits the achievable performance [12] by a closed-loop control strategy. By utilizing the special sample and hold input, a non-minimal phase continuous-time plan can be transferred into a minimal phase (MP) discrete-time one. This section demonstrates this phenomenon using our mini-Segway model [13]. It then proceeds to design a stabilizing controller.
Section 8.5 develops and validates the dual-PID control system model in Simulink. It uses the linearized mini-Segway six-state state-space model (see Section 8.3) with detailed PID gain selection to achieve the desired performance (pendulum stabilization and cart driving). First, the dual-PID control strategy is tuned and validated for pendulum stabilization with the linearized model. Next, both PID controllers are turned together and validated for simultaneous pendulum stabilizing and cart driving with the model developed in Section 8.3, with additional tuning of the dual-PID control gains for improved performance. Last, simulation studies are conducted for all three operational modes including pendulum stabilization, straight driving, and turning.
Section 8.6 conducts a model-based simulation utilizing the controller designed in Section 8.3. First, we investigate the LQR control strategy for state-feedback stabilization (factoring in the mini-Segway’s cart position and speed, and pendulum position and speed). Next, we study state-feedback with the cart speed’s integral tracking control. We factor in not only the mini-Segway’s cart position and speed, and pendulum position and speed states, but also the tracking error state calculated internally in the LQTI controller. Then, we investigate the model-based state-feedback LQTI controller from Section 8.3 in simulation with the nonlinear mini-Segway model from Section 8.1, with the Coulomb friction model added. For all simulation studies, the feedback controller is sampled at 100 Hz.
Section 8.7 uses experiments to validate the dual-PID mini-Segway control strategy. It discusses the mini-Segway system hardware architecture, along with the sensors and actuators used to respectively generate feedback signals and drive the mini-Segway. Then we introduce the dual-PID control software in MATLAB/Simulink, along with the wheel speed signal processing and motor driving software. Recall that we calculated the pendulum angle through sensor fusion by utilizing both accelerometer and rate-gyro signals from MPU 6050. We also calculated the wheel speed based upon the hall-effect sensors mounted on the wheel axes through two gearboxes. Next, we introduce the overall software architecture in Simulink. The Simulink model runs within the host computer. The Arduino MKR 1000 Wi-Fi microcontroller collects the sensor signals; it executes the motor drive commands on the mini-Segway. Here, communication between the host computer and the Arduino microcontroller is through the Wi-Fi at a frequency of 100 Hz. Last, we conduct an experiment of the mini-Segway to validate the dual-PID control strategy for both pendulum stabilization and driving.
Section 8.8 addresses two experimental studies of the model-based dual-loop control strategy. One uses a standard inner-loop zero-order sample and hold input. The other uses an outer-loop square-pulse sample and hold input [13], [31] along with the inner-loop controller. The inner-loop model-based continuous-time LQR control stabilizes the pendulum by optimizing LQR input weight \(R_c\) (with fixed state weight \(Q_c\)) to achieve the best performance experimentally. The outer-loop discrete-time state-feedback LQR controller is designed for the mini-Segway system. Its discrete-time LQR controller is based upon the discrete-time model with square-pulse sample and hold input.
Orienting Questions
- How do we model a mechatronic system step-by-step?
- How can two independent PID controllers in the dual-PID control strategy be used to control coupled mini-Segway pendulum position and cart speed dynamics?
- How do we design a model-based controller for a mechatronic system with tracking capability?
- How does special sample and hold input work with model-based controllers?
- How do we validate the model-based control strategy in an SiL environment?
- How can we implement the dual-PID mini-Segway control strategy in real-time Simulink?
This page titled 8.0: Prelude was last modified on Mon, 24 Aug 2026 20:26:02 GMT and is shared under a CC BY-NC 4.0 license and was authored, remixed, and/or curated by Guoming Zhu (Co-DREAM OER) .
The book could not be loaded just now.