Welcome to PhantomPilots.com

Sign up for a weekly email of the latest drone news & information

automate a retractable landing gear

Discussion in 'Phantom 2 Vision + Discussion' started by sdtag, Sep 26, 2015.

  1. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    OK I'm getting bored. It's time for a new project.
    I want to add a retractable landing gear to my P2V+. I don't have a good reason other than I think it looks cool in the air with the gear up. I found one on Ebay that uses the stock landing gear, and you have to add the servos and the interface and stuff. You control it using the tilt thumb wheel for the camera.
    I want to use my original gear so the quad still fits in the case I have. I don't want a taller landing gear. I don't like the look of the ironing board legs landing gear so I decided on this one that uses my original landing gear.
    I bought it on Ebay and it will be on the slow boat from China. I'll get it in 3-4 weeks and that will give me time to mod my mod. I want to add an ultrasonic sensor looking down so when the quad is less than 10 feet from the ground, the landing gear will be down. Anything over 10 feet and the gear will be up. I have seen the sensors on Ebay for a buck or 2 and they are for an Arduino. Which is like a tiny pc from what I understand. And it has inputs and outputs. digital and analog I think.
    So, in the name of experimenting, if I add the retractable landing gear, the sensor with and Arduino pc, I think I can achieve my goal here. A couple of hurdles for me: I have never programmed before other than basic and ladder logic and I think the Arduino runs Linux? I'm not sure. I just started looking into this. And what about the weight of all this stuff? Will it get off the ground? I'm sure it will but it will probably reduce the flight time a little.
    Any suggestions or comments or collaborators are welcome. TIA
     
  2. N017RW

    Joined:
    May 2, 2014
    Messages:
    6,244
    Likes Received:
    1,614
    Location:
    Palm Beach Co.- FL
    Never seen the tilt wheel used.

    The commercially available unit I have seen from RC Depot uses a PIC processor, I believe, (much smaller than an Arduino) and is inserted in-line (pass-thru) with the flight mode function (S1/channel U- IIRC). Then a toggle sequence is used to perform operation via a PWM signal generated by the PIC as well.

    The other consideration is relocating the compass as once the gear is raised you reorient it in 3D space and swap the Y & Z axes. Not good!

    Of lesser concern is the antennas as this will also change their polarity from vertical to horizontal when the gear is raised. Possible (likely???) reduction in range.

    I've considered removing the gear completely from my P2NV cause it looks interesting and 'saucer' like!
     
  3. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    yeah you're right about the compass. I thought they included a little stand off leg to re mount the compass but I don't see it in the video.


    I still want to try it. I'll make my own compass leg. I have an extra one I can hack it up.
     
  4. RoyVa

    Joined:
    Apr 10, 2015
    Messages:
    2,246
    Likes Received:
    449
    Location:
    Virginia
    You'll have to be sure it's right. I would hate to land on that camera. Just one time and it's costly for those gimbel repairs.
     
  5. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    so does anyone here have any experience with Arduino or Raspberry Pi?

    I found a Micro Arduino on Ebay for less than 10 bucks, and the ultrasonic sensor is 2 bucks.
    I downloaded their programmer. they have lots of examples so I think I won't have to learn a new language, I'll just copy and paste. I think this will work.

    Man if this works I think I can use these little Arduino boards in some of my machine automation. An ultrasonic sensor that detects a forklift pulling away from a pallet wrapper is over 600 bucks. I think I can mimic that action with one of these boards for 10 to 20 bucks. It can't be that simple. Or reliable. We'll see.
     
  6. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    I got my Arduino stuff today. After about 2 hours of play time I got the sensor and board working. I downloaded programs and schematics and did a little tweaking. I have it sitting on my desk looking out horizontally. I can push my desk chair up to it. When it is about 5 feet away it will turn on an LED. I continued to push my chair until it was about 2" from the sensor, simulating a landing. The LED never flickered. I have it working reliably at about 5 feet. I still need to interface this with that but so far so good. And mounting and wiring. Still waiting on the slow boat from China. I don't know what kind of signal I will need, constant on or a pulse, but I'm sure this little board can handle it. so far so good, I am impressed.
     
  7. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    I received my landing gear fast - 2 weeks on the speed boat from China!
    Needless to say I have been consumed these last few days, learning this Arduino stuff.
    It turns out these Arduino's can drive a servo directly. I downloaded sketches (programs) for the ultrasonic sensor and for the servos. I learned and tweaked and copied and pasted and guess what! I have a working system on my desk. I have the distance set to 2 feet for testing and it works. It works reliably. If the sensor sees something at less than 2 feet the servos are in the gear down position. When it sees nothing the servos go to the gear up position. When I install it I want to set it to 5 feet.
    So far the only drawback I see is I will need two 5 volt sources, one for the servos and one for the Arduino. I haven't even begun to look at the quad yet, I was focused on getting the electrical and programming done first. And I haven't checked the power draw yet either. I'm getting there. Videos soon.
     
  8. SteveMann

    Joined:
    Aug 27, 2014
    Messages:
    1,977
    Likes Received:
    653
    Location:
    Westford, MA
    You just need a BEC (Battery Eliminator Circuit) like this one: Hobbyking® Smart 5V BEC LiPo 250mAh (1pc)

    I have a few Arduino projects, and in fact the first 3DR drone is built on an Arduino platform (ArduCopter, Arduplane, etc).

    You will find that in flight the ultrasonic transducer will get false hits, so I would write a delay (a form of missing pulse detection) to make sure that you really have a positive contact before lowering the gear.

    It would look cool, but your endurance will take a hit from the added weight and battery drain.

    I would be interested in seeing your progress.
     
    sdtag likes this.
  9. N017RW

    Joined:
    May 2, 2014
    Messages:
    6,244
    Likes Received:
    1,614
    Location:
    Palm Beach Co.- FL
    A 'switching' BEC is all you need. The added weight of the LiPo in the above referenced device is not necessary.

    Be sure you add fuses to the supply to your BEC. One on each leg (B+/-) to be safest.
    This will prevent the a/c from experiencing a smart batt. voltage brown or black-out should something unexpected occur.
     
  10. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    thanks guys I never knew those existed. I was planning on using a LM7805 (?) 5 volt regulator. Would that have worked?
    I ordered a couple of these BEC from Ebay. Do I use one for the Arduino and one for the servos? I thought I read somewhere that you can't put these in parallel with each other? Or do I only need one for the servos and let the Arduino fend for itself?
    I added a 2 second delay as a de-bounce.
    Fusing the supply side, 5 amp fuses? 3 amps?
     
  11. N017RW

    Joined:
    May 2, 2014
    Messages:
    6,244
    Likes Received:
    1,614
    Location:
    Palm Beach Co.- FL
    Yes but a 7805 is a 'linear' regulator and that means the difference in voltage is wasted in heat and also requires some additional capacitors to work best. Plus you need a heat-sink (more weight) to achieve the rated current which is device package style dependent.

    With a 'switching' type regulator there is much less wasted energy and thus heat.

    Do not run them in parallel.

    Try to purchase one BEC with at least 50% more current than you need. Aside from weight bigger is better in terms of current delivery capacity (up to a point).

    Depending on your experience you may need to 'bench test' the current draw of your finished design unless you have good documentation on the mfgs. current specs.

    Then Fuse them at 50-100% percent above the average drain.

    Use regular fuses not slow-blow and the voltage rating is not important as this is just the max. voltage at which 'arcing' will not occur once/if blown.
     
    #11 N017RW, Oct 7, 2015
    Last edited: Oct 7, 2015
  12. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    what is typical amperage draw in a typical servo with no load? I assumed it was tiny, like 1/4 amp or less. I am starting to think they may draw more, like 1 or 2 amps each or more. I don't know much about servos but I think these are small, the 9 gram version. I haven't even dug out my meter yet and I don't know if it is capable of checking DC amps. I am getting a bad feeling that they do draw more, and that is the reason for the multiple power sources. Good thing they should only be working twice per flight, once up and once down.

    when you said not to run 2 BEC's in parallel I assume that means don't tie the 2 outputs from the BEC's together. What if I got 2 cheap small BEC's and fed them from the same source but their outputs would go to 2 different places. Servo's and the Arduino. Will that work? I have to double check but I think the Arduino can handle up to 12 volts so maybe I won't even use a BEC for the Arduino and just power it from the quad.

    BTW I got a tiny micro Arduino that is smaller than the card (PIC?) that came with the landing gear. it measures 1 1/4 X 3/4" and there are 10 digital pins and 6 analog pins and the digital pins are PWM and it costs 3 bucks. Amazing! I am thinking about mounting the ultrasonic sensor right to the Arduino. The Arduino micro is actually smaller than the sensor.

    Last but not least I have a joke about slow blow fuses but I won't say it. I think we all enjoy fast blow a little more than slow blow - but I could be wrong. haha
     
  13. N017RW

    Joined:
    May 2, 2014
    Messages:
    6,244
    Likes Received:
    1,614
    Location:
    Palm Beach Co.- FL
    SD,

    You need to use Google and get some reference data.

    My quick search indicates 9g servos may draw about 750mA. This I ASSUME is while trying to hold position against a load such as when used on a control surface like an elevator 'fighting' the air passing over it.
    The 'twice per flight' idea doesn't include the current to maintain position which WILL be less than during operation but drain or load none the less..

    Why do you need two power sources? The Quad doesn't.

    The Arduino and the servo(s) will need to share a common return to operate.

    You're better off with one regulator/BEC/source.

    If you can run the uP without a regulator, great but I don't see the need for two BECs.
     
  14. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    I'll experiment some more but when the servos and the Arduino are both powered from the same source, the Arduino reboots when the servos activate. I know that sounds like it is an under powered situation but I am powering these right now from a bench top dual power supply and I don't think they are over amping it.

    And yeah I forgot about holding power. Thanks.

    I'll play and experiment some more, right now I am leaning towards using the BEC for the servos and using quad battery power for the Arduino.

    I've got some old Flukes in my shop. I'm sure one of them can measure DC amps. I need to experiment and document.
    Like I said in another post, this is kind of fun for me and it keeps me out of the bars at night. haha
     
  15. N017RW

    Joined:
    May 2, 2014
    Messages:
    6,244
    Likes Received:
    1,614
    Location:
    Palm Beach Co.- FL
    OK.

    Do you have a small electrolytic cap, say 100uF or so, you can put across the power leads to the Arduino?

    Your BEC & batt. plan is a good one if that works for you.
     
  16. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    good idea about the cap.
    I thought about it but got sidetracked and forgot about it.
    thanks it should help.
     
  17. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    man I thought I was done. I have the Arduino pro mini mounted right onto the HC-SR04 sensor. I had it set to 24" It was on the edge of my desk looking straight down to the floor. I measured it at 26". Looking at 24" it would not see the floor. I can stick my foot under it and trigger the servos. I can make them react to tapping my foot. It was working great. Then I decided to try my future power scheme. 5 volts to the servos and battery to the arduino. Well it lasted for about an hour then I saw the led flicker and go out. I could never get it to come back to life.
    Arduino pro mini was 3 bucks
    the sensor was 1.60
    I just threw away 5 bucks. I can live with that. I made another one this morning and ordered a few more mini pro's.
    Now I am back to plan B. BEC for the servos and either a 7805 or another BEC for the Arduino
    The Arduino says it can handle up to 12 vdc but obviously not.

    20151010_070141.jpg

    poor solder skills. too early and not enough coffee. I hit the wrong pins and had to de solder and move them over 1. tuff little board - it still programmed up and worked after all that
     
  18. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    I fried my first setup.
    My second setup works but it won't let me update the program. The servos can't quite get back to zero when everything is bolted up and they sit there and hum.
    Third setup. I am out of mini pro's now so I started over with a nano. Slightly different pin out.
    Where can I find a housing? I need a small white plastic box about 2 X 1 X 1 to house this thing.
    Right now I just have it taped to the underside.
    ...still going

    upsidedown.jpg
     
  19. sdtag

    Joined:
    Apr 5, 2015
    Messages:
    221
    Likes Received:
    23
    OK I got it. This was way more work than I had anticipated. I got it going with a arduino nano and got it all dialed in. I was able to power the arduino and the servos from one BEC. I don't know how that works, but it works.

    I am getting false triggers when it is up in the air. It looks like a **** bird flapping it's wings. haha I have the distance set to 3 feet. Anything less than 3 feet it is rock solid and the servos never move, thank God!
    I added a 2 second pause to try and debounce this action but I guess it's not enough or it just doesn't work.
    I'll have to try Steve the Mann's missing pulse detector.

    Here's a quick video. You can see it false triggering in the air but when it is less than 3 feet from the ground it is solid. I flew it in the first half and picked it up in the second half, with no false triggers. hmmm. I flipped it over to show the sensor and it looks like I am showing you my quad's balls. haha

    I don't think you can see it in the video but there is a little stand off leg for the compass. Not sure what they were thinking but I made it work. The 2 antennas that were in the legs, I just let them hang down next to the legs. My favorite part about this project is that this hooks up to the battery and that's it.. Totally stand alone. no interfacing. no thumbwheel.

    Thanks for everyone's help with this. Now for the hard part - my office is a total wreck.

     
    #19 sdtag, Oct 11, 2015
    Last edited: Oct 11, 2015
  20. SteveMann

    Joined:
    Aug 27, 2014
    Messages:
    1,977
    Likes Received:
    653
    Location:
    Westford, MA
    That's basically what a missing pulse detector does. When you get a change in the sensor output, wait a second and check again. If the second read is valid then act on it. The problem with ultrasound is that the propwash from the quad can sometimes generate false positives. Fortunately, when you are out of ground effect you will rarely see a false return, and when you are a couple of feet from an object, it's pretty reliable.

    You only need one BEC, just as long as its capacity is 150% or your projected load. If you don't have one, a cheap VOM is a good investment. With this you can measure the actual load.