Jump to content
  • 0

Analog in/out phase lock using the USB-1808X and Python


Julia Fallon

Question

I have an input analog signal that is sinusoidal, but experiences small drifts in frequency unpredictably (2V +/-0.5V). I need to generate an output analog signal (square wave with DC offset) in sync with the analog input in order to operate a second device in phase with the input signal. I have a USB-1808X. Is there any way that I can use this DAQ, along with a Python program, to create a system where the analog input is captured and used to drive the analog output? Thanks.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Hello @Julia Fallon.

How and where did you determine the small drifts?

Are you attempting to acquire data, perform some processing on the data, and then output the data via the analog output channel?  All this in real-time?  Please detail your application and its requirements.  Python may not be the most efficient language to use for processing, in this application.

Regards,

Fausto

Link to comment
Share on other sites

  • 0

The analog signal I am using as input is generated by a physical motion in a system that is driven by a steady 270Hz signal. The physical response of the system to the steady 270Hz is not perfect, so the resulting signal wobbles slightly. Monitoring the physical response signal on an oscilloscope, I can see that it mostly reads 270 Hz but also flickers to 269.X and 270.X values. I need to be able to react to these signal deviations in the DAQ signal output to another device so the two devices can work in sync. Is 270Hz too fast for Python? What would you suggest I use instead?

Link to comment
Share on other sites

  • 0

I'm not entirely sure how best to use the USB 1808X for this application, to be honest. I know for sure I need the DAQ to read and record the analog input, since I will need that data later. I am hoping to use the internal scan clock to sync the in/out scans. I tried creating a loop where the in/out analog scan parameters (frequency based, so rate) were updated every 30 periods based on the last analog in data (by watching the voltage drift), but I get gaps in the recorded data (not really a surprise). I have been informed that TTL digital output might actually be ok for driving the second system, so I was going to try simultaneous analog input and digital pulse output to see if that helps with getting closer timing. I am also trying to figure out the update timing (30 periods is too long or short?).

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...