Bachelor Program in Mechatronics Engineering
Engineering Mathematics III
•
Bachelor
Integrated Mechatronics Modeling Project
Introduction and context
A mechatronic system combines mechanical structure, actuators, sensors, power electronics, computation, control, communication, and human or environmental interaction. Its behavior cannot be understood adequately by studying any one subsystem in isolation. Engineering Mathematics III provides the mathematical language for integrating these domains into a model that can be simulated, tested, validated, and communicated.
An integrated model is more than a collection of equations. It is a structured representation of a real system, together with assumptions, parameters, inputs, outputs, initial conditions, numerical methods, validation evidence, and design decisions. A useful model must answer practical questions such as:
Will the actuator produce sufficient motion and force?
Is the system stable under the proposed controller?
How sensitive is performance to friction, payload, delay, or sensor noise?
Can a numerical simulation be trusted when an analytical solution is unavailable?
Which design choice provides an acceptable compromise between speed, energy, precision, and safety?
This chapter develops an end-to-end workflow using an illustrative smart-actuator system: a single-joint robotic arm driven by a permanent-magnet DC motor. The same workflow applies to mobile robots, autonomous vehicles, drones, digital twins, industrial manipulators, and electromechanical positioning systems.
Learning objectives
By the end of this chapter, the reader should be able to:
Define the boundary, purpose, inputs, outputs, and assumptions of a mechatronic model.
Derive coupled mechanical and electrical differential equations for a smart actuator.
Represent the model in state-space form and explain the meaning of each state.
Compare analytical and numerical solutions and select an appropriate numerical method.
Implement validation using independent calculations, physical measurements, and error metrics.
Use simulation results to justify actuator, controller, sampling, and operational decisions.
Communicate model limitations, uncertainty, safety implications, and reproducibility requirements.
1. From physical system to mathematical model
1.1 Model boundaries and purposes
The first modeling decision is the system boundary. A model of a motor may include only current and speed, whereas a model of a robotic joint may also include gear elasticity, link inertia, gravity, joint limits, encoder quantization, thermal behavior, and controller computation.
The model purpose determines the required detail. A low-order model is often appropriate for controller design, while a high-fidelity model is more appropriate for structural stress or thermal analysis. Adding detail is not automatically beneficial: poorly known parameters can make a complicated model less reliable than a simpler calibrated model.
A professional model specification should state:
Inputs: commanded voltage, reference position, load torque, or disturbance.
States: variables that describe the system's stored energy and evolve with time.
Outputs: measurable or decision-relevant quantities.
Parameters: mass, inertia, resistance, inductance, friction, and geometric dimensions.
Assumptions: for example, rigid links, constant motor parameters, or negligible backlash.
Validity range: operating temperatures, speeds, loads, and voltage limits.
1.2 Continuous-time and discrete-time descriptions
A continuous-time model describes variables as functions of time t. A general nonlinear state model is
where x is the state vector, u is the input vector, p is the parameter vector, and y is the output vector. The functions f and g describe state evolution and measurement generation. A model is linear if it can be written as
ẋ(t) = A x(t) + B u(t), y(t) = C x(t) + D u(t)
where A, B, C, and D are constant matrices of compatible dimensions.
A digital controller uses samples at times tₖ = kTₛ, where Tₛ is the sampling period. A discrete model can be written as
xₖ₊₁ = F xₖ + G uₖ, yₖ = C xₖ + D uₖ
For a zero-order-held input and a continuous linear model, the exact matrices are
F = e^(ATₛ), G = ∫₀Tₛ e^(Aτ)B dτ
The integral expression is general. The frequently used formula G = A-1(F-I)B applies only when A is invertible; it should not be used blindly when A is singular.
2. Deriving a coupled motor–joint model
Consider a motor connected through a rigid gear train to a robotic joint. Let θ be joint angle in radians, ω = dθ/dt joint angular velocity in rad/s, i armature current in amperes, and v applied armature voltage in volts. The motor has torque constant Kₜ in N·m/A and back-emf constant Kₑ in V·s/rad. In SI units, their numerical values are equal for an ideal motor, although their physical units differ.
Let J be the equivalent joint-side rotational inertia in kg·m², b viscous friction in N·m·s/rad, τₗ load torque in N·m, R armature resistance in Ω, and L armature inductance in H. A rigid-joint model is obtained from Newton's rotational law and Kirchhoff's voltage law.
2.1 Mechanical balance
The net torque equals inertia torque plus viscous-friction torque:
J dω/dt = Kₜ i − bω − τₗ
This equation assumes a rigid transmission, linear viscous friction, and no Coulomb friction or backlash. If gravity acts on a link, τₗ may include a position-dependent term such as mgl sin θ, where m is link mass, l is the distance from pivot to center of mass, and g is gravitational acceleration.
2.2 Electrical balance
The applied voltage is divided among resistance, inductance, and back emf:
v = L di/dt + Ri + Kₑω
The back emf is proportional to angular velocity. This relationship assumes the motor operates in its linear magnetic region and that temperature-dependent changes in R and magnetic saturation are negligible.
2.3 State-space form
Choose the state vector x = [θ, ω, i]ᵀ and input u = v, while initially treating τₗ as zero. Since dθ/dt = ω, the equations become
A = [[0, 1, 0], [0, −b/J, Kₜ/J], [0, −Kₑ/L, −R/L]], B = [[0], [0], [1/L]]
If position is measured, y = θ and C = [1 0 0], D = [0]. A load torque can be included as a second input with mechanical input vector B_τ = [0, −1/J, 0]T.
2.4 Transfer function as an alternative representation
For zero initial conditions and zero load torque, eliminating i gives the voltage-to-position transfer function
Θ(s)/V(s) = Kₜ / [s((Js + b)(Ls + R) + KₜKₑ)]
Here s is the Laplace variable. The factor s in the denominator arises because position is the integral of velocity. The transfer function is useful for frequency-domain analysis, but the state model is usually more convenient for simulation, nonlinear extensions, disturbance modeling, and state estimation.
3. Worked numerical model
Consider the following illustrative actuator parameters:
Quantity
Symbol
Value
Unit
Equivalent inertia
J
0.020
kg·m²
Viscous friction
b
0.10
N·m·s/rad
Torque constant
Kₜ
0.50
N·m/A
Back-emf constant
Kₑ
0.50
V·s/rad
Resistance
R
2.0
Ω
Inductance
L
0.50
H
For a 12 V step input, assume x(0) = 0. The state equations are
dθ/dt = ω dω/dt = −5ω + 25i di/dt = −ω − 4i + 2v
The coefficients have consistent units even though they are written compactly. For example, Kₜ/J = 0.50/0.020 = 25 s⁻²·A⁻¹ and 1/L = 2 A·V⁻¹·s⁻¹.
3.1 Steady-state calculation
At steady state, dω/dt = 0 and di/dt = 0. For a constant voltage and no load torque, the steady speed is found from
0 = Kₜi − bω 0 = v − Ri − Kₑω
The first equation gives i = bω/Kₜ. Substitution into the second gives
The corresponding current is iss = 0.10(13.33)/0.50 ≈ 2.67 A. This is a no-load mathematical prediction. Current limits, heating, saturation, and load torque may make it unattainable in practice.
3.2 Analytical response and its limitations
The electrical and mechanical transients are governed by the characteristic polynomial
The roots are approximately s₁ = −6.84 s⁻¹ and s₂ = −2.16 s⁻¹. Both poles are in the left half-plane, so the linear continuous model is asymptotically stable. The slower time scale is approximately 1/2.16 ≈ 0.46 s. An exact step response can be obtained by partial fractions, but its expression is less transparent than a numerical plot when nonlinearities, saturation, and sampled control are included.
4. Numerical simulation and comparison
4.1 Euler integration
For a general state equation ẋ = f(x,u,t), the explicit Euler method approximates the derivative over a step h as
xₖ₊₁ = xₖ + h f(xₖ, uₖ, tₖ)
The method is simple and useful for preliminary calculations, but it has first-order global error, meaning the accumulated error is generally proportional to h. It can become inaccurate or unstable when h is too large relative to the fastest system time scale.
For the actuator model with h = 0.01 s and v = 12 V, the initial derivative is
ẋ(0) = [0, 0, 24]ᵀ
Therefore, the first Euler estimate is θ₁ = 0 rad, ω₁ = 0 rad/s, and i₁ = 0.24 A. This illustrates an important physical feature: current begins to rise immediately, while speed and position initially remain zero.
4.2 Runge–Kutta method
The classical fourth-order Runge–Kutta method evaluates four slopes:
The method has fourth-order accuracy for sufficiently smooth solutions and is often a good default for nonstiff mechatronic models. Adaptive solvers vary h to control estimated local error. Stiff systems, in which fast electrical dynamics coexist with slow mechanical dynamics, may require implicit methods such as backward Euler or an implicit Runge–Kutta method.
4.3 Analytical–numerical comparison
Analytical solutions are valuable as benchmarks. A numerical implementation should be tested first on a simplified case for which an exact or independently computed solution exists. Comparison should use both graphical and numerical evidence. For a sampled output yₖ and reference y(tₖ), common measures are
RMSE = √[(1/N)∑ₖ₌₁ᴺ(yₖ − y(tₖ))²]
and
emax = maxₖ |yₖ − y(tₖ)|
RMSE has the same units as the output. These metrics are meaningful only when the sampling times, initial conditions, parameters, and input histories are identical.
Integrated mechatronics modeling workflow
Figure: Integrated mechatronics modeling workflow
Figure: An integrated workflow from physical system definition to validated engineering decisions.
5. Control, sampling, and operational decisions
A model becomes especially useful when connected to a controller. For position control, a proportional–derivative law may be written
u(t) = Kₚ(θref − θ) − Kdω
where Kₚ and K_d are controller gains and θ_ref is the desired position. In practice, the voltage command must be limited: u = sat(uraw, −Vmax, Vmax). Saturation changes the dynamics and must be included in simulation when large reference changes are possible.
Sampling must be fast enough to represent the relevant dynamics. A useful engineering guideline is to choose the sampling frequency substantially higher than the closed-loop bandwidth, often by a factor of 10 or more, although the final choice depends on delay, noise, computation, and hardware. The Nyquist condition requires the sampling frequency fₛ to exceed twice the highest frequency that must be represented, but satisfying Nyquist alone does not guarantee good control performance.
A design decision should therefore consider:
Decision
Model evidence
Practical constraint
Motor voltage
required acceleration and steady speed
supply and current limits
Controller gains
poles, settling time, overshoot
actuator saturation and noise
Sampling period
fastest relevant dynamics
processor and communication delay
Sensor selection
resolution and noise model
cost, calibration, safety
Gear ratio
torque-speed trade-off
backlash, efficiency, reflected inertia
6. Illustrative case study: a smart pick-and-place joint
Background
The following is an illustrative, fictional case based on a common industrial architecture. A one-degree-of-freedom robotic joint must move a 0.5 kg payload through 60° and settle within ±0.5° before releasing an object. The joint uses an encoder, a DC motor, a digital controller, and a 12 V power supply.
Problem
An initial design uses the actuator parameters listed earlier and a 100 Hz controller. Engineers need to determine whether the joint can meet the settling requirement without excessive current or oscillation. The model must include the commanded position, motor dynamics, sensor sampling, voltage saturation, and a representative load torque.
Analysis and approach
The team first validates the motor equations using the 12 V step response. The analytical poles predict stable behavior with a dominant time scale near 0.46 s. Euler simulation with a 0.01 s step is compared with a fourth-order Runge–Kutta solution using a 0.001 s step. The latter is treated as a numerical reference, not as absolute truth. A convergence test is performed by halving the step; if the output change is small relative to the engineering tolerance, the time step is considered adequate.
Next, a position controller is simulated with voltage saturation. The model records peak current, rise time, settling time, steady-state error, and energy. Electrical energy supplied over an interval is estimated by
Ee = ∫₀T v(t)i(t) dt
where Eₑ is in joules when v is in volts, i in amperes, and t in seconds. A load torque is introduced to test robustness. Encoder quantization and measurement noise are added only after the ideal closed-loop behavior is understood; otherwise, model errors and sensor effects are difficult to distinguish.
Outcome and design decision
The simulation indicates that the ideal linear model meets the position requirement, but voltage saturation causes a slower response for the full 60° move. The load case increases current and produces a small steady error when integral action is absent. The engineering decision is therefore to retain the motor, add a carefully limited integral term or feedforward gravity compensation, and verify thermal performance experimentally. The controller sampling rate is retained at 100 Hz because it is comfortably faster than the dominant mechanical response, but latency is measured rather than assumed.
The result is not a claim that simulation proves the design. It is a reasoned decision supported by a chain of evidence: equations, parameter sources, numerical convergence, measured step tests, and safety limits.
Learning points
A stable open-loop motor model does not guarantee a satisfactory closed-loop joint.
Saturation and load torque can dominate performance even when the linear model is accurate near an operating point.
Validation must compare like with like: the same input, initial state, units, and sampling convention.
Design recommendations should state uncertainty and identify the experiment needed to reduce it.
7. Validation, uncertainty, and reproducibility
Validation asks whether the model is adequate for a stated purpose. Verification asks whether the equations and code correctly implement the intended model. Both are necessary. A model can be correctly coded but physically inadequate, or physically appropriate but incorrectly coded.
A practical validation plan includes:
Dimensional checks: every term in an equation must have compatible units.
Limiting cases: setting friction, load, or inductance to zero should produce physically interpretable behavior where the assumptions permit it.
Conservation and balance checks: electrical power, mechanical power, losses, and stored energy should be plausible.
Convergence tests: reduce the numerical step and observe whether results converge.
Parameter identification: estimate uncertain parameters from measured voltage, current, speed, and position.
Hold-out tests: fit parameters using one experiment and test predictions on a different input.
Residual analysis: plot measured-minus-predicted errors against time, speed, and load.
Parameter uncertainty can be represented by intervals or probability distributions. If output z depends on parameters p₁, …, pₙ, a local first-order uncertainty estimate is
Var(z) ≈ ∑ᵢ∑ⱼ (∂z/∂pᵢ)(∂z/∂pⱼ) Cov(pᵢ,pⱼ)
This approximation assumes small uncertainties and a locally smooth model. Monte Carlo simulation is preferable when nonlinearities, limits, or non-Gaussian uncertainties are important.
Reproducibility requires versioned code, parameter files, units, initial conditions, solver settings, random seeds where applicable, and a record of hardware and firmware versions. A plot without these details is not a reproducible engineering result.
8. Limitations, ethics, and contemporary practice
Important neglected effects may include Coulomb friction, backlash, compliance, motor saturation, heating, battery voltage variation, communication delay, quantization, and structural vibration. A model should not be used outside its calibration range without explicit justification.
Safety is a modeling requirement, not an afterthought. A physical system may require current limits, emergency stops, safe torque-off, watchdog timers, collision detection, and fail-safe behavior. A simulation that omits faults can create unjustified confidence. For collaborative robots and autonomous platforms, risk assessment should consider foreseeable misuse and sensor failure.
AI and machine learning can assist parameter estimation, anomaly detection, surrogate modeling, and predictive maintenance. However, learned components require representative data, uncertainty assessment, drift monitoring, and a fallback strategy. A neural-network prediction should not silently replace a verified physical constraint when safety is involved. Hybrid digital twins, combining first-principles equations with data-driven correction terms, are increasingly useful, but their scope and update procedures must be documented.
Best practice is to maintain a hierarchy of models: a transparent low-order model for reasoning and control design, a validated simulation model for performance prediction, and a higher-fidelity model for specialized questions. The models should be connected by documented assumptions rather than treated as interchangeable.
Chapter Summary
Integrated mechatronics modeling links physical laws, state-space mathematics, numerical computation, control, sensing, and experimental evidence. A rigorous workflow begins by defining purpose and boundaries, then derives equations with explicit assumptions and units. The DC motor–robotic-joint example demonstrates mechanical and electrical coupling, state-space representation, steady-state analysis, pole interpretation, and transfer functions.
Analytical solutions provide valuable benchmarks, while Euler, Runge–Kutta, and adaptive methods support models that are nonlinear, sampled, saturated, or otherwise too complex for closed-form solutions. Numerical results must be checked through convergence, dimensional analysis, limiting cases, and comparison with measured data. Validation is purpose-dependent and must report uncertainty and limitations.
Finally, the model should support a defensible engineering decision: selecting hardware, controller gains, sampling rate, operating limits, or experiments. Safety, reproducibility, and responsible use of AI are integral parts of professional modeling.
Key Terms
State: A variable required to describe the system’s future evolution together with inputs and parameters.
State vector: An ordered vector containing all selected state variables.
Input: An externally supplied quantity that influences system behavior.
Output: A measured or decision-relevant system quantity.
Parameter: A relatively fixed quantity such as resistance, inertia, or friction coefficient.
State-space model: A first-order differential or difference equation representation using states and inputs.
Transfer function: A ratio of output to input transforms under zero initial conditions.
Back emf: Voltage generated by a motor that opposes the applied voltage and depends on speed.
Torque constant: Motor torque produced per unit armature current.
Viscous friction: Resistive torque proportional to angular velocity.
Steady state: Behavior reached when relevant state derivatives no longer change.
Numerical integration: Approximation of a differential equation using discrete time steps.
Convergence: Reduction of numerical error as computational resolution is refined.
Verification: Checking that implementation correctly represents the intended model.
Validation: Checking that the model adequately represents the real system for a purpose.
Residual: Difference between an observed value and a model prediction.
Digital twin: A computational representation linked to a physical asset through data and models.
Sensitivity: Dependence of an output on changes in parameters or inputs.
Saturation: A physical or computational limit restricting an actuator or signal.
Review Questions
Short Answer Questions
What factors determine the appropriate boundary and detail of a mechatronic model?
Define a state and explain why motor current is a state when inductance is nonzero.
State two differences between verification and validation.
Why can a stable motor model still fail to meet a closed-loop positioning requirement?
What information is needed to reproduce a numerical simulation reliably?
Long Answer Questions
Derive the state-space model of the DC motor–joint system using θ, ω, and i as states. Define every parameter and state the assumptions.
Explain how an analytical solution can be used to assess the quality of a numerical integration method.
Compare Euler and fourth-order Runge–Kutta integration in terms of accuracy, computational effort, and suitability for mechatronic systems.
Discuss how saturation, sensor noise, sampling, and communication delay affect a digital position-control model.
Develop a validation plan for a smart actuator, including experiments, error measures, convergence tests, and acceptance criteria.
Analytical / Application Questions
Using the parameter values in this chapter, calculate the no-load steady speed and current for a 6 V input. Explain whether the linear model alone is sufficient to guarantee that these values will occur in hardware.
A simulation uses a step size of 0.02 s and is then repeated with 0.01 s and 0.005 s. Describe how you would use the three results to judge numerical convergence and what you would do if the results differed substantially.
Design an experiment to determine whether an observed positioning error is caused primarily by incorrect friction modeling, encoder quantization, or controller saturation. Specify the measurements and comparisons required.
Multiple Choice Questions with Answers
Question 1
Which variable is a state in the motor model because it represents stored magnetic energy when inductance is nonzero?
A. Armature current
B. Applied voltage
C. Viscous friction coefficient
D. Reference position
Correct Answer: A. Armature current
Question 2
For the illustrative actuator with a 12 V input, the calculated no-load steady speed is approximately:
A. 2.67 rad/s
B. 6.00 rad/s
C. 13.33 rad/s
D. 24.00 rad/s
Correct Answer: C. 13.33 rad/s
Question 3
What is the principal advantage of a state-space model over a transfer function for an extended mechatronic simulation?
A. It eliminates the need for parameters
B. It naturally accommodates multiple states, inputs, and nonlinear extensions
C. It guarantees numerical stability
D. It applies only to steady-state systems
Correct Answer: B. It naturally accommodates multiple states, inputs, and nonlinear extensions
Question 4
The explicit Euler update for ẋ = f(x,u,t) is:
A. xₖ₊₁ = xₖ + h f(xₖ,uₖ,tₖ)
B. xₖ₊₁ = xₖ − h f(xₖ,uₖ,tₖ)
C. xₖ₊₁ = f(xₖ,uₖ,tₖ)/h
D. xₖ₊₁ = h xₖ + f(xₖ,uₖ,tₖ)
Correct Answer: A. xₖ₊₁ = xₖ + h f(xₖ,uₖ,tₖ)
Question 5
Which statement correctly distinguishes verification from validation?
A. Verification checks physical adequacy, while validation checks code syntax
B. Verification checks implementation against the intended model, while validation checks adequacy for the real purpose
C. They are identical terms
D. Validation is performed only before equations are derived
Correct Answer: B. Verification checks implementation against the intended model, while validation checks adequacy for the real purpose
Question 6
For the stated motor model, back emf is proportional to:
A. Angular position
B. Armature resistance
C. Angular velocity
D. Viscous friction
Correct Answer: C. Angular velocity
Question 7
If the simulation time step is reduced and the predicted output changes significantly, the most appropriate conclusion is that:
A. The model is automatically validated
B. The numerical result may not yet be converged
C. The physical system has zero inertia
D. The controller must be stable
Correct Answer: B. The numerical result may not yet be converged
Question 8
Which quantity has units of joules in the expression Ee = ∫v(t)i(t)dt?
A. Voltage
B. Current
C. Power
D. Electrical energy
Correct Answer: D. Electrical energy
Question 9
Why must actuator saturation be included in a realistic closed-loop simulation?
A. It changes the system behavior when commanded signals exceed physical limits
B. It removes all disturbances
C. It makes every system linear
D. It guarantees zero steady-state error
Correct Answer: A. It changes the system behavior when commanded signals exceed physical limits
Question 10
Which practice most directly supports reproducibility of a modeling result?
A. Reporting only a final graph
B. Changing solver settings between runs without recording them
C. Recording code, parameters, units, initial conditions, and solver settings
D. Omitting uncertain parameters
Correct Answer: C. Recording code, parameters, units, initial conditions, and solver settings