04-17-2010 07:48 AM
04-20-2010 10:00 AM
Hi Pavel,
What you are seeing sounds like you are wanting to do continuous 100 ms analog generation and analyzations, but you are seeing 20 ms gaps in your sequence. It sounds like having exactly 100ms in your array will put the end of your sequence just past the fifth rising edge on your clock, and thus it waits until the next rising edge happens to start the process again. That is why you are seeing correct behavior at 99ms. The extra 1 ms buffer allows your sequence to end and reset so that the next rising edge it will start over again just fine.
04-20-2010 04:57 PM
Hi (Kyle),
Is there in a situation described above by Pavel any chance just to count number of 50 Hz trigger pulses and to run signal generation (and analysis) every 5th trigger pulse (to obtain required 100 ms). Then, we can synchronize system for 20, 40, 60 ms etc periods without 1 ms buffering, using 1st, second, third trigger pulse... If it is possible, how it can be realized?
The idea of this is to eliminate noise produce by 50 or 60 Hz supply by synchronizing measurements with phase of supply voltage.
Regards,
Leo
04-21-2010 10:44 AM - edited 04-21-2010 10:44 AM
Hi Leo,
So if I understand correctly, you have a 50Hz signal that you are triggering off of the rising edge of this signal. You want to start generation/analysis every fifth trigger seen. How long are you executing your sequence?
If you are looking to trigger on every fifth trigger, you can use a counter to count the rising edges, and then do a division by 5 on the current count using the Quotient and Remainder vi. Then have a case structure that executes your sequence everytime the remainder equals 0, and all other cases do nothing.
I think I'm a little confused as to what you are trying to achieve, as in your sequence timing. Do you want to do 20 ms bursts or do you want to do 100ms at a time? I think the issue here is that you cannot start another cycle of your sequence without completing the first one. If you plan to do consecutive 100ms sequences, you might consider just having a start trigger and then a continuous sequence that has a particular stop condition.
04-21-2010 03:13 PM
Thank you, Kyle. This is, I think, the answer for the question how to synchronize measurement/signal generation with line frequency.
I am executing 1-20 ms burst (if I understand term burst the same as you are) with period (sequence) multiple to line frequency. So, when there is multiple to line frequency (50 Hz in Europe) period of measurement (20, 100 or 200 ms) the answer seems simple.
However, the next task is to measure/generate 2 ms signal with 5 ms period (4 times in 20 ms period of supply voltage frequency), so that every 5th measurement/generation will start triggered by the rising edge of the next 50 Hz synchro pulse. Is it the same simple answer as above and what kind/size of buffer I need to let 5th measurement start again by 50 Hz line trigger?
Actually, I am trying to replace hardware PLL (phase lock loop) or similar instrumental approaches of synchronization (as in TV-set) programatically. Probably, some known approach permits to do it flawless?
Redgards,
Leo
04-22-2010 05:03 PM
Leo,
So you are making a 2 ms signal into a 5 ms signal, stretching it out to fit that period, is that correct? I'm not sure what you mean by the buffer, but as stated before you need to have your sequence (analysis/generation) finished and waiting for a trigger by the time the trigger comes around. Otherwise, the trigger will happen and be ignored because the task is still executing.
There seems to be a lot of different considerations as to how you are handling the signal and how you are implementing the PLL. If you generate too slow, then there will be gaps in your signal, and if you generate too fast, you either miss the trigger or stop your generation short of completion. I can think of no easy way of doing this, so hopefully I have provided some information for you to continue working with your particular application. The only way I can think of to achieve this is to not continously generate and allow for some time to resync your signal period.
04-22-2010 05:25 PM
Yes, you right. A lot of different considerations make the system very time and processor dependent. Unfortunately, experiments with slow resync (as for example every 5 s) showed that it does not work because 50 Hz (and probably 60 Hz in US) line is not as stable as one may think.
Thank you again,
Leo
04-23-2010 01:45 AM
Leo Pribram wrote:Yes, you right. A lot of different considerations make the system very time and processor dependent. Unfortunately, experiments with slow resync (as for example every 5 s) showed that it does not work because 50 Hz (and probably 60 Hz in US) line is not as stable as one may think.
Thank you again,
Leo
It looks like you are talking about mains power here...
If you are talking about triggering off the mains power lines then this is beacuse the power companies have a duty (under law in the UK at least) to ensure that over a full 24hour cycle the average rate is 50Hz, the rate during any given minute may be higher or lower due to the use of other users on the grid, but over a 24hour period it will sort itself out. This is to ensure people can use didgital clocks and other devices that get their timing from the mains frequency.
Hope this helps.
James