![dc motor speed control using pid controller matlab simulink dc motor speed control using pid controller matlab simulink](https://d3i71xaburhd42.cloudfront.net/6f14d6a5e2544ca1ade9bab9442d8842f4405f31/7-Figure7-1.png)
- #Dc motor speed control using pid controller matlab simulink plus#
- #Dc motor speed control using pid controller matlab simulink series#
However, if we zoom in the milliseconds range, we can easily find out the typical behaviour of an RL circuit.
![dc motor speed control using pid controller matlab simulink dc motor speed control using pid controller matlab simulink](https://i.ytimg.com/vi/V3dA_Tdk098/hqdefault.jpg)
For everyone that is familiar with RL circuits, this overall behaviour might seem odd at a first glance: at 60 seconds the short circuit occurs and the current seems to jump immediately to a minimum negative value. Then, as the speed increases, the back EMF increases as well reducing the current through the windings. Batteries can usually do that but always check the data sheet to be sure. If you were powering this motor directly from a solar panel for instance, you might run into trouble at the startup since the panel may not be able to supply the current required at startup. Note that initially the current is limited only by the resistance of the windings which is very low, therefore a big current spike of about 4.36 A (which is exactly equal to 24V / 5.5 Ohms) follows the application of the voltage. If we take a look at the first scope, we find out that the current has the following behaviour: We apply a 24 V step voltage to the motor, let it reach the equilibrium and then apply a short circuit! This is the Simulink model What would you expect the current to do? Let’s find out. At 60 seconds, a short circuit happens, the voltage on the motor terminals becomes zero. In the following example the motor is started at time 0 with a 24 V step. For example, let’s simulate a short circuit. The model can then be wrapped in a subsystem and then used within other models. The raw model of the DC motor can be modelled as follows In our example we are simulating a DC motor, but think of a parallel of synchronous generatos, what if you’d like to simulate what happens in case of a short circuit at a specific point in a branch of the transmission line? Let’s see some more interesting simulations on the DC motor. I think the advantage of using Simulink is that it allows you to simulate different scenarios and complex models in a very short time. You may, legitimately, ask why use Simulink? A DC motor is very simple, I can use other tools or even just pen and paper to find out the solution to my questions. Simulink was made for simulating dynamic systems and it is particularly useful whenever you need to simulate models described by differential equations. Simulink, quote, “is a graphical programming environment for modeling, simulating and analyzing multidomain dynamic systems”. Why is this happeing? This is happening because by inserting a regulator and negative feedback the poles of the system (and therefore its dynamic behaviour) have been changed. You can immediately notice that the motor took less time to get up to the required speed compared to the previous case. By requiring the motor to reach a speed of 1 rad/s, this is the transient that follows: Now we can set as an input a certain speed and see how the motor behaves in the transient.
#Dc motor speed control using pid controller matlab simulink series#
In the second part of the code, I decided to put a PI regulator in series with the system and then use negative feedback to control the speed of the motor. I mean, we can vary the voltage and then get a certain speed as output but in most cases we need a certain speed regardless of the voltage (provided it is within the nominal voltage). This is a nice result but we can’t really control the motor. You can take a look at the transient of the angular speed variable in the graph below In this case it turns out that by applying a unit voltage step, the motor is absorbing 0.2 A and turning at a speed of 45.8 rad/s. Note that I’m assuming the torque of the mechanical load is constant in this case.Īs you can see in the comments in the code, the final state of the system can be calculated just by setting every derivative to zero and then solving for the state variables. Using Matlab we can simulate the system response to a unit voltage step. Mechanically speaking, the motor can be modelled by considering the following equation: The back EMF can be expressed as a function of the speed of the motor $e = k\phi\omega$. Usually R is very small and can be difficult to measure with a multimeter.
#Dc motor speed control using pid controller matlab simulink plus#
Where $R$ is the equivalent resistance of the brushes plus the windings, $L$ is the inductance as seen from the external terminals of the motor and $e$ is the back EMF. Electrically speaking, a permanent magnet DC motor can be modelled as follows:Īpplying LKT we obtain the following differential equation