Teaching Intelligent Control Systems with MATLAB and Simulink
Overview
Intelligent control systems, integrating both classical and contemporary methodologies, are pivotal in managing complex systems that exceed the capabilities of traditional control mechanisms. Utilizing adaptive, and learning capabilities —often by employing artificial intelligence algorithms—these systems address intricate challenges effectively. This session will highlight an innovative engineering course designed to embed intelligent control principles within the curriculum, utilizing state-of-the-art MATLAB® and Simulink® tools.
The course aims to enrich the educational experience by providing students with a robust understanding of intelligent control systems, proficiency in modern technological trends for control system design and modeling, and advanced analytical tools for practical applications. By emphasizing project-based learning and hands-on activities, the course aims to enhance essential engineering skills such as analytical thinking, problem-solving, and independent learning, thus preparing students for both academic and industrial careers.
The course employs MATLAB Live Scripts for interactive learning, Simulink for dynamic modeling and simulation, MATLAB® Onramps for self-paced online training, and MATLAB® Grader™ for auto-grading student work. Additionally, it utilizes interoperability between MATLAB and Python and includes low-cost hardware experiments enabling students apply theoretical knowledge to real-life projects. The positive outcomes and student feedback underscore the effectiveness of this educational approach in equipping future engineers with the necessary skills and knowledge.
Highlights
- Innovative engineering education strategies: Teaching AI + X with MATLAB and Simulink
- Ease to use and ease to access tools for teaching purposes (MATLAB Apps, MATLAB Online, low-cost hardware connectivity)
- Project based learnings with MATLAB and Simulink Project Challenge
- Interoperability with Python and low-cost hardware
- Enhance Knowledge Transfer with Self-Paced Online Training
- Automated assessment with MATLAB Grader
About the Presenter
Claudia Fernanda Yasar is an assistant professor at Yildiz Technical University, Istanbul. She graduated in electrical engineer from Universidad Tecnológica de Pereira, and she has worked on safety systems for intelligent buildings and taught in Colombia before to move to Europe. She holds an International Doctorate in Mechatronics from Castila-La Mancha University, where she was honored with Cum Laude and "The Best Spanish PhD Thesis Award 2017." Her research focuses on mechatronics, robotics, and control systems, with numerous publications and contributions to international and Turkish conferences.
Recorded: 30 Jan 2025
Hello. Welcome to our presentation integrating intelligent control systems into engineering education with MATLAB and Simulink. My name is Claudia Fernanda Yasar. I am an assistant Professor at Yildiz Technical University, Control and Automation Engineering Department in Istanbul, Turkey. I hold a PhD in mechatronics from Castilla-La Mancha University. Today, we are going to speak and give some examples projects of a course in intelligent control at our department.
First of all, I would like to introduce my team. This project has been done with the help of my master's students at the control automation engineering department, Mohamed, Abderraouf, and Ahmad.
I would like to take you for a short trip in our faculty. Here we are in our lab. We have a real time project and applications. We focus on real time projects and applications. We are doing many of these platforms in our lab with our students. We have drones, industrial applications. We have climbing robotics. Many of these systems have been programmed partially or fully with MATLAB and Simulink.
MATLAB and Simulink for control and automation engineers. We are working in intelligent control, but before that, from the very first year, all the students are working in programming lectures where we are teaching MATLAB and Simulink. And in the second year, we have measurements and sensors for control engineers, mechatronics in the third year, process control and real time control in the fourth year.
Also, we work in system dynamics, model and simulation, and intelligent control. In the fifth year, at the master level, we are working in system dynamics, modeling, control, simulations, and real time applications. In these courses, at least one of the homeworks and in many courses, we have projects to evaluate our students with projects and with homeworks. We are using MATLAB and Simulink.
We are working with MATLAB and Simulink and in the course of intelligent control. And here I'm showing you an example of a platform coming from the Arduino engineering kit. We are working with MATLAB and Simulink because of the rapid prototyping, the variety of functions, add on products, and toolboxes, because we can also deploy our algorithms in real time hardware. We work in data analysis, and we use the visualization tools of MATLAB and Simulink.
We also like very much MATLAB and Simulink because of Simscape. The example here on the right is a motorbike. And we use Simscape for physical simulation. Each part of the motorbike, the wheels and the inertia wheel at the top, can be programmed very easily with Simscape. Each of the joints we can give a rotation, an input that can be ideal, or we can close some loops and test some control algorithms to make it realistic, to make it close to the reality.
After a very good simulation, we test our platforms. In this case, it's the same motorbike, but we have on the left, we have a speed controller. We're controlling the speed of the rear wheel. In the middle, we are controlling the balance of the motorbike with an inertia wheel, fully using mechanical principle, the gyroscopic principle. So we don't use sensor. We use a motor and we give full power to the motor and we control the balance. Or on the right, we are using some sensors and some control algorithms, closed loop position controllers to keep the balance of the motorbike.
Intelligent control systems. So intelligent control comes from conventional control, the control theory, the classical control theory, but is used to deal with complex processes that traditional methods cannot control. It has learning adaptive and organizing functions.
I have here two examples from our lab. The first example is the fixed wings aircraft. Here we have a plane in orange. This is our lab. And we also have another example of a climbing robot that we have been designing in the lab as well. When we come to the fixed wing aircraft, we are flying it in our campus and in normal conditions, weather conditions. It is flying quite well. But what happens when the wind increases or there is a rain or we have some problems and damage or heat or system sometimes? We should be able at least to land the aircraft to use some adaptive controllers at least to recover and allow it to do the landing safely.
We also have here the climbing robotics that uses two wheels, magnetic wheels, some wheels that have neodymium magnets. Each wheel is attached to a DC motor. So this is a differential robot that has neodymium magnets that attach the wheels to vertical walls. These forces are affecting very much when we are trying to do precise position controllers.
So we have disturbances coming from magnetic forces, gravity forces. At the motor side, the column friction also affects our system plus the head angle, where it is going up and down and the robot changes the position, the head angle. Then the overall forces, we have to compensate for the overall disturbances. That is where we find intelligent control useful. That's where we need intelligent control.
Intelligent control system as a project and application. We have been working in this project curriculum development to empower our students with practical skills to promote critical thinking, creativity, and collaboration. We have some students make a team, they select a project, and they work to the full semester from the first weeks and present their project to foster expertise in data driven, model based, and AI control approaches to incorporate emerging technologies and, very important, to explore new teaching methods. Our focus could be to work with experiments, bring some real time platforms to the classroom, and, of course, working with low cost platforms so each student can benefit from it, can have it in their hands.
How MATLAB and Simulink were used in the course. We have the typical sessions with three hours per week, covering intelligent control system theory and very important to evaluate control performance. We have interactive live scripts that work with MATLAB and Simulink and many examples in it. Application focus materials include video simulations and several real time experiments. Everything to motivate engineering oriented analysis, problem solving, and self-learning skills.
We are using live scripts. And for that, we use the Live Editor of MATLAB. It is for interactive programming and documentation. It accelerates the programming when we are working with our students, allows them to create interactive narratives, arranging everything in a single live script in a logical way, and publish reports that you choose PDF, Word documents, and we also can work with LaTex.
Here is an example of a live script. You have titles, tables with the contents. You can paste pictures. You can even add some links where you are working in a specific subject or tell some stories about your problem. Then go to mathematical model and maybe you add your favorite web pages and controlling the dynamics.
Come to the mathematical part and modeling. Write your equations. In this case, I'm showing you a transfer function where we have some parameters, mass, damper, and the spring constant. They change in real time. So you can control them. And finally, you can see some system dynamic responses, pole placement. Everything pops up. So it's very friendly and you are controlling everything in one single path.
Along with the live scripts, we have added some links to go to a YouTube channel that have some experiments. We have recorded some videos of the experiments, some simulations, and we are also using our algorithms in real time. So we show how it works. There are just some of them. You can explore it by using the QR code.
Benefits of using MATLAB and Simulink because of Onramp and the MATLAB Academy. Onramp courses, we suggest the students before taking intelligent control the system lecture to at least do MATLAB and Simulink Onramp. Then for the intelligent control, we ask for Control Design Onramp, Machine Learning, Deep Learning, and Reinforcement Learning Onramp.
You see they are very short courses. One hour, two hours, maximum three hours. The student start from the very beginning until 100%. When they finish the course, a link is generated and they can even print a certificate. They are using this link and the certificates for their CVs and they are sending to the teacher also for evaluation.
We are using the course the MATLAB Grader. With my students, we program 20 different problems. Some of them are initial steps in machine learning. Then we go to enhanced machine learning problems. And finally, we have some examples of model predictive control. They are interactive course assignments, automatic grade student work and provide feedback. The feedback goes for the students also for the teacher for the evaluation.
How does it work? We have a template. And before that, we have been working with similar problems. Then they are following some steps, initial steps. In this case, we are programming the plant model for an MPC, Model Predictive Controller. We have a transfer function. We write the parameters. We obtain the transfer function, numerator, denominator. Then we give some information for discretizing the model. Finally, we write prediction horizon, control horizon, and we go on and on.
This is the reference solution. We also have the student template, the learning template where they are following a step by step. And then by comparison, we obtain-- we evaluate the progress and how they solve the problem. They submit a problem and we can check the progress.
In this case, we see here for example the number of submissions of the student for a single problem. Or we can go further and in detail, we have divided the problem in some task or test. We can see how many times the student attempt to solve this particular part, this test.
Benefits of using MATLAB and Simulink because of the available resources we have in File Exchange, MATLAB and Simulink challenge project. This web page offers a lot of examples of projects. We can use the ready project to enhance our understanding of MATLAB, and have hands on experience in solving real time work problems such as artificial intelligence, computer vision, drones, robotics. All these students are picking a subject from the first week. In the second week, they are writing a title of what they want to work. They want to present in the end of the course.
So here we come to the curriculum of intelligent control system. The first week, we work with computational and thinking tools, control principles, tools, methods, and we give some simulations.
The second part of the course is dynamical system modeling. Remember this is project based. So we have some platforms. We need at least some information about the dynamics to do model based control and hybrid controllers. And for that, we are using the digital lab that is an experimental platform built by our students. Just a DC motor. And we are performing many experiments with it.
We also have the TC lab. This is a temperature lab. It consists of two heaters and two sensors attached to the heaters. With that, we need at least a model of the system to be used for control.
We have data driven modeling for week six to week nine. We are working with the TC lab in semi-empirical model estimation regression. We can do also machine learning classification with the TC lab, the temperature lab. And a very nice live script is the deep learning and your YOLOv for object classification. What we can do with a single webcam and many pictures and do classification. We are using this classification for a robotic application.
In week nine, we have an example of interoperability. Python and Matlab and LSTM models for prediction and forecasting. So we are modeling and we are training and testing. So an LSTM model algorithms, we are optimizing it. And we are using historical data. The temperature data of a particular city and then we are running some algorithms. The data is already available on internet.
Finally, we go to model driven and data driven control. Model predictive control for a DC motor with experiments. Model reference adaptive stream seeking. And the final week, we do DC motor position with fuzzy logic controllers.
Very important for us in the course is computational thinking tools. Here I'm showing you some examples. The virtual hardware and labs for control. You can find it in File Exchange. It has very well known projects in control, like the cruise control, inverted pendulum, the ball and beam. These are done with Simscape. You can explore inside and try to make changes in the dynamics of parameters in there, and running some controllers by using these applications.
Or you can also have the robotics work. For example, my students are working with the robotics playground. In here, we have a differential robot. A robot that has two wheels and you are programming them independently. And then you have also the kinematic, the inverse kinematics. And you can program the velocity forward, backwards, the turning, work with the playground, puts on objects, and then test some algorithms by controlling each of the motors in here.
Dynamic system modeling. So I'm showing here a low cost platform, the DC lab platform. It is just a single DC motor with an encoder. Some of them are coming with the gearbox as well. And we packed it in a box. It has an Arduino Uno and an h-bridge. And with this platform, we are performing a lot of experiments.
How does it work? So here you see at the top how it works in the lab. We are tracking a sinusoidal input and we are designing some position and speed controllers. We have been already working in system dynamics and we are having a reduced model of a DC motor. We can obtain the parameters of the model by running some experiments, performing some experiments, getting the data, and using the parameter estimation toolbox of MATLAB.
Having a model and having the parameters, we can go and, for example, tell the students we need a position controller and show me a critical damped response. The best response that you can have, the fastest without overshoot and minimizing the static error. The problems at the steady state, the error at the steady state.
Here, I am showing you the temperature control lab, the TC lab. It is coming from AP monitor. You can find it online. You can buy it. It is just an Arduino Uno with two transistors as heaters. So you are changing the PWM in each of them and increasing the temperature and lowering the temperature by changing the input. And attached to those heaters, we have two transistors as thermistor transistors. And it's measuring the temperature of each of the heaters.
In here, we can work in dynamic response, temperature response per each of the heaters. We can also do for both. So multi-input, multi-output, and MIMO system. And we can also work with heat transfer. How one heater is affecting the second heater. You can also build this platform in your lab with your students for that.
Data driven modeling. I'm showing classification with machine learning and the TC lab. Remember, we have two heaters and two sensors. We are measuring the temperature with two sensors. I am going to perform an experiment for 500 seconds. The black line that you see there is the manipulated variable. I'm changing that PWM and giving from 0% to 100% and then switch it on and off the first heater. I'm doing it multiple times.
Then you see the orange line. This is the heater number one, the one that I'm switching on and off. And the green one is the temperature in the second heater. This was switched off totally, but it gets some temperature because of heat transfer. We can use that data.
And use, for example, the classification learner. And here there is an option to run many algorithms, to test many algorithms at the same time. And then we can have a look in terms of accuracy which one perform the best. We say that for this particular problem experiment, the fine tree was the best. If you check 97.3%, there is some more information that you can obtain. Error rate, prediction speed.
That can be very important if you are going to use something in real time. We can also go and check for the validation confusion matrix how we have to classify. In this case, we are classifying when it was on and when it was off. We can see the true value when it was on and when it was classified as on, and when it was off and was classified as off. And then we can also have, we can also see some problems in here, some misclassification.
Once we choose, once we run this classification learner and we choose what is the best algorithm, the idea is that our students can have that foundry and program a foundry for this particular application.
More about data driven modeling. Deep learning for object classification, image processing with a webcam, and the use of YOLOv. We are classifying between apple and orange. This problem has been solved and is in File Exchange, and I know that MathWorks has already some trained algorithms. We have collected many pictures and we have trained it by ourselves. We have been doing the training, testing, and validation, and we use it for a real time application for pick and place in our lab.
In here, we see a robot. It has been done everything in the lab, in our lab. The mechanics, the gearboxes, the control, the sensory system. We have the camera. We did the deep learning algorithm by using MATLAB and Simulink. And also this visualization tool interface is done with MATLAB and Simulink. It says MATLAB application. So this is an example. We are sharing this example in one of our live scripts.
Coastline prediction using climate change models. In here, we have data from NOAA Office for Coastal Management. And we are trying to predict sea level rise. We have information about time, year, CO2 emissions, population, sea level, temperature across the globe. And we also have some already predicted sea level from 2013 until 2050. So we can use that information. We can run some algorithms and compare to their predicted models.
Here in our live script, we are going to show some landmarks and world maps, how they show the information. We are going to do some polynomial fitting. And then we are going to use some compared to their models, analyzing landmarks and work maps. The sea level rise in millimeters with information from 1916 until 2020. Then we do try some polynomial fitting.
Then we can also use the data of the sea level and go to regression learner toolbox. We can check some models and choose the best. In this last part, we are using the sea level prediction and the data reported from 2020 to 2035. I am plotting it.
I can also, because I have the models, I can also tell I want to see 2040 what is going to happen. And I can choose a place. In this case, I have chosen Istanbul. And then it report the sea level rise in millimeters. So we can use the information that is already in some online for algorithms.
Data driven modeling. The use of Python and MATLAB and LSTM models for prediction using historical data. Historical data that is coming from internet database and is the temperature in a particular city. Then we work with data generation preparation. We build the model. We optimize the model. We do the training, prediction, and forecasting validation. A very good example of interoperability between MATLAB and Python and an example of unsupervised learning.
Here is the live script. I'm going to show you more or less what we are doing. Important how to work with Python and MATLAB together. Importing the data. Processing the data seeing if the data is Gaussian. Some statistical tests. We are working in time series. Doing the training, testing the validation. Working with the prediction, plotting the forecast plot.
And here we guide the student step by step how to obtain all the needed programs to run the live script. The libraries. The data. We are processing it. We are importing and processing it. Then we see if it's Gaussian. We get the normal distribution. Temperature distribution, probability plot. The time series, how it looks like from 2012 to 2016.
Then some statistics. Rolling mean, rolling standard deviation, just to see some trends. Autocorrelation test. Then we are going to do the training, the testing. We finally have the prediction plots and forecast plots where we compare actual predicted forecasting, and we are pre-casting some days ahead in November.
Model driven and data driven control. In here, we have model predictive control for DC motor positioning. And we are performing some experiments. Remember that before, we were working with dynamics and a reduced model of the DC motor. And also, we have the parameters. So we can easily use the model predictive toolbox and do a linear model predictive controller.
Then we can simulate it and also we can perform experiments, put it together, and see how close they are. And very important, always watch plot and keep that control signal so we don't saturate. And we are always working under the limitations or the boundary.
Here is an example, a video of that linear MPC. System response. A position controller. Then we are comparing the response to a step input. Real system in blue. Simulation in yellow. It might not be noticeable, but there is a little error in the blue one. There is a static error. But they are pretty similar.
So after that many live script weeks projects, what all the students are telling about, how they are evaluating our work. Student feedback. Educational tools. We are asking our students, can you rate your MATLAB graded experience? Can you rate your ramp up experience in a new topic like AI? And they can select between easy, expected, among easy, expected, and complex. All we are asking in your opinion, is using a live script an effective method for sharing educational material? Here most of, I mean, all of the students say this is successful.
We have tested this program in two semesters. This is now the third semester we are doing. We didn't finish yet. And we have 63 students in these two semesters. Project based learning. Student projects. In general, how do you grade the overall success of the students' final projects? So many of them successful. Many of them say it's average.
Answer to the question, what do you like the most about AI in MATLAB? 50% of the students say they like the ramp up materials. And 19% is easy to learn as AI. So model integration with Simulink. A wide variety of applications, application options, Simulink.
Results and personal achievements. So all the students are working from the first week in a project and they have to present in the last week. We are selecting the best projects. We tidy, we make it better, and we share in File Exchange.
And then they also get a certificate that says that they have the best project in the course of intelligent control system, the name of the project and the student. And it is certified by MathWorks.
We have been working quite a lot in algorithms. So we have been using also in projects. On the right, we see a climbing robot with magnetic tracks. Differential robot. And we have simulated this robot fully with MATLAB and Simulink. Before getting the project, we presented all the simulations. Here on the left, we have, again, the robot without the tablet, a differential robot, two motors, and then we have this motor. This is with the magnets. Here it is magnetic wheels. We have applied model reference adaptive control in the robot in real time. And also we have simulations.
Results and personal achievements. The student have to present at least one conference paper in order to get their master's degree. Some students have gone even further. Some students have done very good live scripts, have obtained very good results. We made changes and we are presenting, for example, here we have a journal paper Q1 when you consider scope and in electric power systems research. Remember, the live script that we were forecasting temperature and predicting and forecasting temperature. In here we have another variable. We optimize our algorithm and publish a journal.
Another very good paper was in multimedia applications and applications. This is the working climbing robotics. So climbing robots for corrosion inspection, IoT integration, deep learning, and advanced control strategies. We have presented international conference, three of them. One of them, International Conference in Poland where our work was selected to be in the journal.
We also have in Turkey a community very active working in control. The top conference, we present our works in top conference. They work with the International Federation of Automatic Control. And we have four conferences in two years. This is the work we have done with our students.
Conclusions and highlights. So we believe we have a novel curriculum. That curriculum of intelligent control is novel because it combines model based, data driven methodologies for intelligent control systems. It uses cutting edge topics, integrates AI, make machine learning, deep learning, and predictive modeling.
We work in hands on learning, project based education, and experimentation with low cost hardware. It is innovative in education, because we integrate AI, intelligent control system, using multiple advanced tools. It presents accessible learning using MATLAB resources. Everything is in File Exchange. And we use two low cost hardware that some people can reproduce and work with it.
Skills development. We believe that we are motivating, enhancing analytical thinking, problem solving, and independent learning through automation and interoperability. We are employing live scripts. MATLAB Grader for doing automatic evaluations. And we are using Python for interoperability.
Positive impact. We believe we have proven success through student feedback. We have some publications and we have project outcomes. So this is coming to the end of our presentation. I would like to thank you very much and I am waiting for your questions.