C-mount Powershot Project - Hotwire! Hardware Mods, Accessories and Insights - CHDK Forum

C-mount Powershot Project

  • 10 Replies
  • 5153 Views
C-mount Powershot Project
« on: 28 / April / 2020, 15:14:04 »
Advertisements
Introduction:

Among DSLR enthusiasts, it seems to be generally known that it is better to spend your money on a good lens than spend it all on a great body. But how far can we really take this principle? Will nice glass actually help the image quality of a relatively cheap Powershot? Take a look at the samples below and decide for yourself!

Before:


After:


Purpose:

   To increase the image quality of a cheap and light Canon Powershot by mounting a C-mount lens.

C-mount lenses were used on film 16mm movie cameras originally, but are now used on robots and security cameras because of their small size. Most microscope and telescope camera mounts are also C-mount. Many micro 4/3 enthusiasts have used C-mount lenses with adapters due to their unbeatable price, simple manual controls, and interesting ‘look.’ Recently, a company called Backbone began modifying GoPros and other action cameras, utilizing C-mount traits to acquire a more cinematic look from these cameras’ exceptional sensor. In this experiment, however, we will be utilizing the mediocre sensor of the Canon Powershot ELPH 100 HS.

Procedure:

Note: as with most anything else, please read the whole writeup before trying this yourself – there are a couple of fragile parts that you’ll want to know about so you don’t break them in the process.

First, I selected a camera from Ebay and Craigslist’s available options. I didn’t want something too expensive, since I thought I might destroy it, but I also wanted something that would shoot video (preferably at 1080p), so after a while I came across this ELPH 100 HS.
 


 It was only about $10 since the lens was jammed. When it arrived, I cleared the jam and took the stock camera out for some test footage.

https://drive.google.com/open?id=1p05f7czQl5Ke6U-o3I1n2sfjw3PSvlDt

I ended up ordering a Fujian 35mm F1.7 lens after watching some reviews, but I think I may have gotten a knock-off or something – the images seem to have a blue distortion around all bright contrasts. Maybe that’s just how the lens is.
Before getting inside the camera, you should know that the ribbon cables are kind of fragile. Be really careful with how you pull on and fold them. I had to buy two replacement lens units and a new screen because I kept on breaking cables.
When it comes to the actual modification, there are three main challenges to overcome: getting the camera to accept the lens transplant, setting up the shutter assembly, and physically mounting the lens.

1. Getting the camera to accept the lens transplant.

   The problem is, the camera has sensors on all its major components, so when it starts up, it kind of ‘wiggles its limbs’ to make sure everything is ok. If one (or all...) of them are missing, the camera won’t boot up, showing an error.


 

There are two ways around this. The first is to disable these checks using the CHDK software. This works nicely for the Image Stabilizer error (which comes up, after a few seconds of use as error ‘E32’), all I had to do was send these commands after switching to/from record mode either by CHDK PTP or with a script (attached below):
   call_event_proc(“Mecha.Create”)
   call_event_proc(“StartImStEventProc”)
   call_event_proc(“DisableISDriveError”)
More information here: http://chdk.wikia.com/wiki/User:Srsa_4c/Working_with_a_broken_camera

Unfortunately, I was not able to figure out a way around the other errors with software. For this reason, I had to utilize the other method of making the camera happy – tricking the sensors. The idea is to leave as much of the moving part as is required to satisfy the sensor.

To satisfy the focus sensor, I broke off the arm that holds the focusing lens, but left the motor assembly to move about freely. Be careful since ribbon cable connecting the focus motor is not very strong!

 
The Zoom sensor is located on the main lens housing between the zoom motor and the backup battery. The tiny strip running to it is one of those fragile parts of the ribbon cable, so be mindful of what kind of stress you’re putting on it. It is satisfied by a tab located on the main zoom ring that moves through it as the zoom ring turns.


 
 
Every other part of the lens can be removed, but this main zoom ring must stay to satisfy the zoom sensor.
When you boot up the camera, the focus motor should move about pointlessly, and the focus ring should rotate a bit, but that shouldn’t affect anything. Just some useless shenanigans to keep the camera happy.
« Last Edit: 01 / May / 2020, 19:40:53 by Csavard »

Re: C-mount Powershot Project
« Reply #1 on: 28 / April / 2020, 15:14:34 »
2. Setting up the Shutter Module

This is the shutter/image stabilizer. It is required to take stills, but not video, so if you’re just shooting video, you might be able to delete it altogether.



From top to bottom: Main body, separator layer (that’s what you’ll be cutting a hole in), ND filter, back cover.


   
I think the lens on the image stabilizer affects focus, so the first thing to do is remove it by taking off the metal front cover and fishing out the lens unit. With some modifications, the assembly fit perfectly inside my macro tube mount as you can see in a later picture of the lens mount in place. I don’t think I even glued it. After some testing, I noticed some vignetting on the edges of the picture. The image circle of the lens is more than adequate for the tiny Powershot sensor, so the shutter must be blocking some of it. To correct this, I enlarged the hole with an exacto-knife. Unfortunately, the camera’s ND filter flap was smaller than the new hole, (as seen below) causing a visible edge in the photos, so I removed it as well.


« Last Edit: 28 / April / 2020, 15:23:29 by Csavard »

Re: C-mount Powershot Project
« Reply #2 on: 28 / April / 2020, 15:14:54 »
3. Mounting the Lens

This part can be done a number of different ways. I’ll show you what I did, but if you figure out a better way, go for it! And maybe post about it... :)

According to Wikipedia, C-mount lenses have a ‘Flange Focal Distance’ of 17.5mm. That’s the distance from the back of the lens to the film or sensor. If the lens is mounted too close, you will not be able to focus on near things, and the ‘infinity’ setting on the lens will overshoot infinity (if that’s possible... think about it) making it harder to nail the focus right at infinity. If the lens is mounted to far, you will not be able to focus to infinity, though you will be able to focus on closer things.

https://en.wikipedia.org/wiki/Flange_focal_distance

My lens came with a micro 4/3 adapter and two ‘macro tubes’ generally used for extending the lens to get really close-up shots. I used one of the macro tubes for my lens mount. It turns out a piece of 1 in PVC pipe (schedule 40, I think) fits wonderfully inside the zoom ring around the sensor. In fact, it kind of sits in a trough all the way around the sensor, seating it in the center. I cut this to approximate length and filed it down to get it just right.


 
Especially at the end, a little goes a long way. I overdid it and used paper and cardboard shims to get it level and at the right height. I drilled pilot holes and screwed the PVC to the base of the lens unit. Then I centered a macro tube on top, tacked it down with hot glue, and sealed it in place with epoxy.
 


As I began to use the camera, however, I noticed that I was still just a little bit off. Focusing to infinity requires backing off the focus ring a bit. That said, I would recommend testing the camera a lot before sealing it in permanently!

One other thing to note: The heads of the screws used to attach the PVC to the body stick into where the camera screen is supposed to go, so you may want to try to find screws with really flat heads, or even countersink the holes. I could barely get the case to close!

A few usage notes:

I mentioned earlier that you have to run a script to disable the IS error before using the camera. This is the script I used. I just keep it loaded and run it every time I boot up the camera. It also includes a zoom command, because I think the camera is digitally compensating for the original lens distortion when zoomed out.

--[[
@title NoLensInitialize
]]--

call_event_proc("Mecha.Create")
call_event_proc("StartImStEventProc")
call_event_proc("DisableISDriveError")
r=get_zoom_steps()
set_zoom(r)

As with any CHDK rig, remember to keep the camera in Program mode for the manual overrides to work. I also found this manual video exposure script to be helpful:

https://chdk.fandom.com/wiki/Manual_Exposure_Control_for_Video_Recording



Some problems:

1. The image is very 'zoomed in' like you're using a telephoto lens. This can be handy for macro photography, but mostly it just makes things hard.

2.  The rig overshoots infinity. As I mentioned earlier, I didn't get the lens mounted perfectly, so when I focus the lens to infinity, the image is a little soft and I have to back off a little.

3. The camera's low-res viewfinder makes it really hard to nail the focus.

4. I must have scratched something or gotten dust in it because there are a few specs in the image, but only when the aperture is small. The larger you open it, the more the specs disappear. 

5. The image is distorted, like the opposite of a fish-eye effect I think. Not sure why this is, but the viewfinder looks fine as long as you set the camera to max zoom. However, the images still come out distorted. Must be a digital correction for something the original lens did.

Thanks for reading and good luck on your build! Also, thanks to waterwingz for linking me to some great resources! Some more samples below.

The following pictures are straight out of the camera. Keep in mind, these are cherry picked examples - the vast majority that I take are out of focus. When you really nail it though, it can be quite sharp.

https://drive.google.com/open?id=1ac_gaK6H3M5lGnlIhhnN9ED6cnmeoxg1
« Last Edit: 01 / May / 2020, 19:31:03 by Csavard »

*

Offline Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: C-mount Powershot Project
« Reply #3 on: 29 / April / 2020, 11:05:19 »
I don´t have a screwdriver-licence... 8)
5. The image is distorted, like the opposite of a fish-eye effect I think. Not sure why this is, but the viewfinder looks fine as long as you set the camera to max zoom. However, the images still come out distorted. Must be a digital correction for something the original lens did.
could be one of those cams...
https://chdk.setepontos.com/index.php?topic=13875.msg141062#msg141062

...ah, Ixus115 probably not, so to do what?  :-[
I think, those action cams dont´t have real zoom & don´t need lens/ distortion correction for jpeg calculation.
How to switch that function off?     Edit: Maybe set_zoom() to r=35mm equivalent?
&& How look the raws?
« Last Edit: 29 / April / 2020, 14:50:26 by Caefix »
All lifetime is a loan from eternity.

*

Offline c_joerg

  • *****
  • 1251
Re: C-mount Powershot Project
« Reply #4 on: 29 / April / 2020, 12:21:55 »
Really interesting...
Thanks for  Sharing....
M100 100a, M3 121a, G9x II (1.00c), 2*G1x (101a,100e), S110 (103a), SX50 (100c), SX230 (101a), S45,
Flickr https://www.flickr.com/photos/136329431@N06/albums
YouTube https://www.youtube.com/channel/UCrTH0tHy9OYTVDzWIvXEMlw/videos?shelf_id=0&view=0&sort=dd

*

Offline srsa_4c

  • ******
  • 4451
Re: C-mount Powershot Project
« Reply #5 on: 29 / April / 2020, 16:37:48 »
5. The image is distorted, like the opposite of a fish-eye effect I think. Not sure why this is, but the viewfinder looks fine as long as you set the camera to max zoom. However, the images still come out distorted. Must be a digital correction for something the original lens did.
Yes, that's incorrectly applied distortion correction. As Caefix noticed, it's "one of those cams".
I checked in a fix, new CHDK 1.5 releases from autobuild will no longer distort JPEG images when zoomed in using set_zoom.

BTW, these huge images (linked from Google drive) do not ever get cached and are re-downloaded each time I visit/refresh this topic. Or at least that's what I see on my computer.

edit:
One more note, a custom CHDK build with
OPT_DISABLE_CAM_ERROR=1
gets rid of E32 errors without using those call_event_proc lines in the script.
« Last Edit: 29 / April / 2020, 16:56:21 by srsa_4c »

*

Offline Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: C-mount Powershot Project
« Reply #6 on: 30 / April / 2020, 12:32:26 »
 :D Tested, proofed & veryfied :
The Distortion is gone with origininal lens
&& my mother was pregnant with me.

Tried to compile, got ...
deleted, one of my 'privates' needs an updaet...
« Last Edit: 30 / April / 2020, 12:45:38 by Caefix »
All lifetime is a loan from eternity.

Re: C-mount Powershot Project
« Reply #7 on: 30 / April / 2020, 14:01:03 »
Ah, thanks for the resources, everyone! Obviously I'm not up to speed on this stuff... I'm a simple Mechie and all this computer engineering speak is just a little beyond me. I'll give it a try when I get a chance though!


BTW, these huge images (linked from Google drive) do not ever get cached and are re-downloaded each time I visit/refresh this topic. Or at least that's what I see on my computer.


Thanks for the head's up, srsa_4c, is there anything I can do to get them to cache? Decrease the size maybe? We got a huge internet upgrade a few years ago, but I remember the the days of waiting for oversized pictures to load - I wouldn't wish that on anyone! And I imagine it's a problem if people are paying by the Mb.

And thanks for the tip on the E32 error. It would be nice to not have to run that call_event_proc script every time the camera boots!

*

Offline Caefix

  • *****
  • 948
  • Sorry, busy deleting test shots...
Re: C-mount Powershot Project
« Reply #8 on: 30 / April / 2020, 14:34:45 »
 :) Summary for User:
  autobuild  :haha
Click & upgrade & enjoy...
« Last Edit: 30 / April / 2020, 15:30:53 by Caefix »
All lifetime is a loan from eternity.

*

Offline srsa_4c

  • ******
  • 4451
Re: C-mount Powershot Project
« Reply #9 on: 01 / May / 2020, 17:25:30 »
is there anything I can do to get them to cache? Decrease the size maybe?
Well, you could attach a few pictures to your posts (two are allowed per post, but you would need to reduce their size to fit in the 2MB/post limit) and share a gallery link for the rest. But that's just one way, you could also use a different image hoster, such as Flickr.

Quote
And thanks for the tip on the E32 error. It would be nice to not have to run that call_event_proc script every time the camera boots!
I have attached a special build with OPT_DISABLE_CAM_ERROR=1 . You can just unzip it to your card(s), overwriting the original CHDK install. You will still need to zoom in to get rid of the distortion correction.

I got the firmware version information from the exif data of one of your pictures here.

 

Related Topics


SimplePortal © 2008-2014, SimplePortal