FSM in Visual Applet

  • Hi all,

    I would like to develop an applet that estimates the brightness image level frame by frame and uses this information to tune the exposure time on the following frame (increase or decrease of a fixed step).

    More generally I would like to understand how to implement finite state machines on VA. Can you please describe a possible approach to use?


    Thanks a lot,


    Fabio

  • Dear Fabio,


    I will generate an example design that controlls the sensor exposure duration on trigger pulse length.
    As soon as done I will post it here.


    Best regards

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear Fabio,


    Thank you. I will use that target platform for your example.

    Me5 Marathon VCL

    • What camera/configuration wil be used?
      • Mode: CL BASE/MEDIUM/FULL/DECA ?
      • CL Taps: 1,2,3,8,10 ?
        • Or SFNC Tap-Geometry Name?
      • Planes: 1 = mono, 3 = color ?
      • Bit-Depth: 8,10,12,14 ?

    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear Fabio,


    Here you can find a complete "auto exposure control" on basis of closed loop P-regulator.


    Download: ExposureControl_StateMachine_B.Rudde.va


    In the initial post you asked for fixed steps for control, you can see internal value P as fixed value,

    but please see the large amount of comments within the design for more details.


    So your design includes a loop, but can be simulated in VA except the real camera feedback.

    But you can use any kind of sequence to see how the P-regulator is acting.


    A later post will give more explanation.


    The question of state machine is a shorter answer:
    Rx- and TxSignalLink make it possible to build a signal based state machine,

    or if you require values and simulation for it, please use:

    RxImageLink and TxImageLink.


    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Dear Fabio,


    Here some explanations on the VA design related to auto exposure... ExposureControl_StateMachine_B.Rudde.va

    Download: ExposureControl_StateMachine_B.Rudde.va

    A later post will give more explanation.

    Full overview:


    pasted-from-clipboard.png


    The points of interest are the 3 hierarchical boxes: RxExposure, BrightnessMismatch, NewExposure

    Each listed with comments below:


    BrightnessMismatch, if auto exposure want to work, we need to know how "bright" the image is.
    Here you can set the target value for histogram mean into TargetHistMeanValue, preset = 127.

    The function extracts the mean value from full histogram:

    pasted-from-clipboard.png


    NewExposure, based on the brightness mismatch to target value and the last used exposure value the new one is calculated on basis of simple closed-loop control with P element only. More to read in the commenst within the VA design:


    Basics of loop:

    pasted-from-clipboard.png


    Regulator details:

    pasted-from-clipboard.png


    RxExposure, simply receiving the new exposure value and forwarding it to pulse generation:


    pasted-from-clipboard.png



    I hope the listed VA design shows what you are asking for. In case of questions do not hesitate to contact me or press the like button ;) in case there are no questions to this VA design sketch.


    Best regards,

    Björn Rudde
    Field Application Engineer
    - Basler AG / Silicon-Software GmbH
    chat

    please press :) if post above is usefull

  • Hi Bjorn,

    thank you very much. That's exactly what I was looking for.

    Just a question. In my VA version (3.0.1) in the ExtractResult Box I get GetResult as Dummy. How can it be converted for my version?


    Grazie,

    Fabio