![]() ![]() That should be all we need to model the panel. Let’s add an annotation to show the equation being modeled-so when we come back to it later, we’ll easily know what the equation is. We’ll set the gain to 1/J and, again, let’s define the variable J in the base workspace with a value of 8.6. Then, use the drop down to find the right block and hit enter. We’ll do that with another Gain block.īut now that we know the name of the block, we can just double-click in the model and start typing the block name. To finish up the equation, we need to divide by the inertia, J. Let’s check MATLAB, and yep, the variable Kd has been created. We’ll give it a value of 5 and store it in MATLAB’s base workspace. So click the three dots and select Create. ![]() That red box is telling us that Kd hasn’t been defined yet. Rather than hard-coding the gain value, we can also use a variable, or even MATLAB code. We can branch this signal by right-clicking and dragging to connect it to the Subtract block.Īnd don’t forget we still need to multiply that by Kd. The damping term depends on the panel’s velocity-the theta_dot signal. We need to perform a subtraction, so let’s also grab a Subtract block. You can double-click a block to change its parameters-let’s change the value to 10. Next, let’s model the right-hand side of this equation. Let’s name this one theta_dot_dot for acceleration, then theta_dot for velocity, and theta for the position of the panel. It’s a good idea to label signals to keep things organized, so we’ll double-click the signals and type in a name. Don’t worry about these red lines, we’ll connect them up in a second. We connect blocks together with signals by clicking and dragging between blocks. Let’s add another one to also get the position. Our equation has acceleration and velocity terms, so we need at least one integrator. This is the basis for modeling differential equations in Simulink. If we integrate velocity, we get position. If we integrate acceleration, we get velocity. So why an Integrator block? Well, the integrator block takes an input and integrates it over time. Let’s click and drag an Integrator from the library to our model. To model the equation for the panel, we’ll start with the Integrator block. Open the Library Browser to see all of the blocks available. Simulink models are built up from blocks and signals. We’re starting our model from scratch, so we’ll choose Blank Model. This opens the Start Page, where you can create new models, find examples, and even find basic training. You start Simulink by clicking the Simulink button in the MATLAB toolstrip. With some basic physics, we can write out the equations of motion for each. The physical system has two main components. Once we’re happy with the design, we’ll test it to see how well it does tracking actual sun data. We’ll model those first and then we’ll add a controller to track the sun’s position. The physical system consists of a panel and a motor. If you want to follow along as we build the model, you can download it using the link below. In this video, we’ll use Simulink to design a tracking system to keep a solar panel aligned with the sun. What if you had solar panels that rotated to track the sun so that you could produce as much electricity as possible? That means they produce more electricity when the sun is shining directly on them in the middle of the day, and less power when the sun is to the east or west, early and late in the day. These panels face south and are fixed in place. Let’s get started!Īt the MathWorks headquarters in Natick, Massachusetts, there’s a number of solar panels to generate electricity. Stay tuned to the end to find out where to go to learn more about how to use Simulink. This video will show you the basics of Simulink and give you an idea of what working in Simulink looks like. You can use it to model simple things-like a home thermostat or complex systems-like a fully autonomous vehicle or a surgical robot. ![]() Simulink takes care of the simulation so that you can focus on the engineering. Simulink is a graphical environment for modeling dynamic systems-that is, systems that change over time. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |