Difference between revisions of "FPSControl"

From ElphelWiki
Jump to: navigation, search
(Created page with "= Controlling FPS = == Modes == The sensor has 2 operation modes: *Free Running *Triggered <br> == Free Running Mode == In this mode you can achieve higher frame rate...")
(No difference)

Revision as of 00:57, 9 February 2011

Controlling FPS

Modes

The sensor has 2 operation modes:

  • Free Running
  • Triggered


Free Running Mode

In this mode you can achieve higher frame rate and exposures can overlap frames (while you are reading the current frame exposure of the next one already began). The maximum exposure this is basically 1/FPS.

In the free running mode the software can only adjust frame period by changing vertical and horizontal blanking. It is also possible to change the sensor clock frequency, but sensor "does not like" when the clock is adjusted while it is running and may hang.

Setup

There are 2 things that can prevent your custom FPS settings to work properly:

  • Too high resolution
  • autoexposure is enabled and your camera environment is too dark

Reduce Resolution

  1. Open up the Camera Control Interface (codename: camvc)
  2. Click the "Camera" icon (first on the left)
  3. Reduce the resolution (full frame will not give more than 10 fps in RGB mode) to 1280x720 for example by reducing the WOI (Windows of Interest).

Disable Autoexposure

  1. Also in the Camera Control Interface (codename: camvc) click the "Sun" icon (first slider under the WOI settings). You will notice that the slider will change from a triangle to a circle.
  2. Now you can move the slider. Set it to a value below 40 ms.

Settings FPS

  1. Open up the Parameter Editor (codename: autocampars).
  2. Check the "Streamer" Settings and click "View/Edit Current"
  3. Find the FP1000SLIM and FPSFLAGS parameters. Notice that if you hover over these parameters a tooltip will popup giving you an explanation of the particular parameter.
  4. Set the desired FPS x 1000 in the dec (decimal) field of FP1000SLIM. Lets say you want 25 frames per second. Write "25000" in the dec field of FP1000SLIM.
  5. Set the FPSFLAGS field to "1". This means "maintain fps (not lower than)". Don't forget to press the "Apply" button after changing the values in the fields.
  6. Go back to the Camera Control Interface (codename: camvc) and take a look at the fps indicator. If it did not change click the live image to the right of the settings. The Camera Control Interface has a time-out and stops to reload the live image if there is no activity in the interface. Clicking the live image will wake it up again.
  7. The fps indicator will show "24.989fps". To get higher FPS precision use the Triggered mode.

Triggered Mode

In triggered mode the minimal frame period is the frame readout time (same as the frame period in the free running mode) plus exposure time plus 8 extra lines (some sensor internal overhead). This can effectively reduces exposure time to less than 50% of 1/FPS.

On the other hand it is much easier to set any required frame period in triggered mode than in free running - you can just specify the period in single pixel clock increments (as long as it is above the minimal for this image size and exposure, of course).

Setup

In the camera you can set trigger to FPGA trigger generator (or you can trigger from the external source, i.e. another camera).


Summary


Free Running Mode Triggered Mode
max. FPS higher lower
max. Exposure Time 1 / FPS less than 1 / FPS
FPS precision low
high


This is why when you do not need the highest fps it is usually more convenient to run sensor in triggered mode. It is not controlled by the camera GUI, but you can change it from the custom script or with parsedit.php. If you just open the http://192.168.0.9/parsedit.php page it will show you some sample links to control different parameters, just select the "External Trigger Controls". You may even reduce the number of parameters using the following link:

http://192.168.0.9/parsedit.php?embed=0.1&title=External+trigger+controls&TRIG&TRIG_PERIOD

Each parameter has a short description that would appear as a tooltip when you put the mouse pointer over it.

The triggered mode is turned on by setting TRIG=4, free running mode TRIG=0.

TRIG_PERIOD - frame period in pixel clock periods, by default the clock is set to 96MHz.

If you set something too long, camera may wait and wait... Refreshing the page will not help, at some point all 3 currently specified instances of PHP will be used (something did not work with dynamically increasing number of instances) and you'll not be able to open any PHP-based pages (i.e. parsedit.php). To recover from that condition (without power-cycling the camera) you may telnet to the camera and run killall -9 lighttpd # - that will kill web server and all PHP instances, then restart them all.

That PHP restart still will not "unfreeze" the camera from waiting the trigger, the driver responsible for changing the run time parameters is driven by the sensor frame sync interrupts, you may check the status of the camera/sensor by refreshing the http://192.168.0.236:8081/pointers page - it will work even when the main web server and php are busy. If frame number is not changing - the sensor is not being triggered. In that case you can open external trigger control page, set TRIG=0 and before applying change the value in "Program ahead" column from 3 to 0 - in that case the driver will not wait the frame sync interrupts before applying the parameter(s).