Internal Model Control and Model Error Compensator: From IMC to Add-On Robustness
This article provides a detailed comparison between Internal Model Control (IMC) and the Model Error Compensator (MEC), two control methods that share the same core principle — using the difference between a plant output and a model output as a feedback signal — but differ in their architecture and role within a control system. This article clarifies the structural relationship, the key similarities, and where the two methods diverge. The relationship to the Disturbance Observer (DOB) and GIMC is also discussed. Related articles, research papers, and MATLAB links are placed at the bottom.
Author: Hiroshi Okajima, Associate Professor, Kumamoto University, Japan — 20 years of control engineering research
For the comprehensive guide on MEC, see: Model Error Compensator (MEC): Enhance the Robustness of Existing Control Systems with Simple Compensation
- Internal Model Control and Model Error Compensator: From IMC to Add-On Robustness
- Why Compare IMC and MEC?
- Internal Model Control: Basic Structure
- Model Error Compensator: Basic Structure
- Structural Relationship: What IMC, MEC, and DOB Share
- Key Differences: Where IMC and MEC Diverge
- Comparison Table
- When to Use Which?
- Historical Connection: From 2-DOF IMC to MEC
- Connections to Related Research
- MATLAB Code
- Related Articles and Videos
- Key References
- InternalModelControl #IMC #ModelErrorCompensator #MEC #RobustControl #ControlEngineering #ModelBasedControl #PIDtuning #DisturbanceObserver #2DOFControl #GIMC #FeedbackLinearization #MATLAB
Why Compare IMC and MEC?
Internal Model Control (IMC) is one of the most well-known model-based control strategies, originating from the work of Garcia and Morari (1982) and extensively developed in the textbook by Morari and Zafiriou (1989). The IMC framework provides a transparent design procedure that directly relates controller tuning to the process model, and its connection to PID tuning has made it widely adopted in the process industry.
The Model Error Compensator (MEC), developed by Okajima et al. (2013), addresses a similar problem — making the controlled system robust against model uncertainty — but takes a fundamentally different architectural approach. While IMC integrates the model into the controller structure, MEC adds a compensator to an existing control system to suppress the effect of model errors.
Despite this architectural difference, the two methods share a deep structural connection: both place the nominal model inside the feedback loop and use the difference between the actual plant output and the nominal model output as a key feedback signal. In fact, the foundational JCMSI 2013 paper on MEC explicitly describes the MEC structure as an "internal model type compensator structure." Understanding this connection — and where the two methods diverge — helps practitioners choose the right approach and appreciate how MEC extends the ideas behind IMC to a broader class of problems.
Internal Model Control: Basic Structure
The IMC Architecture
The IMC structure, proposed by Morari, consists of the following components:
- The actual plant
- A nominal model
of the plant (the "internal model")
- An IMC controller
for shaping the transient response
The IMC controller and the model
are combined into a single controller unit (denoted
in the original literature). The model
is placed in parallel with the actual plant
inside the feedback loop. The model error signal — the difference between the actual output
and the model output
— is fed back to the controller.
Important: The IMC structure itself does not use the inverse model . The model
appears directly (not inverted) in the IMC architecture. This is a key distinction from the Disturbance Observer (DOB), which requires the inverse model in its compensator structure.
The closed-loop input-output relationship and disturbance response of IMC are given by:
When the model is perfect () and no disturbance exists (
):
By choosing , any desired input-output transfer function
can be realized, just as in feedforward control. However, unlike feedforward control, IMC also feeds back the model error and disturbance, providing robustness against model uncertainty and disturbance rejection.
IMC Design Procedure
The standard IMC design chooses the controller to achieve a desired closed-loop transfer function
. In the simplest case:
For this to be realizable, must be stable and proper. When
has non-minimum-phase zeros,
must also contain those zeros (so that the unstable poles in
are canceled). Additionally, a low-pass filter is typically introduced to ensure robustness against high-frequency model uncertainty.
Key Properties of IMC
- Perfect model → ideal response: When
and
, the output exactly equals
.
- Feedback of model error: Differences between
and
, and external disturbances, are automatically fed back for correction.
- Equivalence with Smith Predictor: When
includes time delays, IMC and the Smith Predictor are structurally equivalent.
- Standard IMC assumes stable plants: The basic IMC requires
and
to be stable. For unstable plants, extensions such as 2-DOF structures are needed.
GIMC: Generalized Internal Model Control
IMC was extended to a 2-DOF structure known as GIMC (Generalized IMC) by Zhou and Ren (2001). In GIMC, the disturbance rejection performance can be tuned independently from the reference tracking performance, providing greater design flexibility than standard IMC. This 2-DOF extension addresses one of the key limitations of basic IMC, where performance and robustness are coupled through a single filter parameter. GIMC has been applied to magnetic levitation systems and fault-tolerant control.
It is also worth noting that IMC, MEC, and DOB can all be understood within the broader framework of 2-DOF control. The relationship between MEC and 2-DOF conditional feedback structures is discussed in a separate article (planned).
Model Error Compensator: Basic Structure
The MEC Architecture
The MEC has a fundamentally different role from IMC. Instead of being the controller, MEC is an add-on compensator that wraps around the existing plant to make the effective plant dynamics closer to the nominal model. The existing controller is left unchanged.
The MEC structure consists of:
- The actual plant
- A nominal model
- An error compensator
- An existing controller (designed for
)
The compensated control input is formed by adding the output of the error compensator to the original control input
:
where is the output of the nominal model
driven by the same compensated input
. The signal
is the model error signal — the same type of signal used in IMC. The error compensator
feeds this signal back with high gain to drive the plant output toward the model output.
Key feature: Like IMC, the MEC structure does not use the inverse model . Both IMC and MEC place
directly (not inverted) inside the feedback loop. This is in contrast to the DOB, which requires the inverse model.
Design of the Error Compensator
In the foundational JCMSI 2013 paper, the design of the error compensator is formulated as an
control problem. The evaluation function is:
where is a frequency weighting function and
represents the model uncertainty. For constant disturbance rejection and zero steady-state error,
as
, which requires an integrator in
.
For the simplest case (SISO, minimum phase, relative degree 1), the error compensator can be a high-gain PI controller applied to the model error signal. As the gain of
increases, the effective plant dynamics converges to
.
Key Properties of MEC
- Add-on structure: The existing controller is not modified.
- No inverse model required: The compensator
operates on the output error directly.
- High-gain feedback principle: The model error is suppressed by high-gain feedback.
- Applicable to non-minimum phase and nonlinear systems: No model factorization or inversion is needed.
Structural Relationship: What IMC, MEC, and DOB Share
The Common Principle: Model Error Signal
IMC, MEC, and DOB all use the difference between the actual plant output and the nominal model output as a feedback signal. This model error signal captures the discrepancy due to model uncertainty, parameter variations, and external disturbances. The three methods differ in how they process this signal:
- IMC: The model error signal modifies the reference input to the IMC controller
. The controller and the model-based compensation are integrated into a single unit
.
- MEC: The model error signal is fed back through the error compensator
to correct the control input. The existing controller is separate and unchanged.
- DOB: The model error signal is processed through the inverse model
and a low-pass filter to estimate an equivalent disturbance, which is then subtracted from the input.
IMC and DOB: Similar Goal, Different Structure
IMC and DOB have similar feedback structures, but the DOB uses the inverse model in its compensator, while IMC does not. Specifically:
- In IMC, the feedback signal is
(model error), and the controller
processes this signal directly.
- In DOB, the feedback signal involves
(inverse-model-based equivalent disturbance estimation), and a filter
with
is used.
When constructing the inverse model is difficult (e.g., for non-minimum-phase systems), the DOB requires a filter designed to approximate the inverse at low frequencies. This is a structural limitation that neither IMC nor MEC shares.
MEC and IMC: Same Signal, Different Architecture
Both IMC and MEC use the model error signal without requiring the inverse model. The foundational JCMSI 2013 paper explicitly calls the MEC structure an "internal model type compensator structure." However, IMC integrates the model-based compensation into the controller design, while MEC separates it as an independent add-on.
For a detailed comparison between MEC and DOB, see: Model Error Compensator vs Disturbance Observer: A Structural Comparison
Key Differences: Where IMC and MEC Diverge
Despite sharing the model error signal and both avoiding the inverse model, IMC and MEC differ in several fundamental ways.
1. Role in the Control System
IMC is the controller itself. The IMC controller (combined with the internal model
) determines the closed-loop transfer function. There is no separate "existing controller" — IMC replaces it.
MEC is an add-on compensator. It does not replace or modify the existing controller. The existing controller determines the control performance (tracking, regulation), while MEC handles the robustness. This separation — performance by the controller, robustness by MEC — is a central feature.
This distinction has a practical consequence: MEC can be attached to any existing control system (PID, state feedback, MPC, feedback linearization, etc.) without redesigning the controller. IMC requires designing the controller from scratch within the IMC framework.
2. Stability Requirements
Basic IMC requires both the plant and the model
to be stable. For unstable plants, extensions such as GIMC or the 2-DOF conditional feedback structure are needed.
MEC can handle unstable plants directly, because the existing feedback controller stabilizes the plant, and MEC operates as an add-on within the stabilized loop.
3. Non-Minimum Phase Systems
When the plant has non-minimum-phase zeros, the IMC controller design requires to contain the same zeros as
, which limits the achievable performance. The desired transfer function cannot be chosen freely.
MEC addresses non-minimum-phase systems through the parallel feedforward compensator (PFC) extension, without requiring model factorization or constraining the desired transfer function.
4. Nonlinear Systems
IMC is formulated within a transfer function framework and is difficult to extend directly to nonlinear systems. MEC, on the other hand, has been extended to nonlinear systems through robust feedback linearization. For details, see: MEC for Nonlinear Systems: Robust Feedback Linearization
5. Design Philosophy
IMC follows a unified design philosophy: the controller is designed together with the model-based compensation. The performance-robustness trade-off is managed by a single filter parameter.
MEC follows a separation design philosophy: performance is handled by the existing controller, and robustness is handled by the error compensator. This allows independent tuning — a high-performance nominal controller can be designed first, and then MEC can be added to ensure robustness without degrading the nominal performance.
Comparison Table
| Aspect | IMC | MEC |
|---|---|---|
| Core signal | Model error |
Model error |
| Role | Controller (replaces existing) | Add-on compensator (preserves existing) |
| Inverse model | Not required in structure | Not required |
| Inverse model in design | |
Not required |
| Stability requirement | |
Unstable plants handled via existing controller |
| Performance-robustness | Coupled (single parameter) | Separated (controller vs. compensator) |
| Non-minimum phase | |
PFC extension, no factorization |
| Nonlinear systems | Difficult | Applicable (details) |
| Equivalent to PID | Yes, for simple models | Can be combined with PID |
| Origin | Garcia and Morari (1982) | Okajima, Umei, Matsunaga, Asai (2013) |
When to Use Which?
Use IMC when:
- The system is a stable, linear process (typical in process control)
- You are designing the controller from scratch (no pre-existing controller to preserve)
- You want a transparent PID tuning rule derived from the process model
- The plant includes time delays (IMC-Smith Predictor equivalence applies)
Use MEC when:
- An existing controller is already in place and should not be modified
- The system is non-minimum phase, nonlinear, or unstable
- You want to separate performance design from robustness design
- The system involves multiple control methods (PID, MPC, state feedback) that should each retain their original design
- You want a general-purpose add-on that can be applied across different control systems
Practical recommendation:
For practitioners who have an existing control system that works well under nominal conditions but degrades under model uncertainty or parameter variations, MEC provides a direct solution: add MEC without touching the existing controller. For new control system designs where no controller exists yet, IMC provides an elegant starting point, particularly for SISO stable processes.
Historical Connection: From 2-DOF IMC to MEC
The connection between IMC and MEC is not only structural but also historical. The author's earlier work on 2-DOF Internal Model Control with dynamic quantizers (Okajima et al., JCMSI, 2011) used the IMC framework extended with two degrees of freedom. The development of MEC (JCMSI, 2013) can be viewed as an evolution from this 2-DOF IMC work, where the model-based compensation was separated from the controller design and reformulated as an independent add-on structure.
This evolution reflects a broader insight: while IMC couples the controller and the model-based compensation into a single entity, many practical situations benefit from decoupling them. MEC achieves this decoupling while retaining the core principle of using the model error signal for compensation.
Connections to Related Research
Control Using the Signal Difference Between a Model and the Actual Plant — H. Okajima and N. Matsunaga, Systems, Control and Information (ISCIE), Vol. 60, No. 2, pp. 60–65 (2016). A Japanese-language overview that comprehensively discusses IMC, 2-DOF conditional feedback, DOB, MEC, and their structural relationships. This article is largely based on this overview paper.
MEC: The Foundational Paper — H. Okajima, H. Umei, N. Matsunaga and T. Asai, A Design Method of Compensator to Minimize Model Error, SICE Journal of Control, Measurement, and System Integration, Vol. 6, No. 4, pp. 267–275 (2013). The original paper proposing the MEC structure, describing it as an "internal model type compensator structure."
IFAC 2023 Overview — H. Okajima, Model Error Compensator for adding Robustness toward Existing Control Systems, IFAC PapersOnLine, Vol. 56, Issue 2, pp. 3998–4005 (2023). A comprehensive English-language overview of MEC, including comparisons with existing model-based compensation methods.
MEC vs Disturbance Observer — For a detailed comparison between MEC and DOB, see: Model Error Compensator vs Disturbance Observer: A Structural Comparison
MEC for Non-Minimum Phase Systems — MEC for Non-Minimum Phase Systems: PFC Approach. Extends MEC to systems where IMC's factorization-based controller design faces fundamental limitations.
MEC for Nonlinear Systems — MEC for Nonlinear Systems: Robust Feedback Linearization. Extends MEC to nonlinear systems via output-feedback linearization using the model error signal.
MEC + PID Control — MEC + PID Control: Adding Robustness to the Most Widely Used Controller. A practical demonstration of MEC's add-on philosophy: enhancing an existing PID controller without modifying it.
MATLAB Code
- GitHub (MEC with LMI/PSO design): Robust-control-MATLAB_MEC01
- GitHub (MEC with PFC): MATLAB_MEC03_withPFC
- GitHub (Nonlinear control with MEC): non_linear_control_MATLAB_MEC04
- GitHub (MEC + PID): MEC05-rengo2022
Related Articles and Videos
Blog Articles (blog.control-theory.com)
- Model Error Compensator (MEC): Comprehensive Guide
- MEC vs Disturbance Observer: A Structural Comparison
- MEC + PID Control: Adding Robustness
- MEC for Non-Minimum Phase Systems: PFC Approach
- MEC for Nonlinear Systems: Robust Feedback Linearization
- A Design Method of Compensator to Minimize Model Error (JCMSI 2013)
- MEC with Parallel Feed-Forward Filter (JCMSI 2017)
- MEC Design for Polytopic Uncertainty (JCMSI 2021)
- MEC for Non-Min Phase with Polytopic Uncertainties (JCMSI 2022)
- System Identification: From Data to Dynamical Models
- Linear Matrix Inequalities (LMIs) and Controller Design
Research Web Pages (www.control-theory.com)
Video
Key References
- C.E. Garcia and M. Morari, "Internal Model Control. 1. A Unifying Review and Some New Results," Ind. Eng. Chem. Process Des. Dev., Vol. 21, pp. 308–323, 1982.
- Morari and E. Zafiriou, Robust Process Control, Prentice Hall, 1989.
- D.E. Rivera, M. Morari, and S. Skogestad, "Internal Model Control. 4. PID Controller Design," Ind. Eng. Chem. Process Des. Dev., Vol. 25, pp. 252–265, 1986.
- Zhou and Z. Ren, "A New Controller Architecture for High Performance, Robust, and Fault-Tolerant Control," IEEE Trans. Automatic Control, Vol. 46, No. 10, pp. 1613–1618, 2001.
- Okajima, H. Umei, N. Matsunaga, and T. Asai, "A Design Method of Compensator to Minimize Model Error," SICE JCMSI, Vol. 6, No. 4, pp. 267–275, 2013.
Self-Introduction
Hiroshi Okajima — Associate Professor, Graduate School of Science and Technology, Kumamoto University. Member of SICE, ISCIE, and IEEE.
If you found this article helpful, please consider bookmarking or sharing it.