1/9/2012 4:26 AM | |
Posts: 140 Rating:
|
Hello Experts, I thought of a logic to calculate the timer period without using the ero crossing or sign concept. Please look at the attached picture for understanding. However I need help in implementing that logic in the PLC Programming. I also want suggestions on how can I do comparison between current and previous values? Please suggest if you have better ideas. I need to solve this asap! Thanks!
AttachmentTimer_WithoutZeroCrossing.pdf (183 Downloads) |
1/9/2012 3:36 PM | |
Joined: 1/28/2009 Last visit: 9/10/2024 Posts: 6849 Rating:
|
Dear Khyzer, Please refer to the following material on definition of periodic signals as a basic concept in "Signals and System" Signals and Systems/Periodic SignalsYou should find a pattern and follow the pattern to estimate the period.This is also possible to apply for distorted signals. If the signal is contaminated as an example with higher frequecy signals, it is possible to use signal processing blocks to reject specified part of signal (Filters).
But about developing a function to estimate a period of a real time signal, at least we should now the periodic pattern to follow and measure! Best regards, Hamid Hosseini |
2/9/2012 9:54 AM | |
Posts: 140 Rating:
|
Dear Experts, I have found a way to calculate the period for a parameter's waveform without using zero crossing method. Please see the attached program for details. I am using dead time FB to delay the input value by 100ms and then comparing current value and delayed value and based on that I am calcualting time elapsed between two peaks. However I have a new task to achieve now.Calculate the period on basis of sliding window. The first period, after system startup, will take 10 min to calculate. After that, the period will be calculated on every 30 sec based on last 10 minutes data (Sliding Window). I am not sure how to implement this concept. Another thing I want to achieve is to display previous 10 values of the calcualted period on HMI and continuously update them on HMI. Like after 1st period calcualtion it will be shown on HMI and then when 2nd calculation is done, 2nd value (Current) will take place of 1st and 1st value will be shown as previous value, and so on till the 10th value is caluclated. Its like an array stack which has 10 slots FIFO but I want to know the syntax and practical implementation of this concept. Please help me in achieving the above scenarios. Thanks in advance! AttachmentOB35.pdf (159 Downloads) |
7/18/2012 3:26 AM | |
Posts: 140 Rating:
|
Dear Hosseni, Hope you are fine. Regarding my period calculation algo, I managed to calculate it by my method however now I am facing another issue. I need to reject some of the false readings that are causing my calculations to be wrong. Please see the picture attached for more info.I have come up with an algo to remove that fault but I am unable to implement it in Ladder/STL however could you please help me to implement this in SCL? If you need further clarifications then please let me know. I need to solve this issue asap. Hoping for your assistance! regards, Syed!
Attachmentperiod_180712.pdf (184 Downloads) |
7/18/2012 3:04 PM | |
Posts: 378 Rating:
|
Hi Syed, 1) If the polarity of the signal doesn't change "always", it is DC with zero frequency and ∞ period. But what do you mean always ? Is it sampling time? If yes, the period will be X / 0 = ∞ ms, well you have to handle on your program mathematic for such scenario, say: IF (sample1 - sample2) == 0 THEN Period = DC; // where DC is some unique number ELSE useBeVeepost(); // Read BeVee post above. ENDIF 2) If your application has high frequency, I suggest you to use OB's with highest priority rather than FB to have lowest scan time. Regards, |
Follow us on