WEBVTT

NOTE
Part 9   Hardware Control
Transcript by BioGeeks: https://biogeeks.org/videos/wtiemqBES1Y

1
00:00:01.520 --> 00:00:06.780
Welcome to the final part of the Mastering Scientific Cameras course from Tucsen.

2
00:00:09.460 --> 00:00:21.420
In this final part, part 9, Hardware Control, we're going to be examining some of the ways in which cameras can directly interface with other hardware in your optical setup via hardware triggers.

3
00:00:22.060 --> 00:00:31.560
These are dedicated triggering cables which can transmit signals between hardware for two-way communication about timing and synchronisation of events.

4
00:00:31.560 --> 00:00:40.180
So, for hardware control, the question is, how does the camera fit into the rest of your setup?

5
00:00:41.520 --> 00:00:49.680
How do the different pieces of hardware operate and does there need to be synchronisation and timing of events between them?

6
00:00:51.560 --> 00:00:57.240
Tucsen cameras, like many others, offer timing and operation control via hardware triggering.

7
00:00:57.240 --> 00:01:07.680
This allows direct communication between hardware components without the software being involved, which is usually a much faster and simpler way to operate.

8
00:01:07.680 --> 00:01:18.680
It's mostly used by advanced microscopy and physics applications who need the fastest responses to controls and the most precise synchronisation,

9
00:01:19.300 --> 00:01:30.240
either because the experiment really demands this high-speed response or to allow the most efficient experimental operation in terms of time-saving,

10
00:01:30.240 --> 00:01:35.460
because you don't have to wait for software to come back and forth and decide what's going on.

11
00:01:35.740 --> 00:01:42.800
The hardware can directly talk to each other and burn through an application experiment in the fastest way possible.

12
00:01:42.800 --> 00:01:52.540
Some examples of how hardware triggering can allow control and communication between different pieces of hardware might be, for example,

13
00:01:52.980 --> 00:02:02.040
synchronising a triggerable light source with a camera, where, for example, we might be using an LED or a laser light source that can be turned on very, very quickly

14
00:02:02.040 --> 00:02:11.320
and have that directly controlled by the camera, turning on at only the moment of camera exposure and being off automatically the rest of the time.

15
00:02:12.860 --> 00:02:18.320
We can also do things like synchronise with stages and other hardware to tell the camera,

16
00:02:18.680 --> 00:02:23.680
OK, our stage movement has finished, now you can take an image and vice versa.

17
00:02:23.860 --> 00:02:27.760
The image has finished acquiring, now we can move the stage again.

18
00:02:27.760 --> 00:02:38.790
And finally, we might be integrating the camera into a larger instrument setup, maybe even a benchtop experimental setup,

19
00:02:39.050 --> 00:02:46.510
and we want to make sure that everything is communicating effectively and efficiently, and everything is operating as fast as it can.

20
00:02:49.970 --> 00:02:54.630
So, this hardware control, as I've mentioned, is achieved via hardware triggers.

21
00:02:54.630 --> 00:03:04.570
Cameras can send and receive signals, that's electronic signals, via dedicated hardware triggering cables that connect between the camera and other hardware.

22
00:03:05.050 --> 00:03:12.270
These signals take the form typically of 0 to 5 volt digital pulses, also known as a TTL pulse.

23
00:03:13.630 --> 00:03:20.370
These can indicate the timing of events or the state that a piece of hardware is in, and other things as well.

24
00:03:20.370 --> 00:03:28.970
For example, as we saw before, hardware triggering can be used to activate a light source, exactly when the camera is exposing a frame.

25
00:03:29.350 --> 00:03:41.390
And this might take the form of a light source that has a trigger in option, where if it receives a 0 to 5 volt pulse,

26
00:03:41.790 --> 00:03:47.290
for the duration of that 5 volt high signal, as we'd call it, the light source will be on.

27
00:03:47.290 --> 00:03:58.450
And when the signal again drops to 0 volts, the light source will turn off, and the 0 to 5 volt pulses will be delivered by the trigger out options from the camera.

28
00:04:01.300 --> 00:04:08.220
Or indeed, the camera itself can be triggered to acquire its frame, exactly as other hardware finishes the action.

29
00:04:08.460 --> 00:04:13.580
So, two-way communication is possible, either at the same time, or just one or the other.

30
00:04:13.580 --> 00:04:23.750
So, in terms of the triggers into the camera, that control when the camera performs different actions,

31
00:04:24.270 --> 00:04:29.850
there's multiple different options for how this can perform, and different applications that this might suit.

32
00:04:33.130 --> 00:04:39.770
The way the form that this takes would, of course, be once again a 0 to 5 volt signal coming in,

33
00:04:39.770 --> 00:04:47.790
or indeed a 5 volt to 0 volt signal, depending on the polarity of our trigger signals.

34
00:04:48.690 --> 00:04:52.290
But we have that graphically represented here, with time on the x-axis,

35
00:04:52.290 --> 00:04:58.350
and the voltage being plotted between our 0 volt low signal and our 5 volt high signal.

36
00:04:58.690 --> 00:05:03.750
So, this would be a signal coming into the camera from some of the hardware, which has generated this pulse.

37
00:05:03.750 --> 00:05:09.370
We have three different behaviours, or I should say, sorry, two different behaviours here,

38
00:05:09.750 --> 00:05:13.490
for how the camera can interpret this pulse, and what this would actually mean.

39
00:05:14.230 --> 00:05:22.070
We can tell the camera that the rising edge from 0 to 5 volt should trigger the acquisition of an image

40
00:05:22.070 --> 00:05:24.110
that we've set up in software.

41
00:05:25.190 --> 00:05:32.730
Or, indeed, we can tell it that the falling edge from 5 volt to 0 volt should indicate the timing of that image,

42
00:05:32.730 --> 00:05:34.690
which should start that image acquisition.

43
00:05:35.590 --> 00:05:41.670
And, again, we can represent this graphically, where the rising edge would start in exposure,

44
00:05:41.670 --> 00:05:47.370
that exposure time set by software, or the falling edge can start in exposure.

45
00:05:47.910 --> 00:05:58.750
In all of these cases, we do need to begin the acquisition in software to tell the camera to wait for this trigger.

46
00:05:58.750 --> 00:06:02.230
What won't happen is if we just load up the camera in software,

47
00:06:02.910 --> 00:06:08.690
and then, without doing anything else, just send triggers to the camera and expect images to be acquired,

48
00:06:08.870 --> 00:06:11.690
we have to actually start an acquisition in software.

49
00:06:11.850 --> 00:06:15.330
So, the software tells the camera to expect a trigger first,

50
00:06:15.490 --> 00:06:23.730
but the exact timing of that frame acquiring is then very precisely controlled by this external hardware,

51
00:06:23.730 --> 00:06:24.930
which can be very powerful.

52
00:06:27.400 --> 00:06:30.680
We have another option as well, which is width trigger.

53
00:06:31.320 --> 00:06:37.960
This works similarly to rising edge, except the duration of this trigger pulse sets the exposure time.

54
00:06:38.500 --> 00:06:42.660
So, this is no longer set by software, but can be set by external hardware,

55
00:06:43.500 --> 00:06:45.600
representing that graphically here.

56
00:06:45.600 --> 00:06:52.480
A final option that's available to us, alongside these other options,

57
00:06:52.660 --> 00:06:57.600
is to introduce a delay between the trigger event and the exposure start,

58
00:06:58.060 --> 00:07:02.240
and that can be added for all of the settings above, and we can set that in software.

59
00:07:04.620 --> 00:07:08.840
As mentioned before, though, we need to remember that when operating in these modes,

60
00:07:09.080 --> 00:07:13.940
we have to tell the software to expect to receive a trigger,

61
00:07:13.940 --> 00:07:19.260
or the camera, I should say, to expect to receive a trigger by beginning an acquisition in software,

62
00:07:19.560 --> 00:07:27.500
and then only once it's begun will it expect and act when a trigger signal comes its way.

63
00:07:29.100 --> 00:07:32.400
Next, we have the trigger out options for the camera.

64
00:07:32.820 --> 00:07:37.740
These are the different options that the camera has for how to communicate with other hardware,

65
00:07:38.120 --> 00:07:40.000
with the signal coming from the camera,

66
00:07:40.000 --> 00:07:44.140
for the camera to tell other hardware what to do, based on its own state.

67
00:07:45.940 --> 00:07:52.380
So, this can involve various properties of the camera's state being indicated,

68
00:07:52.660 --> 00:07:54.060
whether it's exposing an image,

69
00:07:54.460 --> 00:07:57.220
whether it's reading out and measuring the data that's collected,

70
00:07:57.400 --> 00:08:00.280
or whether it's simply waiting for another action to take place.

71
00:08:01.580 --> 00:08:05.320
This can be used to control illumination, as in the example earlier,

72
00:08:05.320 --> 00:08:08.200
or change hardware conditions between frames.

73
00:08:08.200 --> 00:08:15.020
Say we want to change which wavelength we're illuminating with via moving a filter wheel,

74
00:08:15.340 --> 00:08:21.340
or we want to change a stage position only once the frame has finished acquiring.

75
00:08:21.640 --> 00:08:28.060
We can do that by having the camera tell the other hardware when it's finished the exposure.

76
00:08:28.060 --> 00:08:37.060
Or, indeed, we can have external hardware recording very precise hardware timestamps

77
00:08:37.060 --> 00:08:43.820
for very precisely controlling the timestamps within an experiment,

78
00:08:44.360 --> 00:08:49.880
maybe with other hardware that's also indicating the exact times when things happened

79
00:08:49.880 --> 00:08:53.420
for recording very precisely timed experiments.

80
00:08:53.420 --> 00:08:59.930
There's multiple options for what trigger signals can be outputted,

81
00:09:00.610 --> 00:09:05.590
including, here we'll show them graphically, exposure start.

82
00:09:05.590 --> 00:09:11.150
And this is a trigger that will be set to high for a certain duration

83
00:09:11.150 --> 00:09:14.910
when the camera begins the exposure of a new frame.

84
00:09:15.410 --> 00:09:17.770
And we can set that duration in software.

85
00:09:18.230 --> 00:09:19.930
We can see it on the right-hand side.

86
00:09:20.030 --> 00:09:27.390
The exposure start begins when the first row of the camera starts to expose.

87
00:09:27.390 --> 00:09:30.950
The thing to remember, and I'll explain this diagram briefly,

88
00:09:31.210 --> 00:09:35.030
the thing to remember is that these are rolling shutter cameras for the most part.

89
00:09:35.430 --> 00:09:38.650
Certainly what's displayed on the diagram is a rolling shutter camera,

90
00:09:39.010 --> 00:09:43.930
where, once again, the top row of the camera will start its exposure first,

91
00:09:44.450 --> 00:09:48.530
and the last row will start its exposure sometime later.

92
00:09:49.070 --> 00:09:51.970
And it will roll down the sensor row by row.

93
00:09:51.970 --> 00:09:58.290
That's represented by this diagonal line for the yellow box on the left-hand side.

94
00:09:59.250 --> 00:10:03.650
The end of the exposure will then start at the top and roll down in a similar way.

95
00:10:04.150 --> 00:10:06.350
So that's what these yellow boxes represent.

96
00:10:08.090 --> 00:10:10.650
We have, once again, time on the x-axis,

97
00:10:11.170 --> 00:10:15.430
and which row is exposing on the y-axis for this yellow box.

98
00:10:15.430 --> 00:10:21.570
And, as we can see, the exposure start is aligned with that first row.

99
00:10:21.770 --> 00:10:25.990
When it starts exposing, that's when the camera will send out this trigger.

100
00:10:26.450 --> 00:10:31.360
We also have a trigger for readout end,

101
00:10:31.660 --> 00:10:37.100
when the camera has completely finished the readout of every line,

102
00:10:37.540 --> 00:10:42.180
which will be at the end of the last line of the camera finishing its readout.

103
00:10:42.560 --> 00:10:45.380
And, again, we can set the duration of these pulses in software.

104
00:10:45.380 --> 00:10:52.370
The next trigger that's available to us is global exposure.

105
00:10:53.070 --> 00:10:56.890
And this is a powerful and useful way to operate the camera

106
00:10:56.890 --> 00:11:02.590
that can give us a chance to overcome some of the issues

107
00:11:02.590 --> 00:11:04.930
that we can sometimes have in some experiments

108
00:11:04.930 --> 00:11:10.130
with the rolling shutter operation of the camera via a pseudo-global operation.

109
00:11:10.530 --> 00:11:12.330
And we'll explain this in the next slide.

110
00:11:12.330 --> 00:11:16.740
But, as with the triggers in,

111
00:11:16.900 --> 00:11:20.680
we have the option to add a delay before these triggers are sent out,

112
00:11:21.100 --> 00:11:23.320
which we can customize in software

113
00:11:23.320 --> 00:11:26.860
to allow better synchronization with other hardware and events.

114
00:11:28.620 --> 00:11:29.780
And, as I mentioned,

115
00:11:29.960 --> 00:11:33.040
the pulse width for exposure start and for readout end

116
00:11:33.040 --> 00:11:39.340
can be specified if they're not defined as they are for the global setting.

117
00:11:39.340 --> 00:11:45.480
So, on to this global exposure setting for our triggers.

118
00:11:46.140 --> 00:11:48.340
This is an advanced mode of the camera,

119
00:11:48.520 --> 00:11:51.520
which allows a pseudo-global operation.

120
00:11:51.520 --> 00:11:57.500
We can overcome the effect of this rolling shutter

121
00:11:57.500 --> 00:11:59.960
and potential artifacts that might be introduced,

122
00:12:00.560 --> 00:12:04.820
either for moving objects or for changes of illumination

123
00:12:04.820 --> 00:12:07.500
or changes between frames of our camera.

124
00:12:08.260 --> 00:12:11.460
The application where this is expected to be used

125
00:12:11.460 --> 00:12:14.500
is if we have complete control over our illumination,

126
00:12:14.760 --> 00:12:19.440
as in the case for LED or laser light sources,

127
00:12:19.600 --> 00:12:22.140
where we have very precise control over the timing

128
00:12:22.140 --> 00:12:24.120
of that light source being off and on,

129
00:12:24.380 --> 00:12:26.820
and we can achieve this global shutter effect

130
00:12:26.820 --> 00:12:29.880
via controlling the light source with the camera.

131
00:12:29.880 --> 00:12:34.840
And, the way that this works is that, in global mode,

132
00:12:35.460 --> 00:12:37.520
the trigger high, that 5 volt pulse,

133
00:12:37.660 --> 00:12:39.000
which would turn on the light source,

134
00:12:39.100 --> 00:12:42.640
is only enabled once every row of the camera

135
00:12:42.640 --> 00:12:44.360
is actively exposing.

136
00:12:45.320 --> 00:12:48.380
This is explained graphically on the left-hand side here.

137
00:12:48.720 --> 00:12:50.560
So, if I start this animation running,

138
00:12:52.810 --> 00:12:55.350
the rolling shutter works its way down the sensor,

139
00:12:56.250 --> 00:12:59.750
starting the acquisition of every row,

140
00:12:59.750 --> 00:13:04.390
and only once every row has started its acquisition,

141
00:13:04.610 --> 00:13:05.850
it's exposing to light,

142
00:13:06.090 --> 00:13:08.090
does the light source actually turn on.

143
00:13:08.870 --> 00:13:11.950
The rolling down of the sensor happens in darkness,

144
00:13:12.250 --> 00:13:14.590
so no photons are actually collected.

145
00:13:15.130 --> 00:13:17.230
So, there will be no artifacts captured

146
00:13:17.230 --> 00:13:19.730
during this rolling process

147
00:13:19.730 --> 00:13:21.790
because there's no photons being collected.

148
00:13:21.970 --> 00:13:22.870
The light source isn't on.

149
00:13:22.870 --> 00:13:28.190
So, with this, we're able to completely rule out

150
00:13:28.190 --> 00:13:31.930
this possibility of imaging artifacts for moving samples

151
00:13:31.930 --> 00:13:34.830
due to the rolling shutter.

152
00:13:36.730 --> 00:13:38.070
And, as you can see, once again,

153
00:13:38.370 --> 00:13:40.390
as the light source turns off,

154
00:13:40.610 --> 00:13:44.470
then the exposure end and readout rolls down the sensor.

155
00:13:44.470 --> 00:13:49.570
So, both of these dynamic stages

156
00:13:49.570 --> 00:13:51.310
happen in complete darkness.

157
00:13:52.550 --> 00:13:54.410
Only once the image is already formed

158
00:13:54.410 --> 00:13:55.370
with the light source on,

159
00:13:55.690 --> 00:13:58.310
does the exposure end and readout roll down the sensor,

160
00:13:58.570 --> 00:14:01.310
and then the light source is turned off for that time.

