Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Camera interface issues #20

Open
RoboDoig opened this issue Apr 21, 2023 · 19 comments
Open

Camera interface issues #20

RoboDoig opened this issue Apr 21, 2023 · 19 comments

Comments

@RoboDoig
Copy link
Collaborator

RoboDoig commented Apr 21, 2023

From Ede:

Possible issue with Camera Trigger 1
To acquire with 2 cameras, I duplicated the relevant parts of the workflow and updated the register addresses (36 for CamHz and 37 for CamExposure), but the second camera doesn't start. Checked with a scope, T1 on the HARP board does not fire, T0 does as expected. As a workaround I just connected both cameras to the same trigger for now, so not high priority.

Camera Trigger duration limits
For the camera trigger duration, the max value the board takes is 5000, above that it stops with errorneous write command. While 5ms max may be enough, it would be nice to be able to get more exposure times in certain conditions. I tried it with a low frame rate as well, so I don't think that the frame rate is limiting the pulse width.

@ederancz
Copy link
Collaborator

From Andrew (5 May)
The board that you have had some errors in the original fabrication that were manually repaired by David. It was tested and working before shipping but possible that something broke during shipping. David is producing an updated v2 of the board without these errors that will be sent to you.

@RoboDoig
Copy link
Collaborator Author

@ederancz are the cameras still connected to the same trigger? Looked like the triggering was working for both cameras yesterday but I now realise they may still be on the same trigger port.

@ederancz
Copy link
Collaborator

ederancz commented Feb 16, 2024 via email

@RoboDoig
Copy link
Collaborator Author

Ok thanks for confirming. No need to check anything just wanted to make sure. The Bonsai workflow allows you to set different imaging settings for each camera but we should just keep in mind (when looking at metadata etc.) that in the current setup only one of those settings will be applied in practice.

@RoboDoig
Copy link
Collaborator Author

RoboDoig commented May 7, 2024

You should have now received extra H1/H2 boards from OEPS - are the camera interface issues still present on the new H1 board?

@EleonoraAmbrad
Copy link
Collaborator

I have not tested this but I was also not sure how to set different imaging settings from Bonsai.
so far, I have used the spin view software to change gain and exposure time in each camera and these settings were then correctly applied in bonsai (cameras had different exposure times due to slight variations in setup).

@RoboDoig
Copy link
Collaborator Author

RoboDoig commented May 7, 2024

@EleonoraAmbrad see original message from Ede at the top of this issue for a debugging approach.

In the main workflow, the camera settings are currently hard-coded in the CameraControl sub-workflow. I think previously Ede connected both cameras to the same trigger because of this issue so only the Cam0 settings are used. Another way to debug would be to change the second camera to use the second trigger on the new H1 board. If the interface is working, both cameras should be stopped / started by the start / stop camera keys.

@EleonoraAmbrad
Copy link
Collaborator

I will test this with the new H1 and come back to you next week

@EleonoraAmbrad
Copy link
Collaborator

@RoboDoig i am not sure what you mean but in Main there does not seem to be a way to change exposure time and sampling rate. are you referring only to the triggering issue?

@RoboDoig
Copy link
Collaborator Author

RoboDoig commented May 7, 2024

Inside CameraControl there are a few HARP message creation nodes, Should be named something like Cam0TriggerFrequency, Cam0TriggerDuration, Cam1TriggerFrequency etc. The values there will set the sampling rate, exposure for the cameras.

Brings up another point which is that you may want these to be settable in the schema?

@EleonoraAmbrad
Copy link
Collaborator

ok I wasn't sure that's what those nodes do. the thing is I have been changing the exposure time manually on spin view. this has been the best way to get good illumination (not by setting "triggered width" exposure). would there be a way to change that from bonsai?

@RoboDoig
Copy link
Collaborator Author

RoboDoig commented May 7, 2024

Oh yes I remember now for exposure. Nonetheless, you should still be able to change frequency from Bonsai.

I think if you want to change exposure from the Bonsai trigger there is a setting in SpinView to have the incoming pulse override the manual exposure time.

@EleonoraAmbrad
Copy link
Collaborator

ok, and the incoming pulse would be a number (exposure time) generated by a harp command?

@RoboDoig
Copy link
Collaborator Author

RoboDoig commented May 7, 2024

Yes, I believe the way it works is that each pulse holds the camera shutter open depending on its length. So the HARP command just sets the pulse width for the camera trigger and then that in turn drives the shutter opening/closing.

@EleonoraAmbrad
Copy link
Collaborator

EleonoraAmbrad commented May 10, 2024

ok, thanks for the clarification. By the way do I need to take specific care about something before plugging the new H1 in? (do we need to do some firmware update?)

@EleonoraAmbrad
Copy link
Collaborator

updates on the new H1: triggers work well (both t1 and t0) and it is possible to change the length of the exposure time with the trigger. Max value still seems to be 5000 (microseconds?). This is not a big deal, provided that we can change the gain. Is it possible to control gain from bonsai?

Generally it would also be great to be able to set these variables from the schema.

@RoboDoig
Copy link
Collaborator Author

Should be possible to use the Aeon camera components to control these settings (e.g. gain) and add a parameter in the session schema.

@RoboDoig
Copy link
Collaborator Author

Need to add camera parameters (frequency, exposure, gain) to the schema. Frequency and exposure can already be set, we need to add ability to control gain from Bonsai.

@RoboDoig
Copy link
Collaborator Author

@EleonoraAmbrad Try the PR #93 for setting camera parameters via schema

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants