I wish to express my sincere gratitude to my mentors, Dumitru-Cristian Tranca, Ph.D, and Monica Patrascu, Ph.D. from the Faculty of Automatic Control and Computers at the Politehnica University of Bucharest, without which the present project would not have been carried out.
Traditional DC Motors, also known as Brushed DC Motors, showed great success in various applications. Thanks to their simplicity, low cost, and precision, they have been part of industrial applications for many years. Unfortunately, they have two major drawbacks, both related to the use of brushes. First, brushes tend to wear out, so the motor needs periodic check-ups and maintenance. Moreover, they are not intended to function in hazardous environments due to the occurrence of sparks, posing a major threat for the overall application.
As a results, Brushless Direct Current (BLDC) Motors replaced traditional motors in numerous projects, providing better performances and higher efficiency. According to an article entitled "How to Power and Control Brushless DC Motors", published on the digikey website, brushless motors show improvements between 20% and 30% for the same speed, with the same mechanical load, over the classical machines. Considering the fact that 40% of the global electric consumption revolves around the electric motor, according to the annual report of the International Energy Agency, this eﬃciency boost is huge. Furthermore, BLDC machines, with an obvious advantage in durability, also become smaller and lighter thanks to the eﬃciency gain. These advantages made them very popular in ﬁelds such as automotive, heating, ventilation and air condition (HVAC), aeronautics, medical sciences and industrial automation. The disadvantages of the brushless motors are related to the increased control cost and higher complexity, requiring electronic commutations and supervisory structures to ensure the accurate timing of phase voltages and to properly estimate the speed of the rotor. Fortunately, the producers are rapidly evolving in this ﬁeld, providing cheaper and smarter solutions, thus lowering the overall cost.
This section will briefly explain two different approaches related to control theory:
As it can be found in the Motor Control Class: Lecture 11 - Closed Loop Control, there are certain ways to obtain a Regulator that fulfills the purpose of the application using manual tuning. The advantage of these methods relies in the fact that you do not need an accurate estimation of the motor's mathematical model to have a satisfactory response. The downside is that you will obtain very good results only in certain cases and with a lot of Trial and Error work.We will describe analytical methods to determine the transfer function of the Regulator.
First of all, the closed loop system can be described by the following feedback control scheme:
Pole placement method, although it is vastly found as a state-space method, works great with the transfer function approach. Although this strategy may sound complex, it is one of the most natural implementation of a control algorithm.
We build the ideal transfer function (that determines the response we want to obtain) and, using the model of our Plant, we can rapidly determine the transfer function of the Regulator.
For instance, if we want to obtain the following Closed Loop transfer function (or, more adequately, the response of the following transfer function):
We can easily determine the Open Loop transfer function:
Finally, knowing the model of our plant - Hp, we can determine the transfer function of the regulator:
In some fortunate situations, the transfer function of the Regulator can be implemented using a Proportiona-lntegral-Derivative (PID) Controller:
As it can be seen in the above image that depicts a parallel-form PID Controller, the command generated by this regulator is built using 3 components:
The PID controller is a very powerful tool in automatic control thanks to its simplicity and versatility. If correctly tuned, the closed loop performances are suitable for the vast majority of industrial applications.
The State-Space approach is generally linked with the Optimal Control concept. As the name suggests, Optimal Control is a control strategy that depends on minimizing a performance criterion, also known as cost function, to generate the proper regulator. Most of the applications revolve around maintaining the stability of a system. For instance, satellites are controlled with this type of strategy the ensure the proper orientation and position. The main purpose is generating a command that keeps the satellite in the initial position with the desired orientation, despite external disturbances.
Unfortunately, the classical approach does not include the possibility of following a speed reference. A variation that provides modest results is adding the desired state as an external disturbance. Simply said, if we want the motor to spin at 1000 RPM, we can trick the motor into believing that the actual speed is -1000 RPM so it will generate a command that will bring the rotor at 0 RPM, thus obtaining the desired angular velocity.
Finally, this approach can only guarantee very small steady-state error, but never 0. This can be demonstrated by using a popular principle among control theory projects, The Internal Model Principle. While the inputs of our motor will be step signals with different values, the only way we can ensure null steady-state error is including an integrator block in the open loop system.
A regulator that successfully integrates this concept is called Linear-Quadratic-Integral controller, or LQI Controller. It works with Linear Systems and Quadratic Cost Functions, considering the fact that the Regulator includes an Integrator block.
A Simulink project can be built to demonstrate its functionalities:
The classical method is built around the following equations:
Unfortunately, these expressions do not include the notion of "Speed Error" or "Speed Reference", so following the desired path is not yet possible. We update the system's overall state-space model by adding in the state vector x the state variable Epsilon, which is the Integral of the difference between Speed Reference, lastly added as an input, and the estimated speed. Considering this, the new state-space model becomes:
where r is the speed reference and A,B, and C are the matrices that comprise the BLDC model.
To compute the ideal regulator, we need to minimize the following cost function:
where z is the new state vector (built using the initial state vector x and Epsilon), Q is a matrix that penalizes each component of the state vector, e.g. if we do not want the motor to reach high speeds, the first element found in the Q matrix will be very big. When the speed reaches high levels, the value of the cost function will be greatly increased and, considering the fact that we want to minimize the cost function, this instance will be ignored due to its poor performances.
This project is built using the MTRDEVKSBNK144 development kit that includes a BLDC Motor. The setup is made using the instructions provided in the development kit page and in the Motor Control Class: Lecture 12 - Motor Control System course. No further improvements added.
This article is centered on speed control algorithms. It does show improvements only related to the Regulator Block found in the MATLAB project described by Motor Control Class: Lecture 12 - Motor Control System Other blocks such as Speed Estimator and 6-step Commutation are the ones made by dumitru-daniel.popa.
First of all, to build a successful control block we need to establish a set of performance criteria to determine the best control strategy. Considering several online articles that implement BLDC regulators and by analyzing their performances, we can come up with the following list:
We provide 2 different models for the same motor, using the transfer function approach and the state-space approach.
Hp is the transfer function of the Plant, i.e. the motor itself. The two poles of the systems are complex conjugated poles:
p1 = - 4.8103 + 396.48i
p2 = - 4.8103 - 396.48i
These two poles are placed on the left side of the complex plane, both showing negative Real Part:
Re(p1) = Re(p2) = - 4.8103 < 0
Consequently, the Plant of our system is stable.
The state-space model is comprised by 3 matrices which completely describe the following equations:
where x is the state space vector, taking the form of x = [ w ; (dw)/(dt) ], where w is the angular velocity of the motor,
y = w, and u is the input, i.e. the current that flows through the motor.
The numerical values of these matrices can be found below:
The eigenvalues of the matrix A are both found in the left side of the complex plane, so the stability of our Plant is once again demonstrated.
We want to obtain a second-order response considering the following arguments:
We build the ideal response's transfer function, considering the general formula of a second-order system:
Based on the above expression, the performance parameters can be described using the following form:
Using the imposed characteristics that can be found in the Requirements Section, we can determine the ideal closed loop transfer function:
The stability of the above system can be proved using the Hurwitz criterion.
Considering that our Regulator's transfer function is determined by the fraction
we can determine the transfer function of our controller:
As it can be seen from the above expression, our regulator cannot be implemented using the traditional PID Controller. Using the same sampling time provided in the Motor Control Class: Lecture 12 - Motor Control System, we obtain the Discrete Transfer Function using the Trapezoidal Method:
The simulation results can be found below:
As it can be seen, the closed loop system satisfies our needs.
This approach is very similar to the first approach. Instead of following the principle of reducing the settling time at the cost of the presence of a small overshoot, this method provides a slower response in the absence of the overshoot that can cause problems near the limit regime (high RPM functioning regime).
Starting from the ideal closed loop transfer function that resembles a first-order system's response:
To ensure null steady state error, we get to the following condition:
To obtain a satisfactory settling time, we get to the following results:
where tt is the value of the settling time. Considering that we wish to obtain:
we come up with:
We can demonstrate the stability of our closed-loop system in a very natural way. This system has a real negative pole, so all the poles are placed in the left side of the complex plane, thus showing the stability of our final system.
To compute the transfer function of the regulator, we calculate the open-loop transfer function:
Finally, we obtain the transfer function of the regulator that can be implemented using a PID Controller:
Below you can find the simulation results:
As mentioned before, the final system is determined by:
The command that our regulator should generate is:
The optimal gain matrix K that solves our problem can be found by minimizing our cost function :
Our choice related to Q and R shows two important points in this approach:
By choosing the right values for these matrices we can obtain the desired result.
The analytical solution of this problem can be determined by solving a Riccati equation that gives us the formula of K:
A commonly used MATLAB function can be used to rapidly generate the optimal controller:
Using the above MATLAB tool, we determine the gains for our LQI Controller:
The stability of our closed-loop system can be demonstrated by calculating the eigenvalues of the system matrix:
As it can be seen, all eigenvalues are in the left side of the complex plane, so the system is stable.
After determining the optimal gain matrix K, we can test the performances of the LQI Controller in Simulink:
Thanks to the S32K144EVB, we can rapidly implement our controller using the Simulink Environment. We take the original project built in the Motor Control Class: Lecture 12 - Motor Control System and we modify only the Regulator Block accordingly.
First of all, to evaluate the results of this project, we need to build a starting point. Motor Control Class: Lecture 12 - Motor Control System included a Simulink project that implemented a PI Controller with Kp = 0.2 and Ki = 0.7. The results can be seen in the following images:
As it can be determined using the above images, the performances provided by the default regulator are not satisfactory. The settling time is relatively long and the disturbances are rejected very slowly. Overall, the system does not perform as it is intended.
|Performance Index||Observed Value|
The results are extraordinary. The settling time is very small and disturbances are rejected very fast. The system successfully adapts to the variable mechanical load and comes back into the desired functioning regime.
The downside of this regulator relies in its implementation: due to the fact that it cannot be implemented using the traditional PID Controller, we need to discretize the continuous transfer function to create a digital filter that is implementable. Finally, due to numerical latency, the system cannot function >850 RPM.
|Performance Index||Observed Value|
|Disturbance Rejection||1.5 seconds|
We can further improve the performances of this PID Controller by slightly adjusting its parameters. To decrease the settling time, we can increase the Ki coefficient. The Closed Loop System's response with the freshly tuned PID Controller can be found in the following images:
The performances shown in the above pictures meet the requirements. The settling time is good, not impressive, but not bad. It successfully rejects disturbances in relatively short time. Overall, we must take into account that the response does not include overshoot. This feature makes this controller more suitable for functioning near the limit regime.
|Performance Index||Observed Value|
|Settling Time||3.6 seconds|
|Disturbance Rejection||2.8 seconds|
The LQI Controller provides amazing performances. In the absence of overshoot, the settling time is very short and the disturbance rejection happens very fast. Minor improvements can be made related to the Q and R matrices, but the results will get better only in certain applications. Overall, the LQI Regulator shows the best results.
|Performance Index||Observed Value|
|Settling Time||2.8 seconds|
|Disturbance Rejection||2.3 seconds|
While the shortest settling time was obtained using the Discrete Regulator, this type of approach implies a limitation of 850 RPM. This disadvantage makes this controller unsuitable for the vast majority of applications, including the numerical instability determined by the implementation method.
The LQI Controller shows the best results. It responds very fast to both reference variation and disturbance occurrence (interpreted as a variable load). It is suitable for applications that include a precise model of the plant, in our case a BLDC Motor. As it is part of the Optimal Control Strategy concept, the fact that this regulator minimizes a cost function further suggests that this controller provides the optimal response in a given situation. The downside of this method relies in the computational (needed to compute the Optimal Gain Matrix K) and electronic (two different controllers - in our case an I controller and a PD Controller) costs.
Finally, if the application does not need high performances and cannot sustain high costs, the PID Controller provides satisfactory results - a relatively short settling time and decent disturbance rejection time. Thanks to its versatility and simplicity, it is surely suitable for generic applications such as HVAC.
Thank you for reading this article.
Thank you for posting your work here. It's very interesting.
Are you planing to investigate other types of controllers too ? I would like to see something related with Fuzzy Logic Controllers - Mathworks support this as well. It might be a good approach for systems with unknown mathematical forms.
First, thank you for your work related to the Motor Control Class: Lecture 12 - Motor Control System workshop. It was very helpful.
I'm glad you find this project interesting. Fuzzy Logical Controllers are, indeed, awesome! Especially when, as you said, you try to control unfriendly systems with a poor mathematical model. I do consider involving this type of controller in a future project. As I got more familiar with working on the S32K144EVB, I think that this will be my starting point.