After that select the switch block from this section as shown in the figure below,.From the library browser select the signal routing section as shown in the figure below, For that purpose, we need a conditional statement as we have used in previous tutorial. We must need to provide it some limiting value after which it must reset its value to zero and start over again. It will start updating the previous value to infinity. A counter with no resetting condition is of no use. The problem with the counter is that there is no resetting condition of this counter.Therefore, from the commonly used blocks section select the scope block as shown in the figure below, We will use the scope block of Simulink to see all the process of the loop in one window. This display block, however, will only show the most recent output after the execution that’s why it is not suitable here. Now in order to see the output of the counter we also need some output display. This will add the selected block to the current model.Right click on the block you want to add or place in the simulink model and then click on Add block to the model from the drop down menu as shown in the figure below, Up till now in these tutorials we have been using the drag and drop method to place a component on the Simulink model.From the library browser select the commonly used blocks section and from that section select the delay block as shown in the figure below, Therefore, we need a delay block that will add a delay in the addition of the previous value. Now if we directly attach the output of the add block to its input Simulink will consider it as an error because both the operations are implemented on the same instant. This add block will add up the previous value of the counter to the constant block placed previously to complete one iteration.For the time being select the add block from the math operation section of library browser as shown in the figure below, From this section we need an add blocks and the purpose of that blocks is also described.From the library browser select the math operation section as shown in the figure below, In order to design an algebraic loop for the implementation of the up counter we need an add block which will add 1 to the previous value after each iteration of the loop. If o set it to 2 the counter will change its value in steps of 2 as you will see shortly, once the model of the up counter is complete. This block will be used as the size of the step of the counter i.e.From the library browser click on the commonly used blocks section as we have been doing in previous tutorials and then select the constant block from that section as shown in the figure below, In Simulink click on the library browser icon and open library browser as we have been doing in previous tutorials. I will now perform here a simple example which will help you understand the working of loops in simulink. Lets’ now move towards the programing part. Explanation with a program: Designing an up counter with Simulink
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |