CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD - page 30 - Creative Uses of CHDK - CHDK Forum

CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD

  • 704 Replies
  • 195141 Views
*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #290 on: 15 / December / 2012, 09:00:06 »
Advertisements
THE MECHA SIMULATOR 8 MIPS WALL

The 3.3V module solution has passed all the tests I could throw at it, so we could say there is a proof-of-concept in place.  However, because of the high demand on the microcontroller CPU, we are at the max.  The result is that additional code of any kind, upsets the phase timing for the ZOOM ENCODER DUMMY and requires adjusting & tuning the timing constants.  There is zero-tolerance, and that the 3.3V microcontroller would not allow others to replicate the solution easily.  I found that out by adding a simple LED for the movie and stow failed.  So before I do the filming, I feel the more robust and timing-tolerant solution would be to use the 5V version (16 MIPS - plenty) which is already here available.  It requires some minor level translation (a few resistors) and likely new timing constants and windows will need to be found.  The real miniaturization problem is the power supply.  The S90 AC adapter PS is ~4.5V.   According to the safe operating area graph, http://www.atmel.com/images/doc7766.pdf (p381) 4.5V sits right at the elbow where you have to start dropping the clock down from 16 MHz.  The hope is that because this graph is to +85C, there should be some "equivalent-overclock" headroom at RT (+35C max), and determining the minimum operating voltage will be easy to find on the bench.

*

Offline srsa_4c

  • ******
  • 4451
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #291 on: 15 / December / 2012, 09:58:15 »
Could you issue a version for the always-accessible test bed S90_100c?
Sure: https://subversion.assembla.com/svn/chdk-s1.bin/files/CHDK_s90_100c_disableisdriveerror_nodistcorr.zip (I left the IS error related code in, as it shouldn't have any effect on a camera with working IS).
You can use the following minimalistic Lua script to switch the live view distortion correction on/off.
Code: (lua) [Select]
--[[
@title liveview dist on/off s90
@param a = 0 off 1 on
@default a 0
--]]
poke(0x5338, a)
If it works, I'll include this setting in your 101a build (permanently).

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #292 on: 15 / December / 2012, 10:05:33 »
@srsa_4C
Quote
(I left the IS error related code in, as it shouldn't have any effect on a camera with working IS).
I agree -- "if it ain't broke don't fix it" // famous last words ... I'm not one to talk!

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #293 on: 17 / December / 2012, 01:53:49 »
S90 MECHA SIMULATOR MOVIE and  Arduino IDE CODE for the SparkFun Micro Pro 5V

This is the full-featured solution.  Figure 1 shows the bench setup for the movie. 
  > Lower left:  SticK Shutter Controller (with own 5V PS coming from the left)
       > left red LED:  shutter closed.
       > right green LED: shutter open.
  > Just above controller:  IS and SHUTTER
       > The SHUTTER solenoid is the shiny dot at 8 o'clock (near the ribbon cable).  You can see it move.
  > Upper left: IRIS.
  > Lower center red board:  the star of the movie, the MECHA SIMULATOR
       > Left red LED: power.  Power is connected to the 4.5V camera AC adapter cable.
       > Lower right yellow LED:  simulated FOCUS phototransistor signal.  You can see the infamous stow jiggle.
       > Upper right green LED: simulated ZOOM phototransistor signal.
       > There is no MCU LED for IRIS (similar to ZOOM anyway).
  > Central area: MECHA connector breakout (ZOOM PI, FOCUS PI, left // IRIS PI, ZOOM ENCODER PIs, right).  The connectors at 45deg are ZOOM ENCODER PIs, shown disconnected from the camera main board.
  > Top: S90 facing down towards the table surface.  No LCD, no SWITCH PANEL, no FLASH, and now no MECHA  :xmas
      > On the back of camera: sacrificial MECHA that has so nicely served its purpose, now there only because I have not cut off its main board connector yet // later.

MOVIE

Seconds
 0:   PLAY mode idle: SHUTTER is closed
 5:   ->REC (CHDKPTP): SHUTTER opens
 5+: MECHA unstows
 7:   Liveview ON   
15:  shoot+dcimdl command line from CHDKPTP (Tv=2s with dark subtract ON)
16:  Camera AF LED  turns ON for 1/2 s (faces table but you can see it), and takes the shot
19:  SHUTTER closes for 2s to acquire dark.
22:  SHUTTER opens
22+:  JPG is transferred to PC (*very* slow USB 1.0)
27:  ->PLAY
29:  SHUTTER closes
31:  MECHA stows (yellow LED blinks FOCUS jiggle)
34:   end.

44 MB
http://www.sendspace.com/file/prbvmz

EXTRA COMMENTS

The solution is so small it will fit into the battery compartment, leaving the CCD completely free to swing out over the main board (for thermal hardware) and face upwards (from the table in this photo), finally allowing us to remove the entire MECHA for the instrumentation.  That was the initial objective of this endeavor and I am quite confident to say today it has been 100% successful. 

Sparkfun's BLINKY was bench-tested running down to at least 3.4V at 16 MHz on the 5V MCU.  Therefore, this solution is portable and should run from both the 4.5V AC adapter power supply and 3.7V S90 battery (battery operation was not tested).

One very nice side-effect of this solution is that I found dummy-loading the stepper coils is not necessary and thus the removal of the FOCUS and IRIS reduces power by at least 1W in REC mode, in effect, giving REC mode nearly as much battery life as PLAY mode.

@srsa_4c
Next up ... looking at your latest solutions.

TECHNICAL INFO

Level translation is only needed on the output pins of the MCU module.  With a simple resistor-divider, the reduction ratio needed is 3:2 such that at a MAX operating voltage of 5V, the output pin will present 3.3V to the input of the main board.  Here I used series 1K facing the MCU, 2K to GND, and tap to main board.  On the MCU input pins a HIGH is 1.9V (at 5V), and since the main board (PI POWER drive) delivers 3.3V, no level translation is needed.

The solution is fully specified with MECHA pinouts here: http://chdk.setepontos.com/index.php?action=dlattach;topic=8801.0;attach=7357.  Orientation of the breakouts in Fig 1 is the same as the photo.

Code: [Select]
const int IRIS_pin       =  8; // [iris PI-1] right breakout top (YEL wire)
const int FOCUS_pin      =  9; // [FOCUS PI-2] left breakout (BLU wire)
const int ZOOM_pin       =  5; // [ZOOM PI-4] left breakout (WHT wire)
const int MOTION_POWER_pin   =  7;  // [iris PI-3] right breakout top (ORG wire) -- MOTION_POWER input pin  -- this pin is internally tied to INTERRUPT #4

const int ENCFR_pin       = 14;    // [ZOOM ENCODER PIs FRONT-R] right breakout botttom (YEL wire) -- Encoder front PI
const int ENCBK_pin       = 16;    // [ZOOM ENCODER PIs  BACK-R] right breakout botttom (BLU wire) -- Enooder back PI
const int ENC_POWER_pin  =  3;  // [ZOOM ENCODER PIs COMM] right breakout botttom (ORG wire) -- ENC_POWER input pin  -- this pin is internally tied to INTERRUPT #0
USAGE

It is important to wait a *full* 10 seconds after MCU PUP for it to reset before going ->REC, otherwise you'll get a LENS ERROR.  The GRN and YEL LEDs do a 1/2s flash to indicate ready to go ->REC.

edit:  Please refer to http://chdk.setepontos.com/index.php?topic=8801.msg94646#msg94646 for the latest version.
« Last Edit: 19 / December / 2012, 10:56:07 by SticK »

Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #294 on: 17 / December / 2012, 08:01:46 »
Good work.
I have archived the thread and movie.
It will take some time to download images and attachments.


Note the following in cpp file :-

orignal
orignial
conitnues
« Last Edit: 17 / December / 2012, 08:03:26 by Microfunguy »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #295 on: 17 / December / 2012, 09:18:43 »
@Microfunguy
Thanks for the archive // I am very honored // and ... for your always-meticulous review.  Please note that I have added more info in an edit to the post.  Now the solution is complete and repeatable.

Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #296 on: 17 / December / 2012, 09:44:03 »
Slightly irritating that PRINT thread does not expand CODE sections.

Only missing item is the firmware http://www.sendspace.com/file/x270u3
« Last Edit: 17 / December / 2012, 12:03:09 by Microfunguy »

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #297 on: 17 / December / 2012, 12:03:54 »
Slightly irritating that PRINT thread does not expand CODE sections.

Only missing item is the firmware http://www.sendspace.com/file/x270u3
The PRINT issue must be on the forum side I suppose.  The code snippet in the last post is also in the cpp file.  For your 2nd part the file is no longer on  the server, so if it was a previous cpp file, it's obsolete anyway.  The last post and the reference to the MECHA pinout diagram is all you need.  You can add this for the hardware:  https://www.sparkfun.com/products/11098?

Note that the cpp file was upgraded.


Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #298 on: 17 / December / 2012, 12:32:16 »
It was the file referenced here : http://chdk.setepontos.com/index.php?topic=8801.msg92770#msg92770

The code sections are not a problem, you posted 45 seconds after I changed my post.
I have already added the Sparkfun webpage.

*

Offline SticK

  • *****
  • 779
Re: CHDKPTP: S90 Primary Focal Plane Configuration - hacking out the CCD
« Reply #299 on: 17 / December / 2012, 12:38:17 »
It was the file referenced here : http://chdk.setepontos.com/index.php?topic=8801.msg92770#msg92770
Oh yeah ... that was the S90_101a ROM image I uploaded for srsa.  Both my 100c and 101a should be in your dispensary anyway because reyalp asked for them long time ago.

edit:
By the way, if you have the means with a movie editor, you can shorten the dead-air time in the movie in the file transfer section  (between 21s and 35s) down to 5sec simulating a USB 2.0 transfer and adjust the last few time markers accordingly.  I can then substitute the new link.
« Last Edit: 17 / December / 2012, 12:59:16 by SticK »

 

Related Topics


SimplePortal © 2008-2014, SimplePortal