From Friday, January 17th 11 PM CDT (January 18th 5 AM UTC) through Saturday, January 18th 11:30 AM CDT (January 18th 5:30 PM UTC), ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

External trigger sync in conjunction with nearest pulse of fixed frequency device..

Solved!
Go to solution

I am writing an application that performs a raster scan. One axis of the scanner runs at a fixed frequency. I am using a 5105 high speed digitizer to acquire the data. The slow axis of the scanner is controlled by a servo with an analog input. I will probably use an M-series board for the analog control, but may also go with a 6713 (output only) or some other board. The fixed frequency scanner provides a line clock, which I would like to use to drive the 5105. Additionally, the analog board will need to be synchronized into this. The whole system should be able to accept a trigger from external devices, such that it begins scanning at the next line clock edge.

 

I'm not entirely sure what the best way to do this would be. The external trigger from other devices will be of an indeterminate pulse width, so I can't simply use it as a gate for the line clock. I am reluctant to do it in software (ie via change detection on a digital line) because I want it to be reliably started at the next clock pulse. I have considered things like a counter/timer with a pause trigger, but that could lead to drift between the control board and fixed frequency scanner. It just seems more complex than I think it should be, and it feels like I'm missing a simple way to do this.

 

Any suggestions?

0 Kudos
Message 1 of 8
(4,466 Views)

Hi chsl,

 

It sounds like the scanner might just be running continuously and you only want to trigger an acquisition at certain times.  If this is the case, you can use a Start Trigger with the 5105:

 

Acq_Arm.png

 

Is the AO Card running continuously or is it also triggered?

 

 

I'm not 100% sure on which parts of this application need to come from our hardware and which are already coming from the scanner and other external sources.  If the scanner is running continuously on one axis, wouldn't you want the AO card to output continuously as well on the other axis? 

 

If possible, could you post a timing diagram of what you need to do to help clarify.

 

 

Best Regards,

John

Message Edited by John P on 12-15-2009 05:51 PM
John Passiak
0 Kudos
Message 2 of 8
(4,460 Views)

Thanks for replying.

 

I want something that behaves like a start trigger, that's where the external trigger from other devices comes in. Once that signal is recieved, the analog output should begin on the next line clock pulse, and should stay synchronized to the line clock. One axis of scanning is running continuously, in addition to being at a fixed frequency. I can't just use a start trigger, because there are essentially two trigger inputs (the "external" trigger and the line clock), which may not overlap in time. It's almost as if the external trigger will "arm" things and the next line clock will function as the start trigger.

 

The round-up of signals includes the line clock, which is from a third party device. A TTL trigger (most likely a rising edge) needs to be accepted to kick things off (from outside of the system this will appear to behave like a start trigger, and from inside it will be an "arm"). Then there's the outbound analog signal to the scanner's servo. Any other signals generated/recieved are entirely optional, and will be whatever it takes to get the NI hardware behaving as desired.

 

The scanning will stop and start at all sorts of intervals, under control of higher level software and direct user control. The duration of the scanning will vary considerably, and for longer timescales clock drift can become an issue. When not scanning, the fixed frequency axis of the scanner will keep running, but the other axis will be stopped.

 

If the "external trigger" signal was to behave like a pause trigger or had a width large enough to do a digital pattern trigger, this would make this easy. As it stands, the fact that it's a pulse is what's making this complicated for me.

 

Does that clear it up a bit? Do you have any ideas?

 

I am using NIDAQmx and NI-Scope to program this, by the way.

0 Kudos
Message 3 of 8
(4,455 Views)

Hi cshl,

 

I believe the following should be what you need:

Use the external trigger as the Start Trigger for both your AO and your Scope devices.

 

Use the external line clock as the Sample Clock for each of these devices.

 

This would arm each device when you send the trigger signal, and the AO updates would occur on the line clock edges (can be configured to be rising or falling).  Do you want to take a single sample off of each line clock pulse?  If so just use this as the sample clock for the Scope (assuming the clock is running continuously--the 5105 uses pipelining to achieve higher rates so it requires a continuous sample clock once armed).

 
Best Regards,

John

John Passiak
0 Kudos
Message 4 of 8
(4,434 Views)

Interesting suggestion.

 

I wanted to use the pixel clock as a sample clock for the 5105, but that won't work because the pixel clock varies from around 3Mhz to 12Mhz. We went through this with NI engineers, and there are no boards that can take a sample clock that varies so much. Instead, I am using the line clock as a trigger to acquire ~7500 samples, which I then organize into pixels (with a varying number of samples per pixel) in software. I don't expect there to be much clock drift on the order of a single line, so this approach is fine. But, over many lines, there will be drift, so it needs to get synchronized.

 

As for the analog output, there are two ways to look at it. One is to put out one sample per line, and the other is to run it in a much smoother sawtooth. I had been leaning towards the latter. I think if I went with your approach, it might work reasonably well. Although, it would be nice to have the slow scanner step during the turn around of the fast scanner, so that the motion (and settling) is masked out in the samples we discard. I might be able to do that with a signal available on the servo.

 

The only sticking point is the 5105 still needing two triggers. I could maybe get around this by putting out another signal from the other board to be used as the trigger for the 5105. I don't know how to do that exactly, because I would only get one sample per line clock, and I would need two samples in order to generate an edge. Could a counter/timer solve this?

0 Kudos
Message 5 of 8
(4,429 Views)
Solution
Accepted by cshl

Hi cshl,

 

Good to know--the 5105 has a duty cycle tolerance of 45-55% (mentioned in the specs page), so this is why you can't change the clock rate from 3 to 12 MHz on-the-fly (although if you made small incremental updates over time this would be possible in theory).

 

With the extra information in mind, you might want to try the following on the 5105:

Use the external trigger as a start (acquisition arm) trigger.

Use the line clock as a reference trigger (with a referen