Arduino Dual Shutter Time Sharing Delay

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

Arduino Dual Shutter Time Sharing Delay

Sinan Can
Hi, 

I am using Arduino to time-share two lasers with shutters, in order words sequentially illuminate the sample for two color imaging. With the current setup/code given in the https://micro-manager.org/wiki/Arduino page, I set the system and it works. 

However when I check the system response with the oscilloscope, there is about 30msec delay. We are aiming to get 100msec illumination time so 30msec is a bit high. I tried to increase baud rate but the system failed to work (as written in the wiki page). Is there any way to increase the system response time to reduce the delay? 

Thanks. 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Arduino Dual Shutter Time Sharing Delay

Ti_Sapph
Sinan,

You could increase the baud rate, but it needs to be increased on both the PC and Arduino side. Changing it on only one side will not allow the two to communicate with one another.  You'd change the 57600 value in the Serial.begin(57600); line to 115200 and the rate in the device adapter to this as well.  

If you're doing that, you can also modify the script so that it toggles between the two lasers at a given delay.  My Arduino-based system, which can be set up to toggle on consecutive clock pulses/camera trigger pulses has 6-12 µsec response time.  The 30 ms is certainly excessive.  However, there's no serial communication to accomplish the toggling beyond the initial setup. For very fast response times you'd want to avoid the communication during the 'fast' step.

Thanks,
Rusty

On Thu, Aug 23, 2018 at 3:54 PM, Sinan Can <[hidden email]> wrote:
Hi, 

I am using Arduino to time-share two lasers with shutters, in order words sequentially illuminate the sample for two color imaging. With the current setup/code given in the https://micro-manager.org/wiki/Arduino page, I set the system and it works. 

However when I check the system response with the oscilloscope, there is about 30msec delay. We are aiming to get 100msec illumination time so 30msec is a bit high. I tried to increase baud rate but the system failed to work (as written in the wiki page). Is there any way to increase the system response time to reduce the delay? 

Thanks. 

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
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: Arduino Dual Shutter Time Sharing Delay

Stuurman, Nico
In reply to this post by Sinan Can

On 8/23/2018 3:54 PM, Sinan Can wrote:

> I am using Arduino to time-share two lasers with shutters, in order
> words sequentially illuminate the sample for two color imaging. With
> the current setup/code given in the
> https://micro-manager.org/wiki/Arduino page, I set the system and it
> works.
>
> However when I check the system response with the oscilloscope, there
> is about 30msec delay. We are aiming to get 100msec illumination time
> so 30msec is a bit high. I tried to increase baud rate but the system
> failed to work (as written in the wiki page). Is there any way to
> increase the system response time to reduce the delay?

The latest nightly build of 1.4 contains a code change by Lukas Lang in
the serial communication code that may decrease the response time
significantly.  Curious to hear if you see a difference.

Also, it is always best to use hardware triggering.  If your camera has
a TTL that signals when it is exposing, then you can wire it up to the
Arduino input and set it up to run a sequence.  That way, there will be
less than a microsecond delay between your exposure start and the light
reaching the sample.

Best,


Nico



------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
micro-manager-general mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/micro-manager-general
Reply | Threaded
Open this post in threaded view
|

MM 2.0 and frame summing

Ti_Sapph
Would like to add frame averaging or summing at acquisition to a Beanshell script running in MM 2.0.  I'm struggling with the syntax to get this to work.  I think the issue is getting the image data itself out of the object which I've not found an example of for 2.0.  

Any suggestions or example code to sum N consecutive frames in a loop in MM 2.0?

Thanks,
Rusty


_______________________________________________
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: MM 2.0 and frame summing

nanthony
Ti_Sapph wrote
> Would like to add frame averaging or summing at acquisition to a Beanshell
> script running in MM 2.0.  I'm struggling with the syntax to get this to
> work.  I think the issue is getting the image data itself out of the
> object
> which I've not found an example of for 2.0.
>
> Any suggestions or example code to sum N consecutive frames in a loop in
> MM
> 2.0?

I have modified LC-PolScope's frame averaging plugin to work for
micromanager 2.

See repository here: https://github.com/nanthony21/Micro-Manager-Addons

One option would be to see if you can use the plugin instead of a script.
Otherwise you can take a look at the code here:
https://github.com/nanthony21/Micro-Manager-Addons/blob/master/FrameAverager.2.0/src/edu/mbl/cdp/frameaverage/FrameAveragerProcessor.java#L141

To see how this can be done.

--Nick




--
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