User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Mon Apr 01, 2019 9:37 pm

Last video effective exposure was 10.88µs+140ns+2.4µs=13.42µs.

I wanted to try half of effective exposure time, 6.71µs-2.4µs-140ns is slightly more than 4µs strobe pulse length. So I configured 4µs strobe pulse length (00 16 in registers 3b0[bc]). The frames looked really washed out. I did try brightness 75, 85 and 95. Best of the three was 85, but no nice frames (scaled down to 640x360):
Image


Then I remembered that in gimp the contrast setting helped me out, and tried that with raspivid contrast setting ‒ successfully.
This are the scripts used. In first script raspivid gets started in backgroud, with brightness 85 and contrast 75:

Code: Select all

pi@raspberrypi3B:~ $ cat doit1
#!/bin/bash
raspivid -md 1 -p 10,10,960,540 -fps 1.2 -br 85 -co 75 -pts tst.pts -o tst.h264 -t 10000 &
sleep 0.4
./frex_i2ccs1
pi@raspberrypi3B:~ $ 

The called script sets all the registers as needed:

Code: Select all

pi@raspberrypi3B:~ $ cat frex_i2ccs1
#!/bin/bash
./i2cwrite36 /dev/i2c-0 3002 ff
./i2cwrite36 /dev/i2c-0 3b01 00 08 00 04 00 10 1d
./i2cwrite36 /dev/i2c-0 3b0b 00 16

while true
do
  ./i2cwrite36 /dev/i2c-0 3b08 01 
  sleep 0.0288
done
pi@raspberrypi3B:~ $ 

This is the video uploaded to youtube, again I converted part of the 25fps video to animated .gif (scaled down to 640×360) playing with 5fps:
https://www.youtube.com/watch?v=hcyHCCr ... e=youtu.be
Image


First, I find it really remarkable that with only 4µs strobe pulse length a global shutter video is possible thanks to raspivid's brightness and contrast options. But as you can see the frames look not that good as before.


For any steps reducing strobe pulse time further, swapping out the 5000lm led with 10000lm led is needed.

As asked in earlier postings of this thread, what "nice" speeds (object move less than 1mm) can be captured with global shutter and 4µs+140ns+2.4µs=6.54µs effective exposure time?
152.9m/s or 550km/h:

Code: Select all

$ echo "0.001/0.00000654" | bc -ql
152.90519877675840978593
$ echo "0.001/0.00000654*3.6" | bc -ql
550.45871559633027522934
$ 
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Thu Apr 04, 2019 8:37 pm

In thread "Mouse trap: from 0 to 72km/h in 8ms(!)"
viewtopic.php?f=43&t=234406&p=1433883#p1433883

I used high framerate video capturing to get 10 frames of closing mouse trap bar in moving phase, which is 0.01s in total. While that thread was on video taken from above, here is another 640x75@1007fps video from the side:
Image


All the high framerate videos I have taken sofar have a big rolling shutter effect as can be seen here:
Image


Today I wanted to take global shutter video of mouse trap from side and was interested to catch a frame between 1/2 and 3/4 of the closing phase. That is a bit more than 1 frame, say 2 out of ten frames at 1007fps, or 0.002s. I used the same capturing setup as in second last video, with 11µs strobe pulse length and brightness 75. 2MP videos can be captured at 30fps at most because the long readout phase per frame, I used the same setup as before and that has only 25fps. So between two 2MP frames there is 40ms time. Since I don't know how to synchronize the start of the video and the triggerening of mouse trap I consider it as a random experiment on whether a 2MP frame in the 2ms range get captured or not. Probability of that is p=2ms/40ms=1/20. The average number of rounds needed to see an event with probability p is 1/p, in this case 20 rounds. I was really lucky and captured frame of interest in 4th video captured. The closing bar has speed 20m/s or 72km/h at that moment as calculated in the other thread. I have to work on the lighting, I will have to switch to 10000lm led for less than 4µs strobe length videos anyway, so will take another video of closing mouse trap with 10000lm and without brightness modification later:
https://www.youtube.com/watch?v=gxU-N3- ... e=youtu.be
Image


P.S:
Same frame with contrast 95 in gimp, the nearly vertical closing mouse trap bar can be seen better this way:
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Fri Apr 05, 2019 6:55 pm

I did experiment with "shutter delay==exposure" very low values. In this setup FREX goes HIGH together with STROBE:
Image


I did go down to 23µs only and expected to see much darker frames because of the time the 5000lm led needs to get full brightness. I was rotally surprised to see a frame only slightly darker than the original frame shown in previous posting. It seems the startup time to full brightness is very short:
Image


Recording a 2MP video at 25fps with such short times (13.42µs) of light, the 5000lm led is on for only 25*13.42=336µs in a second. I am pretty sure that even a 10000lm led would need no heatsink for that.
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Sun Apr 07, 2019 6:34 pm

I did upgrade from 5000lm led to 10000lm led. As described in other thread running 10000lm without cooling even for few seconds is dangerous. So I use the 100W 10000lm led only glued on big 200W heatsink with 12V fan. In order to have the reflector just in the place needed I built a Lego mount for lighting to bottom through plexiglas on top of motor test station:
Image


I expected to see a big difference for 11µs strobe pulse length global reset frame capturing, but only saw a very small difference. I was not sure whether the two parallel 38V/1.5A led drivers did work as they should. So I added a 100V/10A voltmeter/amperemeter to the setup:
Image


Unfortunately the measurements with 10000lm led always on showed these results:;
  • led driver 1 only: 33.5V, 1.37A
  • led driver 2 only: 33.4V, 1.39A
  • led driver 1 and 2: 37.3V, 2.77A
It seems that 10000lm led works as it should, but does not deliver double the brightness through same (24°) reflector than 5000lm led. Will try with two 5000lm leds instead, but currently have only one reflector. Another reflector has arrived in Germany yesterday, some more days and it will arrive at home ...

P.S:
The connection inforrmation for the two 100V/10A voltmeter/amperemeters I own is wrong, and it took a while to find a description matching the cabling of my model, but I finally found it:
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Fri Apr 12, 2019 5:19 pm

HermannSW wrote:
Sun Apr 07, 2019 6:34 pm
It seems that 10000lm led works as it should, but does not deliver double the brightness through same (24°) reflector than 5000lm led.
Back home and reinstalled all stuff that I had with me.
I tried several light meters I did install on my Android smart phone.
Unfortunately even powered with only one led driver the measured lux value reached maximum of 34000(!).
Since measuring one led power shows maximal (tool or Android sensor) value I cannot use those apps to compare 1 vs 2 led driver brightness.

Looking at radius of area lighted with 10000lm led, even 5000lm with only one led driver powered is far above the maximal value the app/Android sensor can measure (1 lux is 1 lumen per square meter):

Code: Select all

1/(pi*0.15^2)*5000=70735.53...
Image


Anyway, today two new 92mm 15°(!) reflectors arrived after only 11 days from China (both reflectors plus shipping is cheaper than the 10$ led I have). Time to keep the two 50W led drivers, but to replace the "10000lm" led with two 5000lm leds with two reflectors:
https://www.aliexpress.com/item/COB-Ref ... 02162.html
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Mon Apr 15, 2019 7:56 pm

The four new 10000lm leds did not arrive today. But I thought again on the luxmeter android apps, and the values measured being higher than the maximal values of 34000lux the apps/sensor can handle. But lux is lm per area. So today I just turned the 10000lm led with 200W heatsink and fan and reflector 90 degrees to light the wall on other side of the room. I did put Android smartphone into Realacc soldering hands very close to the wall (1-2mm). Then I compared the values with 1 and 2 led drivers powered and got this for two powered:
Image

As can be seen maximal value was 3144lux (I had to touch the smartphone for getting screenshot, which slightly moved it), with 1st led driver powered only 2132lux were reported, with the 2nd led driver powered 2142lux were reported.

I did measure the diameter on the wall (of what I saw as circle) as 3m. Then I took a photo, and that showed a brighter circle inside:
Image


I used black tape on the wall and took several photos with that until both markers allowed me to measure the brighter inner circle diameter as 1.94m. The ratio of the Watts for 2 led drivers powered versus 1 is 2.25. The distance from led to wall is 1.96m. The reflector angle is 24°. So I calculated the circle diameter that should result as 2*1.96*tan(24/2)=83.3cm only.

Then I calculated 2*1.96*tan(24)=1.75m which is near the measured 1.94. But I am not sure whether 24° reflector angle is for the circle diameter or circle radius.

Summary:
2 led drivers increase lux value by roughly 50%.
Measurements with same reflector for 10000lm versus 5000lm led are needed (same distance to wall).
Bigger distance reduced lux, so bringing 10000lm led closer to eg. mouse trap should get brighter pictures.
Replacing the 24° reflector with one of the new 15° reflectors should increase brightness as well.
So many variables ...
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Wed Apr 24, 2019 5:34 pm

I received new 5000lm leds in addition to the 10000lm leds.
With same setup 10000lm led with two 50W led drivers was only slightly more bright than 5000lm led powered wih one 50W led driver (against 2m distant wall).

Today I tested the 24° reflector versus the 15° reflector with 5000lm and 10000lm leds. It seems that the 15° reflector is really a 30° reflector, since the 24° degree reflector always reported much more lux.

Today I installed a white wall 1m above motor test station allowing to test with vertical up light. I fixated Android smartphone on that wall and did run light meter app the whole time. That way I was able to read the lux values while just changing leds and reflectors leaving everything else unchanged. The maximal lux value read that way was 19353lux at 1m distance, and even though the focused by reflector led light was very bright I was able to read the lux meter on Android display looking down onto motor test station.

With 10000lm led I got roughly 10000lux when powered with one 50W led driver, and 15000lux when powered with two parallel 50W led drivers (24° reflector).

With 5000lm led I got roughly 12000lux when powered with one 50W led driver. After I completed all my planned tests I did power a 50W 5000lm led with two 50W led drivers in parallel. To my surprise the lux value jumped to more that 180000lux.

Normally I would not consider powering 50W 5000lm led with 100W, but for global shutter lighting the power on time is in the microseconds range and I have no problem in doing that to achieve a 50% increase of lux value.

The old 5000lm led and a new are both mounted on 40x40mm aluminum passive heatsink (with Arctic MX-4 thermal compound). I did run both powered from my linear voltage generator with maximal 31V and 1.5A. I cannot explain why the old 5000lm led shows 0.94A at 31V, while the new shows only 0.41A at 31V. And why both produce the same lux values for same distance/reflector setup.


I will continue with 5000lm leds because they are much simpler to handle than 10000lm leds (passive versus active heatsink), but power it with 38V/3A from two parallel 50W led drivers to achieve maximal lux value.

Now will reduce distance to scene (propeller/mouse trap) and take videos with hopefully much reduced microsecond values for exposure.
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Wed Apr 24, 2019 7:37 pm

The work on getting more and more lux payed off.
I placed the propeller center 4cm below the plexiglas, in the center of reflector on top of plexiglas. The distance from led to center of propeller is therefore 8.5cm. I used 5000lm led powered with two parallel 50W led drivers as described in previous posting. The Arducam ov5647 camera looks at the propeller from the side, with view low enough for all reflector stuff being above view, and high enough for metal from soldering third hand fixating the propeller cables being below view to avoid reflections. The lux value is directly proportional to distance, so the propeller center is lighted with (1/0.085)*(1/0.085)*18000lux=2491349lux:
Image


The initial video with settings from previous posting (doit1, 4µs strobe time, with 2.42µs delay 6.42µs in total) was fine (with the values used before of brightness 85 and contrast 75). This is a frame capture while propeller rotated with 60000rpm, that is 1000rps, with diameter 34mm blade tip rotational speed is 106m/s:
Image


The first thing I wanted to get rid off was the contrast setting, and without I got nice frames as well. Then I reduced to brightness 75, still nice. Then I got courageous and reduced brightness to default 50 and got this too dark frame:
Image


I increased brightness to 66 (still no contrast setting) and got this nice frame (propeller tip moves with 106m/s or 381km/h! -- right click and open in new browser tab, the frame is really 2MP):
Image


The increased lux values should give me opportunity to go below 4µs strobe time and still getting nice frames with increased brightness ...


P.S:
The propeller moved 106/1000000*6.42=0.00068m=0.68mm during the 6.42µs effective exposure time, that is the reason the propeller looks so sharp.

P.P.S:
I had to correct the lux calculation, because the area is directly proportional to distance, so the square of distance factor is needed (2491349lux surprised me though).

P.P.P.S:
25.04fps 2MP youtube video:
https://www.youtube.com/watch?v=wDTRnPi ... e=youtu.be
Image

P.P.P.P.S:
From tst.pts file stored while taking the video, minimal frame delta is 34986µs (28.58fps), maximal frame delta is 44851µs (22.30fps). Average frame delta is 9584.473ms/240=39.94ms (25.04fps). Frame delta times in milliseconds:
Image
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Fri Apr 26, 2019 5:36 pm

I only wanted to check the "light off" delay with laser sensor module, now that the object (propeller) is so near to led and gets so much lux.

I placed the sensor at same height just before the propeller center, this is a raspivid mode 1 preview at 50% size (960x540) of the scene with normal light:
Image


I did not run the propeller, but did another run of "doit100" script to take a video with 4µs strobe length and of course do measurements. This is a single 2MP frame from the video taken, the laser sensor can be seen as well:
Image


I did await a longer delay for the sensor to finally detect that light is off, but was surprised to measure now 16µs instead of 2.4µs:
Image


It seems that I cannot use the laser sensor anymore for analysis of "light off" delay, since the propeller frames from video recorded yesterday were sharp despite 106m/s blade tip rotational speed. If the delay would be really 16µs, then effective exposure time would be 4+16=20µs. In that time the blade tip would have moved 106/1000000*20=0.00212m=2.12mm, and I cannot see such blur in the yesterday's video frames ...
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1239
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: ArduCam OV5647 Camera Board w/ M12 Mount

Tue Jun 04, 2019 2:31 pm

I was able to make "normal" Raspberry v1 camera do global (external) shutter captures as well.

See "Raspberry v1 camera global external shutter" github repo for details, requirements, tools, ...:
https://github.com/Hermann-SW/Raspberry ... al_shutter


Today I switched v1 camera used for the work sofar with Arducam ov5647 camera.
Here are fifteen 7µs strobe pulses 63µs apart (34mm diameter propeller runs with 20000rpm, that is 35.6m/s at blade tips). The frame was created by "shots" tool:

Code: Select all

shots 15 7 63
Image


All tools from the repo work with Arducam ov5647 camera as well. Only "gpio_alert.c" distance between two pulses needs to be reduced slightly from 0.925s to 0.850s in order to make both 9µs strobe pulses appear on same frame.
bookmark list: https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://github.com/Hermann-SW/fork-raspiraw
https://github.com/Hermann-SW/userland
https://twitter.com/HermannSW

Return to “Camera board”