MCCDAQ

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

MCCDAQ

mglotzer
I am trying to get a Mad City Piezo stage and a few shutters initialized with
M-M. They are all controlled with a (old) DAQ Board 2000 and are operable
with Metamorph using the indicated outputs.
<http://micro-manager.3463995.n2.nabble.com/file/t397362/MetaDAQ.jpg>

I was excited to find this   post
<http://micro-manager.3463995.n2.nabble.com/Measurement-Computing-PCI-DDA08-16-Drivers-MCCDAQ-td7580725.html>  
that suggested this was feasible.

I installed the Measurement Computing Universal Library and that allowed me
to select various MCCDAQ devices in the configuration wizard.

Installation of the shutters failed, however, with the error devices not
found.

Installation of the focus drive was successful at first, in that it
installed as a device, but the device was not operable.
<http://micro-manager.3463995.n2.nabble.com/file/t397362/Z_control_issue.jpg>
In case the image doesn't show the error reads Cannot Set property "Volts"
to "2.36" [Error in device MCC-DAC-0": MCC bad board error (1)]

I note that in metamorph the available devices are not labeled with generic
names. Instead Z, Monochromator, etc which suggests to me that there are
some parameters set somewhere that are specific to my application (I didn't
install the board myself, initially) and it looks like there are 8 shutters
in addition to the ones I use. It is not easily possible to try other
shutters than the ones I use because the breakout cable I have only has ~6
BNC connectors, so not every channel is accessible.

I'd be eager for any suggestions. This is the last piece of hardware that is
precluding me from using M-M for actual imaging!
best,
Michael







--
Sent from: http://micro-manager.3463995.n2.nabble.com/


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MCCDAQ

mglotzer
A partial solution to this problem was to avoid the DAQ board entirely and
use an Arduino instead. This  tutorial
<https://micro-manager.org/wiki/Control_laser_shutters_with_Arduino>   got
me most of the way there (H/T to Rocco!).

The solution is partial as the analog control of the Piezo stage is still to
be worked out.



--
Sent from: http://micro-manager.3463995.n2.nabble.com/


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MCCDAQ

Stuurman, Nico
Hi Michael,

> A partial solution to this problem was to avoid the DAQ board entirely and
> use an Arduino instead. This  tutorial
> <https://protect2.fireeye.com/url?k=31b38511-6df3b02f-31b3a20c-0cc47ad9c120-0e998ce49eca2ef8&u=https://micro-manager.org/wiki/Control_laser_shutters_with_Arduino>   got
> me most of the way there (H/T to Rocco!).
>
> The solution is partial as the analog control of the Piezo stage is still to
> be worked out.

Talley Lambert asked me about the state of analog outputs in MM, and I
send him the following:

Analog out control is an interesting point.  For many years, I have been
trying to get an easy to use, affordable way of doing this, but still do
not have a solution that I can fully stand behind.  A bit of history,
couple of options:
- In 2008, we put a DA chip on an Aruindo to provide real Analog outs.
Works fine, but needs some creativity.  There is still code in the
Arduino adapter to do this.  I am still scouring the internet on
occasion for a nice Arduino shield that have a couple of analog outs.
There are dirt cheap single channel DAQS (for instance:
https://www.sparkfun.com/products/12918), but those need work
integrating in both software and hardware.
- Velleman (Belgium company), had boards with analog outs.  First the
K8055, later the K8061.  The latter is faster, and highly preferable.  I
see that they now can be bought for $120.  MM has support for these.
They need a bit of work to wire up.
- The NI USB boards should work.  They may be found on Ebay for not too
much money.
- Ed Simmons used to sell Arduino inspired boards with analog outs.
Regretfully, he has disappeared.
- Austin Blanco used to sell the "triggerscope" that can be used for
analog outs.  No idea if he still does.
- Matt Paszek's group is working on open source hardware that has many
capabilities for analog outs
(https://www./biorxiv/.org/content/10.1101/533349v1). They are working
on good micro-manager support.
- It is possible to add a capacitor to a PWM output to generate an
analog output.  Would need very fast PWM, and I always worry about
fluctuations.


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: MCCDAQ

AustinBlanco
I wanted to note my Triggerscope 3B is available (now 6th generation), with more info here - http://www.austinblanco.com/blog/new-triggerscope-3-b-adds-range-spanning-leds-high-current-drive-and-more/
Obviously my marketing efforts for this aren’t up to par, otherwise this would be more widely known!!

For those who want to “roll their own” I’d recommend avoiding the PWM/cap option. This won’t produce a clean signal with appropriate source/sink to various devices.

The input requirement for any signal in our world of microscopy is something like
50mA sink
250mA source
Obviously this depends on what you are driving, but eventually you’ll run into laser impedance issues with the anti-ringing measures they employ, hence the requirement for 200mA drive. 
So none of the ‘duinos do this. Especially the faster ones.
It follows then that you’ll need an output buffer. 


Using Eagle/kiCad you can build a PCB that will interface w/ an Arduino, which, the Triggerscope is simply this idea expanded to include a front panel, I/O connections (this is another annoying problem - how to get the signal out in a non “wires everywhere” way (and not requiring a custom cable) as well as high current source/sink for impedance matched lasers, and a 16 channel DAC @ 16 bits and range selectable from 0-2.5/5/10/-10+10 etc. 

So what ends up happening is you can use the arduino board for the microcontroller side as a canned solution (IC, clock, power management, I/O breakout), then add buffering IC’s for the digital pins, then add a monolithic DAC IC or two, then add SMA connectors, then source a custom enclosure (because none of the stock enclosures are sized for such a board, and because drilling ~ 36 holes in a front panel is annoying, and because custom panel companies charge a LOT to do this for you ) , and then add assembly labor, and what you end up with is something akin to the triggerscope.

Anyway, I hope that explains how I approached the problems involved, and how I addressed them. I sell the triggerscope for $1,300 list price, at which I think most people would be surprised to find are thin margins for the work involved. Most importantly (at least to me) is that I will support the use of the device, e.g. help customers get it working. It’s tough to figure out at first, especially without an oscilloscope, so I’ve tried to both provide support on installs, but to also incorporate new ways to help when doing setup. This is why I added the new Led status indicators, showing whether an output is enabled, whether a trigger is received, etc. 

Nico, on a separate note, I’d like to discuss the TG3B with you and make sure it works for your needs. An official blessing by the Micromanager team would be nice!


Austin Blanco
Advanced Research Consulting Corporation
e. [hidden email]
w. www.advancedresearch.co
c. 510.708.2995





On May 7, 2019, at 5:40 PM, Stuurman, Nico <[hidden email]> wrote:

Hi Michael,

A partial solution to this problem was to avoid the DAQ board entirely and
use an Arduino instead. This  tutorial
<https://protect2.fireeye.com/url?k=31b38511-6df3b02f-31b3a20c-0cc47ad9c120-0e998ce49eca2ef8&u=https://micro-manager.org/wiki/Control_laser_shutters_with_Arduino>   got
me most of the way there (H/T to Rocco!).

The solution is partial as the analog control of the Piezo stage is still to
be worked out.

Talley Lambert asked me about the state of analog outputs in MM, and I
send him the following:

Analog out control is an interesting point.  For many years, I have been
trying to get an easy to use, affordable way of doing this, but still do
not have a solution that I can fully stand behind.  A bit of history,
couple of options:
- In 2008, we put a DA chip on an Aruindo to provide real Analog outs.
Works fine, but needs some creativity.  There is still code in the
Arduino adapter to do this.  I am still scouring the internet on
occasion for a nice Arduino shield that have a couple of analog outs.
There are dirt cheap single channel DAQS (for instance:
https://www.sparkfun.com/products/12918), but those need work
integrating in both software and hardware.
- Velleman (Belgium company), had boards with analog outs.  First the
K8055, later the K8061.  The latter is faster, and highly preferable.  I
see that they now can be bought for $120.  MM has support for these.
They need a bit of work to wire up.
- The NI USB boards should work.  They may be found on Ebay for not too
much money.
- Ed Simmons used to sell Arduino inspired boards with analog outs.
Regretfully, he has disappeared.
- Austin Blanco used to sell the "triggerscope" that can be used for
analog outs.  No idea if he still does.
- Matt Paszek's group is working on open source hardware that has many
capabilities for analog outs
(https://www./biorxiv/.org/content/10.1101/533349v1). They are working
on good micro-manager support.
- It is possible to add a capacitor to a PWM output to generate an
analog output.  Would need very fast PWM, and I always worry about
fluctuations.


_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

Re: (QUAR} Re: MCCDAQ

Stuurman, Nico
In reply to this post by Stuurman, Nico
Hi Michael,

ccing the mailing list.
>
> I am going to look into triggering. I have avoided it so far, but that
> is probably an oversight.
>
> Does the camera get any feedback from the stage? Or does the piezo
> move so fast that it doesn’t matter?

Yes, that is the idea.  In practice, we have never seen problems
(settling times are usually ~10 ms, exposures are often longer, plus
step sizes are usually small).

>>
>>>  Have any thoughts about the other question I posted on with the
>>> projector plug in? I can’t get temporal control of the SLM pulses - it
>>> just triggers a shutter opening of defined time.
>>
>> Back in the lab now.  Will try to get time on our system and look there
>> to refresh my memory.

I just had a look and that stuff is a mess.  The problems very much
originate from the desire to use the same code for both galvo-based
photo-conversion bleaching devices, and "screen-based" SLMs.   The
latter clearly do not work correctly in the Projector plugin. Currently,
the only way is to manually (or script-wise) operate shutter.  I will
have a look at this, and hopefully can fix up the 2.0-gamma code.


>
> I have a few unrelated questions I thought I might ask
>
> 1) I was also wondering what you advise about Version 2. Should one
> one stick with the current stable version for now?

No.  Use 2.0-gamma.  It is the only branch that gets update (on the Java
side).  It shared the hardware side with the 1.4 branch.  If I manage to
fix the Projector plugin, this is where you will find the fixed code.

> 2) Is there a way to call a script from the MDA window (or vice
> versa)? Or if one wants to go beyond MDA, do you need to script each step?
Yes.  You can use so called "Runnables" to attach to an MDA.  See:
https://micro-manager.org/wiki/Multi-Dimensional_Acquisition_Programming,
and
https://valelab4.ucsf.edu/~MM/doc/mmstudio/org/micromanager/api/ScriptInterface.html#attachRunnable(int,%20int,%20int,%20int,%20java.lang.Runnable)
(in 2.0-gamma:  studio_.getAcquisitionManager().attachRunnable().

>
>
> 3) Speaking of scripting, I was able to write my first (extremely
> primitive) script to control the intensity of the projector:
>
> import ij.IJ;
> import mmcorej.CMMCore;
> import org.micromanager.utils.ReportingUtils;
>
> slms =  mmc.getSLMDevice();
>
> mmc.setSLMPixelsTo(slms, (short) 63);
> mmc.displaySLMImage(slms);
>
>
> From the documentation, a nearly identical script should allow me to
> set the color and exposure:
> https://valelab4.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html
>
> |*setSLMPixelsTo
> <https://valelab4.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html#setSLMPixelsTo(java.lang.String,
> short)>*(java.lang.String slmLabel, short intensity)|
> |*setSLMPixelsTo
> <https://valelab4.ucsf.edu/~MM/doc/mmcorej/mmcorej/CMMCore.html#setSLMPixelsTo(java.lang.String,
> short, short, short)>*(java.lang.String slmLabel, short red,
> short green, short blue)|
>
> But substituting
> mmc.setSLMPixelsTo(slms, (short) red);

red is not a number.  Likely valid values are 0-255.

>
> mmc.setSLMExposure(slms, (double) 100.);
> Also threw an error.

Even though the SLM interface has that function, most SLM devices do not
support it (setting an exposure for an SLM does not really make sense,
you set an image on the SLM, and then open a shutter....).


>
> I am not very well versed in Java programming and I am probably making
> major rookie mistakes! Do you see anything obviously wrong with this?
> With the color thing, it seems odd that the same function could accept
> both a number and a color  - and shouldn’t the color be a string?

It doesn't accept a color as a string.  If you have a color SLM, you can do:

mmc.setSLMPixelsTo(slms, (short) 255, (short) 0, (short) 0);

to get a red color displayed.

Best,

Nico

_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general