Repackaged R/C + Arduino KAP Controller

245678

Comments

  • Looking forward to seeing this in action.....I am still up for a Baltimore KAP session some time in Feb or March.

    WW
  • This looks great Dave!
    Fantastic that you’ve unravelled the secret of the Hobbyking Tx module’s input frame (Appendix A) – this should help miniaturisation immensely.
    My latest repackaged Hobbyking T6A has been in use for about 18 months now. It has an integrated video Rx and display and uses Arduino for Auto Panning.
    With your Arduino to Tx module circuit and Sketch I should be able to reduce the size further. Looking forward to the next update.
    Many thanks for sharing,
    Al
  • Hey Al-
    Good things in small packages. How 'bout a look at your current version. I have a Hobby King on the bench,
    half dissected. With these new ideas on the horizon I need to re-direct. Thanks for any info.
    Paul
  • Hi Paul,
    I don't want to hijack Dave's thread so I've used this one to describe my gear: arch.ced.berkeley.edu/kap/discuss/index.php?p=/discussion/2021/re-casing-the-transmitter
    Al
  • edited February 2015
    Hey everyone. Here's a little update for your Sunday evening entertainment:

    The software and hardware are now complete with the LCD incorporated, multi-shot shooting modes and autokap. (I don't have a new demo video yet, though. Soon!)

    The documentation has been updated to complete the unfinished sections, delete the LED ring and add the LCD display:

    All the source code for the controller is now on github. You can find it at https://github.com/howtokap/kap-tx1. (The design document is also in that repository for convenience.)

    The source repository includes a second Arduino sketch called ppm_gen. This was my test sketch where I developed the PPM generation code. If you have a project of your own and are looking for this functionality, try using this small sketch instead of picking through the much larger controller sketch.
  • I look forward to studying this at length, but would suggest that you put your name somewhere in the documentation pdf. Like at the top of page 1. Unless it's a state secret.
  • Oops. No state secrets here. Just a rushed job and forgetting the basic stuff. I'll put my name and email on it for the next edition.

    Also thanks for your feedback in the private message. I'll try to address those issues, too.

    While I was putting the code into github, I discovered they have a very nice project Wiki feature on that site. So I'm thinking of putting all the material from the document into the Wiki. That would make this project much more internet-friendly (read Google searchable). It would also allow me to describe some of the peripheral work that may be of interest, like the testbed for PPM generation on the Arduino.

    And if anyone else has questions or suggestions, please send them my way.
  • GREAT, indeed, beautiful overall great work

    large number of options under a finger, clear compact indications about PAN - TRIM .....mode,...

    and the little chain for TILT is a surprising detail of your RIG

    SMAC from Italy
  • That's great work, David. Thanks very much for doing this.

    I saw the discussion on Flickr about the display. If the basic Sharp part is LS013B4DN04, then that's a 3V part, and it looks like Adafruit has packaged it with a voltage regulator and level shifters (the HC4050) so that it will work with the Arduino's 5V. Mouser sells the display itself for $18.18, but there may be a cheaper source somewhere. Digikey sells it for about $11, but the minimum order is 500.

    Anyway, I think this is really nifty. Microcontrollers like the Arduino have put lots of new stuff within reach.
  • SMAC, the chain-driven tilt mechanism was something I copied from Cris Benton, our admin. Same with the double-rail carbon tubes across the top and the gearing for the pan mechanism and most of my kites. Cris' KAP hardware has undergone a lot of refinement and he's been very generous sharing the details here and on Flickr. I've profited greatly from it. :-)
  • Thanks David !! Cris Benton has an unbelievable rich collection of pictures and of RIGS,... OK I had to go back to RIG number 10

    Thanks Cris !! thanks of everything,.... a long work during the years,...

    SMAC from Italy
  • David - I've ordered all the components in your write-up except the Bluetooth module. I've also downloaded and installed the Arduino software and libraries. Your code compiles successfully, but the compiler says there's just 26 bytes left for local variables - "Low memory available, stability problems may occur."

    Is this OK? Have I got the arduino options wrong? I selected:
    Board - Arduino Pro or Pro Mini
    Processor - ATmega328 (5v, 16MHz)
  • Excellent! It will be interesting to see how well the documentation holds up as you make your own. ;-) (I'm already reviewing in my head all the bits of code I never finished commenting. Oy!)

    My board is "SparkFun Pro Micro 5V/16MHz". I think I had to install a module from Sparkfun into my Arduino environment to get that.

    Now I have a question: How did you get the compiler to report the free memory? I'd been struggling with that -- only discovering memory was low when a new build would crash shortly after startup. Perhaps I should update my Arduino env? I'm on 1.0.5-r2.

    I suspect you and I are in the same boat with 26 bytes for local variables. This might be OK or it might result in some latent bugs coming out later. The good news is I think we can move some variables from RAM to Flash with little effort.

    Other thoughts: you must have already discovered the dependencies on the Adafruit graphics library and driver. Also, this design depends on your pan servo being non-continuous and geared to permit at least one full rotation of the rig. (It's even better if it can rotate the rig through about 90 degrees extra.)

    Dave Wheeler
  • Dave
    Here's a screenshot image

    I just ran the arduino app - I'm running it under Mac OSX 109 (Mavericks). I didn't do anything special - though if I ask for 'verbose output' during compilation in Preferences I get a lot more information about the compile. I did copy the Adafruit_GFX and Adafruit_SharpMem libraries into the Arduino resources/java/libraries folder (by showing the package contents). I was expecting to have to do a lot more fiddling but this page made it pretty easy.

    I noted that your rig has a 4:1 gear ratio for panning and last week cut the necessary gears at our FabLab.


  • Dave, if you can cut another gear for a 5:1 ratio you might be happier with the results.

    With the 4:1 ratio, my rig can barely turn 360 degrees right now. It used to have about 450 degrees of rotation with my autoKAP controller. But this R/C system can't produce PWM pulses with as much range as the autoKAP system did.

    The reason that matters: When panning, the software sometimes reaches the limit of the pan servo's movement and it has to "unwind". For example, to make one 15 degree step clockwise, it might have to turn 345 degrees counter-clockwise instead. The extra pan range will result in less thrashing. And, although the software doesn't do this yet, we could make the system smarter to avoid unwinding in the middle of a sequenced shot.

    And I'll try upgrading my Arduino development systems. It sounds like I'm way behind!

  • You guys are too cool .... !!!

    pmc
  • Dave, after updating to Arduino 1.6.0 I, too, can see there are just 26 bytes available for local variables.

    And I'm pretty sure that's not enough. A couple guys as cool as us would want at least 64 bytes free, I think. I'll get to work on that. :-)

    Dave


  • I'm a complete novice at this, but is there a reason why you've used a large array (circ_bits) to draw a circle using drawXBitmap and not used drawCircle?
  • Using drawCircle would probably be simpler and faster and use less memory.

    But using drawXBitmap was lazier.

    When I started imagining the pan and tilt indicators, I wanted a fat little arc that runs around just inside the circle to indicate tilt. And I knew I couldn't draw it with any of the primitives so I started experimenting with bitmaps. Over the course of about two days I learned how to use ImageMagick to draw simple bitmaps and save them in .xbm format. And I used Gimp to crop them to reduce their memory footprint. As I was playing around with different looks for the tilt arcs, I had ImageMagick draw the outer circle, too, to help me visualize the whole thing. It took a lot of tweaking to make the elements look just right without overlapping. Once the tilt indicator bitmaps looked good on my workstation, I hastily inserted them into the LCD test bench code for the Arduino. At that point, since I already had the circle with tick marks as a bitmap, it wasn't any effort to display it with drawXBitmap. This does waste some flash memory space, of course.

    It wouldn't be hard to replace it now with a call to drawCircle, although I would expect a little fussing over exactly which pixel to use for the center or the radius. But doing so wouldn't accomplish much. The system isn't constrained by flash memory space yet, so I just let it stay the way it is.

    All this discussion reminds me, though, I should add the ImageMagick scripts to github, along with instructions for generating the bitmaps.
  • I've pushed an updated arduino sketch to the github repository. Now it reports global variables use 1797 bytes. That leaves over 200 free for locals, I think. It doesn't complain anymore.
  • edited February 2015
    I am following this thread with great interest. This is just such a neat controller. My c. 2007 Spektrum transmitter is starting to seem like a bit of steampunk gear in comparison. My workbench is beckoning with whispers of you know you want to do it.

    Dave – thanks for the shout out earlier.
  • I'm following this, too. I've got a couple of pencil sketches in my notebook for a controller I've wanted to build for a while, but this has been a massive kick in the seat of the pants to just go out and do it.

    I've also got a kit of parts on order. No LCD or bluetooth, and I've got a much simpler code set in mind. But MAN I can't wait to shed the bulk of that transmitter from my bag. W00t!!!!

    Thanks again, Dave, for taking on this task and sharing it with all of us.

    Tom
  • Thanks dave, the changes make all the difference. I'll cut some 5:1 gears as you suggested - is the tilt geared 2:1 to get the 180 throw?
  • I think it's 24 teeth to 16, so 1.5:1. 2:1 would work as well.

    When you run this software against your own rig, you'll need to modify the Arduino sketch to calibrate it for your servos and gears.
  • I have to agree with other comments that David's project has resulted in a great controller, and is definitely an inspiration for anyone else who has previously considered making a custom controller ;-)

    I have a few MSP430 microcontrollers waiting for a suitable project, and might have to look into interfacing one to an RC board...
    The MSP430 is tiny, but has more limited IO compared to an arduino.
    To give you an indication of the scale, here's one on my (large) finger:
    image
  • Those are nice, indeed. My previous autoKAP controller was based on that module:
    New KAP Controller
  • Arduino and joystick have arrived. Protoboard and Sharp LCD should arrive next week.

    Would it be possible to add the bezel STL file to github?

  • The bezel STL file is in github now, along with the OpenSCAD file I used to design it.

    I couldn't resist making one more change before pushing it -- I changed the units from 1/16 inch to mm.

    With the STL file in terms of 1/16 inch, I had to perform an extra step to change the scale after importing the STL into Makerware. Hopefully this change will mean you don't have to perform that step (and I don't have to document it.)

    If, somehow, I've introduced an error, please let me know. I'm about 99% sure this is correct, though.

    I'm really glad you asked for these files because they would probably have been lost otherwise. The files for this project are scattered among 5 machines I use at work and at home. Remembering where the latest versions are is already proving difficult. I should have the source files for producing the graphics icons in github later today.
  • Many thanks for that Dave. I've been using 123D Design and 123D Make (free from123dapp.com) to play with 3D designs. When I open the bezel stl file in 123D Design it has the correct size in mm (roughly 76x43x3) when I compare it with the size of the protoboard (8cmx10cm). It compiles fine in OpenSCAD too.

    And thanks for the pointer to OpenSCAD - it looks very interesting. I know someone at our FABLAB who needs just such a text-oriented tool.
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