Simulink help for getting a frequency I can use as an input

Click For Summary

Discussion Overview

The discussion revolves around extracting the frequency of a sine wave signal in Simulink for use as an input to a PID controller. Participants explore various methods and blocks available in Simulink to achieve this goal, particularly in the context of controlling the frequency of a Double Fed Induction Generator.

Discussion Character

  • Technical explanation, Debate/contested, Experimental/applied

Main Points Raised

  • One participant describes the challenge of obtaining a numerical frequency output from a sine wave block in Simulink to use in a PID controller.
  • Another participant suggests using a Phase-Locked Loop (PLL) block available in Simulink to find the frequency of the signal.
  • A participant expresses difficulty in connecting the PLL block to obtain a frequency output, specifically mentioning that a display only shows a value of 1 when connected.
  • Another participant notes that without the DSP toolbox, there may not be a straightforward block to use and suggests using FFT or DFT functions to extract frequency information.
  • This participant also proposes writing a custom function for the Fourier transform or using individual blocks to implement the necessary functions, with the option to save the setup as a subsystem for future use.

Areas of Agreement / Disagreement

Participants present multiple approaches to the problem, with no consensus on a single solution. There is disagreement on the best method to extract frequency information, particularly regarding the use of the PLL block versus FFT or DFT methods.

Contextual Notes

Some participants mention the need for specific toolboxes (like the DSP toolbox) to access certain blocks, indicating that the availability of tools may limit options for extracting frequency information.

Vagabond7
Messages
50
Reaction score
11
Ok, say I have a sine wave block that has a frequency of 60Hz. What can I do to get that frequency as a number so I can use it as an input to another block? I've tried various things such as a "sign" block that counts when it switches from positive to negative and then a counter that resets after a second. That doesn't work. It counts up and resets, but it doesn't just tell me what the frequency of the signal is. I want something that will just say "hey, the frequency of the input signal is this." so I can feed it into another block.

Essentially I am trying to get a frequency I can feed into a PID so I can control a variable frequency to keep it at a steady 60 Hz.

I am actually trying to control the frequency of a Double fed induction generator that doesn't have a steady output voltage frequency. We can control the rotor frequency as a means of controlling the stator output frequency, but I am trying to do this automatically with a PID controller. I'm feeding the stator voltage into a controller that can run simulink models, but I can't get it to just say what the stator frequency is. I can't find anything is simulink that will just give me a block that has the frequency of the input signal that I can feed into something else. Any suggestions?
 
Engineering news on Phys.org
Hi,
You can use PLL block in Simulink to find the frequency of the signal. Both single and three-phase PLLs are available in Simulink.
 
I had looked at the PLL block, but I couldn't find a way to hook it up to anything that actually gave me the frequency. Say for example, I just hook up a sinewave block set to 60Hz to the PLL, what do I need to run the Frequency output to for it to say "60"? I tried just hooking it up to a display but it would only give me a 1 I think. What do I need to do with the PLL to actually get it to output the frequency being fed in?
 
unless you have the DSP toolbox, there is not a drop in block.

have you had a signals and systems class?
You want to extract frequency information, which implies a DFT, FFT, or continuous Fourier transform function.
Either use the FFT block from the DSP toolbox, or use the s-block to write your own function and implement the Fourier transform or fft or dft.
or you can use individual blocks to implement the for-mentioned functions. Then you can save the pattern as a subsystem and use it in the future.
 
Last edited:

Similar threads

  • · Replies 14 ·
Replies
14
Views
3K
  • · Replies 0 ·
Replies
0
Views
2K
  • · Replies 9 ·
Replies
9
Views
1K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 46 ·
2
Replies
46
Views
5K
Replies
26
Views
7K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
10
Views
3K