MATLAB & Simulink


Applying Control Design with Matlab, Simulink,Stateflow and Simulink Coder

Course Highlights

This is a comprehensive course that demonstrates effective techniques for improving efficiency in the use of MATLAB and SIMULINK for modeling and simulation Control Systems with Control System Toolbox and SIMULINK Control Design. It elaborates ways to linearize a model and develop control laws using a variety of design methodologies. It explores Stateflow in implementing complex decision flows and finite-state machines to model and simulate event driven and logic systems. It introduces the automatic code generation with Simulink Coder for real-time application development. Topics include:

  • Control system design overview

  • System modeling

  • System analysis

  • Control design

  • Controller implementation.

  • Simulation Speedup with Code Generation

  • Parameter tuning with external mode

  • Code Generation

  • In-the-Loop Verification

  • Code execution profiling

  • Flow graphs

  • State machines

  • Hierarchical state machines

  • Parallel state chart



Upcoming Program

xilinx ATP 黑.png

Techsource Systems is
Mathworks Sole and Authorised Distributor and Training Partner

Course Objectives

The aim of the course is to provide general knowledge for participants to use MATLAB and SIMULINK control system design tools to accelerate the design process for closed-loop control system, Stateflow to implement complex decision flows and finite-state machines, and Simulink Coder for real-time application development.

Who Must Attend

Engineer, researchers, scientists, and managers who are involved in control engineering design and problem solving. It is also strongly recommended for those who would like to establish and strengthen their foundation in Control Engineering, MATLAB and SIMULINK.

Course Benefits

Upon the completion of the course, the participants will gain a comprehensive understanding on utilizing the Control System Toolbox and SIMULINK Control Design to design and develop control system using a variety of design methodologies. The participants will be able to implement complex decision flows with Stateflow, and develop real-time application with Simulink Coder. 


Course Outline

Attended basic training for MATLAB and SIMULINK, and an understanding of terminology and concepts related to common control systems.

Day 1 of 4

Control System Design Overview


Objective: Provide an overview of the control system design process and introduce how MATLAB and Simulink fit into that process. The details of each step in the design process are covered in later chapters.

  • Defining a control design workflow

  • Linearizing a model

  • Finding system characteristics

  • Setting controller requirements

  • Tuning a controllers

  • Testing the controllers


Model Representations


Objective: Discuss the various formats used for representing system models. Also highlights the pros and cons of each format.

  • Model representations overview

  • LTI objects

  • Simulink models


System Identification


Objective: Illustrate how to estimate system models based on measured data.

  • System identification overview

  • Data importing and preprocessing

  • Model estimation

  • Model validation


Parameter Estimation


Objective: Use measured data to estimate the values of a Simulink model's parameters.

  • Parameter estimation overview

  • Model preparation

  • Estimation process

  • Parameter estimation tips


System Analysis


Objective: Outline the different analysis tools and functions available for understanding system behavior - such as system resonances, transient response, etc.

  • System analysis functions

  • Linear System Analyzer

  • DC motor analysis

  • Automation of analysis tasks

  • Open loop analysis

Day 2 of 4



Objective: Discuss techniques for linearizing a Simulink model and validating the linearization results.

  • Linearization workflow

  • Operating points

  • Linearization functions

  • Frequency response estimation


PID Control in Simulink


Objective: Use Simulink to model and tune PID controllers.

  • PID Workflow

  • Model setup

  • PID Controller block

  • Automatic tuning

  • Additional PID features


Classical Control Design


Objective: Use classical control design techniques to develop system controllers. Common control techniques are covered, such as PID and Lead/Lag controllers.

  • Open-loop tuning

  • Closed-loop analysis

  • PID control

  • Lead-Lag control


Response Optimization


Objective: Use optimization techniques to tune model parameters based on design requirements and parameters uncertainty.

  • Optimizing model response

  • Performing sensitivity analysis

  • Optimizing with parameter uncertainty


Controller Implementation


Objective: Discuss steps that might be needed to effectively implement a controller on a real system.

  • Identifying physical and practical limitations of controllers

  • Discretizing a controller

  • Preparing a controller for code generation

  • Converting to fixed-point data types

Day 3 of 4

Modeling Flow Graphs


Objective: Implement decision flows with flow graphs.

  • Junctions and transitions

  • Flow graph behavior

  • Stateflow interface

  • Conditions and condition actions

  • Chart data

  • Common patterns


Modeling State Machines


Objective: Implement state machines with state transition diagrams.

  • State machine behavior

  • State and transition actions

  • Chart initialization

  • Action execution order

  • Flow graphs within states


Hierarchical State Machines


Objective: Implement hierarchical diagrams to improve the clarity of state machine designs.

  • Superstates and substates

  • State data

  • History junction

  • Transition priority

  • Action execution order


Parallel State Diagrams


Objective: Implement parallel states to model multiprocessing designs.

  • Benefits of parallel states

  • Chart/state decomposition

  • Parallel state behavior

Day 4 of 4

Simulation Speedup with Code Generation


Objective: Speedup the simulation of your Simulink models and perform Monte Carlo simulations using the code generation features in SIMULINK.

  • Normal simulation mode

  • Accelerator mode

  • Rapid Accelerator mode

  • Standalone rapid simulation (Rsim)

  • Simulation speed comparison and tradeoffs

  • Monte Carlo simulation with Rsim target


Parameter Tuning with External Mode


Objective: Tune parameters in the embedded application using the External mode feature in Embedded Coder.

  • External mode workflow

  • Parameter tuning in External mode

  • External mode considerations


Code Generation


Objective: Generate code for algorithm implementation and integrate the code with execution harness or legacy code.

  • Generating Generic Real-Time (GRT) code from a model

  • Verifying GRT code

  • Generating Embedded Real-Time (ERT) target from a model

  • ERT code modules and entry points

  • Calling model entry points

  • Integrating external code


In-the-Loop Verification


Objective: Verify generated code using Simulink Coder and Embedded Coder.

  • Generating an S-function from a subsystem

  • Software-in-the-loop (SIL) verification

  • Processor-in-the-loop (PIL) verification

  • Verifying a subsystem using SIL and PIL

  • Verifying an entire model using SIL and PIL

  • Legacy code and verification


Code Execution Profiling


Objective: Profile execution times in generated code using Embedded Coder.

  • Code execution profiling for a subsystem

  • Selective profiling

  • Code execution profiling for an entire model

  • Applications of code execution profiling