Camera Control and OSD for UAV Projects

Hello guys!
Here goes a video showing the Camera Control working:

I'm using Canon SDK definitions (PS-ReCSDK 1.1.0e) and PTP protocol though Arduino USB Host Shield.
Thank you Oleg Mazurov, for helping me to understand the PTP dump through your awesome shield and pointing me the way to go. ;)

The project includes integration with RC/APM and OSD (for telemetry and Camera feedback by using Max7456).

By now we have simple serial commands to:

  • Capture mode control (lenses show/hide);
  • Continuous session - only limited from battery (without shutdown by time or so);
  • Focus Lock/Unlock;
  • Focus mode (center point, average);
  • Zooming control;
  • Shooting;
  • ViewFinder output through the ntsc video output <--- I was fighting with it... but now it's 100% OK (Next step:

  • Total abortion (close session on camera hardware and shutdown).

Sandro Benigno.
E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones


  • Developer

    Hey, Gisela

    Hahaha... That was really tricky, eh!? Well, the good part is that you found the correction. Congratulations!

    Please, let me know if you find some other tricky thing like that. I will add this to the code to help other people to not face the same problem on their G7 cams. Thank you for share the solution. ;)


  • Hi Sandro

    After a painful exercise of using a USB Monitor on some commercial software, I worked out how to make it work. Seems like a quirk in the camera code - but you need to do a GetDeviceProperties of the Shutter Speed and Aperture (when in Tv / Av modes respectively) and only thereafter will it let you set these properties. Why I cannot say!


  • Developer

    Well... the project may be faced as a Camera Control solution with OSD as a plus or... an OSD solution with Camera Control as a plus.

    Maybe the post tells just OSD because most part of people is more interested on the OSD part. In fact I have other ideas too. Maybe making some additional firmwares. Let's say you don't want to use the usb port to camera control. So, with the same hardware, you can use USB port to another job, like hosting a thumb-drive to easy log and so on. (of course the log thing needs to tested, to see if the 328 chip would hold the file system work without mess up the OSD job).

  • Developer
    Hey... what is the secret? All I'm talking here is already announced by Chris:
  • Developer

    No way, Johann. This is what I tried to say with that post with this scenary:

    APM and most of Arduinos -> USB = serial port
    Newest Arduinos -> USB = real USB peripheral (could act as mouse, keyboard, joystick, storage, etc)
    Camera Control -> USB = host = USB bus(it act like an USB port on your PC).


    The bold text above reflects the state of newest 8 bits APM you're talking about. It will work without the FTDI chip, but still act as a peripheral, not as host.

    I'm pretty sure that it will be possible by using ArduPilot 32bits (ARM based). But isn't that easy. A lot of things that you have already done --in a hardware based implementation, like MAX3421-- probably it will need to be hand coded from scratch. It sounds similar to a software emulation approach. Maybe not so hard, if there is internal registers dedicated to USB hosting inside the ARM chip or even an already done library or something like it.

    But, calm down... as I said, the schematic is done. In fact, it's in best hands as possible, at this moment.

    We'll have fresh news soon, not so fast, due the next step will take some time, but is in the way. :P

  • Developer

    Nice post, but it's totally different. It's not a camera control and it's not even using USB to do it. The post is about servo controlling to just move the camera to track a subject on ground.

    The tracking point isn't even by camera processing. He fixed a coordinate on the parked cars (probably the take-off location) and so when the aircraft is flying, the APM controls the servos which moves a 2 axis camera mount by a triangulation between the last position, current position and the fixed point (the target point). So, the camera is looking always to the target. ;)

  • Developer

    Hey, Johann! No way to do this, man. The USB on APM is a serial port driven by FTDI chip. Camera control is a USB host. It's like a PC USB port. The MAX3421 recognize the hardware attached to its bus and so, deal with it. It's a relatively complex host centric transaction, with enumerators and different drive to each peripherals. This is why you need a dedicated part to the job.

    The entire scenery is:
    APM and most of Arduinos -> USB = serial port
    Newest Arduinos -> USB = real USB peripheral (could act as mouse, keyboard, joystick, storage, etc)
    Camera Control -> USB = host = USB bus(it act like an USB port on your PC).



  • Developer
    Hey, Gisela. I tried but I just can't reproduce the G7 behavior.

    A friend of mine will lend me his G7 camera to test it. ;)

    The bigger part of my free time is dedicated to ArduCopter documentation. In mean time, I used all the little gap to get working on the OSD library and work around and finish the schematic. In next weeks I will try to dedicate more time to the ArduCam project.

  • Hi Sandro
    Unfortunately I am not running Linuz so cannot use GPhoto. Pity. Would really appreciate it if you could try it your side.
  • Developer
    Hello Gisela,

    That was exactly the idea. So, no way.
    I will try to reproduce it here this weekend.

    Just a trick: If you have a Linux on your lab, you can try to set the Aperture or Speed and observe the transaction through GPhoto by debug mode.

This reply was deleted.