161
00:14:03.390 --> 00:14:05.010
So, photons are only captured

162
00:14:05.010 --> 00:14:07.270
when the sensor is behaving globally.

163
00:14:08.230 --> 00:14:11.230
The exposure start and readout happen in darkness.

164
00:14:11.230 --> 00:14:13.750
So, once again, we do need to have control

165
00:14:13.750 --> 00:14:15.830
over our light source for this to be possible.

166
00:14:16.930 --> 00:14:19.430
But this does avoid any possible motion

167
00:14:19.430 --> 00:14:22.470
or synchronization artifacts in this case.

168
00:14:25.890 --> 00:14:28.590
One thing to note is that there will be dead time

169
00:14:28.590 --> 00:14:29.650
between the frames.

170
00:14:31.170 --> 00:14:34.530
And that while this rolling process is occurring,

171
00:14:34.750 --> 00:14:37.090
we can't be actively acquiring data.

172
00:14:37.330 --> 00:14:39.870
But this is only around 10 to 20 milliseconds

173
00:14:39.870 --> 00:14:42.390
depending on the speed of the camera.

174
00:14:42.390 --> 00:14:44.670
This dead time is simply one divided

175
00:14:44.670 --> 00:14:46.930
by the frame rate of the camera

176
00:14:46.930 --> 00:14:49.630
in whatever mode we're operating it in.

177
00:14:50.430 --> 00:14:52.610
So, this dead time can be really quite short.

178
00:14:55.280 --> 00:14:59.800
So, in summary, we looked at hardware triggers.

179
00:15:00.280 --> 00:15:03.400
And hardware triggers are what allow communication

180
00:15:03.400 --> 00:15:05.600
between cameras and hardware

181
00:15:05.600 --> 00:15:07.800
with high precision and high speed

182
00:15:07.800 --> 00:15:09.900
via zero to five volt pulses

183
00:15:09.900 --> 00:15:11.880
along dedicated triggering cables,

184
00:15:11.880 --> 00:15:14.400
again, without the software being involved

185
00:15:14.400 --> 00:15:16.020
and having to think things through

186
00:15:16.020 --> 00:15:18.220
at whatever speed the computer's operating.

187
00:15:18.940 --> 00:15:22.320
The hardware can directly interface with each other

188
00:15:22.320 --> 00:15:23.740
at the speed of electronics,

189
00:15:24.080 --> 00:15:25.840
which is obviously very quick.

190
00:15:28.320 --> 00:15:30.160
Triggers in allow precise control

191
00:15:30.160 --> 00:15:32.200
over the moment of exposure start

192
00:15:32.200 --> 00:15:35.520
or also over the duration of that exposure.

193
00:15:35.520 --> 00:15:45.260
And triggers out allow control and signalization

194
00:15:45.260 --> 00:15:47.940
with other hardware, such as light sources.

195
00:15:48.580 --> 00:15:52.800
We also looked at this global trigger option,

196
00:15:53.300 --> 00:15:56.200
which enables the sensor to be only active

197
00:15:56.200 --> 00:15:59.400
while all rows of the sensor are actively exposing.

198
00:15:59.400 --> 00:16:04.900
And if this is connected to a triggerable light source,

199
00:16:05.260 --> 00:16:08.560
this allows an effective pseudo-global imaging

200
00:16:08.560 --> 00:16:10.660
on a rolling shutter camera

201
00:16:10.660 --> 00:16:13.580
with all of the advantages for signal-to-noise ratio

202
00:16:13.580 --> 00:16:16.100
and speed that a rolling shutter camera brings.

203
00:16:20.530 --> 00:16:24.270
So, finally, for the hardware control,

204
00:16:24.530 --> 00:16:25.470
we're going to have a look

205
00:16:25.470 --> 00:16:27.350
at some examples and applications.

206
00:16:27.350 --> 00:16:30.770
So, some examples for hardware triggers

207
00:16:30.770 --> 00:16:35.250
might be synchronizing capture with hardware

208
00:16:35.250 --> 00:16:36.790
for multi-channel imaging.

209
00:16:37.170 --> 00:16:39.550
Like, for example, if we're in fluorescence imaging,

210
00:16:39.950 --> 00:16:43.530
we might be iterating through UV, blue and green,

211
00:16:43.690 --> 00:16:45.350
and maybe even red illumination

212
00:16:45.350 --> 00:16:47.750
to build up a multi-channel image,

213
00:16:48.250 --> 00:16:50.290
such as the one on the right-hand side.

214
00:16:50.570 --> 00:16:52.750
And we can do this very quickly and efficiently

215
00:16:52.750 --> 00:16:54.330
by using hardware triggering

216
00:16:54.330 --> 00:16:56.550
to control that light source to say,

217
00:16:56.550 --> 00:16:58.650
okay, you can turn on and turn off now.

218
00:16:59.590 --> 00:17:01.050
This might be another case

219
00:17:01.050 --> 00:17:04.190
where we'd want to use that pseudo-global shutter mode

220
00:17:04.190 --> 00:17:06.910
because what we would want to make sure wouldn't happen

221
00:17:06.910 --> 00:17:10.410
is that there'd be any overlap between frames

222
00:17:10.410 --> 00:17:14.130
where the green frame, for example,

223
00:17:14.290 --> 00:17:17.330
might also overlap with some of the acquisition

224
00:17:17.330 --> 00:17:18.670
of the blue frame

225
00:17:18.670 --> 00:17:21.790
and would have both appearing in the same image.

226
00:17:21.970 --> 00:17:23.130
We want to avoid that.

227
00:17:23.190 --> 00:17:25.390
So, we can use this pseudo-global shutter mode

228
00:17:25.390 --> 00:17:27.670
to mean when there's any overlap between frames,

229
00:17:27.990 --> 00:17:29.510
the light source isn't turned on.

230
00:17:34.210 --> 00:17:35.990
We can also use triggering

231
00:17:35.990 --> 00:17:39.550
to speed up multi-location imaging,

232
00:17:40.030 --> 00:17:41.070
including fluorescence,

233
00:17:41.150 --> 00:17:42.590
such as spinning disk and focal

234
00:17:42.590 --> 00:17:43.670
and light sheet imaging,

235
00:17:44.110 --> 00:17:46.170
where triggers in will tell the camera

236
00:17:46.170 --> 00:17:48.830
that the X, Y or Z stage has finished moving

237
00:17:48.830 --> 00:17:51.570
or that the filter wheel has finished moving

238
00:17:51.570 --> 00:17:53.250
if we have one of those in our setup.

239
00:17:53.250 --> 00:17:56.010
And triggers out can then control the light sources

240
00:17:56.010 --> 00:17:58.290
and tell it that the frame has finished

241
00:17:58.290 --> 00:17:59.790
so we can make the next movement

242
00:17:59.790 --> 00:18:01.070
and visit the next place.

243
00:18:01.670 --> 00:18:03.710
And this can really speed up the acquisition

244
00:18:03.710 --> 00:18:06.710
over what software alone would be able to do

245
00:18:06.710 --> 00:18:08.890
when controlling these pieces of hardware.

246
00:18:10.470 --> 00:18:12.210
We can also use triggering

247
00:18:12.210 --> 00:18:15.250
to start exposures at a very specific time

248
00:18:15.250 --> 00:18:16.970
in our experiments,

249
00:18:16.970 --> 00:18:19.670
such as in laser-induced breakdown spectroscopy.

250
00:18:19.670 --> 00:18:24.520
And finally, we can use hardware triggers

251
00:18:24.520 --> 00:18:26.300
to connect to other equipment

252
00:18:26.300 --> 00:18:28.620
and hardware used to manage the experiments,

253
00:18:28.760 --> 00:18:30.360
such as in electrophysiology,

254
00:18:30.900 --> 00:18:32.400
neuroscience and cardiology.

255
00:18:32.620 --> 00:18:33.560
On the right hand,

256
00:18:33.920 --> 00:18:36.940
here we have a patch clamping setup imaged

257
00:18:36.940 --> 00:18:39.460
and we can use hardware triggering

258
00:18:39.460 --> 00:18:43.380
to synchronize the acquisition of frames

259
00:18:43.380 --> 00:18:45.160
with electrical stimulation

260
00:18:45.160 --> 00:18:46.920
being delivered to a sample, for example.

261
00:18:47.660 --> 00:18:50.400
And this can allow quite versatile control

262
00:18:50.400 --> 00:18:51.600
over our experiment.
