Repackaged R/C + Arduino KAP Controller



  • Laurent Dupire and Peter Laudanski both reported a problem compiling the Arduino code. There was one line that said "#ifdef 0" where it should have said "#if 0". I've corrected that now and updated the Git repository.

    So in case any of you have tried to use this and ran immediately into this problem, you might want to try again as it is fixed now.

  • edited October 2015
    I'm now close to being able to use my TX for KAP - I've almost finished building the EOS M rig to go with it (my first rig without a continuous rotation pan servo). As you can see below, it's clearly based on Cris Benton's EOS M rig - though as yet there's no HoVer capability. It will also take my S100 camera without any modification.

    Almost all the parts are made from laser-cut ply or plastic (thanks to the local FabLab which lets me use their laser-cutter for nothing!).


  • This is amazing. For those of you who have built this, what is the price range for all the necessary parts?
  • Here's a photo of my boxed KAP rig for my EOS M (not yet flown).

    Costs of the TX (using the same components Dave Wheeler lists in his documentation):
    Adafruit LCD - £38 (the most expensive component)
    Wombat prototyping board - £11
    Arduino Pro Micro - £6.25
    Joystick £1.80
    4xAAA battery box - £1.50
    Total just about £60 (the 2.4GHz radio component came from my junked reboxed Turborix transmitter that I retired 2 years ago).

    The rig was very cheap - I already had the carbon fibre tubing, servos and scrap aluminium - the total cost of the ply (1.5mm and 3mm A4 sheets) was less than £5.

    boxed rig, TX and Canon EOS M

    The sharp-eyed will notice that I've (a) replaced the plastic 3D-printed bezel with one made from laser-cut ply (the plastic bezel didn't quite fit) and (b) added a ring for a neck strap (on the right side of the case - the battery box and arduino prevent it being on the bottom).
  • edited October 2015

    Here's another replica of the RC-controller developed by David.
    Thank you very much, David for your work on the development and the excellent documentation, for finding the matching parts und writing the program.

  • This morning Peter emailed me asking about how to tune some of the timing in the controller. It was cycling too fast for his rig and camera so some shots were skipped. Here's my response describing how to adjust the timing in case any others experience the same problem:

    To change the time between shots, you should not place any delay() statements in the code. There are already delays built in and you just need to adjust their values.

    To start, find in the middle of the file, this piece of code:
    #define TICKS_PER_SECOND (50)
    #define SECONDS(n) (n * TICKS_PER_SECOND)
    #define TIME_STABILIZING (10)
    #define TIME_SHUTTER_DOWN (5)
    #define TIME_SHUTTER_POST (35)
    #define TIME_JS_INITIAL (25)
    #define TIME_JS_REPEAT (3)

    These are delay times for various states, in units of 50ths of a second. I suggest changing TIME_SHUTTER_POST to a larger value until your camera doesn't miss any shots. Currently, at 35, the rig waits 35/50 or 0.70 seconds after each shot. If you set it to 100, for example, this time is increased to 2 seconds. Feel free to tune it however you like.

    The whole shooting process for one picture works like this:
    * The controller positions the servos, stops and waits a brief time (TIME_STABILIZING) until the camera is stable.
    * Then it "presses the shutter" and holds it long enough for the camera and/or GentLED device to react (TIME_SHUTTER_DOWN).
    * Next it releases the shutter and gives the camera a moment to focus, shoot and store the image (TIME_SHUTTER_POST).
    * After that it waits for the servos to aim at the next point and the process repeats.

    So the whole cycle takes TIME_STABILIZING + TIME_SHUTTER_DOWN + TIME_SHUTTER_POST + time spent moving to aim point.

    I was quite aggressive about minimizing these values for my rig and camera. In fact, if my EOS M has auto-focus enabled it can take too long and I miss shots, too. So it's no surprise you will need to adjust these.

  • Dave, out of curiosity, how are you triggering your eos M? IR or microphone jack/magic lantern? And what is your manual focus solution - hyperfocal -- 5m, 8m, infinity?

  • This Dave is using an IR Gentled. I have not installed Magic Lantern. Currently it still hasn't flown so I've not experimented with focus.

    The weather here has been pretty bad - we're in the midst of our 4th named storm ("Desmond"), in 3 weeks - a new thing here, we've never named storms before, gale force winds and torrential rains. No end in sight either.
  • I also use an IR GentLED and stock software on the EOS M.

    I set the focus at infinity using this method: First I set focus mode to auto, then aim at something in the distance and take a shot manually. Then I switch back to manual focus mode so the focus doesn't change. Unfortunately, this procedure also requires changing the camera from single shot mode to take the one picture, then back to timer/remote triggered afterward. And it's easy to forget all the necessary steps. (This has tripped me up on more than one occasion.)

    It might be worth mentioning at this point that the Arduino controller treats the shutter as just another channel to the R/C receiver. That channel is connected to a GentLED IR device on my rig but it could just as easily be a servo or some other flavor of GentLED. In those cases, one might need to adjust the timing or the throw of the shutter servo output by changing other values in the code.
  • edited December 2015
    Thanks both! My old EOS M seems to have significant problems with delayed or missed auto-focus in low light (the latest experiment was in a snow storm but it's had problems on run-of-the mill cloudy days). And I noticed drone folks having similar problems -- purportedly because of vibration or movement during autofocus. I've been experimenting with setting focus manually with the ring, but I think I like DW's solution better. If I think ahead it might work with some closer-in pole photography subjects.

    Beautiful and useful foundational work you two have been doing.
  • I've posted some changes to the software for this project on the Github site. No new features at this point, though. The changes were to reorganize the code into separate modules. This should make it easier to document and modify things in the near future.

  • edited January 2016
    I have started to build this controller using a custom made laser enclosure.
  • Dave - I get a page not found message when I click on that link.
  • I am trying to wire the device directly with wires, instead of a circuit board.
  • edited January 2016
    I previously asked for help here with compiling.

    When compiling, I received some errors and posted them here.

    As per David Wheelers instructions below, I made sure to use the current files from Github.

    Now after compiling, Arduino indicates DONE COMPILING with the following message

    Sketch uses 21,032 bytes (65%) of program storage space. Maximum is 32,256 bytes.
    Global variables use 1,722 bytes (84%) of dynamic memory, leaving 326 bytes for local variables. Maximum is 2,048 bytes.
    Low memory available, stability problems may occur.

    So I believe I am good to go.

    Thank Dave.

  • Hey Dave, I just saw this and am starting to investigate a bit. Since all of these errors are from the Adafruit_SharpMem library, my first guess is that it isn't located in the right place or the project isn't configured to use it properly. I'll follow up when I learn a little more.

  • Let's focus first on that last error about 'swap' not being declared. Since 'swap' is defined as a #define macro in Adafruit_GFX.h, I suspect that library didn't get added properly. Can you try repeating the step to add the GFX library using Sketch/Include Library/Add .ZIP library?

    [The warnings don't bother me much, although it's odd that I don't see the same problem you're having. I bet they'll go away if we can fix the other error.]

    If that doesn't help, I have a few questions. Are you using the latest kaptx code I put on Github around the 16th? And do you have a folder C:\Users\dave\My Documents\Arduino\libraries\Adafruit-GFX that contains the file Adafruit_GFX.h? [Note, the subtle inconsistency where they use dash in the folder name and underscore in the file name.] As I recall, when you unzip the Adafruit zip files from Github, you get an extra level of folders with a name like "something-master". Those need to be renamed/moved to match the path I described above.

    And, just FYI, I'm using Arduino version 1.6.1 on Windows at the moment. And I see that the most recent version available is 1.7.8. I'll probably upgrade to that soon but I'll wait until after we work through your compile error.

  • Any sign of a test flight yet, Dave M?!
  • I'm still waiting for the weather. It has rained at some point here every day since late October! Currently we've got very strong winds too.
  • I've only KAPed twice since 31 October! I totally understand the weather issues (we're only 80 or so miles apart).

    Got any video of it in operation at home?
  • At last! Today I managed a brief test of the new rig and EOS M.

    See here.
  • Congratulations, Dave. Yay!
  • Good to hear that things are working.
  • edited February 2016
    Here’s an update of my progress since David Wheeler published his paper ‘An Arduino Based R/C KAP Rig’. Firstly though, I would like to thank David for his excellent work on the development and documentation of the Arduino microcontroller for Kite Aerial Photography.

    I have built two KAP controllers which take advantage of the miniaturization afforded by the ability to drive the HKT6A transmitter directly from Arduino units.

    The first is a small controller which fits in the palm of the hand like David’s, although I use a BCD thumbwheel and a 3 position switch rather than a joystick. The BCD thumbwheel has 16 positions each corresponding to 22.5 degrees of pan rotation. The 3 position switch allows for elevations of 90, 45, and 0 degrees.

    imageHandheld KAP Controller" />

    These two controls and the shutter button are all within easy reach of the operator’s thumb. The difference between this design and David’s is in the visual indication of pointing position and the rather coarse control of my unit compared to the more precise positioning of the original design. On the upper surface you will see an on/off switch and an indicator light, as well as a switch for auto KAP.

    imageInside the Handheld KAP Controller" />

    Inside the unit there are just a few components. On the left sits the battery (2S 300 mAh lipo) and the 2.4 gHz transmitter unit from the Hobby King T6A. On the right are the control switches and the Arduino ProMicro.

    Note. This T6A transmitter unit has an internal regulator and can operate from the 2S battery. Other T6A transmitter units use the 5 volt regulator on the T6A main board and would not be suitable for the 7.4v supply. The Arduino ProMicro contains a 5v regulator and can therefore operate from higher voltages through the raw input.

    The second controller is considerably more versatile and much bigger. It is a belt mounted unit which I use on most KAP outings where the live video is a big advantage.

    David’s work in determining the code used to drive the HK T6A has freed up the large amount of space occupied by the cut down control board used in previous versions. In this unit there are relatively few parts since the Arduino Nano does most of the ‘work’.
    This controller is used with my three servo rigs as well as my two gimbal rigs. The secret to this versatility is in the ‘Mode’ switch which uses a 16 position BCD thumbwheel switch to select the correct code for each rig and operating mode. All switches and potentiometers are connected directly to the Arduino board so that any changes to the operation between KAP outings can be programmed in via the usb connector.

    imageSkysnaps99 Arduino KAP Rig" />

    imageInside the Skysnaps99 KAP Controller" />

    From the photo you can see the layout where most of the wiring connects the switches (right), potentiometers (top) and joystick (middle) to the Arduino Nano. The BCD thumbwheel switch is in the upper right while the transmitter module and Arduino unit are lower down. Additional pushbuttons are located below the potentiometers for focus (A6000 servo rig) and zoom (S110 gimbal rig). The left side is occupied by the video receiver (upper), battery (lower) and under voltage sensor (middle). The 4 inch video display is mounted on the unit’s upper surface.

    Note. The transmitter module used in this controller requires a 5v regulator which can be seen on the right of the unit on an adjacent board.

    Once again I would like to thank David for showing us how to utilize Arduino micro controllers for Kite Aerial Photography.

  • Thanks again for all that detail Al. Very clever stuff.

    It's a shame you're not planning to come to KAPiCa 2016 - I'm sure the participants (Dave Wheeler and I in particular) would love to have a closer look at your rigs and controllers.
  • I'd be looking to steal Al's rigs! They are awesome.
  • I'd love to be attending KAPiCA Dave but I'm afraid I can't make it this time and given Kevin's predilection to pilfering (!) I'm not sure it would be a good idea anyway!

    Thanks for you comments gents, frankly I never thought I would enjoy C++ programming but after a lifetime of analogue electronics I have to admit that a good micro controller and flexible software make a fabulous combination which trump the analogue solutions every time.


  • Beautiful work, Al!

    When I wrote up my Arduino project last year, I had fairly low expectations that anyone would actually find it useful. So it's been very gratifying to see so many of you starting projects of your own. And now to see how far Al has taken it is really incredible.

    I suspect there's nothing more than a couple functions of my code left in that beast. Still, I'm glad I could turn you on to the love of a good microcontroller, Al.

  • I have all the bits to do my spin on David's design but I haven't put them all together yet. My plans are a lot less ambitious than Al's, but wouldn't even remotely be possible using the original T6A boards. (Everything has to fit in a Wii nunchuk.) Without your paper, David, I never would've even started.

    This thread really hammers home one of my favorite things about KAP: We're all innovators. We have to be. You can't flip through a B&H catalog and find gear designed for KAP. Cameras? Yes. Controllers and rigs? Not so much. So we design and build and test and re-design and re-build and re-test and do some phenomenal photography as we go. And we share not just the photos, but the ideas that led to our being able to make them. It's a love of the act as much as it is a love of the results. The more hobbies I take on and explore, the more I find what a rare combination this is.

  • Tom,

    If you haven't dissected the T6A unit yet, just let me remind you: don't cut or desolder the cable from the RF module to the antenna. It's a micro coax cable, not just a wire, and would be difficult to repair.

    Instead, you'll want to cut the plastic collar formed by the case to free the module.

    I shot some video of this procedure last weekend to show everyone exactly what I mean. That should be edited and posted somewhere in the next week or so.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion