Lens serial communication

Wifi, USB, GPS, Grips, Mics, Ext Power, Lens, Flash

Re: Lens serial communication

Postby meyerti » Wed May 20, 2015 8:31 am

Hi,
great thread you have created here, thanks very much for all the information!
For tissue culture experiments we have bought a high-speed camera with F-Mount and 90mm MF-Macro Lense and mounted them in a sterile hood. Unfortunately focussing is extremely cumbersome, because of camera position. Therefor I seriously think about buying a AF Lense, however since the camera is non-Nikon I need to find a way to control the focus externally. No AF needed, just access to the lens' step motor. Here my questions:
1) would the 5V one can draw from a USB Port suffice to aliment the lens?
2) my preferred toy is matlab (though 'm not an expert), has anyone experimented with lense-control through matlab?
3) Before i start building my own, does anyone have a source for a F-Mount (Female) Adaptor with pins in place?

Thanks for any ideas, links, etc.

Best t
meyerti
 
Posts: 3
Joined: Wed May 20, 2015 8:19 am
Been thanked: 0 time

Re: Lens serial communication

Postby meyerti » Thu May 21, 2015 2:50 am

Ok, i started reading more:)
Obviously direct connection to USB does not work, but using a D/A Converter, like this one "Velleman VM167" should do to communicate with the lense or not? Those a directly hooked e.g. Matlab, so one only needs to figure out what signals to send...

Best

Tim
meyerti
 
Posts: 3
Joined: Wed May 20, 2015 8:19 am
Been thanked: 0 time

Re: Lens serial communication

Postby meyerti » Thu May 21, 2015 11:14 pm

now I got it, i need a USB-to-SPI Adapter, like this one "MikroElektronika MIKROE-1204" to get started. Can anyone point me to some minimal code i need to move the AF motor via USB? I see years of experience in this forum, what's the fastest entry point?

cheers Tim
meyerti
 
Posts: 3
Joined: Wed May 20, 2015 8:19 am
Been thanked: 0 time

Re: Lens serial communication

Postby lain » Thu May 21, 2015 11:34 pm

My Arduino library and the rest of this thread should be everything you need to start talking to the lens: https://github.com/lainy/NikonLens
Protocol details and a few known commands: wiki/Lens_Serial_Interface

We probably "know" a lot more commands now, but I haven't had time to go back over things. In particular, there's a lot of miscellaneous information about commands in this thread that hasn't been assembled into a more useful format.

Good luck!
User avatar
lain
Developer
 
Posts: 189
Joined: Fri Mar 29, 2013 3:42 pm
Been thanked: 111 times

Re: Lens serial communication

Postby astronomer » Thu Oct 01, 2015 1:05 pm

Attachments
Lens_serial_schematics.png
Lens_serial_schematics.png (217.25 KiB) Viewed 7349 times
User avatar
astronomer
Developer
 
Posts: 722
Joined: Fri Apr 06, 2012 10:06 am
Location: US
Been thanked: 293 times

Re: Lens serial communication

Postby arthurking83 » Sat Oct 03, 2015 6:30 pm

arthurking83
 
Posts: 27
Joined: Tue Aug 13, 2013 3:23 am
Been thanked: 8 times

Re: Lens serial communication

Postby GoneJohnson » Sun Jul 09, 2017 5:22 pm

I just wanted to say thanks to all of the people that contributed their time and knowledge to this thread. It has made it a lot easier for me to work with Nikon's interface.

I made myself a plastic ring that threads into the lens I'm using.
Image

The wiring through the ring.
Image

Finished off with hot glue.
Image

The spring loaded pins. They aren't perfect, but they all seem to work.
Image

Wiring it to an actual Lens so that I can watch the data.
Image

Tonight I got an Arduino to Parrot back what the other Lens sends the Camera.
Image
Currently the Arduino MISO line isn't hooked to anything, but the logic analyzer.
The Arduino sends 0xFF anywhere that I'm planning on receiving, so that I'll be able to transfer to full duplex later.

It correctly parrots back the last two bytes of the 0x40 command.
Image

I have some noise issues caused by a fan in the room, but the 0x28 command response is mostly correct.
Image

Thanks
User avatar
GoneJohnson
 
Posts: 2
Joined: Wed Jun 21, 2017 3:13 pm
Been thanked: 1 time

Re: Lens serial communication

Postby GoneJohnson » Wed Jul 12, 2017 11:41 am

I'm thinking about renting a lens with an electromagnetic diaphragm mechanism. So that I can figure out how the camera controls the aperture.

This is the cheapest type E lens to rent. https://www.lensrentals.com/rent/nikon- ... af-s-dx-vr

The PC-E lens aren't that much more expensive though if it might have some unique commands. https://www.lensrentals.com/rent/nikon-24mm-f3.5d-pc-e

Would renting and logging the commands on an AF-P type E be to the advantage of anyone else?
This lens hasn't been released yet, but I'm in no big hurry. http://www.nikonusa.com/en/nikon-produc ... ed-vr.html
User avatar
GoneJohnson
 
Posts: 2
Joined: Wed Jun 21, 2017 3:13 pm
Been thanked: 1 time

Previous

Return to External Hacks

Who is online

Users browsing this forum: No registered users and 5 guests