![]() So maybe we can tell sunny from cloudy by comparing the power in the higher frequencies to some threshold. Remember those short-time variations? Well that’s how they look in the frequency domain. We see that the low frequency content is about the same for both days, but the cloudy one has way more high frequency content. Although the default time unit is seconds, we’re actually measuring time in days. So the x-axis is cycles per day, not cycles per second (or Hz). The y-axis shows us how much power is in our signal at a given frequency. And let’s turn on the legend to see which day is which. This time we can run our model from within the Spectrum Analyzer by pressing the green button at the top. We have short signals, so we’ll need to change a few settings in the Spectrum Analyzer block so we can see them properly. To branch a signal line, you can right-click as you drag the signal line to a block. We first add a Spectrum Analyzer block from the DSP System Toolbox and then connect the two signals to it. ![]() We’ll use spectral analysis, which helps us measure the frequency content of each of the signals. Well let’s also look at these signals in the frequency domain. So how can we use these features to decide if we have a sunny day or a cloudy day? The blue line shows that the cloudy day produces less power, as you’d expect, and also has many short-term variations as the clouds pass over the solar array. Let’s double-click on the Scope block to see the signals.Īnd lets connect our data points using lines. We can now run our model by clicking on the Run button in the toolstrip. We should also set the total simulation time to 1 day. To bring the data into Simulink, we can go to the Model Settings window, then the Data Import/Export pane, and add the time and two power signals as inputs. ![]() Under the Signal Attributes tab, set the Sample Time to the reciprocal of the sampling frequency. We have to set the Sample Time of the two Inports, so double-click on each Inport to adjust its block parameters. Sampling every 15 minutes means we get 96 samples per day. We also have the sample frequency, in samples per day, in the variable Fs. The corresponding timestamps are in tday. In MATLAB we have two vectors, sunnyDay and cloudyDay, representing the power measurements for two particular days in June. To label a signal line, double-click and type the name. We can connect the blocks together with signal lines by clicking and dragging. Let’s label the two Inport blocks “Sunny Day” and “Cloudy Day” and the Scope block “Time Domain”. To view our signals, let’s drag two input ports, or Inports for short, into our model. We’ll start by visualizing two power signals – one from a sunny day and one from a cloudy day. Open the Library Browser to see all of the blocks available. Simulink models are built up from blocks and signal lines. We’re starting our model from scratch, so we’ll choose Blank Model and save it as sunnyvscloudy. 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 on the MATLAB toolstrip. Let’s design a system that can predict if it’s going to be sunny or cloudy using signal processing techniques in Simulink. Then on cloudy days, we use it to supplement the lower power generation. To smooth out the generated power, on sunny days we can store some of the power in a battery. Predicting and managing the variable production and demand is an important part of renewable energy generation. Of course, the power depends on the amount of sunshine, which depends on the time of day. We’ll use measurements of the power produced by the array every 15 minutes. We’ll assess the performance of our algorithm and, once it’s ready, convert our model into C code that can be embedded into real-time hardware. So let’s get started…Īt the MathWorks headquarters in Natick, Massachusetts, there are solar panels that generate electrical power. Based on that, we’ll design and build digital filters as part of a signal processing algorithm. We’ll perform spectral analysis to explore the signal. In this video we’ll use Simulink to process a signal from a sensor. They’re in robots in factories, in our cars, on our wrists, even in our refrigerators making sure our food stays fresh.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |