Tag: TTL

  • Understanding TTL control, Blanking & Device Streaming, and why it matters for your research.

    While this is an old subject in terms of technology, I find that every few years I end up describing it to a new group. Surprisingly to me, every time people seem to appreciate the information, and I think it’s just not covered often in broader imaging trainings. So today I’m writing about a favorite subject of mine – TTL control. To do this I’ll be referencing some fun technology – namely:

    TL:DR

    The Problem

    For illustration of the device control, I’ve captured a few real example frames from my oscilloscope, but also added some simulated oscilloscope examples that I hope will better depict the work behind the scenes for these devices.

    I think it’s most important to frame this in a question,

    When my software controls devices, how fast do they respond?

    Assume we click a shutter button in any software. This can be for a laser, an LED, even an old mechanical shutter. In every case a bunch of things must happen for the end device to actually change it’s state. For that state (let’s say, “OFF” to change to “ON”,

    • the software must accept the command
    • and issue control signals to the device connection.
    • That connection talks to the device controller (normally, a microcontroller)
    • The microcontroller reads the command and does what it’s told
    • The state changes.

    Now, along the way, each device has a communication bus, and each bus has a traffic control system to insure multiple communications don’t conflict. As a result, the timing from the start of the button click to the end is variable – sometimes, up to 20 milliseconds!

    Now, because the software is typically programmed to “confirm” each thing it does, it doesn’t just shout orders into the dark. Instead, the software waits for a confirmation, or acknowledgment, of the command being received, and oftentimes it will confirm the new state is active.

    Consider this means a new set of jobs which must be completed.

    • The device controller changes state
    • The device controller then replies, or reports state
    • The communication connection on the PC receives the reply
    • The software reads the reply, and confirms it’s correct
    • The software continues to the next job.

    And so again, we can see a stack-up of not only delay, but a variable amount of delay.

    If we visualize this in a graphic example like the one below, we can see the software code is sent to an LED microcontroller, the command is processed, and the led illuminates. However, we can also see there is a lot of room for improvement!

    Another way to look at this control is what happens with a typical complex instrument. Below is a video where I control 3 devices. The PCO Camera, a Zaber filter turret, and the Tetrem. Notice how long it takes just to get 3 time points for 2 channels. The exposure is short, that's not the issue - the issue here is of course, the devices need to move, but also each device must receive + process + move + report positions, and this takes a long time.

    TTL Control -> Old + Fast = Awesome

    So what is TTL? Basically, nothing more than an on/off switch! Just like a light switch allows an electrical signal to feed a light, TTL uses a voltage to send a signal to another device. You can find a thorough history on this communication method here if interested.

    What we care about is that we have an on/off control system. Because it's nothing more than a voltage, no crazy translations need to happen for things to immediately react. If a TTL control line is on, or "High", then the device should be doing whatever ON is. Many devices have this input, but few people even know about it! For example, most Focus controllers, XY Stages, Peristaltic Pumps, Perfusion systems, and many other devices like lasers, shutters, and actuators accept a TTL input for control.

    TTL Logic typically comes in 2 flavors. Older systems will use 5V for "on" and 0V for "off". The device being controlled might use thresholds or a midpoint. Some devices, assuming you give them at least 2.5V, will go active. Others want at least 4V or 4.5V before they enable. Newer devices often use 3.3v control. This is the same concept as 5V, just with lower voltages. One word of caution here - before connecting things up, it's good to confirm the logic of your devices. Generally, the amount of power these use is quite low, and signal inputs won't break things - but in the case of an exposed microcontroller pin, you can definitely cook a 3.3v input with a 5V line!

    TTL Blanking - A partial Solution

    So what can be done about this overhead? First, we can consider that the only time we really need the illumination on, is when the camera is truly collecting data. One way to do this is to use the I/O control cables found on most scientific cameras. In my case I routed the expose signal from the edge camera into the Tetrem on a single channel, and then, told the tetrem in my software to use "TTL Control". With these changes, the LED source now waits for a TTL input to go high, before it enables it's emission.

    So now, let's assume that when the camera is exposing, we can enable the LED line. The software can act as a logical "AND" if needed, but the line won't enable unless there is real collection of light by the camera. You can see an example of this below.

    For the example, the yellow line is the camera output, or trigger output, the teal line is the LED B brightness result, and the purple line is the software-only reaction. In this example, we can see the delay (latency) of the response, yet in most software, the purple line will illuminate before the camera exposure. What this means for research is your cells are being exposed to excitation energy, and you aren't even collecting that light onto a sensor! So, we are in effect just cooking cells for fun. NOT GOOD!

    Oscilloscope reading TTL from PCO camera

    Using the Triggerscope for State Control of Devices

    This is great for a single LED, but how can we control more than 1 channel? For this, we would use a logic controller like the Triggerscope Mini! With the mini, the camera expose line is routed to it's TRIG input, and up to 4 output channels are connected to it's TTL control pins.

    Triggerscope Mini with Tetrem Controller for intensity

    With this done, we can assign an active line using the triggerscope. This provides fast easy state switching, and can even be done over multiple devices. Doing this will mean, for this example, we won't be moving our filter cube device. Instead, we would use a multi-band dichroic. However we can switch the LED excitation, and that's how we will gain some speed here.

    In the example above, we see a high speed switch. This is simply by telling the Triggerscope Mini to change channels, instead of the LED. But - there is still more to do to improve our speed!

    Streaming for the Win

    The above example uses the triggerscope via USB, and while we only have 1 device, we are still using a "set + capture + set + capture" type of sequence. What if we just told the camera, "run as FAST as you can." Then, we used the output signal from the camera to count frames, and we told the triggerscope, "every other frame, switch from LED 1 to LED 2, then back to 1". THIS is the power of "Streaming", or also called "Sequencing". With this capability, we pre-load stuff to do into the triggerscope. Then, we arm the triggerscope. With that done, our triggerscope is sitting, locked into a state, simply waiting to receive camera frame TTL inputs. Below is a graphical depiction of this technique.

    Now, we tell the camera, "Give us 2 channels * 10 frames = 20 pictures, and do so as fast as possible". In effect, "give us video of 20 frames".

    In this method, there is zero control overhead. The camera free-runs, the triggerscope switches, and the LED reacts. Below is a video example of this, note also there is a small in-view live feed from a web camera (for all these video samples), and you can see that, indeed, streaming is crazy fast! For the below example, we've tied the camera "transfer" line into the triggerscope. This way, the triggerscope recieves a brief pulse before capture occurs. We enable on the "low" side of the signal, and illuminate. You can see for the CMOS style readout on the left of the example, once readout is done, the channel switches.

    So what does the above look like in real life? Check out this example below! Note that I select in my "lambda" control box the "Stream" checkbox. Then once start capture is pressed, the triggerscope is armed, the camera is readied, and we snag 20 images in < 300ms!

    Of course, we can extend this using the 5V DAC control line on the triggerscope for capture of Z as well as channel, and if using the more capable triggerscope 4B, we can control even more devices.

    I hope this article has helped explain not only why I make devices such as the triggerscope, but also how it's important to use software that provides complete control for your light sources and other devices, as well as the ability to do things like this. My sincere thanks to Excelitas for lending me the Edge camera and Tetrem LED, both of which have worked flawlessly on my system. Nebula has drivers for both products fully integrated for streaming control if you have interest in using it.

    -Austin

  • Triggerscope Mini Micro-Manager Setup

    Below is a short video introducing the Triggerscope Mini, as well as demonstrating how to set it up in micromanager.

    If you’re in a hurry, I’ve also outlined the basic steps below with screen shots.

    Connect the triggerscope mini to a USB-2 compliant port, via it’s USB C connection cable (included).

    Open micromanager, select the device configuration wizard, and browse to the add device page.

    Scroll the device list until you see “Triggerscope-MM” expand that and select the -Hub device.

    A window will appear, set the COM port to the port used by the triggerscope mini, and set the baud to 115,200, then click OK.

      After a few seconds, a list of components will appear. Note this is for the full triggerscope, so we will only choose the TTL 1-8 Bank, and DAC 1 + DAC 2. Below is a basic chart showing what devices are supported on the mini vs the standard triggerscope.

        When prompted for the DAC voltages, only select 0-5V (default), and click OK.

          That’s it! Follow the manager to complete the install. Once done, you’ll have the common TTL output control, DAC control, blanking, sequencing and other features of a standard triggerscope!

          1. Triggerscope Mini Released

            Compact, Simplified TTL and DAC – Micromanager Native

            I’m happy to share a new device I’ve been working on after encouragement from numerous clients. This new smaller version of the Triggerscope is intended to bridge the gap between large complex systems and more streamlined setups.

            With the Mini you get:

            • 4 TTL Outputs at 5V
            • 2 DAC Outputs at 5V
            • 1 3.3V to 5V input Trigger
            • Status LEDs for all connections!
            • A single USB-C Connection to the computer
            • Full supported Micromanager Triggerscope-Hub Behavior

            This was a super fun project for me, as for the first time this board uses a bare MCU, which enabled my team to use any connector we wanted (hence the USB C) as well as full USB-Serial emulation on our own terms.

            I’m also quite fond of the baby side-emitting LEDs on the outputs. These LED’s draw almost no current, but having them for all of the outputs makes it so easy to know whether a given control line is on or off. For the DAC LED’s, they change brightness with the output!

            I tried to keep this design in-line with the current TG4, as it’s worked well for us over the years. This one is of course thinner, lighter and smaller, but in effect a truly miniaturized version of the larger model.

            If you’d like to buy a Mini, we have them ready for sale on the store page here. For more information on the unit please see this flyer or the product page, thanks!

          2. Triggerscope 4 Released – with New Software and New Micromanager Driver Options

            I’m excited today to announce the release of the Triggerscope version 4. TG4 marks a major improvement in the performance and capability of the Triggerscope.

            New Features

            • At the heart of Triggerscope 4 is a New high speed MCU running @ 600 Mhz. This is an 83x improvement over the Triggerscope 3B.
            • On board 1024K MCU RAM provides more than enough memory for arrays.
            • A new features provides access to a 16GB External SD Card, installed inside. Memory may be used for storing data for sequence access, recording of external parameters and timing events, or saving of advanced settings.
            • A new Real Time Clock is included for better timing over long duration experiments and delays.
            • DAC update rates can be overclocked, to a maximum frequency of 270kHz. 
            • Integrated and simplified external controls for easier operation.

            New Software

            In addition to the release of Triggerscope 4, ARC is introducing a python-based, multi-platform compatible standalone control application. Our application can be installed on Windows, OS-X, or Linux systems. Source is also available from the GitHub Repo here. Users have two options for use – EXE and APP executables provide a small containerized version of python, so the entire application runs without any external installs required. Or, for customers who already have python installed, simply downloading and running the native python file is an option.

            For debugging, all communication between the software and the triggerscope are printed for the user to view, to make diagnostics and custom driver development as simple as possible.

            New Micromanager Firmware Options

            Nico Stuurman recently undertook a huge endeavor, and implemented a new approach for using MicroManager and the Triggerscope, with faster syntax, greater memory capacity, and tight integration into the Micromanager sequencing system for fast device control. ARC can install this firmware option before your triggerscope ships, just let us know which version you’d like to use!

            -Austin

          3. Setup Guide for Triggerscope 3B Using MicroManager

            Required Components and Preparation

            For a new Triggerscope 3B shipment, remove from packaging and account for the following:

            • 12V power supply
            • Mini-USB cable
            • SMA-BNC connector cables, if purchased
            • ARC certificate of compliance paperwork
            • Triggerscope 3B Controller

            Hardware Connections

            Once unpackaged and all components are accounted for, plug the 12V power supply into the slot located on the left side of the unit labeled “12V,” and plug the other end of the power supply into an available power outlet.

            Next, plug the mini-USB cable into the left side of the Triggerscope unit in the slot labeled “USB,” and plug the other end into the computer you are going to be using.

            Driver Install

            With install of Arduino IDE complete, open the newly installed Arduino IDE application on your computer.

            On the top ribbon, select the “Tools” tab. Then hover over the section that says “board” and then click on the “Board Manager” option.

            Next, in the “Board Manager” window, click on the “filter your search” box and type “DUE,” and the following should pop up on the screen, “Arduino SAM Boards (32-bits ARM Cortex -M3) by Arduino.” Click install on this option.

            The Arduino application will proceed to download and install the driver package needed to run the Triggerscope 3B unit.

            MicroManager Setup

            In MicroManager, select the “Hardware Configuration Wizard”, Click Next until reaching step 2. In the lower list, browse to the “Triggerscope” section, and add the Triggerscope Hub Device.

            For the Communication setup, select the COM # assigned to your triggerscope under the Windows Device manager, read as “Arduino Due Programming Port”.

            Configure the Com # found int he device manager, make sure to set the BAUD rate to 115200.

            When prompted, select the TTL and DAC lines needed for your application. Also note DAC 16 is tied by default to the FOCUS device. If running sequencing for Z stacks you’ll want to add this.

            Continue through the dialog options, if connecting to a Z stage, be sure to specify the maximum and minimum height of your stage so that Z data is properly calibrated. Contact ARC if using a range other than 0-10V.

            Next, confirm proper operation by opening up the Device Property Browser. You should have discrete control over the DAC lines added, and on/off state control over TTL lines. Note that the Triggerscope 3B will illuminate an output LED when DAC control is enabled, or when TTL control is enabled. This can be very useful to confirm proper communication with the computer.

            This concludes the basic setup for Triggerscope 3B. Please contact ARC with any questions if you are having difficulty!

          4. LED, laser, or other PWM control using Triggerscope

            It appears that more and more people want to use PWM control for illumination devices from Micro-Manager and other imaging software. PWM may be used for any number of applications, from high speed pulsing of an LED, or a laser, in order to reduce phototoxicity or just to control brightness, or to drive a DC motor at a varying speed, or to drive a device like a spinning disk to set the PRM. I figured I’d address this using the Triggerscope system controllers. rIn order to support PWM drive over an external device, I wanted a few useful functions to work in MM:

            • PWM duty cycle should be controlled form presets
            • PWM should be called to “off” from a TTL or other “shutter” style command
            • Once off, a similar “ttl on” type command should re-enable PWM at the alst used duty cycle
            • multiple output lines should be supported at different duty cycles.

            Version 407 of the Triggerscope firmware now supports this, and uses the existing driver available for these devices. I’ve made a short demo video showing how this works on an oscilloscope output. I’ll place an option for this on the store. Please get in touch with any questions or post here – thanks!

          5. Shutter Configuration of TTL devices in Micromanager

            I made this video to show how to use both a state device shutter object and a group shutter object in micro-manager. Hopefully others can make use of it!

             

          6. How to use external triggers on scientific and industrial cameras

            Controlling a camera from an external trigger can be very useful. External triggering provides greater timing accuracy, direct control over exposure duration, and remote operation from TTL devices. This is a prime reason I made the Triggerscope controller, so I though it would be useful to explain how this works and what you can do with it.

            What is “triggering”?

            Most cameras built for scientific imaging or life science have a high density connector located on the back. 90% of the time, this is only used by savvy customers, or OEM integrators (companies buying a camera to place inside a machine for resale). The connector on the back of the camera will typically include 2 basic functions: Inputs (connections which send signals into the camera) and outputs (signals which activate when the camera is in a process or cycle).

            Why use Triggering on a camera? Doesn’t the software control image capture?

            Of course, software can tell a camera to snap an image. But when will that image be captured? Software needs to do more than say “snap” when you capture an image. Behind the scenes, a LOT of stuff happens!

            • the top level controls you see are converted into camera-specific commands via the camera “device driver” in your software.
            • The camera commands are fed into a control card or USB port and up to the camera.
            • The camera accepts the commands, which activate sets of tables in the camera firmware, to set up a sequence of turning on and off clocks and transistors at very high speed, all depending on your binning, ROI, etc.
            • The camera performs the above operations, and sends back an image.

            What is quickly apparent is how much has to happen to get an image. In addition, the camera firmware will process some instruction sets faster than others! So some exposures might come back 200ms from issuing the “snap” button, while others will return in 130ms, 30ms, who knows!

            So when precise timing is desired, and you really want that camera to fire at a specified time, triggering may be used. In this configuration, all software comms with the camera are pre-compiled, everything’s done. All of the steps above are performed, but the last step, the “camera performs operations above” sits….and waits…for the trigger line to run from 0 Volts to 5 Volts. As soon as that happens, an image is captured.  For single frames, this is somewhat useful, but for sequences, this is great. We can capture images at some interval with 100% confidence timing is accurate.

            Example

            Let’s look at a typical camera, and pull the information we need from the user manual, in order to better understand triggered control. For this post, I’ll use the Photometrics CoolSNAP MYO camera, and as Photometrics makes it easy to read up on the user manual for their products, you can find the user manual here.  Page 21 of the PDF describes the various operating modes for the trigger input. Note, the PDF also gives us information on EACH PIN used in conjunction with input and output signaling. There’s more than one!

            Screen Shot 2016-01-15 at 2.33.15 PM

            Note, PM also provides short descriptions for each pin:

            Screen Shot 2016-01-15 at 2.33.29 PM

            So – now we know which pins communicate which functions from the camera head connector – to connect to any of these, we’d simply connect a ground wire, and a positive pin wire to our chosen camera pin (for our needs, say Pin 1 – Trigger In)

            Now – the most pertinent for us is the trigger in line, which runs in a few modes.  Let’s review each, and why we might use them:

            Trigger-First (sometimes called other things like “Fire”)

            In this mode, the camera is set to snap some # of images (let’s say 10), but waits for a trigger input. Once that input goes high, the camera snaps 10 images as quickly as possible.

            Strobe

            In this mode, the camera is again configured for some # of images, but every image waits for a trigger.

            Bulb

            In this mode, the exposure time for each image is controlled by the input trigger. Again, multiple images are assumed (although Image qty of 1 is acceptable), and each frame waits for a trigger input pulse.

            These three modes constitute the majority of uses for a typical triggered input line.

            So, what does “receive a trigger” actually mean? Good question!

            Triggering = TTL Control

            Cameras, like almost all computer systems, are made to interact with external systems. One of the oldest, and most common methods, is referred to as “transistor transistor logic” or TTL. This boils down to the concept that if we specify an electrical voltage value of X as “off” and Y as “ON” then we can remotely flip a switch.

            Many imaging devices use this communication method. A simple uniblitz shutter for example, can accept USB/serial data to open and close the shutter, but using TTL is faster and simpler. (just one thing to do, send 5Volts or 0Volts.) Below is an oscilloscope capture of such a signal. The vertical scale = Voltage level, and the horizontal scale from left to right = time elapsed. My annotations are in red. Note the yellow line, which indicates the signal.

            ttl_example

            Example Signal

            Let’s say we have a device, for now, it’ll be the triggerscope 2, which is connected to the “TRIGGER” line of our camera. We want to signal the camera to capture immediately after we turn on an LED. In this case, we might use the triggerscope line 1 for the LED on and off, and line 2 for the camera signal.

            In our software, we’d specify the camera exposure time, binning, and other usual parameters. In our controller, we’d set the output to high when we wanted to capture our image. Let’s use an example of 1 image:.

            Tell the camera to acquire using software (nothing should happen yet!)

            -Camera waits for a trigger signal

            Tell our triggerscope to send a TTL high

            -Camera captures an image.

            Tell our triggerscope to send a TTL low

            (nothing changes)

            The above sequence can be used for a series of images. In that case, the acquisition would be configured for some # of frames (say 10), and the camera would capture 1 frame each time the signal swung from low to high.

            To tie everything together, I’ve recorded  quick video explaining this on the scope. Check it out!

            [youtube width=”600″ height=”365″ video_id=”4KNe5GxpuOo”]

            So – now you know how cameras can be controlled via TTL – if anyone has questions please comment below, so I can address them. Thanks!

            -Austin

             

             

             

          Social Media Auto Publish Powered By : XYZScripts.com