0% found this document useful (0 votes)
15 views4 pages

FOMCON MATLAB Tutorial for FOPID Control

The document is a tutorial on model-based control design for fractional systems using the FOMCON toolbox in MATLAB. It outlines tasks such as identifying a fractional-order model, designing and validating controllers, and retuning existing PID controllers based on experimental data. Additionally, it provides guidance on implementing the controller in C/C++ and includes a code snippet for IIR filter implementation.

Uploaded by

vanhoan2402003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

FOMCON MATLAB Tutorial for FOPID Control

The document is a tutorial on model-based control design for fractional systems using the FOMCON toolbox in MATLAB. It outlines tasks such as identifying a fractional-order model, designing and validating controllers, and retuning existing PID controllers based on experimental data. Additionally, it provides guidance on implementing the controller in C/C++ and includes a code snippet for IIR filter implementation.

Uploaded by

vanhoan2402003
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Model based Control Design for Fractional Systems

with FOMCON Toolbox for MATLAB: A Tutorial

Aleksei Tepljakov

Files for the tutorial

Get the materials here: [Link] Also, download the FOMCON


toolbox from [Link] and add it to MATLAB
path. Type fomcon in MATLAB and if a UI appears then you should be good to go.

Problem statement

The task is to control the output y(t) of a certain “black box” system, which has the
following known characteristics:

• Control input signal range is u ∈ [−1, 1].

• Output range y ∈ [0, 2].

You are given two sets of experimental data (p_id_v1 and p_id_v2) which may be used
to identify a linear (fractional-order) dynamical model and validate it. Once you obtain
a suitable model, you must design a (FO)PID controller subject to the following design
specifications pertaining to the identified linear model:

• In the time domain: For reference yr = [0, 1]: Settling time τs 6 40 s, overshoot
ϑ 6 5%, error band ye = ±5%;

• In the frequency domain: Gain margin Gm > 15 dB, phase margin ϕ > 60◦ and
in addition, phase response at critical frequency ωc must be as flat as possible to
ensure robustness to gain variations.

Both overshoot and error band percentages are taken based on the set point value.
The given tasks must be solved by means of FOMCON toolbox for MATLAB. To
evaluate the performance of the control system, you are given a Simulink model which
contains the black box process model. The FOPID controller block uses a configuration
save file format from the FPID optimization tool. Finally, you are also encouraged
to try the FOPID controller-based retuning method for existing PID control loops. A
simulation model is provided for this purpose.

Tasks to be solved

The following list summarizes the tasks of the practical exercise.

1. Identify and validate a FO-FOPDT model using the given experimental data,
with or without the delay term e−Ls specified by the lag parameter L. Assess the
correctness of the identified model, analyze the identification results, and present
them graphically (you may use the figures generated by the model validation
function). Does the process, as seen from the experimental data and model
validation, possess distinct linear dynamics? Are there any noticeable nonlinear
effects?

2. Design a classical PI or PD or PID controller for the plant setting the design
specifications as required in the control problem. Then, design a FOPI or FOPD
or FOPID controller subject to the same specifications. Which type of (FO)PID
controller offers the best performance and satisfies all of the specifications? Provide
the final results of controller tuning in the time domain, and also the Bode diagram,
where the relevant frequency-domain specifications are highlighted. Do this for
both classical and fractional-order PID controllers. Compare the results. Hint:
To tune a classical controller using the FPID optimization tool set the values
of controller component orders λ = µ = 1 and choose “Fix exponents” from the
drop-down list in the FOPID parameter panel. Use the “Simulate only” checkbox
to obtain the time- and frequency-domain characteristics of the control system.

3. Save the controller configuration and validate the performance of the control system
using the supplied Simulink model object_control.mdl. Analyze the results of
controller validation. Are all the specifications in the time domain fulfilled? If
not, and if you cannot otherwise achieve the fulfillment of all specifications in
both time and frequency domains, which ones would you revise or relax (without
explicit knowledge of the process characteristics) and why?

4. Identify a higher-order fractional model using the same experimental data as before.
Use the pseudo-order ν = 3 for the fractional pole polynomial a(s) and choose a
suitable commensurate order q. Leave a single free term in the zero polynomial
b(s), e.g. start with b(s) = 1. Identify a model. Does it offer superior description
of the process dynamics than the FO-FOPDT model identified earlier? Can the
obtained model be simplified (e.g. the orders and/or coefficients truncated)? Hints:

• Use the “Generate initial guess model” panel in the identification tool.
• To get a commensurate-order model make sure that you are using the “Fix
exponents” identification method. You may try, for instance, the following
commensurate order values: q = {0.15, 0.25, 0.35}.

5. Retune the FOPID controller obtained earlier using the newly identified model.
Validate the controller by means of the Simulink model with the “real plant”. Does
the performance of the control system improve?

6. Once you are satisfied with the performance of the design FOPID controller,
implement it using the impid tool in MATLAB. Determine the approximation
parameters and discretization method that preserve critical frequency-domain
specifications of the controller. To obtain the second-order section coefficients, use
the d2sos() function. The coefficients are printed out in MATLAB console as
arrays in C language style.

7. Discover the benefits of the retuning approach by means of the included Simulink
model named object_retuning_control.mdl. Take note of the gains of the
original PID controller, and fill in all of the parameters of the CR3: FOPID + PID
retuning controller block. Launch the simulation and observe the performance of
the original control loop. Now, use the Enable retuning control switch to enable
the secondary retuning loop. Compare the results.

By completing this tutorial, you will have knowledge of how model based control design
works in the context of FOMCON toolbox for MATLAB. Also, you will be able to
implement the obtained controller in C/C++ or comparable computer language (e.g.,
Python) and run it on a hardware device or on an embedded system (note, however,
that proper signal scaling still needs to be implemented)1 .
Please send your questions, comments, and feedback related to this exercise and to the
FOMCON project to [Link]@[Link].
1
You can also consider the open source implementation of the FOPID controller that you can find
here: [Link]
A Code in C Language for IIR Filter Implementation

double Do_IIR_Filtering ( volatile double zCoeffArray [][3] ,


volatile double pCoeffArray [][2] ,
volatile double Kc ,
volatile double memArray [][2] , double input , uint8_t nsec )
{
// Assign local pointers
volatile double (* b )[3] = zCoeffArray ;
volatile double (* a )[2] = pCoeffArray ;
volatile double (* s )[2] = memArray ;

volatile double u_n , y_n ; // Local input / output

// Filter signal
u_n = Kc * input ;
for ( uint8_t m =0; m < nsec ; m ++)
{
y_n = b [ m ][0] * u_n + s [ m ][0];
s [ m ][0] = b [ m ][1] * u_n - a [ m ][0] * y_n + s [ m ][1];
s [ m ][1] = b [ m ][2] * u_n - a [ m ][1] * y_n ;
u_n = y_n ;
}
return u_n ; // Assign output
}

Fig. 1: Transposed direct form II structure of the biquad IIR filter

Common questions

Powered by AI

Improving control system performance with a retuned FOPID controller involves using the new model as a more accurate representation of the system dynamics. The retuning can adjust the controller parameters - such as proportional, integral, and derivative gains, as well as the orders λ and μ - to enhance system stability and responsiveness. Validation using a Simulink model with the real plant ensures that these adjustments yield improved performance. Observing primary metrics such as overshoot, settling time, and robustness to disturbances can confirm the efficacy of retuning .

The FOMCON toolbox for MATLAB facilitates the creation of fractionally controlled embedded systems by providing a comprehensive suite for model identification, controller design, and validation. With tools for fractional-order systems, it enables precise design processes, such as optimizing FOPID controllers, ensuring both time and frequency domain specifications are met. The toolbox's simulation models assist in real-time validation and optimization, while its capacity for exporting controller configurations into languages like C/C++ allows seamless integration into embedded systems. These capabilities provide a robust framework for deploying fractional-order control strategies on hardware platforms .

The retuning approach for FOPID controllers provides adaptive control tailored to new system dynamics or performance requirements, offering flexibility that traditional retuning methods lack. Specifically, it allows for continuous customization of fractional orders, which can enhance responses to non-linear behaviors and achieve desired performance metrics more effectively. This adaptability often results in improved robustness, quicker settling times, and reduced overshoot compared to traditional methods, by dynamically incorporating updated models and system feedbacks .

The fractional-order PID (FOPID) controllers can offer advantages over classical PID controllers in terms of flexibility and meeting specific design specifications. When designed using the same specifications, a FOPID may provide better performance by precisely tuning the controller's orders λ and μ, allowing more tailored control over system dynamics. Classical PID controllers can have limitations in achieving stability margins and handling non-linearities effectively. Depending on the design task, the FOPID controller may demonstrate superior tuning in both time and frequency domains, thus fully satisfying all specified metrics .

If initial controller designs fail to meet time-domain specifications, considerations for revising these specifications could include understanding the process dynamics and system constraints. For example, if the settling time or overshoot is difficult to meet without compromising stability or response, it might be appropriate to relax these criteria slightly. Modifying them requires a trade-off between fast response and acceptable stability margins. Without explicit knowledge of the process characteristics, adjustments should be made cautiously to avoid degrading system performance or causing unwanted oscillations .

The design specifications for a PID controller as stated require that in the time domain, the settling time τs should be less than or equal to 40 seconds, overshoot ϑ should be less than or equal to 5%, and the error band ye should be within ±5% of the set point value. In the frequency domain, the gain margin Gm must be greater than or equal to 15 dB, and the phase margin ϕ must be at least 60°. Additionally, the phase response at the critical frequency ωc should be flat to ensure robustness to gain variations .

To identify and validate a FO-FOPDT model using the FOMCON toolbox, you start by inputting the experimental data provided (p_id_v1 and p_id_v2). You can include or exclude the delay term specified by the lag parameter L. Use the model validation function to assess the accuracy of the identified model, which involves analyzing the graphical results generated by the tool. Determine whether the system dynamics appear linear based on both experimental data and model validation results, and check for any observable nonlinear effects. This iterative process is essential for ensuring an accurate model representation of the system's dynamics .

Designing a higher-order fractional model involves selecting a pseudo-order (e.g., ν = 3 for the fractional pole polynomial a(s)) and a suitable commensurate order q. A single free term in the zero polynomial b(s) is advisable, starting simply with b(s) = 1. Initial model guesses can be generated using the identifications tool's panel, ensuring the 'Fix exponents' method. Commensurate-order model values such as q = 0.15, 0.25, or 0.35 should be tried consecutively. The identified model should be checked for its dynamics description capabilities compared to prior models, and simplifications might be made by truncating orders or coefficients if they don't significantly affect performance .

The 'object_retuning_control.mdl' Simulink model helps in visualizing the effects of implementing the CR3: FOPID + PID retuning controller block by showing differences in system dynamics before and after retuning. Initially, it compares the original PID control loop's performance, evaluating parameters like response time and stability. Enabling the retuning control switch demonstrates the impact of integrating secondary retuning loops, manifesting as changes in overshoot, settling time, or robustness. This interactive model highlights how retuning can adapt control strategies to evolving specifications, better illustrating its practical benefits .

To implement a FOPID controller using the "impid" tool in MATLAB, one must first determine appropriate approximation parameters and discretization methods that maintain critical frequency-domain specifications, such as gain and phase margins. These parameters affect how well the discrete model approximates the continuous dynamics of the FOPID controller. Approaches such as using the d2sos() function can yield second-order section coefficients, essential for preserving the designed characteristics of the controller in digital applications. Managing these parameters ensures the FOPID controller maintains performance and robustness across different systems and conditions .

You might also like