60 FPS with V4?

567 views
Skip to first unread message

Meow

unread,
Oct 11, 2021, 4:00:28 PM10/11/21
to Miniscope
Hi, 

We got two new miniscope v4 in the lab. Is it possible to get images with 60 Hz FPS with them? I tried to changes the FPS in the user config file but it didn't seem to work. We don't need the whole field of view if the bitrate is the limiting factor.

Best,
Mang 

Daniel Aharoni

unread,
Oct 11, 2021, 6:50:45 PM10/11/21
to Miniscope
Hi Mang,
Yes it is possible to image up to around 120FPS with the V4 Miniscope but this requires a small change in the human editable videoDevices.json configuration file. The issue you might run into though is this causes a larger power draw for the CMOS image sensor which results in it heating up and becoming noisier. 

The other option would be, as you said, cutting the FOV is roughly half which could give you around double the FPS without heating up the sensor more. This change can be made in the videoDecives.json files as well.

I unfortunately do not have time to make these additions myself currently but will put them on my todo list for a future release. If you are interested in making these changes yourself I would be happy to point you in the right direct.

Meow

unread,
Oct 12, 2021, 12:49:33 PM10/12/21
to Miniscope
Hi Daniel,

Thanks a lot!
I'm happy to make those changes myself. I've changed the videoDevice.json like this (changes are highlighted):

"Miniscope_V4_BNO": {
        "qmlFile": "qrc:/Miniscope_V4_BNO.qml",
        "sensor": "PYTHON480",
        "frameRate": "adjustable",
        "width": 300,
        "height": 300,
        "pixelClock": 16.6,
        "headOrientation": true,
        "isColor": false,
        "controlSettings": {
            "gain": {
                "displaySpinBoxValues":["Low", "Medium", "High"],
                "displayTextValues": [1, 2, 3.5],
                "outputValues":[225,228,36],
                "startValue": "Low",
                "sendCommand": [
                    {
                        "protocol": "I2C",
                        "addressW": "0b00100000",
                        "regLength": "1",
                        "reg0": "0x05",
                        "dataLength": "4",
                        "data0": "0x00",
                        "data1": "0xCC",
                        "data2": "valueH",
                        "data3": "valueL"
                    }
                ]
            },
            "frameRate": {
                "displaySpinBoxValues":["10FPS", "15FPS", "20FPS", "30FPS", "60FPS"],
                "displayTextValues": [10, 15, 20, 30, 60],
                "outputValues":[10000,6667,5000, 3300, 1650],
                "startValue": "20FPS",
                "sendCommand": [

                    {
                        "protocol": "I2C",
                        "addressW": "0b00100000",
                        "regLength": "1",
                        "reg0": "0x05",
                        "dataLength": "4",
                        "data0": "0x00",
                        "data1": "0xC9",
                        "data2": "valueH",
                        "data3": "valueL"
                    }
                ]
            },
.......

When the FPS is set to 60 in GUI, the image became darker. However, the real FPS is unchanged. 
Screenshot 2021-10-12 123223.png
What else should I change?

Best,
Mang

ianejo...@gmail.com

unread,
Dec 3, 2021, 5:17:19 PM12/3/21
to Miniscope
Hello all,

Was a solution to this issue ever found? I encountered the same result while updating my .json files. 

Best,
Ian

Daniel Aharoni

unread,
Dec 8, 2021, 4:14:13 PM12/8/21
to Miniscope
Sorry for not following up on this quickly. So the changes that need to be made are in the "initialize" section of the videoDevices.json file. You need to send additional I2C packages with configuration values to specific registers of the PYTHON480 image sensor. This involves potentially enabling the PLL of the image sensor or changing the FOV size or binning. 

Mang

unread,
Dec 9, 2021, 4:08:20 PM12/9/21
to Miniscope
Thank you! I'll give it a try.

Best,
Mang

ianejo...@gmail.com

unread,
Dec 16, 2021, 11:24:36 AM12/16/21
to Miniscope

Hi Daniel, thanks for the advice!

So far, I've only been able to get the fps to cap out around 38fps on average. I played around with frame length and exposure time values, but no matter how low I make either of these two values, I still cap out at ~38. For example, a frame time of 1666 (60fps) with an exposure time of 1000 and a frame time of 1000 (100fps) with an exposure time of 800 yield the same fps. I have reason to believe these changes are actually being implemented on the sensor registers, as my image brightness changes proportionally to the change in exposure time and adjusting frame length was how I solved the initial issue Mang and I had of capping out at 30fps.

I tried enabling subsampling and enabling the PLL, but it seems like something else is keeping my framerate low, as neither of these modifications were able to increase my FPS any further. I enabled the PLL by commenting out the DISABLE_PLL definition in the MCU firmware, so I believe it should be initializing correctly. I also want to mention that I checked the DAQ's frame out signal from its SMA port and it's matching the average fps and timestamps read out by the miniscope GUI, so that leads me to believe the speed issue has to do with something on the rigid-flex PCB. Do you have any ideas of what else I can try?

Thanks,
Ian

Daniel Aharoni

unread,
Dec 17, 2021, 5:12:25 PM12/17/21
to Miniscope
Hi Ian,
I think it sounds like the PLL is not fully being enabled here. If the PPL is properly enabled, it will boost the pixel clock (and frame acquisition rate) but 4x without the need to change any other settings. So you shouldn't have to modify any of the FPS settings or registers and once the PLL is enabled "30 FPS" in software will result in ~120FPS. 

I will try to find some time to test this out myself over the next few weeks. I think what might be happening is the PLL cannot be enabled without the PYTHON480 image sensor going through a full reset. If this is the case, we might need to just enable this feature within the MCU firmware on the V4 Miniscope itself.

Isaac Anthony

unread,
May 24, 2022, 12:42:20 PM5/24/22
to Miniscope
Hi there,

I am reducing the frame rate of the V4 to 0.5 or 1 (LED @ 1), but this results in too great of saturation, especially for the events we are hoping to detect. One solution is to use less virus for our injections, but I'm thinking reducing the gain or LED power to a value lower than the currently programmed minimum would work too if possible. Does anyone know how I might do this? I've pasted the part of the code that seems most likely relevant but admittedly do not know where to start to understand it myself.

"controlSettings": {
            "gain": {
                "displaySpinBoxValues":["Low", "Medium", "High"],
                "displayTextValues": [1, 2, 3.5],
                "outputValues":[225,228,36],
                "startValue": "Low",
                "sendCommand": [
                    {
                        "protocol": "I2C",
                        "addressW": "0b00100000",
                        "regLength": "1",
                        "reg0": "0x05",
                        "dataLength": "4",
                        "data0": "0x00",
                        "data1": "0xCC",
                        "data2": "valueH",
                        "data3": "valueL"
                    }


"led0": {

"startValue": 0,

"min": 0,

"max": 100,

"stepSize": 1,

"displayValueScale": -2.55,

"displayValueOffset": -255,

"sendCommand": [

{

"protocol": "I2C",

"addressW": "0b00100000",

"regLength": "1",

"reg0": "0x01",

"dataLength": "1",

"data0": "value"

},

{

"protocol": "I2C",

"addressW": "0b01011000",

"regLength": "1",

"reg0": "0x00",

"dataLength": "2",

"data0": 114,

"data1": "value"

}
]

Thanks,
Isaac

Daniel Aharoni

unread,
Jun 16, 2022, 11:52:35 PM6/16/22
to Miniscope
Hi! If you are saturating the image sensor when running at a really low FPS, why not just increase the FPS a bit? The Gain and exciation LED intensity cannot be pushed lower than what is already allowed in software. You could modify the deviceConfig file to adjust the exposure the of the image sensor but this is a lot more work than just increasing the FPS a bit.
Message has been deleted

Abby Vigderman

unread,
Dec 10, 2023, 9:12:02 AM12/10/23
to Miniscope
Hi there,

I have recently obtained the V4 scope and am trying to increase the frame rate as well. I am not an expert in this but am wondering if there was ever a solution to increase the frame rate. Any explanation for someone who is not very well versed in using this sort of technology would be very helpful. Thanks!

Abby

Abby Vigderman

unread,
Jan 16, 2024, 4:18:03 PMJan 16
to Miniscope
Hi,

I have been taking some steps to try to figure out how to increase the frame rate to 60 fps with the V4 and wanted to share my progress. Although I have not figured this out yet I am looking for feedback or clues to whether I am going in the right direction.

I have been looking in the miniscope DAQ firmware file that contains the USB descriptor tables (called cyfxuvcdscr.c). I see the section where the different frame descriptors are located for each of the resolutions, and see the values that are corresponding to 30 fps (0x15, 0x16, 0x05, 0x00). I was thinking of trying to replace this with the values for 60 fps (which I believe are 0x0A, 0x8B, 0x02, 0x00) and updating the firmware with this file. I imagine I'll have to change something in the videoDevice.json file as well. It's unclear to me if I'm looking in the right place to make the change, or if I have to update more about the frame descriptor so that the values are compatible with the image sensor. 

Thanks so much,

Abby

Reply all
Reply to author
Forward
0 new messages