Author Topic: Canon XL Spi bus lens protocol  (Read 8344 times)

0 Members and 1 Guest are viewing this topic.

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Canon XL Spi bus lens protocol
« on: April 17, 2014, 05:35:38 pm »
hey there :-) im working on controlling canon XL lenses.

Here a little background:
My Name is janosch im working full time as an engineer and in my free time as photographer and cinematographer.
Because there is no affordable slow motion raw camera on the market i decided to build my own :-) the MiniRAW
Its based on a small industrial point grey flea 3 usb3 camera which can shoot up to 120fps at 12 bit and 720p.
One downsize is that the sensor is only 1/3" and it has a 7x crop compared to 35mm. Now the Canon XL comes in play :D it also has a 1/3" sensor and some fine optics! for example an 3-10mm which would be in 35mm world 21-70mm nice? :D

Problem: The canon xl lenses work only with a canon xl1s attached cause there is no mechanical iris focus and zoom...

Solution: try to emulate the camera with an arduino :
= works :D

i hijacked the spi bus with an saleae logic analyser and sent the data with an arduino back which works BUT now the tricky part:

i know which byte is the iris and the zoom the focus not quiet sure. at the moment i sent pre recorded packets ( which contain 40 bytes each)
and as you can see in the video it opens the iris and then the zoom and focus ring work..BUT because i sent always the same packets the lens is confused if it should listen to the arduino or to the lens input.

any ideas how can program this? my goal is to mount the lens in front of my MiniRAW1 and control focus zoom and iris.

hope thats understandable

cheers and thx
janosch


 
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: Canon XL Spi bus lens protocol
« Reply #1 on: April 17, 2014, 09:31:01 pm »
...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Re: Canon XL Spi bus lens protocol
« Reply #2 on: April 18, 2014, 08:06:27 am »
nice find mechatrommer :-)

but i still have noe idea how i can code this inside an arduino program :-/

cheers janosch
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: Canon XL Spi bus lens protocol
« Reply #3 on: April 18, 2014, 08:42:10 am »
but i still have noe idea how i can code this inside an arduino program :-/
you are on your own. i never heard or google anyone try to hack XL lens and probing spi comm. the xl1s service manual doesnt show detail implementation of it. good luck.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Canon XL Spi bus lens protocol
« Reply #4 on: April 18, 2014, 11:21:03 am »
Try making many SPI dumps changing one parameter at a time from camera's controls and writing down the values, then compare the packets to see which bytes are affected by which parameter and how do they match the values you see on camera body. Don't get messed by changing many things together or dumping many changes continuously, do it step by step: dump the camera power on (there can be some init), save it, note the values camrea shows, start clean acquisition, change i.e. F param one step +-, save the dump, attach a note "changed F from X to Y", etc
 

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Re: Canon XL Spi bus lens protocol
« Reply #5 on: April 18, 2014, 12:04:38 pm »
Try making many SPI dumps changing one parameter at a time from camera's controls and writing down the values, then compare the packets to see which bytes are affected by which parameter and how do they match the values you see on camera body. Don't get messed by changing many things together or dumping many changes continuously, do it step by step: dump the camera power on (there can be some init), save it, note the values camrea shows, start clean acquisition, change i.e. F param one step +-, save the dump, attach a note "changed F from X to Y", etc

yeah thats what i did :-) and its working BUT my problem is that when i sent the same packets back ie the one for changing the aperture i want to sent only byte 20 which is the iris but the lens expects the other 39 bytes so when i sent the same bytes over and over the lens is confused when i try to change the focus on the lens. is that clear? :D
 :scared:
 

Offline amyk

  • Super Contributor
  • ***
  • Posts: 8269
Re: Canon XL Spi bus lens protocol
« Reply #6 on: April 18, 2014, 01:19:12 pm »
What circuitry is inside the lens? It might help to find out what IC you're talking to, if by chance it happens to be a common one and not proprietary...
 

Offline Rerouter

  • Super Contributor
  • ***
  • Posts: 4694
  • Country: au
  • Question Everything... Except This Statement
Re: Canon XL Spi bus lens protocol
« Reply #7 on: April 18, 2014, 02:13:35 pm »
the other approach as you have the camera would be to log it while performing each action (in manual mode so you are changing as few things at a time)
 

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Re: Canon XL Spi bus lens protocol
« Reply #8 on: April 18, 2014, 02:24:16 pm »
What circuitry is inside the lens? It might help to find out what IC you're talking to, if by chance it happens to be a common one and not proprietary...

will try to find that out

@rerouter
thats what i did :-) and what i sent with the arduino back but as i said this works but i want also to adjust the focus by hand
in manual mode i change ie the aperture and loged this with the saleae so now i know exactly what each aperture value is the only problem is how can i sent just this value without change the others :-)

 thx alot guys for the tips and the fast help love this place and the eevblog youtube stuff  :-+
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11630
  • Country: my
  • reassessing directives...
Re: Canon XL Spi bus lens protocol
« Reply #9 on: April 18, 2014, 03:10:08 pm »
What circuitry is inside the lens? It might help to find out what IC you're talking to, if by chance it happens to be a common one and not proprietary...
having serviced few canon lenses, and from understanding who they are, i suspect it will be "canon" brand chip aka proprietary, even if its common like say AVR, its just SPI IO, the hardest part is dechypering the proprietary comm protocol encoded in it. anyway, you may be luck finding the service manual from the net. i got xl1s body SM from http://www.servicemanual.ws/search.asp?query=canon+xl&search=Search 10 cents per pdf is like free, most of scattered SM in the net are all gathered in this one site, easy. good luck.
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Re: Canon XL Spi bus lens protocol
« Reply #10 on: April 18, 2014, 04:40:29 pm »
yeah the service manual for the camera i found also :-) but for the lens no luck hard stuff but exciting :D

 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Canon XL Spi bus lens protocol
« Reply #11 on: April 18, 2014, 07:11:27 pm »
So the problem is that SPI data you send contains focus value, but you are changing the focus manually and it doesn't match SPI data? But how does original camera body handle this? Maybe lens sends some "focus has changed to X" message back to the body, so the body uses that X in the next packets? Try dumping this situation too - adjust something like aperture, adjust focus manually, adjust aperture again, look for changes other than aperture in data packet and for some lens->camera data.
 

Offline jsfotografieTopic starter

  • Newbie
  • Posts: 8
Re: Canon XL Spi bus lens protocol
« Reply #12 on: April 18, 2014, 08:15:19 pm »
So the problem is that SPI data you send contains focus value, but you are changing the focus manually and it doesn't match SPI data? But how does original camera body handle this? Maybe lens sends some "focus has changed to X" message back to the body, so the body uses that X in the next packets? Try dumping this situation too - adjust something like aperture, adjust focus manually, adjust aperture again, look for changes other than aperture in data packet and for some lens->camera data.

good point as i just want to use the lens without the canon xl1s perhabs i can sent something on the miso bus when i change focus by hand? damn why are they making it so complex and hard to hack :D BUT on the other hand i gain so much mor respect for camera manufactors!
 

Offline abyrvalg

  • Frequent Contributor
  • **
  • Posts: 824
  • Country: es
Re: Canon XL Spi bus lens protocol
« Reply #13 on: April 19, 2014, 12:01:23 am »
Btw, have you seen Canon EF protocol description? http://pickandplace.wordpress.com/2011/10/05/canon-ef-s-protocol-and-electronic-follow-focus/
There are short commands, but perhaps your big 40byte packes are just many of those short commands combined together? Try matching bytes preceding known parameters in your dumps with command bytes for the same parameters from EF protocol.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf