PDA

View Full Version : Build Log Flying Fox open source autopilot


Pages : [1] 2 3 4

zik
Aug 28, 2007, 07:28 PM
I thought it was about time I started a build log on this project.

To get things started here's the schematic of the prototype autopilot board. The main things in my mind when doing this design were small size, keeping cost down and having all the features needed for accurate, controlled flight.

zik
Aug 30, 2007, 08:01 AM
Here's the circuit board from an earlier prototype of the autopilot I did a while back. The new "Flying Fox" design is an improvement of this old design.

zik
Aug 30, 2007, 08:24 AM
I've spent the last couple of evenings putting together the schematic for the GPS and wing leveler board.

Since the Flying Fox has a GPS and a thermopile-based wing leveler which both need to be somewhere on the top of the plane I decided to integrate the two together into a single unit. This should keep things a bit neater and simpler - only one unit to mount on top.

The GPS module is an old favorite of mine - the uBlox LEA-4S. I've used this in a couple of other projects and have been impressed with its performance. It has excellent sensitivity and a 4+Hz update rate. FWIW the thermocouple amplifier is based on an application note from the CS3012 data sheet. I've noticed that the copilot and paparazzi designs seem to also be derived from this application note.

Aeroflot
Aug 31, 2007, 02:35 AM
Zik, nice work and neat Schematics too, are you planning a Vtail and Delta wing mix in the code? Thanks

zik
Aug 31, 2007, 09:57 PM
Hi Aeroflot, I plan to support a variety of plane types. And even if you come up with something I haven't thought of you're still ok - since this will be open source anyone can get in and implement any function they want.

On licensing: when I do release this I plan to make it "free for non-commercial use". In other words hobbyists can do whatever they like with it. If people want to sell it for money they have to come to some arrangement with me. Does anyone have a problem with this type of license?

(For now the copyright remains with me by default until I've decided on the license and released it)

sergey123
Aug 31, 2007, 10:50 PM
Hi Zik, your schematic looks very professionally done and keeping it open source is very-very good for everyone including you too. Linux always been open source and it is best OS now. All my support with you man!!!

_helitron_
Sep 01, 2007, 10:02 AM
Very impressive work so far Zik !

Cheers,

//Erwin

zik
Sep 01, 2007, 07:17 PM
Thanks guys. This UAV stuff is a blast :)

Here's a picture of a real "Flying Fox". We have a colony of about 30,000 of these just near my home in Melbourne Australia. At dusk we often see them flying over our house, hundreds at a time.

As bats go these guys are big. Wingspan goes up to 1.5m (5 feet). Presumably they get their name from the fox-like ruff around their necks.

Myron
Sep 01, 2007, 09:07 PM
Zik,

I cant really make a hole lot of sense out of the schematics because I'm not a board level electronics guru, but are you sure its a great idea posting your plans for someone else to copy and possibly capitalize on your design? Even if you patent your work, it only takes a 10% change for someone else to bootleg your hard work.

Myron

zik
Sep 01, 2007, 10:58 PM
Hi Myron, copyright law says that any modification of a work is a "derived work" and the original copyright still applies to it. It doesn't matter how much it's modified by, it's still jointly copyright to the original person. But in any case I plan to make these designs free for non-commercial use so people will be welcome to copy and change them as much as they like (as long as they're not doing it for profit).

Where it comes to copyright it's pretty moot anyway. China will copy and sell any design they like, copyright or not.

So anyway my attitude is why not share the joy and let other hobbyists get the benefit?

sergey123
Sep 01, 2007, 11:07 PM
Yes it is exactly like that Myron. Good people will always follow rules and law but bad will never even think about this (including copyright). One small thing about sharing – you just fill great doing this :) (or at list I fill)

zik
Sep 01, 2007, 11:43 PM
I've spent the last day or so doing the printed circuit board layout for the prototype. I haven't bothered to make this one particularly small since this is just a prototype. Squeezing it down takes a lot of time.

This is a double-sided board which will give plenty of access to the tracks if I have to chop and change things at this prototype stage. The final version will probably be a four layer board which will help to make things very small.

The finest traces on this board are 0.25mm - that's a hundredth of an inch to you Americans. This will make soldering the processor a reasonably challenging job but fortunately I have some SMT reflow gear which will help.

The next step for me is to do some checking and then send the PCB design off to Bulgaria for fabrication. Sure there are closer places but these guys are cheap and reliable - and can handle the very fine features on this PCB which many places can't. It'll be at least a couple of weeks before the PCB comes so I think I'll get moving on the software side of things while I wait.

vector_vortex
Sep 01, 2007, 11:52 PM
Zik,
looks good, where are the decoupling caps on the VCC lines of the micro? Also where is the power supply.
when you go into production you should check out goldphoenixpcb.biz, they are really cheap for set sizes, And very good resolution/quality, not to mention very fast to aus as they are based in china.

zik
Sep 01, 2007, 11:58 PM
Hi vector_vortex,
There are a few components on the back side of the board - mostly the decoupling capacitors for the MCU and the power supply that you noticed missing. If you look carefully at the blue traces you can see where they are.

Incidentally I'm using sparkfun modules for the IMU sensors on this prototype (makes soldering easier) so that's what the big boxes are.

Myron
Sep 02, 2007, 11:30 AM
Hey Guys,

I guess I didnt see the "open source" part of the original thread. We (RP Flight Systems) quit posting details about our work a long time ago because the lawyers and investors spooked us pretty good. I guess the big difference here is that are more after the commercial end of un-manned systems...

Myron

zik
Sep 02, 2007, 06:03 PM
Hi Myron, that's fair enough. Lawyers are scary like that - but still there's also plenty of precedent for commercial operations releasing their work as open source too. For instance Cygnus Solutions (now part of Redhat) built a very successful business out of writing open source software. Their business model is essentially to be "programmers for hire" who have expertise in the popular GNU compiler GCC and other software tools. Their clients are computer companies who need a compiler for their computers. Having Cygnus port a free compiler is an incredibly cost effective way of doing that.

Another example - in my day job I work for a multinational electronics company developing embedded computer systems. I'm currently writing linux device driver modules for some hardware we've designed. Since these drivers are part of the linux kernel they have to be released as open source too. My company understands that there's a huge cost benefit to using linux - and there's really no quantifiable downside to releasing the code freely.

So I just wanted to point out that open source and commercial applications aren't necessarily mutually exclusive. Sometimes sharing is a good thing - just like your mama told you :)

Aeroflot
Sep 02, 2007, 06:47 PM
Zik , nice shot of the Flying Fox we have these guys in our backyard on warm summer nights eating from a pear tree, nice PCB.

samanpriya
Sep 03, 2007, 07:33 AM
Hi Zik,

Very interesting project!!!!
We are waiting for more details about project, in the mean time I have stupid question,

Is there are any way to use our existing OEM GPS modules with your new system?



Rgds

Spriya

m1tch37
Sep 03, 2007, 08:16 AM
Great project zik.

I was wondering what IMU from sparkfun you will be using? 2xIDJ300?

Cheers
Mitch

zik
Sep 03, 2007, 09:32 AM
Hi samanpriya, if you have a GPS which speaks 3.3V logic levels you should be fine. I've designed things so that another GPS module and an FMS copilot sensor can be used in place of my combined sensor design if you like.

And m1tch, my prototype uses some sparkfun modules just to make the prototyping process quicker. The final version won't use any sparkfun modules at all since they're a bit expensive. I'm trying to keep the price down as much as possible without sacrificing performance too much. (The prototype version uses 2 * IDG300 and 1 * MMA7260Q modules.)

BrutalByte
Sep 03, 2007, 05:49 PM
Zik-

Do you have a web page with more info on this autopilot of yours? I'm curious about the details of this project (i.e. Capabilities, power consumption, parts listing, etc...). I am new to the realm of Hobby UAVs and am the type of person that learns by creating from scratch. This looks like the perfect project for me!

Thanks!

BrutalByte

zik
Sep 03, 2007, 05:54 PM
Hi BrutalByte,

I don't have a project page for this project yet. I plan to create one when I have something which works. I'd feel bad about unleashing something on the world which had problems. It'll be at least a month before I have the prototype back and constructed and the final printed circuit board layed out so stay tuned.

You can get a fair idea of what's in the project from the two schematics I've posted in this thread. I haven't changed very much since I posted them - just corrected some minor errors.

zik
Sep 05, 2007, 01:46 AM
I finally got the prototype board sent off for fabrication. It took a couple of extra days due to the usual finicky last-minute fixes and too much socialising :)

I've also been working on the layout for the GPS/thermopile sensor board. I was initially having some problems getting it to all fit in but I think I can do it by having the thermopiles facing NW/SE/NE/SW rather than N/S/E/W (you know what I mean). Has anyone experimented with this configuration?

sergey123
Sep 05, 2007, 10:16 AM
For me NW/SE/NE/SW setup work fine with FMA copilot - no problems at all

_helitron_
Sep 05, 2007, 12:29 PM
I also flew with such a config with the FMA FS-8CPI co-pilot without problems (problems I had only with the FS-8 Rx) and in the meantime with a AP2000i from SpartanRC, also with a X-Y sensor from FMA and with a NW/SE/NE/SW config. No problem at all.

//Erwin

zik
Sep 05, 2007, 06:03 PM
Thanks guys. It looks like that's the way to go then.

Last night I modified the sensor board design slightly for improved precision. For the cost of about ten cents in parts I estimate that I got a couple of extra bits of precision compared to the copilot. It may not be totally necessary but I'd prefer to do things the best way where possible. And if those extra bits give smoother, more accurate flight it's all good!

zik
Sep 10, 2007, 07:57 PM
The GPS/thermopile sensor board layout is finally done. I had a hard time optimising it to maximise the GPS antenna's ground plane while minimising noise on the thermopile sensors. I'm still not 100% happy with the result so I figure I'll have to go to multi-layer board for the final version. In the meantime this prototype should work fine but antenna performance may be down about 2dBi on my target. Having said that I still expect it to be significantly more sensitive than most other GPS units out there.

The final version will clock in at 40x40mm in size, will double as both a GPS and thermopile leveling board, should be more sensitive and should also be quicker to acquire the first fix than the other autopilot GPSes out there. Basically it'll be smaller than having separate GPS and leveling sensors while (hopefully) giving better performance.

This prototype version still does all that but it's slightly bigger and less sensitive due to being stuck with only two board layers - I'm using double sided boards for quick/cheap prototyping.

Now that this last PCB's finally off to Bulgaria for fabrication I can get moving on the software. The general plan is to take a look at what those nice guys at Paparazzi have done and see if it can be adapted. I'm planning to use freeRTOS and gcc - which I already know from experience make a good combination with the AT91SAM7 ARM processor I'm using.

samanpriya
Sep 11, 2007, 12:09 AM
:(
Hi Zik,

This is may be out of the topic, but I would like to hear about Ground Control Station for this Autopilot systems.
Do you have to any plan implement GCS? And is there are ways to get on flight information to ground station?
(Actually I had plan to use RCAP2, WPS1 and EM406, module as AP and Visual GPS software and video capturing software with OSD as GS, but I believe you have batter plan on this)
If you have any plane on this please let us Know.( sorry for the out of topic questions because I am beginner on this filed)


Rgds
Spariya

zik
Sep 11, 2007, 12:46 AM
Hi samanpriya,

Hardware-wise I'm using easyRadio modules for telemetry to and from the plane. This is intended to work with a ground control system.

On the software side I'm looking at using the paparazzi software. They've done quite a lot of work on their ground control system. Here's their web page on the system:

http://www.recherche.enac.fr/paparazzi/wiki/index.php/GCS

Looks pretty good to me!

Please keep in mind that the Flying Fox is still in development. If you want to get started right now I wouldn't want you to wait. Go and get your RCAP2 and WPS1 and get going with those. Flying Fox will still be at least a couple of months coming, probably more.

zik
Sep 11, 2007, 06:59 AM
Here's that PCB layout for the GPS/leveler.

zik
Sep 18, 2007, 07:41 PM
Mini-update: I'm still waiting on the PCBs to come back from fabrication. The main autopilot board has been sent (from Bulgaria) and should be showing up any day now.

In the meantime I've been putting together two new planes to test the autopilot with. One is an ElectriStar Select - an electric 40 size trainer. It's BIG with heaps of room inside and masses of carrying capacity. It'll be great for aerial photography and some of the more advanced experiments I have in mind.

My other new bird and the main one for testing out the FlyingFox is a modified Canterbury Sailplanes Eraser. This is an incredibly tough slope combat plane. I've modified it to have twin brushless motors which are protected from crash damage by their location between the EPP nose and the wingtips. I'm hoping this will be a very durable UAV test vehicle. If a bug crashes the software at least the plane should survive!

zik
Sep 20, 2007, 03:32 AM
The prototype PCBs have arrived! They look pretty nicely made. I can't wait to get these puppies running. Turns out the capacitors I have lying around are the wrong size (should have thought of that) so while I wait for the correct ones I'll just have to be patient.

For now I'm working on the software side of things, getting things ready for the real hardware when I have it. I have a prototyping board with a similar processor so I'm able to get programs running in preparation for the real thing.

Crashaholic
Sep 20, 2007, 11:15 AM
zik, I was looking at the schematic for the processor board and I saw that you tied the JTAG pins high. I am assuming that you are going to use SAMBA through USB to program the thing. Do you have another platform to debug code on?

BTW: I have quite a bit of experience with that MCU if you hit any walls. I really like the part but there are a few things that are a PITA.

Tip #1: Not sure if FreeRTOS has one, but do make sure you have a "Spurious Interrupt" handler if you are enabling/disabling interrupts on the fly (no pun)

zik
Sep 20, 2007, 06:18 PM
Thanks Crashaholic. Yes, I've been using SAM-BA when developing on an AT91SAM7X256 proto board. Avoiding JTAG means that people at home can program the unit directly via USB without having to buy a special programming device - and it saves having to have a clunky JTAG connector just for programming.

I got FreeRTOS running on my proto board last night along with support for all the microcontroller's internal peripherals. The next step on the software side is to start porting the paparazzi flight code across to it.

Crashaholic
Sep 20, 2007, 06:49 PM
Avoiding JTAG means that people at home can program the unit directly via USB without having to buy a special programming device

While this is true, it means that you, the primary developer, cant get at the JTAG either. I usually just put weak pull ups (100k or so) on the JTAG lines so that I can use SAM-BA and JTAG.

Anyway, I see that you have R1 (100k) connecting TST to GND. I would not mount that. The MCU has an internal pull down (10k) in it already. You can mount it eventually if you need to with a lower value resistor. The reason I would not mount it is that after you program the MCU through SAMBA it boots to your code (not SAM-BA). You need to connect TST, PA0, PA1, and PA2 to Vdd to get it to boot SAM-BA again to reprogram the thing. Not mounting R1 gives you a nice pad to solder a jumper to. GUess you could jumper to it whether or not R1 was mounted since you will need to jumper the other pins as well.

If you already know all of this, just let me know and I will close my mouth.

BTW: All of the TST, ERASE,NVM, SAM-BA etc. stuff is different between the SAM7S and SAM7X parts. Weird.

Good job getting freeRTOS running. Are you using the sample code from here: http://www.freertos.org/portsam7xlwIP.html ?

I have the same proto board and used the sample. Works well.

zik
Sep 20, 2007, 09:47 PM
Good catch Crashaholic. My previous designs have used the 7X and I missed this difference. You've saved me a couple of hours scratching my head there.

I'm using a different 7X proto board - the "make microcontroller" from makingthings. I like it. The FreeRTOS I'm using is adapted from that system.

zik
Sep 24, 2007, 07:22 PM
I've spent the last couple of nights bringing the paparazzi code across to my FreeRTOS base. There are two main issues I'm working on. Firstly some of the paparazzi code is specific to the LPC processor they use. The SAM7 processor in Flying Fox is similar to the LPC in that it's an ARM7 processor but the on-board peripherals are quite different. I need to replace this LPC-specific code with some SAM7 drivers I already have lined up.

Paparazzi have their own LPC-specific system level routines which I'm replacing with FreeRTOS. I already have FreeRTOS working on the SAM7 and it also brings some nice new features along with it.

One of these benefits is that FreeRTOS supports preemptive multitasking. This is particularly handy as a fail-safe. As an example I'm planning to run the rc receiver and servo control subsystems as separate tasks from the autopilot so if the autopilot software fails the operator should still be able to hit the manual override and regain control. You don't want your failsafe to crash along with your autopilot. This same principle applies to other subsystems which can be run as separate tasks. Lose one and you don't lose them all.

All these changes require a little bit of work but I think it'll be worth it. I'm hoping the result will have the excellent flight performance of the paparazzi autopilot while keeping a cheap price point and adding a few extra features along the way. As a side note I'd like to say that I'm pretty impressed with the quality of the paparazzi code - for the most part it's well written and seems well designed.

Choosing a microcontroller for a project like this is a complex tradeoff. One reason I chose the AT91SAM7S processor for Flying Fox is that it has a built-in boot loader (called SAM-BA). You'll be able to plug in a standard USB cable and program the unit immediately without having to buy an expensive programmer. Debugging can be done via USB as well. Most other processors at this level require a special programmer to program them either all the time or at the very least to install a boot loader. The SAM-BA system will make it possible for people to build their own Flying Fox from scratch without having to buy any special programming equipment.

So back to what I'm up to. For now I'll continue integrating FreeRTOS, SAM7 code and paparazzi. That'll keep me busy for a while. I'm expecting the GPS/leveler PCB to arrive from the fabricators in the next few days and a pile of parts are coming too. When the parts arrive I can start testing the hardware bit by bit.

I already have a slightly revised schematic which I've been working on in the background. It streamlines a few things to move away from a prototype design towards a final design. More interestingly it adds a secret new feature which I think is very cool. But you'll have to wait to find out what it is!

zik
Sep 26, 2007, 06:18 PM
Woohoo! The parts I've been waiting on arrived. Now I can start getting this hardware running (Once I have my tax return done... The tax man has no sympathy for the importance of UAV projects...)

AntonK
Sep 26, 2007, 07:06 PM
Hehe zik, Im glad you like the quality of the paparazzi code. The 2 main writers definitely know what they are doing. If you have any doubts to the robustness of paparazzi as a system check out www.mav07.org and look at the results of the competition. The results are also posted on the paparazzi wiki.

AntonK

zik
Sep 29, 2007, 04:12 AM
I started soldering the prototype today. Working with the very fine "LQFP" sized microcontroller chip is hard work. I use a stereo microscope so I can see what I'm doing. The soldering I do with the surface mount rework station as seen in the photo.

For now I've installed just the "bare bones" of the unit so I can start to get it working. Firstly I want to check that the power supply is operating correctly, then I'll check the clock circuit and look at getting a simple test program running.

zik
Sep 29, 2007, 06:38 PM
A long rambling post about SMD soldering issues follows. It's probably of no interest to anyone but electronics geeks.

I had a couple of problems yesterday when I was soldering the board. Doing this prototype has already been very helpful in finding problems before making the "real" board.

The main problem I found is that the "footprint" for the microcontroller was not quite right. I checked it against the data sheet and it seems that the idea of what an "LQFP-64" package is varies between manufacturers by a few tenths of a millimeter. That was enough to make it hard to get all the pins touching the contacts.

I worked around the problem by scraping some of the solder mask off to give more room to solder to. This was good for all but a few contacts which went back under the chip instead of out. Those ones I had to bend back the tiny legs under the chip slightly so it'd make contact. This all had to be done under the microscope - it's just too hard to see otherwise.

I soldered on one microcontroller and then realised I just wasn't convinced that all the pins were connecting properly. I had to remove it by desoldering it and starting again with a new micro. It was all very messy. I'll change the microcontroller's footprint on the next version of the board to fix this problem and it should all be much, much easier.

I found a couple of other minor issues but nothing which was a big deal. The next step is to thoroughly check my connections with a multimeter and then power it up and test each circuit block.

Crashaholic
Sep 30, 2007, 11:32 AM
Zik, I feel your pain about SMD soldering. A few tips though...

Using solder paste works really well. Put the paste on, then the components. Next use a toaster oven to reflow the parts. Spakfun even has a kit to make a afancy one if you want to. In normal SMD double sided fab, they will glue the parts down on the first side so they dont fall off on the second. If you were to do the side with all of the little 0402/0603 components first, the surface tension of the solder would hold them on and you wouldnt need any adhesive.

After I create a new footprint, I always print it out, actual size. Sometime I do the same thing with the top and bottom layers of the whole board. Then lay the components on thefootprint to see if everything lines up ok. Sometimes I also make special footprints for boards I know will be hand soldered. An extra .2mm or so of pad length can make all the difference in the world when you are trying to thte the tip of the iron in there.

Good luck!

zik
Sep 30, 2007, 05:53 PM
Thanks Crashaholic. Yes, I'm using solder paste and it certainly does make things easier. I'm planning to use a solder stencil for the production version which will help - this time all the solder paste was hand applied. I also have a reflow toaster oven controller on order which will make things a lot easier.

I've had trouble finding a toaster oven locally which has a good rapid temperature ramp. I ended up buying one which isn't as quick to heat up as I'd like but I'm hoping it'll do the job. It's not possible to import a "known good" toaster oven from the US since we run off 240V here.

Thanks for your suggestions.

zik
Oct 01, 2007, 08:49 AM
Mini update: I spent some quality time with a multimeter tonight. Everything checked out so I applied power via the USB port. No smoke signals - always a good sign. All the regulators are working properly - the two on the board and one inside the microcontroller.

Tomorrow I'll take it to work and check out the clock generator on some equipment there. (They have better toys than I do)

vector_vortex
Oct 01, 2007, 06:14 PM
zik, I bought my toaster oven from cash converters,
just went in there and looked for the highest wattage oven, found an old GE 1500W oven with two bottom and two top elements for $20. I went for the smallest size/power ratio as that will influence the heat up time. I was planning to do all my reflow with this and after building a controller and writing thermal control software the board delaminated after it's second run through so for the time being I resorted to hand soldering the TQFP. I found a good method for soldering these packages with any size soldering tip, I use the default one that came with my station, about 1.5 mm
1: use flux pen to apply flux all over the pads of the QFP
2: drag iron across pads while feeding in solder to tin pads of qfp.
3: tack solder one pin of the QFP, ensure correct alignment.
4: wipe iron across other pins, don't worry about bridges, just focus on reflowing the solder under the lead and making a good joint,
5: use desoldering braid to clean up bridges
6: check each connection with a multimeter.

Have Fun

Joel

zik
Oct 01, 2007, 07:07 PM
Thanks Joel. I've heard of people having success with that soldering method. The guy at work who does most of our SMD soldering does it a similar way to you. I've tried the same thing myself but found it hard to wick off the solder bridges without removing too much solder and leaving the joint questionable. I'll have to give it another try sometime.

zik
Oct 01, 2007, 07:23 PM
The GPS/leveler boards arrived this morning. I just realised I have all the parts I need except the battery clip. Rather than wait for another delivery I might just cheat and solder the battery straight on for now. Incidentally I chose to use a more conventional battery backup rather than the supercapacitor paparazzi uses. Some quick calculations indicated that the supercapacitor backup would be useless if you were only flying once a week - you'd have to wait minutes for the GPS to download its almanac every time. If there are any paparazzi users out there I'd be interested to hear if this problem really does occur in practice.

I was experimenting a little with silkscreen on this board. This one's another throwaway prototype so it didn't really matter what I put on the silkscreen layer. I have to trim the corners off the board before I solder the thermopiles on - in the final board I'll get these cut off in production.

Peter Seddon
Oct 03, 2007, 06:06 AM
Zik,

I would persevere with the desolder braid to remove bridges and generally tidy things up when SMD soldering. I found that success with the braid came when I had some solder on the iron and made sure the braid stayed in contact when both applying and removing the braid. Whilst it appears to remove all the solder and leave a questionable joint; if you use a microscope or jewellers loupe you will see that the joint is sound unless the leg of the ic was not touching the pad in the first place when all the solder may get sucked out. I haven't used a 'scope but are you able to orient the board to inspect the pad to leg solder?

regards Peter

zik
Oct 03, 2007, 08:22 AM
Hi Peter,

My understanding from the experts at work is that there is an optimal amount of solder to use. Not too much, not too little. This gives the joint a curved, concave shape. This is meant to give the best reliability and mechanical stability. I think if you wick off too much solder you're going to compromise the reliability of the joint.

But really everyone seems to have a slightly different method which works for them. If you look around the net there are at least three wildly varying yet popular methods of doing surface mount soldering. Each method has its advocates but I'm sure they all work well enough.

Personally I'm planning on giving the reflow method a serious go very soon (my reflow controller box arrived today). Reflow is how it's done in serious production so it's a tried and proven method. It'll also allow me to do small scale production from home.

Cheers,
Zik

zik
Oct 03, 2007, 08:32 AM
This evening I started putting together a GPS/leveler prototype board. If you check out the photos you'll see that I've only installed the GPS-related parts so far. The weird soldering on to the battery is because I didn't have the battery clip so I've just soldered to the battery for testing purposes.

Note how there's a lot of ground plane around the GPS antenna? This should give it really good sensitivity.

I fired the board up briefly and the voltage levels all checked out. I'll have to put an RS-232 level converter together so I can check it out fully. When I'm happy with the GPS I'll start looking at the thermopile leveler part.

I just realised it's hard to get an idea of how big the board is from the photos. This version is about 4cm x 4cm, or 1.5" x 1.5" but it's actually a bit larger than the final one will be. Given that it combines the leveling sensor and GPS into one package the overall size is smaller than the two units while also giving better GPS performance (I hope!)

Crashaholic
Oct 03, 2007, 10:12 AM
Glad to see you used the uBlox rx. That faster update rate helps a lot.

zik
Oct 03, 2007, 06:41 PM
Hi Crashaholic,

Yes I've used that same uBlox GPS module before - it works really well.

zik
Oct 05, 2007, 03:49 AM
The GPS works!

vespa
Oct 05, 2007, 12:59 PM
Great project zik! I've been using Paparazzi for a few years now and can answer your question about the gps backup battery. In the early days we used the complete SAM-LS modules (receiver + antenna) and we added watch batteries to them. The results were very poor as the batteries only lasted 3-4 months instead of the 12-18 months we predicted and when they got low, the receiver did very strange things.

Now we use a capacitor which lasts for several days but I find that the first flight of the day always requires 40-60 seconds regardless of the battery, capacitor, or number of days passed. And even within the same day, the backup has less effect than I would expect and out of 10 back-to-back flights, maybe 4-6 will require the full 40 seconds or so, a few will be under 2 sec, and a few in the 10 sec range.

What seems to be the greatest benefit of the backup power is that the fix is "stronger" and more accurate, expecially in the first minute or two - important because we measure the ground altitude prior to takeoff.

B.T.W. the top side of your GPS pcb looks very compicated. Note that the pcb is a critical part of the antenna. You have traces all over the top side, maybe even carrying digital signals? May I suggest that you move the comm/power wires to the edge close to the RX pins and make both top and bottom planes as solid and symmetrical as possible? Looks like an Emtac 1580 18mm antenna which should give you 5-7 sats over 45dB with a ~40mm ground plane.

zik
Oct 05, 2007, 09:48 PM
Hi vespa,

Thanks very much for describing your experience with the backup power sources! I think I'll stick with the more conventional battery backup since it sounds like the supercapacitor on the paparazzi design isn't working 100%.

The PCB traces on the antenna side of the board are necessary due to it integrating a thermopile leveling sensor as well as GPS functions. This one is just a prototype - the final one will be multi-layer and will have no traces on the antenna side.

You asked about the antenna - it's an Inpaq PA1575MZ50J4 which is 18mm and has about 2dBi gain with a 4x4cm ground plane. This is equivalent or superior to most of the 25mm antennas I looked at. I believe it's better than the Emtac 18mm antennas.

vespa
Oct 05, 2007, 10:18 PM
Ah, that makes more sense - I was wondering what the funny pads were on the corners. :) Should be fine then since the traces are not power, digital signals, or high frequency analog, but I must say it looks like you have slot antennas connecting each of the thermopiles. They are *very* sensitive to RFI, no, make that *VERY* sensitive to RFI.

As for the battery/capacitor, I guess I wasn't clear. The capacitor used by paparazzi works great, and is a huge improvement over the unreliable and troublesome lithium cells. I was only noting that any backup system, battery or capacitor, is only useful within the day.

zik
Oct 06, 2007, 02:02 AM
The thermopile leveling sensor circuitry is now installed. From a quick test it looks like it's working nicely.

toxicmouse
Oct 06, 2007, 02:19 AM
nice work Zik.

Aeroflot
Oct 07, 2007, 08:35 PM
Zik looks like the project is moving along nicely well done. I noticed this post might be useful as an ARF uav airframe it’s the biggest Pusher I have seen at 80”
http://www.rcgroups.com/forums/showthread.php?t=722800

zik
Oct 07, 2007, 09:08 PM
Hi there Aeroflot - that's a great find! Looks like it has plenty of space for gear and good carrying capacity.

I just maidened my aerial photography airframe yesterday. It's an Electristar - an electric powered 40 sized trainer. It's big and flies very stably and predictably. It was really a dream to fly. It has a high wing loading so it also handles windy conditions with ease. The downside as a photography platform is the front prop getting in the way of forward photography but in this case I plan to be shooting down or to the side so it's no big problem. I'll be interested to get my autopilot into this plane - I think it'll be perfect for some UAV missions.

zik
Oct 07, 2007, 09:28 PM
Mini-update: A few days ago I did some testing on the main autopilot board and found that the main oscillator wasn't running. I've been distracted by the GPS/leveler for a few days but just took another look at the oscillator issue. I found a problem with some capacitor values. I need to change them to values which make a better match for the crystal I'm using and fingers crossed that should sort out the problem.

Aeroflot
Oct 07, 2007, 10:30 PM
Zik, Don't forget if you need any local helpers for testing, equipment, construction or baggage handlers! just PM or post.

(Sorry I ment to post this here)

zik
Oct 08, 2007, 06:41 PM
Update to the mini-update: I read the SAM7S data sheet some more and realised that the original capacitor choices are fine. So actually what I thought was a problem was not a problem at all. But why isn't the oscillator oscillating? More reading of the data sheet tells me that it's turned off by default at startup. Duh.

So my next trick is to get the processor running with its USB boot loader. Then I can start getting some code on to it and testing things out.

yanglu77
Oct 10, 2007, 07:42 AM
I`d very like this "Flying Fox"
Iwant try do it and thanks a lot ZIK ,he give me much help!!!!!

zik
Oct 10, 2007, 08:56 AM
Time for a new prototype board revision. I've changed some parts to smaller versions and added some minor new features, like an extra LED etc.. Most importantly I've fixed the MCU footprint so it'll solder correctly.

sergey123
Oct 10, 2007, 10:48 AM
it is great progress :) Zik, keep as updated and hopefully we can start testing it soon too :):)
BTW: how you are going to integrate thermopile leveler with imu and GPS??

rcelectronics
Oct 10, 2007, 11:06 AM
Time for a new prototype board revision. I've changed some parts to smaller versions and added some minor new features, like an extra LED etc.. Most importantly I've fixed the MCU footprint so it'll solder correctly.

Cool project. I am interested to see how it turns out. You mentioned that the project is open source. Are there design files (hardware and firmware) posted anywhere?

One thing I noticed in the schematic is that you are lacking the pull-up on PIO16 to support the SAMBA USB interface. This is required for SAMBA to work over the USB with the SAM7S parts. See the AT91SAM7S data sheet doc6175, section 22.6. The schematic in the AT91SAM7S-EK data sheet is also helpful.

Keep up the good work.

David

zik
Oct 10, 2007, 05:58 PM
it is great progress :) Zik, keep as updated and hopefully we can start testing it soon too :):)
BTW: how you are going to integrate thermopile leveler with imu and GPS??

Thanks sergey123,

I haven't looked into how I'm going to integrate the leveler with the IMU and GPS yet. If paparazzi has a solution I'll use that. Otherwise I'll work out something of my own when I get that far. I have some ideas about using confidence intervals with the various IMU/leveler/GPS data and combining them mathematically to obtain a "best guess" position and orientation.

zik
Oct 10, 2007, 06:22 PM
Cool project. I am interested to see how it turns out. You mentioned that the project is open source. Are there design files (hardware and firmware) posted anywhere?

Hi David,

The only designs so far are what's in this thread. I'll release the whole lot in source form once I have the system working well. I don't want to have people making an incomplete experimental version and then being disappointed when it doesn't work.

One thing I noticed in the schematic is that you are lacking the pull-up on PIO16 to support the SAMBA USB interface. This is required for SAMBA to work over the USB with the SAM7S parts. See the AT91SAM7S data sheet doc6175, section 22.6. The schematic in the AT91SAM7S-EK data sheet is also helpful.


This was a deliberate hardware-saving effort. When using SAM-BA the USB pull-up driven from PA16 is activated by SAM-BA as soon as it fires up and is held high throughout. When it's not driven the device is not recognised as a USB device at all. Since I want Flying Fox to always be visible as a USB device I believe I can drive it high permanently. Here's an Olimex development board which takes a similar approach:

http://www.olimex.com/dev/pdf/sam7-p64.pdf

By driving it permanently high I save a few components and can reduce the cost by a couple of dollars.

The other consideration with SAM-BA is that PA0-PA2 have to be tied high when TST is triggered. Since the SAM7S has internal pull-ups activated by default I believe this is covered as well.

You're obviously experienced with the SAM7S series. Am I missing something here? I'm always interested in hearing of possible problems in advance.

rcelectronics
Oct 11, 2007, 12:50 AM
This was a deliberate hardware-saving effort. When using SAM-BA the USB pull-up driven from PA16 is activated by SAM-BA as soon as it fires up and is held high throughout. When it's not driven the device is not recognised as a USB device at all. Since I want Flying Fox to always be visible as a USB device I believe I can drive it high permanently. Here's an Olimex development board which takes a similar approach:

http://www.olimex.com/dev/pdf/sam7-p64.pdf

By driving it permanently high I save a few components and can reduce the cost by a couple of dollars.

The other consideration with SAM-BA is that PA0-PA2 have to be tied high when TST is triggered. Since the SAM7S has internal pull-ups activated by default I believe this is covered as well.

You're obviously experienced with the SAM7S series. Am I missing something here? I'm always interested in hearing of possible problems in advance.

I have done a number of designs with the SAM7S. For those that have used the SAMBA over USB I have always included the pull-up transistor. It is a very small part that is only a few 10s of pennies.

That said, if permanently pulling it high works, it works.....

As for the pull-ups on PA0-PA2, I don't know if you can depend on the internal pull-ups. The LEDs pull up PA0 and PA1, so that is OK either way.

To be safe you could just add the footprint for a pull-up on PA2 and the pull-up transistor on PA16/the USB

zik
Oct 11, 2007, 01:29 AM
Thanks David,

I think I'll do as you suggest - play it safe and put pads on for the extra parts just in case there's a problem. The downside of having the USB pullup transistor sitting on PA16 is that I'd lose a much-needed output. But I expect it won't come to that - if it works for Olimex without the transistor it should work for me (I hope).

zik
Oct 14, 2007, 07:01 PM
Mini-update: Over the last few weeks a couple of people have thrown up questions about the SAM-BA programming method I've been planning to use. Different people seem to think different things and the docs aren't very helpful. I want to be totally sure I've got it right so I ordered a SAM7S development kit I can use to test my approach. Now that the dev kit's arrived I should be able to nail down how it really does work once and for all.

zik
Oct 17, 2007, 09:09 AM
Ok, that ended up being more difficult than I expected. Getting the new development board from Olimex set up and running took a couple of evenings. But the end result is all good, I've proved that:

a) the SAM-BA boot loader method I was planning to use works
b) it's not necessary to connect anything to the I/O pins to restore the chip to SAM-BA mode - this was also the original plan and saves a few components
c) no extra transistor is necessary on the USB pull-up - this was also my original plan and saves a few more components and makes an extra servo output available

This little digression has cost a few days but on the upside it's shown that the design is sound. I can now confidently keep my economical design - keeping it cheap while also saving space and weight.

I think I'm going to hack together a quick-n-dirty prototype based on this development board to validate the rest of the design.

zik
Oct 20, 2007, 05:11 AM
Meet FrankenFox!

I knocked this one together quickly so I can get programming while I wait for the next set of printed circuit boards to be made. It's pretty close to the functionality of Flying Fox but with none of the beauty.

zik
Oct 23, 2007, 08:10 AM
Mini-update: A new radio has been released which is much cheaper than the easyRadio I'd designed in to FlyingFox. I'm redesigning the radio section to cater to this different kind of radio. $9 for this radio module is a lot better than $59 for the easyRadio!

Crashaholic
Oct 23, 2007, 10:24 AM
Care to share which radio you will be using or at least specs: freq, data rate, power, sensitivity, etc.?

zik
Oct 23, 2007, 06:10 PM
Hi Crashaholic, the radio is a Hope RF RFM12B. More information here:

http://www.hoperf.com/pro/RFM12B.html

zik
Oct 24, 2007, 10:53 PM
Quick question: what do people want in a ground station? Would you prefer a cheap USB dongle so you can control your UAV from a laptop or would you prefer a more expensive handheld device with a display and some buttons which you can easily carry around a field?

Prashanth
Oct 24, 2007, 11:43 PM
I would prefer a simple laptop interface ........with flexibilty to port onto a pda or any other handheld device..

small_rcer
Oct 25, 2007, 07:29 AM
In looking at the HopeRf web site I found they have some very small, very sensitive pressure sensors, suitable for high precision altimeters. Could one of those be integrated for a secondary altitude control along with the GPS derived altitude?

Just a thought and at their small size and weight, they would be an attractive option.

Jim H

Medve
Oct 25, 2007, 02:02 PM
USB out to a laptop would be perfect, but also a way to plug in a set of video goggles at the same time. This would allow FPV, and an assistant,copilot or bystanders to view on the laptop.

Crashaholic
Oct 25, 2007, 02:17 PM
You sure the radio is going to be good enough for an autopilot? Plan on going beyond visual range? Sensitivity is mediocre at around -100dBm (at 1.2kbps) and output power is pretty low at around 5dBm. What kind of range are you shooting for? I would think you would want to be in the neighborhood of -110 dBm sensitivity with around 1 watt of output power.

You arent going to be happy about the price but this is the type of modem you should be looking at:

http://www.sparkfun.com/commerce/product_info.php?products_id=559

And go with an interface to a standard device (laptop/PDA). I think you will be MUCH happier with the developent process.

zik
Oct 25, 2007, 05:48 PM
Hi small_rcer, as it happens I changed the design a couple of days ago to use the use one of the Hope RF pressure sensors. The one I chose is slightly cheaper than the MS5540B I was using but most importantly saved me a couple of I/O lines which I needed for the new radio. It's slightly less accurate than the MS5540B but it's still fine for the job.

Hi Medve, it's almost like you read my mind! FPV is on the cards once I have this first version of Flying Fox up and running. I'm already getting the gear together. Stay tuned for more news on this once I release Flying Fox.

Hi Crashaholic, Australian law requires that model planes be within vision of their operator at all times. I'm not sure about the law in other countries but I suspect it's similar. The radio I've chosen is good for visual range and it's a tenth of the price of the one you suggested. I want Flying Fox to be an affordable hobbyist project so keeping it as cheap as possible is pretty important.

If you're looking for greater range you may want to wait for my next autopilot "SkyBot" to be completed - this will work at long distances from the operator. Just (ahem) don't break the law with it by flying it out of your sight, ok? :)

For people who want to use a more expensive radio I might set things up to allow an easy mod so you can use any 3.3V serial radio modem you like. Is that helpful Crashaholic?

Crashaholic
Oct 25, 2007, 06:05 PM
Ya, I am aware of the laws. The radio you picked is good for 200-300 meters or so making some assumptions about the antennas. Realize that this is only about two football fields. I know that I fly further away than that on a regular basis. I have a feeling you may be end up realizing that the radios are inadequate later and i would recommend that you leave your architecture open to an upgrade in the future. I understand what you are saying about cost but the comms component is not the place I would choose to save money. TI makes some parts that are really easy to work with, are pretty cheap, readily available in pieces or more expensive modules for prototyping, have great sensitivity, and more output power. They could easily triple your range. I know that US law doesn't require FCC approval for hobbyists...not sure about Aussie law.

Anyway, I will drop the issue unless you want to pursue it further.

Crashaholic
Oct 25, 2007, 06:07 PM
For people who want to use a more expensive radio I might set things up to allow an easy mod so you can use any 3.3V serial radio modem you like. Is that helpful Crashaholic?

:cool: you were adding to your post while I was typing. I would highly recommend this. Actually, this is slightly more work but you may want to leave a SPI interface open as well :)

zik
Oct 25, 2007, 09:08 PM
I would highly recommend this. Actually, this is slightly more work but you may want to leave a SPI interface open as well :)

Done. Serial and SPI interfaces will be available for people who don't want the standard radio. An I2C interface is already available as standard by the way. That's a lot of interfaces for a little autopilot!

I don't particularly intend Flying Fox to have every possible bell and whistle. Fancy autopilots cost big money. This one's intended to be a cheap, easily modified autopilot with the kind of features a hobbyist needs.

Before I started on Flying Fox I was working on my SkyBot autopilot project. This is a much more serious design with loads more servo outputs, more failsafes, a three-axis magnetometer, camera interfaces, airspeed sensor, better gyros and a honkin' big MaxStream radio. It's great to have all this nice gear but it's much, much more expensive than Flying Fox. I figure Flying Fox will do what most people here need and if they want more they can add their own mods. It's better than spending thousands on a "real" autopilot.

vector_vortex
Oct 25, 2007, 10:23 PM
zik,
I just finished my uni UAV communications system project, I used the HP-03D hope RF modules, I have full code and schematics for interfacing with these modules if you want, the data sheet has a bit to be desired.
Also,
I have released the first version of my UAV control software, written in java, it's very pre-alpha but you are welcome to modify as you wish, it's GPLed
you can find it all here,
http://members.optusnet.com.au/j2na/joel/Joel.html
have fun
Joel

zik
Oct 25, 2007, 11:01 PM
Hey nice job Joel!

Also I recall you suggested the Hope RF pressure sensors to me ages ago. I ended up using them so thanks for the suggestion.

zik
Oct 26, 2007, 01:03 AM
I've been thinking about the radio question some more. I think I'll design an expansion board which will allow the Aerocomm 1W module to be connected in place of the Hope RF one. Up to 40 miles range - that should make Crashaholic happy!

I'll design the ground station to accept either radio module. The aerocomm one will probably need an extra power supply. The aerocomm gear will cost about $160 extra so it's quite an expensive upgrade. Meanwhile I'll keep the cost of the standard system as cheap as possible.

vector_vortex
Oct 26, 2007, 07:40 AM
Aerocomm AC4790 is AUD$138 in single unit quantities from the australian distributor, Tekdis, for your info, the max current draw is 1.38 Amps 100% transmit duty cycle,I prefered the Aerocomm to the Maxstreams as the Aerocomm ones can produce the full power output at 3.3V, the Maxstreams need 5V to do this. powering everything off 3.3V makes life much easier. I recommend you allow the expansion board to use the CTS, Reset and Command/Data pins that way users will have more control over the radio via software.
Zik, the sensors worked pretty well for cheapies, I got a good 12.01 Pascals Per metre rate over 16 metres with the trend looking very linear.

Have Fun

Joel

zik
Oct 26, 2007, 08:39 AM
Hi Vector,

Mouser sells the AC4790 for US$77.50 each, which is pretty reasonable (and a lot cheaper than Tekdis!). And since the American dollar is practically the same at the Aussie dollar these days it's a steal.

Your comments about controlling the aerocomms are noted. I have A Cunning Plan which will make all this work out.

One thing which irritates me about the aerocomms is that their quoted power ratings are baloney. When they say 200mW they actually mean 100mW since they're quoting EIRP, not power output. When they say 1W really it's just 743mW. Which is pretty decent power but I wish they'd just say 743mW instead of spinning it.

I'm knocking together the schematic for the ground station at the moment. Stay tuned.

zik
Oct 27, 2007, 10:47 PM
Here's a first cut of the ground station. For most users the basic circuit on sheet 1 does everything they'll ever want. It plugs into a PC as a USB dongle and has a radio to talk to the plane.

More ambitious users can add a bunch of options:

* Long range with an Aerocomm radio module
* PDA interface for handheld operation
* Head tracker for FPV flight
* GPS for "find the moving operator" fun
* Automatically track your plane with a servo controlled high gain antenna
* Magnetometer option to automatically point your tracking antenna in the correct direction (can't be used with the PDA option)

The basic ground station with none of the extras is designed to be small and cheap. The PDA version is slightly more expensive since it adds a "host USB" interface. One you have either of the basic units you can easily add the other options from there.

zik
Oct 29, 2007, 06:39 AM
Here's the aerocomm adapter board. It plugs in where the normal radio goes and allows any of the AC4490 or AC4424 series radios to be connected. The AC4490-1000 has a claimed range of up to 20 miles (or 32 km) so that should make the long-range crowd happy.

The chip I'm using here is an SPI UART. It's a cheap and easy way of providing the serial I/O and all the control signals necessary for the radio. A low-dropout regulator is used to bring the 5V off the main board down to the 3.3V at 1.5A required by the radio module.

This adapter plugs straight into both the Flying Fox autopilot board and the ground station. People who want to use the aerocomm modules would buy two radios and two adapter boards. From there it's just plug and go.

vector_vortex
Oct 29, 2007, 07:58 PM
Looks good Zik,
howabout a separate switchmode power supply for the Aerocomm module instead of linear?, it's going to be generating a lot of heat with 1.5 Amps running through it. Also the reset signal needs to be either high impedance or logic high for a reset, not high/low as was my mistake, make sure that your outputs can easily be switched to inputs. Also the AC4790 datasheet specifies pins 6 and 19 as do not connect pins however I have taken pin 6 to an input pin with no ill effect.

zik
Oct 29, 2007, 08:23 PM
Hi vector_vortex,

The average current drain with the AC4790-1000 is only likely to get up to around half an amp in normal use. It peaks at around 1.5A while transmitting. The voltage drop across the regulator is only 1.7V so the likely power dissipation comes to under 1.5W. Basically it'll need a small heat sink in your average well ventilated plane. That's only for the largest aerocomm radio - the other aerocomm radios won't have any problems.

I considered a switching regulator but it's always risky to have a switcher near a sensitive radio receiver due to potential EMI (radio interference) problems. I figure people may use a uBec or similar switcher to get the 5V supply on their plane but that's probably far enough away to not be such an EMI risk. Since this regulator has to be close to the radio it must have low EMI. I figured a linear regulator was the best way to minimise the risk of interference while also keeping costs down.

Still, it's all a work in progress so we'll see how things go in practice. If heat's an issue in the prototype I'll change to aerocomm's sample switcher design. It's more expensive, larger and requires a higher input voltage so I'd like to avoid it if I can.

zik
Oct 29, 2007, 10:52 PM
It just occurred to me that the radio itself will be dissipating about 4.7W in heat as well. (5.5W total power consumption, .8W radiated as RF) So the 1.5W from the regulator is looking pretty cool by comparison. I'll still have to make sure the regulator has a decent copper plane to radiate from but it should be fine.

zik
Nov 05, 2007, 04:54 PM
Mini-update: I'm currently doing another board layout. This will add the new radio and altimeter while solving some problems I had with the first version. Doing the layout and routing takes a long time...

zik
Nov 11, 2007, 09:13 PM
Mini-update: Still working on the new board layout in between messing around with changing all of my development tools. I want to provide the ability for people to use JTAG programming if they want (some people were keen on this) so I'm in the process of changing all my setup to JTAG-based tools.

vpatron
Nov 11, 2007, 10:24 PM
Hi zik, your project is excellent and very close to what I have been looking for!

Have you considered using simple audio FSK and on the ground end use a sound card to decode the FSK? Take a look at this plot: http://www.nortap.com/AGWTracker

This is using the TinyTrak3 from www.byonics.com to encode the GPS, and then on the ground using AGWPE Packet Engine (http://www.elcom.gr/sv2agw/) and his mapping program.

My point is that many RC aerial photographers and FPV pilots already use a video downlink that has an existing and usually unused audio channel. Why not use it to send telemetry down?

And there's code out there to decode FSK using the PC's sound card. Can't get cheaper than that.

Can your autopilot work without the thermopile sensors? I shoot often in hilly areas and those darn Copilot things just don't work very well because of the terrain. Attached photo is from a shoot last week. The airplane we use is very stable and self-leveling and very slow. I took off and landed right in the middle where you see two cars between the trees.

I basically am looking for something that can make the plane go straight or in large circles at the flip of a switch without having to upload waypoints, so we can shoot totally around a subject.

Thanks!

-Vince
www.nortap.com

harryn
Nov 12, 2007, 12:16 AM
Hi, Thanks for all of your work on this - very interesting read.

I am just curious, I have a friend who is a bit "excessively" interested in GPS, and raves about the SiRF III chip set, and fankly, was not all that impressed by the Atmel version. Do you happen to know if there is an advantage of one approach over the other ?

Thanks