Sensorless Speed Estimation of Induction Motor in MATLAB
Buy This Project
Today I am going to show you Sensorless Speed Estimation of Induction Motor in MATLAB. In order to control and estimate the speed of Induction motor, there are many methods proposed by different scientists. The method I have selected in my project is Adaptive method. Using this method, I have controlled the speed of Induction motor using MATLAB software. Matlab software is used for simulation design. The simulation is designed in simulink and the MATLAB version used for designing this project is MATLAB 2010. It is also tested on MATLAB 2012 and 2013. All the details of this project are mentioned below.
If someone wants to buy this project then click on the button shown on right side. Its quite difficult to implement and is designed because of the efforts of our team that's why we haven't made it open source but we have placed a very small purchase amount because mostly it is asekBefore going into the details of Induction motor, let’s first have a look on the mathematical derivations. Few of the well-known methods are:
- Adaptive Method.
- Least-Squares Method.
- Non Linear Method.
So let's get started with Sensorless Speed Estimation of Induction Motor in MATLAB:
Mathematical Derivation - Sensorless Speed Estimation of Induction Motor
In order to apply the adaptive method on the Induction motor, there was a need to first design the induction motor on Simulink. For designing the Induction motor on Simulink, mathematical calculations were required. So, my first task was to derive the complete mathematical equations for all the variables of Induction motor.
The basic mathematical model also known as the a-b model (or two-phase equivalent model) of induction motor is given as:
Where,
- ? is the rotor angular velocity.
- ?Ra& ?Rb are the rotor magnetic fluxes.
- iSa and iSbare the stator currents.
- s = 1 – M2/ LR LSalso known as leakage parameter.
Adaptive Method Calculation
The approach used in this report is to consider the speed as an unknown constant parameter. The reason for choosing this parameter is that it changes slowly as compared to all the other electrical parameters and as it changes slowly so it can be controlled more effectively. The adaptive method techniques are applied on the speed parameter and thus estimated it. This adaptive method approach on speed parameter was first implemented by Shauder and are further enhanced and researched by Peng and Fukao. Using the last two equations of the system (1), I derived the below equations:
Where,
- ?maand ?mb are the magnetic fluxes and are thus known quantities.
Now take the second and third equations of system (1) and divide them by M / LR and then differentiate them w.r.t time and the below equations are obtained:
Where,
- d? / dt = 0 as we have already assumed in this approach that the speed will remain constant.
System (3) gives us the derivative of magnetic fluxes. In order to calculate the error dynamics induced in the system, we need to calculate the estimated values of these magnetic fluxes and then subtract them from the system (3). The estimated values of the magnetic fluxes are as follows:
Now the error dynamics in the system will be calculated by subtracting system (4) from the system (3), which is calculated as:
Now, according to the Lyapunov function,
V (ema, emb) = ½ (e2ma + e2mb)
Using the above equation and the values of ema and emb, we get:
Now after putting the value of ?and then applying Popov’s criteria, we get:
These are the mathematical equations used in the modeling of this system in MATLAB. In the next part, we will check the simulation designed in MATLAB using these set of equations and will study that model in detail.
Modeling in Simulink
The model designed in MATLAB is shown in the figure 1. This model is performing the simulation of motor moving in both the directions i.e. clockwise and anti-clockwise. It contains four main blocks, which are:
- 3-Phase Input Voltage with variable Frequency.
- Vabcto stationary frame conversion block.
- Motor system block.
- Speed estimation block.
All these four blocks are discussed below in detail:
Figure 1: Model Designed in MATLAB for Induction Motor
3-Phase Input Voltage with variable Frequency
This block, as the name depicts, is used for generating variable frequencies. In the start, the first model, I generated, was for fixed frequency of induction motor and was also showing just one direction of motor. So, I did few modifications in the model and added this block so that the motor could move both in positive and negative directions and can also move at different frequencies.
Figure 2 shows the parameter block for this block and from this block one can set the frequency of this motor quite easily. From this parameter block, one can set:
- Amplitude of the input signals.
- Phase difference between the input signals.
- Frequencies of these input signals.
By default, I have taken two frequencies, for which the motor will rotate during a cycle.
Reverse Direction of motor
In order to change the direction of the motor, I have used the phase change. When the voltage applied to the motor reverses its direction, the direction of the motor also reverses. For this simulation, the motor will rotate in clockwise direction when:
- Phase of Va = 0
- Phase of Vb = -2*pi/3
- Phase of Vc = -4*pi/3
And it will reverse the direction, when:
- Phase of Va = 0
- Phase of Vb = -4*pi/3
- Phase of Vc = -2*pi/3
i.e. Vb and Vc are changing their positions. In order to do so I added a phase change in this block and thus for the first 5 sec the motor will move in one direction and for the last 5 sec it will move in the opposite direction automatically.
Figure 2: Parameter Block
Vabcto Stationary Frame Conversion Block:
This block is separately shown in the figure 2. This block takes Vabc as an input and gives output in the form of V(alpha) and V(beta). This conversion is known as Clarke Transformation. This transformation is used in order to simplify the implementation of three phase systems as in Clarke Transformation, a reference signal is obtained. V (gamma) becomes zero in Clarke Transformation that’s why it becomes very easy to use.
Figure 3: Vabc to Stationary Frame Conversion Block
In Clarke Transformation, the relation between Vabc and V (alpha) and V (beta) is given as:
The above equation is implemented in the sub system named as Vabc to stationary frame in figure 2 and is shown in the below figure 3.
If we closely examine the figure 3, then it is shown that inputs coming are Va, Vb and Vc. After that the above equations are applied on these input signals and the output received is V (alpha) and V (beta). In simple words, figure 3 is implementation of Clarke Transformation.
- Va, Vb and Vc are simple sine waves with amplitude of 2300 and frequency of 50 rad/s.
- As it’s a three phase system so all these three signals have a phase difference of 120o.
Figure 4: Implementation of Clarke Transformation
- V (alpha) and V (beta) obtained after the Clarke Implementation are shown in the Figure 4.
Figure 5: Graphical Representation of V (alpha) & V (beta)
Motor System Block:
Motor system block is the practical implementation of set of equations shown in the system (1). It is the basic mathematical model of Induction motor shown in figure 5. It is taking V (alpha) and V (beta) as an input along with the load applied on Induction motor. In other words, I can say that this block is the actual Induction motor and I need to apply the adaptive method technique on this block in order to estimate and control its speed.
V (alpha) and V (beta) applied here are the same obtained in the Clarke Transformation explained in the previous section. Outputs of this function are the states which we will study in detail in the fourth section and the derivatives of currents Isa and Isb.
Figure 6: Induction Motor System Block
Let’s double click this motor system block and check the functions it’s calculating. The functions of this sub system are shown in the figure 6. As I told earlier, this block is the simulation of system (1), which is also shown below:
Figure 6: Motor Block Functions
As shown in the figure 6, motor block is implementing all the five equations of system (1), which are:
- First block in Figure 6 is calculating d?Ra/dtwhich is the equation 2 of the system 1.
- Second block in Figure 6 is calculating d?Rb/dtwhich is the equation 3 of the system 1.
- Third block in Figure 6 is calculating d? /dtwhich is the equation 1 of the system 1.
- Fourth block in Figure 6 is calculating usawhich is the equation 4 of the system 1.
- Fifth block in Figure 6 is calculating usbwhich is the equation 5 of the system 1.
All these functions are shown in the figures 7(a-e).
Figure 7a: Implementation of equation 2 of system 1
Figure 7b: Implementation of equation 3 of system 1
Figure 7c: Implementation of equation 1 of system 1
Figure 7d: Implementation of equation 4 of system 1
Figure 7e: Implementation of equation 5 of system 1
- Graphical representation of all these systems are shown in the figure 7(f, g, h, i).
Figure 7f: Graphical Representation of equation 2 of system 1
Figure 7g: Graphical Representation of equation 3 of system 1
Figure 7h: Graphical Representation of equation 4 of system 1
Figure 7i: Graphical Representation of equation 5 of system 1
After the implementation of all these equations, a complete model of Induction motor has been obtained. Now there’s a need to apply the technique of adaptive method on it so that the speed could be controlled without the help of sensor, which is done explained in detail in the next section.
In order to change the parameter of this system, I have added a parameter block in it shown in the below figure:
Speed Estimation Block:
Let's have a look at the Speed Estimation Block of Sensorless Speed Estimation of Induction Motor in MATLAB. Speed Estimation is the place where adaptive method technique is applied to estimate the speed of Induction motor. This block is actually implementing the system (3) and system (4) and thus calculating the real speed and the estimated speed of the Induction motor respectively. After the calculation of these speeds, it is further calculating the error dynamics by subtracting the estimated speed from the real speed.
Figure 8: Speed Estimation Block
Speed Estimation block is shown in the figure 8. Inputs coming to the speed estimation are the same obtained in the first and second block i.e. V (alpha), V (beta), Isa, Isb, dIsa/dt and dIsb/dt. The functions implemented by this subsystem are shown in the figure 9.
Figure 9: Functions Implemented by System Estimation Block
System (3) and system (4) are implemented in the figure 9, which are as follows:
- First green block in the figure 9 is implementing the equation 2 of the system 3.
- Second blue block in the figure 9 is implementing equation 1 of the system 3.
Thus the outputs of these two blocks will give us the real speed values.
- Third green block in the figure 9 is implementing the equation 2 of the system 4.
- Fourth pink block of the figure 9 is implementing the equation 1 of the system 4.
So, the output of these two blocks will give us the value of estimated speed. The internal functions of all these four blocks are shown in figures 10a, 10b, 10c and 10d respectively.
Figure 10a: Implementation of Equation 2 of System 3.
Figure 10b: Implementation of Equation 1 of System 3.
Figure 10c: Implementation of Equation 2 of System 4.
Figure 10d: Implementation of Equation 1 of System 4.
After the calculation of all the four values, the speed estimator block then implemented the system (5), which is:
Implementation of this system 5 is separately shown in the figure 11, which finally gives us the value of estimated speed.
Figure 11: Implementation of System (5)
Graph of both the estimated speed and the actual speed is shown in the figure 12.
Figure 12: Graph of Estimated Speed and Actual Speed
Conclusion:
Let's have a look at the conclusion of Sensorless Speed Estimation of Induction Motor in MATLAB. Figure 12 shows both the actual and estimated speed induction motor. In the start, the motor is moving at the speed of around 25 rpm, after that the speed is increased to 50 rpm, and the motor starts to rotate in the opposite direction that’s why the graph shows the negative value. Now, it’s moving at 50 rpm in the opposite direction and lastly, it is moving at 25 rpm in the opposite direction. Figure 13 shows the graph for estimated errors. It is quite obvious from the error graph that whenever the speed of the motor fluctuates the error goes quite high. In other words, the acceleration produced in the motor causes the error to increase while the error remains zero when the motor is moving at constant speed, regardless of direction.
Figure 13: Estimated Error Dynamics
So, that's all for today. I hope you have enjoyed Sensorless Speed Estimation of Induction Motor in MATLAB. Will meet you guys in the next tutorial. Till then take care and have fun !!! :)
Download Serial Terminal Software in vb2010
Hello everyone, I hope you all are doing great and having fun. In today's tutorial, I am going to share a new software which I have named Serial Terminal. I have designed this Serial terminal in vb2010. You can download this software from below button. I have already posted a complete tutorial on How to use Serial Port in Visual Studio 2010 in which I have explained how to send and receive data via serial port. It was quite a basic software, which just transmit and receive data from a serial port but today I am gonna provide you a complete serial terminal, which will not only transmit and receive data but will also display that data in different formats.
As shown in the below figure, first of all you need to select the COM Port from which you want to receive the data and then select the Baud Rate. Hit Connect and you are now ready to communicate with the selected com port.Download link for this software is given below:
Download Software
Features added in Serial Terminal
Different features are added in the serial terminal to make it more user friendly. First, let's talk about the Transmitting portion. If you guys have noticed, in the previous version of serial terminal. there was no option for Carriage Return and Line Feed but now these options are added.
- If you simply want to send data without Carriage Return or Line Feed then uncheck both of them.
- If you check the Carriage return, then it will be sent after the data.
- If you check Line feed, then it will be sent after the data.
- If both are checked, then both will be sent after the data.
- Here's its final look:
- Now, coming to the receiving side, the data received will be shown in different formats.
- In the above figure, I have shown a random data.
- Now in order to check this data in hex format, simple click on hex tab and the data will be presented in Hex format, as shown in below figure:
- Similarly you can also convert your data in Decimal Format by clicking the Dec tab, as shown in below figure:
- In the below figure, the data is displayed in the Binary format.
Showing data in different formats helps in designing the project because understanding of coming data is quite necessary. Give this software a try and let me know your suggestions for the improvement. That was all for today, will see you guys in next tutorial. Have fun !!! :)
How to add a Delay in Visual Studio 2010
Hello friends, hope you all are enjoying good health and having good time. Today's tutorial is not too big and is simple about how to add a delay in visual studio 2010. Before starting this tutorial, let me first tell you that I got an excellent feedback about the last tutorial on How To Use Proteus ISIS & ARES & also got few queries and suggestions. One of them was to post a similar tutorial on the Eagle software as well which I will hopefully start in the coming week.
Today's post is a very small trick but yet very effective one. In a recent project of mine, it helped me a lot and yet its quite a small thing but it took me around half an hour to find it online and that's the reason I decided to share it with you guys. I have to design a software in which I was using a database in visual studio 2010 and in that project I have to add some delay in my readings addition in database so I was like :O how to add delay in visual studio 2010. I searched online and after quite a lot of time I finally able to get it, which I am sharing now in this post. Btw if you wanna learn about database then read How to create a database in visual studio 2010. After the creation of any software in visual studio there's a need of creating its executable file so that we can use the software standalone and just simply install our software on any computer so I think you should also read How to create exe file in Visual Studio 2010. Anyways coming back to adding delay in visual studio 2010, let's first discuss delay in programming language. :)
What is a delay?
The engineers who had worked on Microcontrollers like Arduino or PIC Microcontroller or 8051 Microcontroller, then they know that what is a delay.
- A delay in programming is a statement which adds a pause in your code.
For example, in some project you want to turn on two lights one after another with a delay of like 5 sec so now what will you do. You will first turn the first light on and then add a delay of 5 sec and then turn the second light on. That delay just let your code wait for 5 sec and then execute the next line.
So, now we have an idea what is a delay so lets have a look at how can we add this delay in visual studio 2010.
Add a Delay in Visual Studio 2010
In
Microsoft Visual Studio, the command used for adding the delay is:
System.Threading.Thread.Sleep(1000)
This command will generate a delay of 1sec. You can change this value in order to change the time of delay. i.e.
- 500 for 0.5 sec delay.
- 2000 for 2 sec delay.
- 5000 for 5 sec delay.
You need to calculate this value for your required delay and add it here.
Note:
- You should take much care in using this delay because this delay simply makes your software to sleep and thus while the delay is in process, your software won't do any other task.
As I told earlier, its quite a small tutorial, in fact not a tutorial just a quick trick of adding a delay in visual studio 2010. If you are interested in Visual studio projects then must read
How to send Emails in Microsoft Visual Studio 2010. Its quite exciting. :)
PCB Designing in Proteus ARES
Hello friends, today's the last post of this Proteus tutorial. I have tried my best to explain everything but knowledge is limitless so explore this software, play with it and you will know many new things. Today's topic is about the PCB designing in Proteus. When you install Proteus, you have seen that along with ISIS there's also another package named as Proteus ARES. This Proteus ARES is used for PCB designing. You should also check the Arduino UNO PCB Design for Proteus ARES.
In order to design the PCB in Proteus ARES, first you need to make the circuit of that PCB in Proteus ISIS. You can also make PCB directly but I recommend that use Proteus ISIS first, its quite the easy approach as you don't need to do anything in it and the software intelligence helps you throughout the designing. Here's the list of Top 10 PCB Design Software. So let's get started with PCB Designing in Proteus ARES:
PCB Designing in Proteus ARES
- As in this tutorial, I just want to give you an idea of How to design PCB that's why I haven't taken difficult circuit, just a simple PIC basic circuit.
- First design your circuit in Proteus ISIS as shown in below figure:
Components Used:
These components are used while designing this simulation:
Working Principle:
- After you got sure that your circuit is perfect and ready for designing, then click on the Tools and then Netlist to ARES as shown below:
- After clicking, Proteus ARES will be opened.
- Now in Proteus ARES, select the block option from left toolbar and also make sure that you selected Board Edge in the below drop down menu as shown in below figure:
- Now make a rectangular block in the workspace, this block is actually the boundary of your PCB.
- You can set its proper dimensions and can also re-size it manually using the mouse.
- Now select the component option from the left toolbar, it will show all the components used in your circuit.
- Place all these components in the workspace one by one as shown below. These green lines shown in the below image is actually the software intelligence.
- Using the circuit, it gives us the routes automatically and we don't need to panic any more just need to follow these route, if we are doing manually routing.
- Now there are two ways of adding routing, first method is auto routing.
- To do auto routing, click on Tools and then Auto Router and a property box will open where you can set many different option for routing like the width of route and the PCB layers etc.
- After selecting your properties just click on Begin Routing.
- And then a magic will start and you PCB will become ready as shown in below figure:
- Second method is manual routing, you can do manual routing by clicking the edges just like we connect wires in Proteus ISIS. For manual routing select the option shown in below figure and start routing.
That's it. I don't think its much difficult. I am gonna stop this tutorial here. I have tried my best to share my knowledge about Proteus. IF you guys having any problem in part of this tutorial, feel free to contact me. Take care.
Component Designing in Proteus ISIS
Hello friends, hope you all are having fun in your life.
Today's tutorial is about the component designing in Proteus ISIS. This tutorial actually deals with the presentation of your project. Usually when students give presentation of their projects, then it is asked that add the circuit diagram of their project. Now when students open Proteus in order to design their circuit, they found out that the components they have used in their project are not available in the Proteus Directory. Now what to do ?
In that case, there's a need to design your own component in Proteus and place it in the circuit. Although, this new designed component won't work as the real component but for presenting the circuit, it will be enough. ofr example, we don't have Arduino boards in Proteus software. so, I have designed some of the Arduino baords myself for Proteus which you can download from
Arduino Library for Proteus.
Similarly, it usually happens to me during my freelancing work to design some circuit and when I don't find the required component in the Proteus library then I simply design it on my own and then create its PCB. We will check the PCB designing of such components in the coming posts of this tutorial. So, now let's get started with component designing in Proteus ISIS.
Component Designing in Proteus ISIS
- Now I am going to design a simple component having 4 pins.
- First of all select the 2D Graphics Box Mode as shown in the below figure.
- Now click on the workspace and drag the cursor to create a box, as shown in the below figure.
- We have created the body of our component, now there's a need to add pins in it.
- For this, click on the Device Pins Mode as shown in the below figure and click on the workspace.
- It will add a small pin, attach this pin with the box as I did in the below figure.
Note:
- The pin has a small green bubble on it. Make sure that this end is not connected with the box as this bubble end is for the wire.
- I have added four pins with the box. Now there's a need to name these pins. For this purpose, double click any of the attached pin and the properties box will open up as shown in the below figure.
- Mention the Pin Name and the Default Pin Number, it will appear on the component and then click on Next.
- When you click Next, it will ask for the same things for the second pin and so on.
- When you fill these info for all the four pins then click OK.
- Now when you click the ok button, your component will now look as shown in the below figure.
- I have given my pins the names as Vcc, GND, Output, Signal.
- We have completed all the info of our product, now there's a need to add this component in our library.
- For this purpose, select the whole component and then right click and select Make Device.
- When you click on this option a new dialog box will open up as shown in below figure.
- In this dialog box, you just need to give info of your new component so that you can search it easily in your Proteus library.
- Just fill the Device Name in it and click Next. I have given the name Test Device to my component.
- Now click Next and go on clicking Next, unless you reach at the below page.
- Here you need to place your component in the category. Choose the appropriate category for your product and click on OK.
- That's it. Now your component has been added to the library. Open your part list and search for the component like in my case I search for Test Device and the below component appeared in my list.
That's all for today. If you have any questions regarding this tutorial, ask in comments and I will reply them. Take care.
Servo Motor Control with PIC Microcontroller
Hello friends, hope you all are healthy, wealthy and wise.
First of all, I am quite sorry about not posting for a long time, actually the load of work has really increased and I don't even have time to comb my hair.
Secondly, I have a really great news for you guys and the news is we have officially set up our office. Now, we will be more professional than ever and will respond to your queries quite fast now. I will update the photos of my new office soon INSHAHLLAH.
Let's come back to our topic. Previously, I have discussed the DC Motor control in Proteus ISIS and Stepper Motor Control in Proteus ISIS. So, now we are left with only one motor which is Servo Motor. Today's topic, as the name suggests is about the Servo Motor Control using PIC Microcontroller. The microcontroller, I am going to use in this tutorial is PIC16F877A. In this tutorial, I will design a circuit for Servo Motor Control and will also provide the code, which I have used for Servo Motor Control. If you are working on a Servo motor then you should also check Control Servo Motor with Arduino. in which I have design a servo motor control circuit using Arduino board. The code is also given there. Moreover, you should also check Angle control of Servo Motor with 555 Timer.
A Brief Intro About Servo Motor
- Servo motor is simply another motor having a much better control system already installed in it.
- The beaut of servo lies in its precise angular movement. In other words, you can move the motor at any angle you want. Like I want to move the motor to 30 degrees then I can do it quite easily in servo, which is not possible in DC or stepper.
- Moreover, it has just 3 wires to control, one is GND, one is Vcc and the third one which is usually the middle one is for controlling purposes.
- Now when you apply signal to the middle one, it starts moving. Now, how much it will move depends on the length of signal applied. If the signal applied is small, it will cover small distance.
Servo Motor Control Circuit in Proteus ISIS
- First of all select the below components from the Proteus library and add it in your workspace.
Components Used:
These components are used while designing this simulation:
- PIC16F877a.
- Servo Motor.
- Crystal Oscillator. ( 16MHz )
- Resistors. ( We need 3 resistors of 10k ohm )
- Capacitors. ( We need 2 capacitors of 33pF )
- Two Push Buttons.
Working Principle:
- Now, design your circuit as shown in the below figure:
- When I started this simulation the motor moved to the -90 degree angle. Now when I press the button, it will move in the opposite direction.
- That's how it works. Just a simple motor nothing much complicated.
PIC Microcontroller Code for Servo Motor Control
- Here's the code which I have used for controlling this servo motor. Burn this code in your PIC Microcontroller.
#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1
int a;
void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;
a = 1;
while(1){
if((B1 == 0) && (a==1)){
PortB=0xFF;
delay_ms(100);
PortB=0x00;
delay_ms(1);
PortB=0xff;
a=0;
}
if(B2 == 0){
PortB=0x00;
}
}
}
Note:
- The code and the Proteus Simulation has already been emailed to all the subscribed members. If you are new here then subscribe to our newsletter and it will be emailed to you as well.
That's all for today. Hope I have helped you in some ways. In the next tutorial, we are gonna have a look at
Relay Simulation in Proteus ISIS. Till then, Take care, Stay Blessed.
Stepper Motor Drive Circuit in Proteus ISIS
Hello friends, hope you all are healthy, wealthy and wise. Today's topic is about the control of stepper motor. In the last post we have seen
How to control DC motor in Proteus, and now we are gonna see How to design a Stepper Motor Drive Circuit in Proteus ISIS. Stepper motors are usually of two types and the main difference between the two is in the number of wires used to control them. Mostly stepper motors use 6 wires to control them but few of them also have 4 wires to control them. Today we will have a look on the 6 wired stepper motor.
In stepper motor, there are electromagnets which gets polarized when we supply voltage to them and depolarized when we remove the voltage. These electromagnets act as a stater and when one side get magnetize, it attracts the rotor towards it and then we need to magnetize the other side and demagnetize the previous one and in this ways if the sequence is right the motor starts moving.
Stepper Motor Drive Circuit in Proteus ISIS
- First of all, add the below two components from the Proteus library in the workspace.
- Now design the circuit as shown in the below figure:
- This circuit is just for understanding purposes. Now I have added four states in the circuit, when I make any state one that stator got magnetize and the motor rotor will attract towards that stator and start moving.
- In the below series of images, I have shown the clockwise movement of motor.
- Now, as you can see from the above sequence of images, the motor is moving in the clockwise direction as I am supplying voltage in the clockwise direction.
- Now, if I reverse the order of applied voltage the motor will also reverse its direction and will move in the counter clockwise direction.
- The speed of the motor will depend on the speed of this sequenced voltages. If you apply these voltages with delay, the motor will move slow and if you apply them fast and continuously, the motor will rotate quite fast i.e. rpm of motor will increase.
Stepper Motor Control with Microcontroller
- Now, in order to control this motor using stepper motor, simply connect these wires with four pins of microcontroller and apply a sequenced voltage in programming and the motor will run quite smoothy.
- I will upload the video of the stepper motor control with microcontroller soon in this post.
That's it for today and I hope now you got the idea how to design a Stepper motor Drive Circuit in Proteus ISIS. In the next post, we will have a look at How to
design a Servo Motor Drive Circuit in Proteus ISIS. So, we will meet in the next post hopefully. Take care.
DC Motor Drive Circuit in Proteus ISIS
Hello friends, hope you all are fine and enjoying good health. In the previous posts, we have seen How to
design a 5V DC power supply in Proteus ISIS and after that we have also discussed How to
design a variable DC Power supply using LM317.So, now today we will check how to design a DC Motor Drive Circuit in Proteus ISIS. DC motor is present in Proteus and quite easy to use. First we will simple drive it by applying voltage on its both sides i.e. direct method and after that we will automate it and will drive the circuit using PIC Microcontroller. The microcontroller I am gonna use will be PIC16F877A and the compiler will be MikroC Pro For PIC.
This tutorial is not a correct method of driving any DC motor. In this tutorial, I am just giving an overview of How to design a DC Motor Drive Circuit in Proteus ISIS so you can say this tutorial is more about DC motor in Proteus software. So, don't try it in hardware. DC motor is a simple motor which needs polarity difference at its two ends. IF this polarity is in forward direction then DC motor moves in one direction and if we reverse the polarity then the DC motor moves in the opposite direction. So, let's get started with DC Motor Drive Circuit in Proteus ISIS.
Simple DC Motor Drive Circuit in Proteus ISIS
- First of all I will show you the simple control of DC Motor in Proteus so that you get an idea how this motor works.
- Add these two components from the Proteus library:
- Motor
- Logic State
- Logic State has two states 1 and 0. When its 0 means 0V and when at 1 means 5V.
- Now design the circuit as shown in the below figure:
- Now I have added two Logic State on both the sides of motor. Direction of motor will depend on these logic. So, their will be total four states:
- When both states are at 0, motor will not move and remain stationary.
- When both states are at 1, still the motor will not move and remain stationary.
- The motor will move Clockwise when upper state is at 1 and lower at 0.
- The motor will move Anti-Clockwise when upper state is at 0 and lower at 1.
DC Motor Drive Circuit Using PIC Microcontroller
- Now we will drive our motor using PIC Microcontroller, add below components from the Proteus library.
- Join these components and make a circuit as shown in the below figure:
- Now create a new project in the MikroC Pro For PIC and add the below code into it.
/* Code provided by www.TheEngineeringProjects.com */
#define M1 PORTB.F7
#define M2 PORTB.F6
#define B1 PORTD.F0
#define B2 PORTD.F1
void main() {
TRISB=0;
TRISD=0xFF;
PORTB = 0;
while(1){
if(B1 == 0){PortB=0xAA;}
if(B2 == 0){PortB=0x55;}
}
}
- Now burn the hex file of this project in the microcontroller of the Proteus file.
- If everything goes well, then when you click one button the motor will move clockwise and when you click other button the motor will move anti-clockwise.
- I have also shown the simulation in the video below.
Video Tutorial
- A complete video demonstration of the above tutorial is as follows:
Note:
- The Proteus circuit of DC motor drive and the hex file to burn in the microcontroller has been emailed to all the subscribed members.
- If you need these files, then subscribe to our newsletter and these files will be emailed to you as well.
That's all about DC Motor Drive Circuit in Proteus ISIS. In the coming tutorial, we will have a look at
How to drive a Stepper Motor in Proteus ISIS.
How To Use Oscilloscope in Proteus ISIS
Hello friends, today I am going to post the next lecture of Proteus Tutorial. I am receiving quite a positive response about this Proteus tutorial. In the previous post, we have seen
How to use Virtual Terminal in Proteus and today I am going to explain How to use Oscilloscope in Proteus ISIS. This oscilloscope is just the same which you have seen in your electronic or electrical labs. Oscilloscope is basically used to monitor signals or waveforms. Particularly when you are not much aware of the circuit and you need a little debugging then you use oscilloscope.
In oscilloscopes, we can visualize the electrical properties of waveforms, like we can check whats the frequency of electrical signal, what's its voltage or current. Digital oscilloscopes have vast range of features in it like RMS value calculation etc. So, in short when you want to visualize or research your available signal then oscilloscope is the first and right most option for you. In today's tutorial, first of all, I am gonna design a simple Pure sine wave circuit and then we will visualize its properties using oscilloscope in Proteus ISIS.
Pure Sine Wave Circuit Design
- First of all, design a circuit as shown in the below figure.
- This circuit is a simple pure sine wave inverter which is inverting the DC Signal into AC signal.
- I have also encircled the components so first of all, find these components in the Proteus database and then design the circuit as shown in the figure. (Right click on the image and then open it in new tab to get the clear view).
- When I was designing my Pure Sine Wave Inverter Simulation in Proteus then I have to use oscilloscope quite a lot.
How to use Oscilloscope in Proteus ISIS ???
- Now in order to add the oscilloscope in the circuit, first click on the Virtual Instruments Mode as shown in the below figure.
- In that mode the first option will be the Oscilloscope which I highlighted as Click # 2 in the below figure.
- Now drag that oscilloscope and place it in the workspace, as you can see below this component has total four legs means you can view total four different types of signals using this oscilloscope and cal also compare them, if you need to.
- Now what I want to check in my circuit is, whether I am getting the pure sine wave at the output or not.
- So in order to check that I have attached the two ends of the bulb which is acting as a load with the two probes of oscilloscope i.e A & B as shown in the below figure.
How to Monitor Oscilloscope
- Now in order to monitor the oscilloscope, run / play the Proteus circuit and then double click on the oscilloscope and a new window will open up as shown in the below figure.
- As you can see in the below image there are total two curves are showing i.e. Channel A & B.
- Now, if you check the right side of the above figure, you can see there are total four channels, each channel represent each probe.
- Like we have attached our curves with A & B now I can change settings of A & B channel and the output curves will be changed.
- Play with this tool and you will how easy it is to use. Change the position of circular know and the amplitude unit will be changed, then change the linear know of each channel and the dc offset will be added in the curve.
Note:
- This Proteus file has been emailed to all the subscribed members, if someone needs it kindly Subscribe to our Newsletter and it will be emailed to you.
Video Tutorial
- Here's the complete video tutorial of above discussion, better for understanding.
That's all for today, hope you guys have enjoyed today's tutorial nad have got the clear idea of How to use oscilloscope in Proteus ISIS. In the coming tutorial, I have explained
How to Design a DC Power Supply in Proteus ISIS. So, let's meet in the coming tutorial. :)
How To Use Virtual Terminal in Proteus ISIS
Hello everyone, I hope you all are doing great. In today's tutorial, we will have a look at How to use
Virtual Terminal in Proteus ISIS. It's our 5th tutorial in Proteus Series. I will first explain what is virtual terminal and then we will have a look at its uses and performance in Proteus ISIS.
Virtual Terminal is an important tool available in Proteus and it comes quite in handy while working on serial modules i.e. GSM, GPS, XBee etc. So, let's get started with Virtual Terminal in Proteus.
What is Virtual Terminal ?
Virtual Terminal is a tool in Proteus, which is used to view data coming from
Serial Port (DB9) and also used to send the data to Serial Port. In windows XP, there's a built in tool named
Hyper Terminal, which is also used for the same purpose but in windows 7 there's no such tool, so for windows 7 users this virtual terminal is quite a great comfort. If you guys don't know about serial port then I would suggest you to read this tutorial to get better idea of serial port:
I have posted many tutorials on my blog in which I have communicated over Serial port using different software. For example, you can check this
Serial communication in MATLAB and can also have a look at
Serial Communication in Visual Studio 2010. As serial communication is too common, so almost every microcontroller supports Serial communication. Arduino UNO has builtin single serial port at its pins 0 and 1, while Arduino Mega 2560 has built in four Serial ports in it. Similarly,
PIC Microcontroller also supports Serial port and it is also available in
8051 Microcontroller.
Uses of Virtual Terminal
Virtual Terminal in Proteus, as I explained above, is used to send or receive data to or from a serial port. Serial port is a 9 pin port which is mostly find on the computers and is used in
Embedded System Projects for data communication. Normally in student projects, data is sent from hardware to computer via serial port and then user design some application on their computer to view that data in some represent-able form.
Now, in projects there are some testing steps which are quite helpful, if we use them properly, and these testing steps require some tools in order to test the process. Like, suppose some student have designed the hardware to send the data to the computer and have also design its application to receive it and now when he tests it he didn't receive any data. At that point student got tensed and don't know where's the error so at that point there's may be some error in the hardware or may be in the software.
Now, in order to be sure he need to test both of them separately and here is the point where virtual terminal is used. First connect your hardware with the computer and then run the hardware and check whether you are receiving data on the virtual terminal or not. If you are receiving it, means your hardware is okay and the problem is in software side and if you are not means your hardware is not so good.
Whenever I start working on some projects, I always make sure that I am going in right direction like if I have to made this project then after completing my hardware, I will first check it via this virtual terminal and once I got sure that my hardware is okay then I will move to the software part. If you are gonna design the hardware then I think you must check
Serial communication with 8051 Microcontroller, which is also designed in Proteus ISIS software and the data is displayed using the same virtual terminal.
There are also many other applications of this terminal like suppose you wanna design some circuit in Proteus which involves serial port then you can add this terminal on your circuit and can test it before going to the hardware, which we will shortly see below. So, now let's get started with Virtual Terminal in Proteus.
How to Use Virtual Terminal in Proteus ISIS?
- First of all open the Proteus ISIS and click on the P button to search for the components, as we seen in previous tutorials.
- Now in the search box type "COMPIM" , when you search this a result will show up as shown in the below figure:
- After Selecting this, click OK to add this component in the database.
- COMPIM is the serial port in Proteus and using its properties we can assign any COM pin of our computer to it and it will behave like that pin. We will change the properties shortly.
- Now, click on the Virtual Instrument Mode and then on the Virtual Terminal as shown in the below figure and add it in the Proteus workspace.
- Now join the TXD pin of COMPIM with the TXD pin of Virtual Terminal and RXD with RXD as shown in the figure below:
- Now, double click on the COMPIM to open the Properties menu and set the properties as shown below:
- I have selected COM1 and my baud rate is 9600, you can set it whatever you want like if you are using the COM3 then set the port to COM3 and baud rate of your own choice.
- Similarly open the properties of the virtual terminal and make sure that the baud rate is same in both the cases.
- Now connect your hardware with the computer and play the simulation. Again make sure that the port which you have selected for the COMPIM is same port with which you have attached your hardware.
- After you play the simulation a black window will open up which will show the data coming from your hardware to the COM1 pin as shown below:
- This black box is actually the Virtual Terminal which is showing data coming from my hardware.
- If you play the simulation and this Virtual Terminal doesn't pop up then right click on the Virtual Terminal Component and then click on Virtual Terminal which will be at the end in the options and this black window will open up.
I think you guys have got much of the idea of this Virtual Terminal in Proteus ISIS. If you have any problem anywhere, ask in comments and also subscribe to our newsletter via email to get these amazing tutorials right into your mailbox. In the next tutorial, I have explained
How to use Oscilloscope in Proteus ISIS. Thanks, take care.