Mechatronic System Modeling & Simulation

Chapter 8
Nonlinear, Linearized and Hybrid Systems

Bachelor Program in Mechatronics Engineering
Mechatronic System Modeling & Simulation   •   Bachelor

Nonlinear, Linearized and Hybrid Systems

Introduction

Most physical systems used in mechatronics are nonlinear, even when their operating range is narrow enough that a linear model is useful. A robotic joint may include gravity, friction, backlash, and actuator saturation; an autonomous vehicle may switch between driving modes; and a manufacturing cell may combine continuous motion with discrete logic. These systems are therefore best understood through three related modeling perspectives:

  • Nonlinear models, which represent the physical laws over a broad operating range.
  • Linearized models, which approximate nonlinear behavior near a selected equilibrium or operating point.
  • Hybrid models, which combine continuous-time dynamics with discrete states, events, and logic.

This chapter develops the mathematical foundations and engineering interpretation of these models. The emphasis is on equilibria, local stability, linearization, mode switching, event detection, finite-state behavior, and the practical construction of cyber-physical system models.

Learning Objectives

By the end of this chapter, the reader should be able to:

  1. Distinguish linear, nonlinear, continuous, discrete, and hybrid system behavior.
  2. Determine equilibria of nonlinear state-space models.
  3. Linearize a nonlinear model using Jacobian matrices.
  4. Interpret eigenvalues and local stability.
  5. Model saturation, dead zones, hysteresis, friction, and other nonlinearities.
  6. Formulate hybrid automata using modes, flows, guards, resets, and invariants.
  7. Analyze event-driven mode switching and finite-state control.
  8. Identify numerical, safety, and implementation issues in hybrid simulation.

1. Linear and Nonlinear State-Space Models

A continuous-time system is commonly represented in state-space form as

ẋ = f(x,u,t), y = h(x,u,t)

where x ∈ ℝⁿ is the state vector, u ∈ ℝᵐ is the input, y ∈ ℝᵖ is the output, and f and h are vector-valued functions. The state contains sufficient information, together with the future input, to determine future behavior.

The model is linear time-invariant (LTI) when

ẋ = Ax + Bu, y = Cx + Du

where A, B, C, and D are constant matrices of compatible dimensions. Linearity means superposition applies: if inputs produce responses, the response to a weighted sum of inputs is the same weighted sum of the individual responses.

A model is nonlinear if it contains terms such as x2, sin θ, x1x2, |x|, or nonlinear functions of the input. A pendulum illustrates the distinction:

Jθ̈ + bθ̇ + mgl sin θ = τ

Here, J is rotational inertia in kg·m², b is viscous damping in N·m·s/rad, m is mass in kg, g is gravitational acceleration in m/s², l is the center-of-mass distance in m, θ is angular displacement in rad, and τ is applied torque in N·m. The term sin θ makes the model nonlinear. Replacing sin θ by θ is valid only for small angles measured in radians.

With state variables x1 = θ and x2 = θ̇, the pendulum becomes

ẋ₁ = x₂
ẋ₂ = −(b/J)x₂ − (mgl/J)sin x₁ + τ/J

This form is suitable for equilibrium analysis, simulation, and linearization.

2. Equilibria and Operating Points

An equilibrium is a state at which the system remains constant when the input is held constant. For a constant input uₑ, an equilibrium xₑ satisfies

f(xₑ,uₑ) = 0

The corresponding output is ye = h(xe,ue). An equilibrium need not be the zero state. For example, a robot arm may have a nonzero equilibrium angle when a constant payload torque is applied.

Example: Equilibria of a damped pendulum

For zero input, τe = 0, the equilibrium conditions are

x₂ₑ = 0

and

sin x₁ₑ = 0

Thus, x₁ₑ = kπ for any integer k. In a physical pendulum, x₁ₑ = 2kπ corresponds to the downward position and x₁ₑ = (2k+1)π to the upright position. These equilibria have different stability properties.

For a constant torque, the equilibrium condition becomes

mgl sin θₑ = τₑ

A static equilibrium exists only when |τe| ≤ mgl, assuming the simple pendulum model and no other supporting torque. If the applied torque exceeds this limit, no static equilibrium exists.

3. Local Linearization

A nonlinear model can often be approximated by a linear model near an equilibrium. Define perturbation variables

δx = x − xₑ, δu = u − uₑ, δy = y − yₑ

Using a first-order Taylor expansion about (xₑ, uₑ), and using f(xe,ue)=0, gives

δẋ = Aδx + Bδu

and

δy = Cδx + Dδu

where

A = ∂f/∂x |_(xₑ,uₑ), B = ∂f/∂u |_(xₑ,uₑ)
C = ∂h/∂x |_(xₑ,uₑ), D = ∂h/∂u |_(xₑ,uₑ)

The matrices are Jacobians. The approximation is valid when perturbations are sufficiently small and the functions are differentiable near the operating point. It does not describe large excursions, switching, saturation, or behavior near nonsmooth points accurately.

Linearizing the pendulum

For the pendulum with input torque,

f(x,u) = [x₂; −(b/J)x₂ − (mgl/J)sin x₁ + τ/J]

The Jacobian with respect to the state is

A(x₁) = [0, 1; −(mgl/J)cos x₁, −b/J]

and

B = [0; 1/J]

At the downward equilibrium θe=0,

Ad = [0, 1; −mgl/J, −b/J]

At the upright equilibrium θe=π,

Au = [0, 1; +mgl/J, −b/J]

The sign reversal in the lower-left element explains why the two equilibria behave differently.

4. Local Stability and Eigenvalues

For the linear perturbation model δẋ=Aδx, solutions are governed by the eigenvalues of A. In continuous time:

  • All eigenvalues with negative real parts imply local asymptotic stability.
  • At least one eigenvalue with positive real part implies instability.
  • Eigenvalues on the imaginary axis require further analysis; linearization alone may be inconclusive.

For a second-order system

λ² + a₁λ + a₀ = 0

with real coefficients, asymptotic stability requires a1>0 and a0>0. This is a special second-order result, not a replacement for general eigenvalue analysis.

For the pendulum, the characteristic polynomial is

λ² + (b/J)λ + (mgl/J)cos θₑ = 0

At the downward position, cos θe=1, and positive inertia, damping, mass, length, and gravity produce a stable linearized model when b>0. At the upright position, cos θe=-1, so the constant term is negative and one eigenvalue is positive; the upright equilibrium is unstable.

Stability conclusions are local. A stable linearization does not guarantee global stability of the original nonlinear system. Conversely, a nonlinear system may have behavior outside the linear model’s region of validity, including limit cycles, multiple equilibria, or finite-time escape.

5. Important Nonlinearities in Mechatronics

5.1 Saturation

An actuator cannot produce unlimited force, torque, voltage, or speed. A symmetric saturation can be written as

sat(v) = { vmax, v > vmax; v, −vmax ≤ v ≤ vmax; −vmax, v < −vmax }

where v is the commanded quantity and vₘₐₓ is its limit. Saturation may cause tracking error, slower response, and integrator windup in controllers.

5.2 Dead zones

A dead zone produces no output for small inputs, as in valve stiction or motor drive thresholds. A symmetric dead-zone model is

dz(v) = { v−d, v>d; 0, |v|≤d; v+d, v<−d }

where d is the dead-zone width. Dead zones are continuous but not differentiable at their boundaries.

5.3 Coulomb and viscous friction

A simple friction model is

Ff = b v + Fc sign(v)

where b is the viscous coefficient, v is velocity, and F₍c₎ is Coulomb friction. The sign function is discontinuous at zero. Real mechanisms may also exhibit static friction, Stribeck effects, and stick–slip motion. A simulation must therefore specify how zero velocity is treated.

5.4 Hysteresis

Hysteresis means that output depends on the direction or history of input change. A thermostat, magnetic actuator, or relay controller may use two different switching thresholds. Hysteresis prevents rapid chattering when a measured signal contains noise.

5.5 Backlash and compliance

Gear backlash creates a region in which input motion produces little output motion until contact is re-established. Flexible shafts and belts introduce compliance, often adding states and resonant modes. These effects can be represented by piecewise models, complementarity conditions, or detailed mechanical contact models.

6. Hybrid Systems

A hybrid system combines continuous evolution with discrete changes. Typical examples include:

  • A robot that switches from free motion to contact mode.
  • An electric vehicle that changes between propulsion and regenerative braking.
  • A thermostat that turns heating on and off.
  • An automated production line controlled by finite-state logic.
  • An autonomous drone that changes between takeoff, flight, landing, and emergency modes.

A useful hybrid-system description contains:

  1. Modes or locations: discrete operating states.
  2. Continuous state: variables evolving within a mode.
  3. Flow dynamics: differential equations active in each mode.
  4. Guards: conditions that trigger transitions.
  5. Reset maps: changes to the continuous state at transitions.
  6. Invariants: conditions under which a mode may continue.
  7. Outputs and control laws: signals associated with each mode.

For mode q, a compact representation is

ẋ = fq(x,u), x ∈ Invq

A transition from mode q to mode r occurs when

x ∈ Gq→r

and the state after transition is

x⁺ = Rq→r(x⁻)

Here, G is the guard set, R is the reset map, and superscripts minus and plus denote values immediately before and after the event.

A transition may be autonomous, triggered by a state condition such as position reaching a limit, or controlled, triggered by a command or logic signal. Some transitions do not reset the continuous state; they only change the active equations or controller.

Hybrid automaton example: thermostat

Consider room temperature T and heater state q ∈ {OFF, ON}. A simplified thermal model is

C Ṫ = (Ta − T)/R + qP

where C is thermal capacitance in J/K, R is thermal resistance in K/W, Tₐ is ambient temperature in °C, P is heater power in W, and q is 1 when ON and 0 when OFF.

Use two thresholds, Tₗ and Tₕ, with Tₗ < Tₕ:

  • OFF → ON when T≤Tl.
  • ON → OFF when T≥Th.

The gap between thresholds is hysteresis. It prevents immediate repeated switching near one threshold. The continuous state does not jump, so the reset is T^+=T^-.

Hybrid thermostat automaton OFFq = 0 ONq = 1 T ≤ Tₗ T ≥ Tₕ C Ṫ = (Tₐ − T)/R + qP
Hybrid thermostat automaton with off and on modes
Figure: Hybrid thermostat automaton with off and on modes

Figure: A two-mode hybrid automaton for thermostat control.

7. Events, Logic, and Finite-State Machines

A finite-state machine (FSM) represents behavior using a finite set of states and transitions. Each transition is usually specified by an event and, optionally, a condition. An industrial pick-and-place mechanism might contain the states HOME, EXTEND, GRIP, RETRACT, and FAULT.

A robust FSM should specify:

  • Initial state.
  • Permitted transitions.
  • Entry and exit actions.
  • Sensor conditions and timeout rules.
  • Fault and recovery behavior.
  • Priority when multiple transitions are enabled.

In a hybrid controller, continuous variables may generate events. For example, a transition may occur when position reaches a limit switch, velocity changes sign, pressure exceeds a threshold, or a timer expires. The event detector must avoid missing crossings and should define behavior when several events occur at the same simulation instant.

Zeno behavior and chattering

A hybrid model exhibits Zeno behavior if infinitely many discrete transitions occur in a finite time. Idealized bouncing-contact models can show this mathematically. In implementation, rapid switching may instead appear as chattering caused by noise, numerical error, or inadequate hysteresis.

Common remedies include hysteresis, minimum dwell time, filtered measurements, transition priorities, or physically realistic compliance. These remedies must be used carefully: excessive filtering or delay can compromise safety and control performance.

8. Worked Example: Linearizing a Nonlinear Actuated System

Consider a one-degree-of-freedom mechanism with position x and velocity v:

ẋ = v
ṽ = −(k/m)x − (c/m)v − (α/m)x³ + u/m

Here, m is mass in kg, k is linear stiffness in N/m, c is damping in N·s/m, α is cubic stiffness in N/m³, and u is force in N. The cubic term makes the model nonlinear.

Assume a constant equilibrium with ve=0. The second equation gives

0 = −kxₑ − αxₑ³ + uₑ

Therefore,

uₑ = kxₑ + αxₑ³

The Jacobian matrices are

A(xₑ) = [0, 1; −(k+3αxₑ²)/m, −c/m]

and

B = [0; 1/m]

The local effective stiffness is keff=k+3αxe². Thus, even though the physical spring is nonlinear, its small-signal stiffness depends on the operating position. A controller tuned at one position may perform differently at another.

For example, let m = 2 kg, k = 100 N/m, c = 4 N·s/m, α = 20 N/m³, and xₑ = 0.5 m. Then

keff = 100 + 3(20)(0.5²) = 115 N/m

The linearized matrix is

A = [0, 1; −57.5, −2]

The characteristic polynomial is

λ² + 2λ + 57.5 = 0

Its roots are approximately λ=-1±j7.52 s⁻¹. The negative real part indicates locally asymptotically stable oscillatory behavior. The imaginary component indicates an approximate damped oscillation frequency of 7.52 rad/s, or about 1.20 Hz. This conclusion applies near x = 0.5 m, not necessarily for arbitrarily large displacement.

9. Simulation of Nonlinear and Hybrid Models

Continuous simulation typically integrates differential equations numerically. Explicit methods such as forward Euler use

xk+1 = xk + h f(xk,uk,tk)

where h is the time step in seconds. Euler integration is simple but may be inaccurate or unstable for stiff systems. Higher-order Runge–Kutta methods and variable-step solvers generally provide better accuracy.

Hybrid simulation requires more than ordinary time stepping. A reliable procedure is:

  1. Identify the active mode.
  2. Integrate its flow equations.
  3. Detect the earliest guard crossing.
  4. Stop integration at the event time.
  5. Apply the reset map and change mode.
  6. Reinitialize the solver and continue.

A solver that merely checks guards at widely separated time steps may miss short events or detect them late. This is especially dangerous for collision avoidance, overcurrent protection, and emergency shutdown systems.

Discrete controllers also introduce sampling. If a continuous plant is controlled every Tₛ seconds, the digital implementation may use a discrete approximation. Sampling, computation delay, quantization, and asynchronous communication can alter stability and event timing. A model should therefore distinguish physical time, controller update time, sensor time stamps, and network delays where these affect behavior.

10. Applied Case: Automated Conveyor Pick-and-Place Cell

Background

The following is an illustrative engineering case. A conveyor transports components to a robotic pick station. A two-axis actuator extends a gripper, closes it, retracts, and releases the part at an inspection location.

Problem

The cell must handle normal production, missing parts, actuator limits, and jam conditions. A purely continuous trajectory model cannot represent the operational logic, while a purely discrete FSM cannot predict motion, collision, or motor current.

Analysis

The continuous state may be

x = [p, v, i]

where p is actuator position in m, v is velocity in m/s, and i is motor current in A. In a motion mode, a simplified model is

mṽ = Kt i − b v − FL
L di/dt = V − Ri − Ke v

where m is reflected mass, Kₜ is torque or force constant, b is viscous friction, Fₗ is load force, L is motor inductance, V is applied voltage, R is resistance, and Kₑ is back-emf constant. Units must be selected consistently; for a translational actuator, force constants and reflected mass are used, whereas a rotary actuator requires torque and inertia.

The discrete modes are:

ModeContinuous behaviorTransition condition
HOMEMove toward home positionHome sensor active
EXTENDTrack pick positionPick position reached or timeout
GRIPClose gripperGrip force achieved or fault
RETRACTMove away from conveyorRetract position reached or timeout
RELEASEOpen gripperOpen sensor active
FAULTDisable driveReset command and safe conditions

Approach and solution

Each mode is assigned a controller and invariant. For example, EXTEND may require position limits and current below a safe threshold. A guard such as i≥imax causes a transition to FAULT. A timeout guard handles a broken position sensor. A part-present sensor is checked before EXTEND; if absent, the system returns to HOME or enters a waiting state.

Hysteresis is applied to analog current and force thresholds. The FSM gives FAULT priority over normal completion transitions. The drive is disabled through a safety-rated channel rather than only through ordinary software logic.

Outcome

The combined model can answer questions that neither submodel answers alone: whether the actuator reaches the target before timeout, whether current saturation prevents motion, whether a jam causes a safe transition, and whether the sequence can restart without losing synchronization.

