Shop OBEX P1 Docs P2 Docs Learn Events
Rocket Camera Controller — Parallax Forums

Rocket Camera Controller

Dave HeinDave Hein Posts: 6,347
edited 2007-07-14 15:56 in Robotics
I recently completed a controller for an AipTek PenCam digital camera. I modified this camera so it could be launched in the payload bay of a model rocket. The controller pulses the shutter line on the camera every eleven seconds so that a series of pictures can be taken while the camera is in the air.

The controller is built around an SX28. A G-switch is used to tell the controller when the rocket begins to take off. The first picture is taken 6 seconds into the flight when the rocket is close to its highest altitude. The remaining pictures are taken as the rocket is coming down under its parachute.

Information about the controller and camera is at home.swbell.net/davehein/ModX/ModX3c.html

You can get more information about the rocket, which is named Mod X at home.swbell.net/davehein/ModX/ModX.html

One of the pictures taken by the camera is at home.swbell.net/davehein/AARG110406/IMAGE0050.jpg

Other pictures can be found in the launch log for the Mod X rocket.

I plan on making some changes to the software so that it allows the camera to go into a power saving mode. I also plan on implementing a configuration where a motion video sequence is taken while the rocket ascends, and still pictures will be taken as the camera descends.

Comments

  • Mike CookMike Cook Posts: 829
    edited 2006-11-09 00:48
    Dave,

    Pretty Cool!

    What are you using for your G-Switch on your new SX controller?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike
  • Dave HeinDave Hein Posts: 6,347
    edited 2006-11-09 11:56
    I use the G-switch from PerfectFlite.· I tried another method using a strip of aluminum, but this was not as reliable.· The G-switch from PerfectFlite cost $8, so I'm looking for a cheaper alternative.

    Dave
  • Dave HeinDave Hein Posts: 6,347
    edited 2006-11-10 00:53
    I am attaching the source code for the camera controller program.· I used the timer interrupt to generate 100 interrupts per second, which is then divided down by 50 to provide half-second intervals.· The variable TickCount is decremented every half-second in the interrupt service routine.· TickCount is used to generate a delay by setting it to the number of half-second intervals for the delay, and then waiting for it to go to zero.
  • Dave HeinDave Hein Posts: 6,347
    edited 2006-12-04 22:56
    I updated the program to allow the camera to go into the sleep mode. The 9 volt battery would run down in about 15 or 20 minutes when I kept the camera awake. I have attached the new source code and a couple of pictures taken by the camera.

    Dave Hein
    1248 x 960 - 135K
    1248 x 960 - 177K
  • steve_bsteve_b Posts: 1,563
    edited 2006-12-05 00:39
    I dig that 2nd picture. Very cool!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-01-02 01:34
    I built another version of the controller that fits in a smaller rocket.· For this version I used an SX18 mounted on circular PC board that is 1.25" in diameter.· The controller also included a G-Switch, DIP switch, LED, 4 MHz resonator and a 4-pin header for programming.· The controller was powered by 3.3 volts provided by the Aiptek camera.· I used an Estes StormCaster rocket for this project.· The StormCaster is 1.6" in diameter and can be launched with the Estes C11, D12 or E9 motors.

    I have attached pictures showing the controller, the Aiptek camera, the rocket launching and one of the pictures it took.· The camera looks out the small 1/2" hole on the side of the rocket.

    Dave Hein
    530 x 790 - 121K
    1143 x 582 - 145K
    640 x 480 - 57K
    1248 x 960 - 162K
    1002 x 882 - 255K
  • steve_bsteve_b Posts: 1,563
    edited 2007-01-03 18:07
    Nice!

    Do you have more pictures?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ·

    Steve

    "Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
  • SSteveSSteve Posts: 808
    edited 2007-01-07 21:36
    steve_b said...
    Do you have more pictures?
    Go to the second link in his original post and look through the launch log.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    OS-X: because making Unix user-friendly was easier than debugging Windows

    links:
    My band's website
    Our album on the iTunes Music Store
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-01-08 16:22
    Here are some of my favorite pictures taken by the camera rockets.

    Dave
    1248 x 960 - 380K
    1248 x 960 - 162K
    1248 x 960 - 300K
    1248 x 960 - 180K
    1248 x 960 - 210K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-01-08 17:28
    Dave, very nice and inspirational!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • Paul RowntreePaul Rowntree Posts: 49
    edited 2007-02-11 18:58
    Hi Dave;
    This looks very nice. I am interested in using the SD-PenCam on a 4-6 hour balloon flight, but was worried about the time-out/shutdown. How do you put the camera to sleep, and wake it up ? Did AipTek document this, or did you hack it?

    Cheers!
    Paul Rowntree
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-02-13 16:16
    Paul,

    There is no way to turn off (or put to sleep) the mini PenCam manually. It turns off automatically after being idle for 60 seconds. The program in the SX keeps track of the state of the PenCam by timing how long it has been idle. It is important to know if it's in the sleep mode because the mode button must be held down for a second to wake it up before a picture can be taken. If the mode button is held down while it is awake the camera will go into the movie mode instead of the still image mode.

    The SD PenCam is nice because you can put a 128 MB SD card in it. It is also possible to manually turn off the SD PenCam. The manual says that the mode and shutter button must be held down for 2 seconds to turn it off. The SD is newer than the mini PenCam, so Aiptek may have improved a few things on it. The mini PenCam draws quite a bit of current when it is on, even when it is not taking a picture. This is why its important to let the camera turn off when its not taking pictures. The SD may not have the same problem as the mini, but I suspect it uses the same circuitry as the mini.

    With the SD PenCam, you could turn it on, take a picture, wait till is completely stored and then turn it off. This would give you the longest battery life.

    One thing about the mini PenCam is that it could take a picture about once every 6 seconds when I first got it. However, after taking lots of pictures, the time between pictures became longer -- somewhere around 10 seconds per picture. I programmed the SX to take a picture every 11 seconds to ensure that the PenCam is ready. Also, the mini PenCam would store fewer and fewer pictures over time. Initially, it would store about 90 pictures, but my current PenCam (I'm on my third one now) is down to about 50 pictures. My first PenCam got to the point where it could no longer write to internal flash memory. The SD PenCam may not have these problems with SD memory.

    Dave
  • HenrymouHenrymou Posts: 128
    edited 2007-02-21 08:11
    Omg so cool!
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-07-11 16:49
    I took a trip to the beach last week, and modified the program in the controller to take pictures from a kite instead of a rocket. Instead of using the G-switch I modified it to use the DIP-switch that was already on the controller. I also changed it to take an unlimited number of pictures instead of just 5.

    I didn't have time to reprogram the controller before I left for my trip, so had to do it once I got to my destination. I downloaded the SK-Key IDE software from the Parallax website onto my laptop, which had never been used for programming SX chips before. Everything worked great, and I was able to take a few nice pictures from the kite.

    I have attached the schematic for the controller and a couple of pictures I took from the kite. These pictures were de-skewed to compensate for distortion caused by the the Aiptek PenCam when it is moving.

    Thanks to the Parallax team for their great online support!

    Dave
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-07-11 16:52
    Here are the pictures.
    425 x 238 - 4K
    1384 x 1010 - 412K
    1410 x 960 - 545K
  • WhitWhit Posts: 4,191
    edited 2007-07-12 16:45
    Very neat project. Your website on the Mod X is super too! Love the pictures - great detail. I also like the de-skewed images from the kite. How do you do that?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-07-12 22:43
    The Aiptek PenCam introduces distortion in the image when the camera is moving. This is because it takes several milli-seconds for the camera to read the image out of the CMOS sensor (maybe as long as 30 msecs). As each line is read out, it has a slightly different veiw of the scene if the camera is moving.

    My initial attempt at de-skewing was to shift each line to the right or left by an increasing amount. As an example, I would shift the first line by 1 pixel, the second line by 2 pixels, the third line by 3 pixels, and so on. The actual amount of the shift was determined by measuring the angle of a vertical structure against the angle of the horizon in the picture.

    This method works fairly well if the camera is rotating along its main axis at a constant rate, which is what happens when the camera looks out the side of a rocket. In the case of the kite, I just hung the camera from a string. The wind would cause it to rock back-and-forth and spin around. This caused straight objects to appear curved.

    I found that I could correct for this motion by varying the amount that I de-skewed each line. The pictures contained many vertical lines, so I was able to measure the amount of skew at various places in the image. I did a least-squares fit to the measured data, and it produced the results shown in the pictures.

    A better reconstruction would require rotating the lines in addition to de-skewing them. However, that was more work than I wanted to do on them.

    Dave
  • WhitWhit Posts: 4,191
    edited 2007-07-13 03:18
    Wow! De-skewing the photos is an accomplishment in itself.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Whit+


    "We keep moving forward, opening new doors, and doing new things, because we're curious and curiosity keeps leading us down new paths." - Walt Disney
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2007-07-14 04:24
    As an ounce or two of prevention, have you considered a Picavet suspension for your camera? They look like they'd be a pain to set up, but they should hold your camera steady and keep it from twisting slowly in the wind.

    -Phil
  • Dave HeinDave Hein Posts: 6,347
    edited 2007-07-14 15:56
    Phil,

    Thanks for the information on the Picavet.· I have considered a Picavet, but I intentionally wanted the camera to turn in the wind·so I would get pictures from different directions.

    For these pictures I attached it to a short string that was only a few inches long.· In a previous attempt I used a string that was 2 or 3 feet long, and I did not get as much distortion.· A longer pendulum has a longer period, so the angle changes at a slower rate.· This is probably why the pictures with the shorter string were so distorted.

    There are some fairly complicated camera cradles that use a Picavet to provide a stable platform, and then use and actuator to rotate the camera to get different views.· However, at this point I'm just trying to keep it simple.

    Dave

    ·
Sign In or Register to comment.