User avatar
HermannSW
Posts: 5178
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany

Raspberry "Pyro" ignites electric match and records 665fps video

Sat Feb 03, 2018 4:45 pm

I wanted to do high framerate recording of match ignition. Once I did a 100fps video of match ignition with the standard way to ignite matches, keeping the match in video view was a challenge. Unlike that method I wanted to record a static scene this time without moving match, at very high framerate (665fps). The automation done this time will allow others (teachers, students) to do high framerate video capturing for eg. physics or chemistry experiments.

While the ignition of a match can be done in many different ways, I learned yesterday from this youtube video how to build an electric match. Wikipedia article on electric match describes more detailed how this works. Basically a single copper strand is used as bridegwire and coated end of match as pyrogen.

So first lets see the result, a 1s (665 frames part) of 665fps recording as animated .gif, played at 25fps (default framerate for youtube upload), 26.6 times slower than real:
Image


If this loads slowly for you, the reason is that this animated .gif is of size 20MB.
You can though open the associated youtube video.
Its description details on how to single step fore/back between the 1503μs apart consecutive video frames:
https://www.youtube.com/watch?v=ORN0pLc ... e=youtu.be

This is the setup I used. I learned that using two clamps allowed me to move the electric match head far away enough to not be a danger to other parts. The Pi 2B controls via motor driver when and how long the 25C 900mAh 11.1V 3S lipo (mounted on caterpillar robot) gets connected to electric match:
Image


The high framerate recording is possible with raspiraw main branch (see signature) after high framerate features got merged by @6by9.

Before talking in detail how the video was done, here some selected single frames showing the different phases of ignition (one of the main values of high framerate videos -- most times some frame contains the details needed, consecutive frames in the video are only 1503μs apart). I lighted the scene bright with a 1000lm bulb, that is the reason why the datails in frame are visible well.

First only a little smoke:
Image


Then a first small flame:
Image


A second:
Image


More small flames:
Image


Now big flame becomes so bright that the remainder of frame, although lighted bright, becomes dark:
Image


Even bigger flame:
Image


Finally narrow and high flame:
Image


The motor driver was connected to 3V3, GND and GPIO24 pins of Pi 2B.
I used gpio command to control GPIO24 from "doit" bash script.
First the script sets GPIO24 to output mode, and LOW state.
Next the 3s video capturing via 640x128_s tool is started in background.
After a sleep of 0.3s GPIO24 is set to HIGH for 0.6s.
I started with 0.1s and 0.2s before and nothing happend.
With 0.4s I saw a little smoke, but match did not get ignited.
Setting 0.6s did ignite the match as seen in the video.

Code: Select all

$ cat doit 
#!/bin/bash
gpio -g mode 24 OUT
gpio -g write 24 0
640x128_s 3000 &
sleep 0.3
gpio -g write 24 1
sleep 0.6
gpio -g write 24 0
sleep 3
$

Here you can see the complete execution with frame delay and delta analysis.
1503μs ± 6μs between frames, in total 5+1+1=7 frame skips in 3s video of 1982 frames.

Code: Select all

$ ./doit
removing /dev/shm/out.*.raw
capturing frames for 3000ms with 659fps requested
1982 frames were captured at 665fps
frame delta time[us] distribution
      1 
      1 1497
      1 1499
      1 1500
    508 1502
   1459 1503
      1 1504
      2 1506
      1 1508
      5 3005
      1 3006
      1 10519
 ...


I created the (uploaded to youtube pyro.ogg video) and pyro.anim.gif with this command.
Output file prefix "pyro", 665 frames between 900 and 1564, target framerate 25fps, and doubling ("d") each of the captured 64 every other lines to get back frame matching fov:

Code: Select all

raw2ogg2anim pyro 900 1564 25 d

The 2nd part of analysis shows that exactly one frame skip (at frame 1146) happened in the 665 frames selected:

Code: Select all

...
after skip frame indices (middle column)
3005,2,4356622295
3005,334,4357122708
3005,361,4357164785
3005,363,4357178309
3006,364,4357181315
3005,1146,4358357961
0% frame skips
$

P.S:
I have never seen a multi frame skip before, but in above recording we have one:

Code: Select all

...
      1 1508
      5 3005
      1 3006
      1 10519
 ...

The 7 frame deltas long skip (frame 362) happend outside of selected frames (500-1564) though:

Code: Select all

$ grep 10519 tstamps.csv 
10519,362,4357175304
$ 
https://hermann-sw.github.io/planar_graph_playground
https://stamm-wilbrandt.de/en#raspcatbt
https://github.com/Hermann-SW/memrun
https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/en/Raspberry_camera.html

Return to “Camera board”