Learning points

  1. Continuous dynamics predict physical feasibility.
  2. Discrete logic defines operational intent.
  3. Guards connect measured physical conditions to decisions.
  4. Fault modes must be explicitly modeled.
  5. Safety-related shutdown should not depend solely on a non-safety simulation or general-purpose program.

11. Design, Safety, and Governance Considerations

Hybrid models are powerful but can conceal unsafe assumptions. Engineers should document sensor failure assumptions, actuator limits, timing, communication delays, and the meaning of every guard. Safety analysis may use hazard and operability studies, fault-tree analysis, failure-mode analysis, or formal verification of selected properties.

A model should distinguish nominal behavior from fail-safe behavior. For example, “motor command equals zero” is not always equivalent to “motion stops,” because stored mechanical energy, gravity, or a failed brake may continue motion. Emergency stopping may require redundant sensing, energy isolation, mechanical braking, or a safety controller.

AI-based perception and decision systems add uncertainty rather than eliminating it. If an AI classifier determines whether an object is present, the hybrid controller should include confidence thresholds, missing-data behavior, and a safe fallback. Training data, bias, cybersecurity, traceability, and human oversight become engineering governance issues. An AI output should not be treated as a guaranteed truth merely because it is numerical.

12. Best Practices and Limitations

Recommended practices include:

  • Define states and units before writing equations.
  • Separate physical dynamics from control logic.
  • Compute equilibria before linearizing.
  • State the operating region of every linear model.
  • Use hysteresis or dwell-time rules when appropriate.
  • Specify event priority for simultaneous guards.
  • Test boundary cases, sensor faults, saturation, and communication loss.
  • Compare simulation with experimental data.
  • Use conservative assumptions for safety-critical behavior.
  • Record model versions, parameters, and calibration sources.

Important limitations include parameter uncertainty, unmodeled friction, delays, sensor noise, discontinuities, and numerical solver dependence. A mathematically elegant model may still be unsuitable if its parameters cannot be measured or if its event semantics are ambiguous. Validation should include both normal operation and abnormal scenarios.

Chapter Summary

Nonlinear state-space models describe physical behavior beyond the restricted assumptions of linear systems. Equilibria are found by solving f(xe,ue)=0, and local linearization is obtained from Jacobian matrices evaluated at an operating point. Eigenvalues of the linearized state matrix provide local stability information, but their conclusions are valid only near the selected equilibrium.

Mechatronic nonlinearities include saturation, dead zones, friction, backlash, compliance, and hysteresis. Hybrid systems extend continuous models with discrete modes, guards, reset maps, invariants, and event logic. Finite-state machines are especially useful for sequencing and fault handling, while continuous dynamics are necessary for predicting physical motion and feasibility. Reliable hybrid simulation requires accurate event detection and careful treatment of simultaneous transitions, chattering, and Zeno-like behavior. In professional practice, modeling must also address safety, uncertainty, validation, cybersecurity, and the limitations of AI-assisted decisions.

Key Terms

Equilibrium: A state that remains constant under a specified constant input.

Operating point: The state and input about which a model is analyzed or controlled.

Nonlinear system: A system for which superposition does not generally apply.

Linearization: A first-order local approximation of a nonlinear model.

Jacobian: Matrix of first partial derivatives of a vector-valued function.

Perturbation state: Deviation from an equilibrium or operating point.

Eigenvalue: A scalar characterizing modes of a linear system matrix.

Local stability: Stability for sufficiently small deviations from an equilibrium.

Saturation: Limitation of an actuator or signal to a finite range.

Dead zone: Input interval producing no output.

Hysteresis: Dependence of output on input history or direction of change.

Coulomb friction: Approximately constant-magnitude friction opposing motion.

Hybrid system: System combining continuous dynamics and discrete transitions.

Mode: A discrete operating condition with its own equations or controller.

Guard: Condition enabling a transition between modes.

Reset map: Rule defining the continuous state after a transition.

Invariant: Condition that must remain true while a mode is active.

Finite-state machine: Discrete model consisting of states, events, and transitions.

Zeno behavior: Infinitely many transitions occurring in finite time.

Chattering: Rapid repeated switching, often caused by noise or poor event design.

Review Questions

Short Answer Questions

  1. What equation defines an equilibrium of a nonlinear state-space model?
  2. Why is linearization considered a local approximation?
  3. What is the purpose of hysteresis in a switching controller?
  4. Define a guard and a reset map in a hybrid system.
  5. State the continuous-time eigenvalue condition for local asymptotic stability of a linearized model.

Long Answer Questions

  1. Derive the linearized model of a pendulum about both its downward and upright equilibria, and compare their stability.
  2. Explain how saturation, dead zones, friction, and backlash affect mechatronic control performance.
  3. Describe the components of a hybrid automaton and illustrate their roles using a thermostat.
  4. Explain why event detection is important in numerical simulation of hybrid systems.
  5. Discuss the limitations of using a linearized model for controller design over a large operating range.

Analytical / Application Questions

  1. For ẋ1=x2 and ẋ2=−4x1−2x2+u, determine the equilibrium for constant input uₑ and assess the stability of the zero-input equilibrium.
  2. Design a finite-state controller for an elevator door with OPEN, CLOSING, CLOSED, OPENING, and FAULT modes. Specify at least one guard, invariant, timeout, and safety transition for each relevant mode.
  3. A motorized actuator switches between position control and force control when contact is detected. Formulate the modes, continuous variables, switching guards, reset behavior, and one method for preventing rapid switching near contact.

Multiple Choice Questions with Answers

Question 1

For a nonlinear system ẋ = f(x,u), which condition defines an equilibrium under constant input uₑ?

A. f(xₑ,uₑ) = 0

B. xₑ = uₑ

C. f(xₑ,uₑ) = 1

D. ẋ = uₑ

Correct Answer: A. f(xₑ,uₑ) = 0

Question 2

The matrix A in a local linearization is obtained from which quantity?

A. The integral of the output

B. The Jacobian of f with respect to x

C. The determinant of the input matrix

D. The inverse of the equilibrium state

Correct Answer: B. The Jacobian of f with respect to x

Question 3

For a continuous-time linearized system, what generally indicates local asymptotic stability?

A. All eigenvalues have positive real parts

B. At least one eigenvalue is zero

C. All eigenvalues have negative real parts

D. The input is constant

Correct Answer: C. All eigenvalues have negative real parts

Question 4

Which feature is specifically used to reduce rapid switching around a threshold?

A. Higher actuator saturation

B. Hysteresis

C. Removing all guards

D. Increasing model nonlinearity

Correct Answer: B. Hysteresis

Question 5

In a hybrid automaton, what does a guard represent?

A. The continuous differential equation

B. A condition enabling a mode transition

C. The initial parameter estimate

D. The output scaling matrix

Correct Answer: B. A condition enabling a mode transition

Question 6

For the equation mẍ + cẋ + kx = 0 with m > 0, c > 0, and k > 0, what is the usual local stability conclusion?

A. Asymptotically stable

B. Unstable with one positive pole

C. Always marginally stable

D. No equilibrium exists

Correct Answer: A. Asymptotically stable

Question 7

What is the principal limitation of a linearized model?

A. It cannot represent any input

B. It is generally valid only near its operating point

C. It always requires discrete states

D. It cannot be simulated numerically

Correct Answer: B. It is generally valid only near its operating point

Question 8

In the worked nonlinear actuator example, with k = 100 N/m, α = 20 N/m³, and xₑ = 0.5 m, what is the effective stiffness k + 3αxₑ²?

A. 105 N/m

B. 110 N/m

C. 115 N/m

D. 130 N/m

Correct Answer: C. 115 N/m

Question 9

Which item specifies the continuous state immediately after a hybrid transition?

A. Invariant

B. Reset map

C. Eigenvalue

D. Sampling period

Correct Answer: B. Reset map

Question 10

What is Zeno behavior?

A. A continuous state that never changes

B. Infinite discrete transitions in finite time

C. A controller with no feedback

D. A stable equilibrium with zero input

Correct Answer: B. Infinite discrete transitions in finite time

Mechatronic System Modeling & Simulation
Chapter 8 of 15