Git Product home page Git Product logo

Comments (14)

hsw28 avatar hsw28 commented on August 16, 2024 1

thanks for looking at this!! I was setting it to 0<value<1 in the param file and it wasn't erroring, but it would automatically have it as 1 on the slider when I started up the program.

from miniscope-daq-qt-software.

hsw28 avatar hsw28 commented on August 16, 2024 1

Also you tagged the wrong account above, I was later to the game and had to put the 28 onto hsw :(

from miniscope-daq-qt-software.

jonnew avatar jonnew commented on August 16, 2024 1

Whats up @hsw28! Been a while :). At the end of the long Rube Goldberg machine, there is a digital potentiometer which controls the current passing though the LED to determine its brightness. This has 256 taps and therefore there are 256 discrete current/brightness levels. I'm not sure how the 1-100 setting on the QT software is transformed into these 256 levels. I would assume via some reasonable rounding that probably maps 1 -> lowest current step. On the bonsai package, they are brought out directly and so you have access to all of them, in case this is helpful.

        [Range(0, 255)]
        [Editor(DesignTypes.SliderEditor, typeof(UITypeEditor))]
        [Description("LED brightness.")]
        public double LEDBrightness { get; set; } = 0;

Edit: I have not verified that the firmware running on the camera actually directly writes these values to the pot, but it would take work not to do that, so I assume it does.

from miniscope-daq-qt-software.

daharoni avatar daharoni commented on August 16, 2024 1

Alright, let's take this discussion offline for the time being as it is beginning to feel like this thread is becoming counter productive.

@sneakers-the-rat, @fnsangiul, @RaymondWJang, and I need to have a discussion in person and then we will respond.

Thanks for raising this issue @hsw28.

from miniscope-daq-qt-software.

hsw28 avatar hsw28 commented on August 16, 2024

Hey @jonnew :) ! Thanks for the info! Depending if they mapped 0 or 1 to 256 maybe I have a little wiggle room, if I can access the lower values.
Any chance you'll be at cosyne this year?

from miniscope-daq-qt-software.

fnsangiul avatar fnsangiul commented on August 16, 2024

Solution addressed here. None of the solutions explained above are correct for this issue.

from miniscope-daq-qt-software.

sneakers-the-rat avatar sneakers-the-rat commented on August 16, 2024

so I found where the display values are mapped to the I2C values here:

onValueChanged: root.valueChangedSignal(value, (value * root.displayValueScale - root.displayValueOffset)<<root.displayValueBitShift, 0)

so for a value of 1, the value that gets written over I2C is
(1 * -2.55) + 255 = 252.45 so you actually do have a bit of headroom on the software side.

So unless we want to go with "you need to resolder a resistor onto your miniscope" as the accepted answer to this solution, this should stay open, since both fixing that and changing the exposure as suggested here are certainly preferable outcomes that should be added to docs. but whatever

from miniscope-daq-qt-software.

fnsangiul avatar fnsangiul commented on August 16, 2024

It depends on what the user needs. I personally would prefer a lower irradiance by limiting the current of the LED as it would reduce photobleaching over time. Also, the digital potentiometer (datasheet here) only takes integers.

from miniscope-daq-qt-software.

RaymondWJang avatar RaymondWJang commented on August 16, 2024

How exactly would lowering the brightness via hardware setting vs the software setting make a difference in photo bleaching?

Also isn't Jonny suggesting we could throttle it up to 255?

from miniscope-daq-qt-software.

fnsangiul avatar fnsangiul commented on August 16, 2024

You can't change the brightness of the LED via software. Please refer to the LED driver (LTC3218) datasheet:
image

My suggestion for lowering the LED intensity via hardware is based on this graph. The software option of reducing the exposure doesn't change the amount of irradiance that reaches the brain. It only captures less light in the image sensor. That's why the only sensible option to reduce photobleaching is to reduce the LED intensity.

from miniscope-daq-qt-software.

sneakers-the-rat avatar sneakers-the-rat commented on August 16, 2024

Presumably the firmware truncates the remainder on the float, thats the part of the code I dont rly get (and why it would be dope to have tests to validate). Still that means there are 2 more clicks to be had of lowered brightness that would be desirable to be able to test before resoldering the scope, since OP says they dont want to have to modify this for one animal. The luminance isnt decreased, but the PWM time is, right? Trying to stay responsive to the issue at hand, and OP hasnt specified a problem with bleaching (but I could be wrong?)

Since we are trying to EOL this software, I would suggest @hsw28 try bonsai as @jonnew suggests, which can write the values directly, and see if that is enough, then since presumably they know about photobleaching, try the gain thing, and then if that still isnt enough then resistor change.

Ideally we would have docs with a FAQ section that describes the tradeoffs @fnsangiul describes between lowering intensity, exposure, and resoldering the resistor as a last resort. Typically if the resolution to an issue is docs, you leave it open until the docs get written. In the meantime, these two issues are an imperfect replacement for that. (Idc really about the closedness of this issue, im just happy we are raising them instead of debugging individually over email lol)

from miniscope-daq-qt-software.

fnsangiul avatar fnsangiul commented on August 16, 2024

@sneakers-the-rat I don't know how to make more clear that dealing with the potentiometer won't enable an intensity lower than the minimum. You can try if you want but you won't get any useful result. The two possible solutions for this issue are

  1. Changing the Rset resistor to 100k based on the graph I posted above sourced directly from the LTC3218 datasheet
  2. Change the exposure time by setting it on the user configuration files of the Miniscope QT software.

Option one makes the overall Miniscope excitation dimmer, which is preferred if you want to minimize photobleaching at the expense of making the Miniscope not usable on dimmer mice. Option two doesn't change at all the excitation power of the Miniscope, it just makes it less efficient by lowering the exposure time of the image sensor. On my end I'll post solution two and close this issue.

from miniscope-daq-qt-software.

RaymondWJang avatar RaymondWJang commented on August 16, 2024

Oh, is the led brightness fixed at a hardware level? As in you can't change it once the Miniscope is deployed?

Nonetheless, I think Jonny's point then is that you could lower the exposure time into the pixels via software and thus keep them from saturating. Am I correct? @sneakers-the-rat

from miniscope-daq-qt-software.

sneakers-the-rat avatar sneakers-the-rat commented on August 16, 2024

Loud and clear on the fact that the LED has a fixed intensity, but the brightness setting does control PWM correct?

What im saying is that the "1" value does not translate to the minimum that the PWM controller can do - setting to 1 sends a value of 252, so the firmware can accept 253 and 254 before turning off at 255, but the software cant send those values because of how the 1-100 range is mapped to 0-255. Aka there is a software bug here orthogonal to the luminance of the LED.

Not sure where the tone is coming from, all im saying is that it would probably be good to try bonsai (which can set the minimum PWM value) and exposure settings first before resoldering the component, since the first two options might meet the needs here and allow the scope to be used with the other animals. I get what youre saying and am not even disagreeing that obvi changing the resistor would decrease intensity and is one way of addressing the issue.

from miniscope-daq-qt-software.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.