PDA

View Full Version : Discussion Anyone use any of the xbow autopilots


rclinks2002
Sep 01, 2006, 04:36 PM
Hello, Is there anyone out there who can vouch for the features of the xbow MNAV100CA? Or anything in the similar price range?

Thanks
Ben

Unterhausen
Sep 01, 2006, 06:14 PM
I'm working on getting my micronav ready to fly. This will be a boring post, because I'm trying to think of all the things I need to do to get the plane to fly. Put the pressure tube in the wing today. I've got a lipo with a BEC to power the receiver, Stargate and micronav. I'm going to try to get all the hardware finalized on Tuesday and fly sometime next week. I've got to get the control system worked out as well. The software as written has control code for a elevon plane, so there is elevator/aileron mixing in the code. This is an easy change.

I know people say they are flying with the Micronav, and Crossbow certainly is flying with it.

clolson
Sep 02, 2006, 12:41 PM
Yesterday I got my stargate board upgraded to Release_7.3 from platformx.sf.net The kernel from this release includes the batmon.o driver so you can "cat /dev/platx/batmon" to get your battery voltage. I'm very happy about that because I really don't like guessing about my batteries when so much equipment (and labor) is at stake. Unfortunately one of the students here fried our unav so we have to send that back for service. :-(

I'm pretty sold on the unav as a "low cost" uav controller which does a pretty good job of balancing performance, quality, functionality, good calibration, good vibration tolerance, good temperature compensation, and of course cost.

That said, we haven't actually flown yet with a unav setup as PIC.

Curt.

rclinks2002
Sep 04, 2006, 01:54 PM
So with the xbow, it has stabilization built in? also does the included software provide an adequate means to control the autopilot? Lastly, is the starboard required to connect the unit to a radio modem and control it that way?

Thanks
Ben

Unterhausen
Sep 04, 2006, 08:56 PM
The Kalman filtering code runs on the stargate. I believe you can get it to run on a Gumstix which is a lot less money, not as convenient.

I wouldn't say there is any stabilization code in this system, I think they are pretty much counting on you having a stable platform, and not getting it too far out of shape.

clolson
Sep 05, 2006, 10:48 AM
So with the xbow, it has stabilization built in? also does the included software provide an adequate means to control the autopilot? Lastly, is the starboard required to connect the unit to a radio modem and control it that way?


Hi Ben,

The micronav is "just" the sensor head and just provides the raw sensor data (and thus is a bit noisy.) It also can read your receiver signal (control inputs from the transmitter) and can drive several servos. And it has static and dynamic pressure ports along with everything else. It's a pretty nifty all-in-one unit.

The unav sends all it's sensor data (via a serial connection) into the stargate board (or optionally a gumstix or pc if you want to do a bit of extra work) and all the sensor integration and kahlman filtering runs on the stargate (gumstix/pc/etc.)

The stargate code is all open-source (linux/unix) so you can examine it, compile it, modify it, port it to other platforms (i.e. gumstix or pc).

Along with that code to filter and integrate all the sensor data is an autopilot module. This code is also open source and by default is setup to pilot a flying wing. I've actually seen this in action and can vouch that it works pretty well. The zagi (flying wing) is not exactly a stable platform and the code and sensors and everything will keep up with it to hold an altitude, hold a heading, fly a route, etc. They demonstrated many flights with zero crashes over the course of a 2-day session.

The autopilot code is also open-source so you can get in there and modify it for any airframe with any oddball control surface configuration you like. That takes some understanding of programming and PID's, but it's all very straightforward stuff if you know anything about software and PID's. There's nothing clever or hidden or magic in their code.

I personally plan to completely rip out the xbow autopilot code and replace it with the FlightGear autopilot code which I feel is more sophisticated and better developed and tested (at least in simulation.) :-)

The micronav can be rigged to output to a standard serial port, so you can feed this directly into a radio modem. Some guys here have done exactly that on a yard stick and were able to fly the unav and passively collect data to their ground station.

Or you plug the unav into the stargate and the stargate itself has an extra serial port (+ usb + pcmcia + probably a few other interfaces.)

The xbow folks have their zagi/flying-wing demonstation unit rigged up to use a pcmcia wireless card for the ground station communication, although that has all the obvious range limitations.

The really neat thing (in my view) is that all the source code running on the stargate (kahlman filtering, autopilot, ground station communication, etc.) is open-source and available to examine, modify, and change. This makes the unit incredibly flexible and powerful and adaptable to new airframes and applications. However, it also puts a little more burden on the developer to pull all the pieces together into a working system.

Curt.

Unterhausen
Sep 05, 2006, 03:36 PM
Curt, very nice writeup.

I also like the open-source aspect of the micronav. Everything is open source, micronav firmware and stargate nav code. We were looking at competing products, and never bought them because of the problems with source code. Of course, the downside is I'm stuck re-learning things I last used in 1985.

Unterhausen
Sep 21, 2006, 11:05 AM
Is anyone aware of any simple code to get data from the micronav? I could hack the avionics code, but I'd rather not at this time.

I'd like to be able to excercise the servos and do calibration without using microview. I think the version of Microview that is easily available doesn't work with the current firmware. It's so much easier to talk to the micronav throught the stargate.

Anyone know how to do the hard iron calibration for the magnetometers? I'm trying to find out what the constants in the software actually mean.
Code has these constants, I take it they are corrections to turn an oval into a circle or something like that:
#define bBy 0.0 //-0.4
#define bBx 0.0 //-0.27

Curt, how hard was it to update the firmware on the stargate? I was looking at the link you gave, and it says it has the same kernel version I'm running on my stargate, 2.4.19. Did you upgrade to a newer kernel than that?

Eric

clolson
Sep 21, 2006, 12:03 PM
Curt, how hard was it to update the firmware on the stargate? I was looking at the link you gave, and it says it has the same kernel version I'm running on my stargate, 2.4.19. Did you upgrade to a newer kernel than that?
Eric

I upgraded to version 7.3 of the platformx project. I forget which kernel version that is but, 2.4.19 sounds about right. Once I found the upgrade instructions on the web site, the actual upgrade procedure was pretty straightforward.

Curt.

Unterhausen
Sep 21, 2006, 08:06 PM
Curt,
Thanks. I forget if I mentioned this, but I'm running everything off a 2 cell 2.1 Ah battery. It runs the receiver, stargate and micronav for at least 2 hours. When we timed it, it went 3 hours. I'm using a 3 amp BEC.

I learned way too much about how this device works today. Sitting on the floor of our basement lab turns out to be a crummy place to test code. The Kalman filter doesn't run unless the gps is running. I would like to be able to use it indoors, so I guess I'll be looking at changing that.

cmcnz
Oct 19, 2007, 02:07 AM
Hi Guys, I'm new in UAV. Just wondering where did you order kit? The Crossbow dealer here in New Zealand unfortunately does not know much about the product.

Appreciate your help..

Cheers

clolson
Oct 19, 2007, 07:34 AM
I would think you could contact Crossbow directly: www.xbow.com

Ben H
Nov 02, 2007, 05:20 PM
Hi,
I'm developing a UAV based on a delta wing whiplash model. The UNAV / Stargate system is top of my list for autonomous control unit for 2 reasons, Price (as always budget is limited!) and the flexability of open source code.

I'm not completely new to programming but also certainly no expert. I've played around with programming PICs using picbasic for simple communications and robotic control, and a bit of programming in C within the windows enviroment.

How much trouble is it compiling the open source code onto the stargate? I understand the stargate runs a linux kernel... Do I need to compile from a laptop running linux? or can I do it from within windows?

Where do I save the compiled files (avionics, ahrs, control, etc..) within the stargate file system? I guess they have to be able to find each other in the right place to work together as a system?

Clolson, How are you getting on with your setup? is it flying yet? Any drawbacks?

Hope my newbie questions aren't completely daft!!

Ben.

Unterhausen
Nov 02, 2007, 06:47 PM
Hi,

How much trouble is it compiling the open source code onto the stargate? I understand the stargate runs a linux kernel... Do I need to compile from a laptop running linux? or can I do it from within windows?

Where do I save the compiled files (avionics, ahrs, control, etc..) within the stargate file system? I guess they have to be able to find each other in the right place to work together as a system?

Ben.
You have to set up a compiler on a Windows or Linux desktop to build the avionics program. You have to get the Arm cross compiler toolchain. I have only done it using windows, you set up Cygwin and then install the cross compiler. All the different files are built into one stargate executable. The Stargate is a little linux computer, and you just copy the files over. The easiest way is to use the scp command on Cygwin.

Ben H
Nov 03, 2007, 06:26 AM
You have to set up a compiler on a Windows or Linux desktop to build the avionics program. You have to get the Arm cross compiler toolchain. I have only done it using windows, you set up Cygwin and then install the cross compiler. All the different files are built into one stargate executable. The Stargate is a little linux computer, and you just copy the files over. The easiest way is to use the scp command on Cygwin.

Many thanks for your advice :) , but could you please be more specific.

I have the Turbo C++ compiler on windows, but it won't compile the avionics code. is there a setting I'm doing wrong or do i need a different compiler?

I have installed Cygwin on my machine but I'm not sure how to install the cross compiler (is that the arm-cygwin-gcc-3.3.2.tar.gz file?) :confused:

If you could take the time to post a step by step guide for a newbie like me it would be greatly appreciated.

Ben.

Unterhausen
Nov 04, 2007, 12:37 AM
I haven't done it for a while, so writing a step by step guide isn't practical at this point. Here is the readme from the cross compiler:
How to install:
while running cygwin
cd /usr/local
tar zxvf arm-3.3.2-cygwin.tar.gz (note that tar needs to know where this file is, either cp the file to /usr/local, or add the pathname to the file name) /cygdrive/c gets you to the c drive on windows.
Add /usr/local/arm/<version>/bin to your path to use the cross compiler
You have to figure out what <version> is by listing directories

If you have installed cygwin correctly you there should be a .bashrc in your home directory which you can modify to add change your path or just change it using the normal windows techniques. Once the compiler is in your path, you can run make in the source code directory, and it will build the file.

Ben H
Nov 04, 2007, 04:56 PM
Thanks for your help so far, I found the following information, I've been setting up the toolchain on cygwin. so far so good.. although I get an error (FATAL: unable to open makefile) when trying to MAKE in the ncurses-5.6 folder. Anyone have any sugestions??

I hope the information will be of use to others, :)


Install Toolchain on PC


Linux Installation


This method is the ideal one since it will also accommodate the lnurse class. I haven't tried this on cygwin yet. I will update this once is done. For the time being, I am doing all my compiling in Linux. For those who prefer to not install Linux natively, consider using parallel OS programs like VMWare.
The first step is to download all the required files:


Cross Compiler: arm-linux-gcc-3.3.2 or arm-linux-gcc-3.4.1
Cross Tools: crosstool-0.27-gcc-3.4.1
NCurses: ncurses-5.6


Save these files or move them to the top of your file system i.e. /
Create the directory /usr/local/arm i.e. mkdir /usr/local/arm
Extract the cross tool, crosstool-0.27-gcc3.4.1.tar.gz, to the directory /
Extract the cross compiler now from the / directory, it should default install to /usr/local/arm
Add /usr/local/arm/3.3.2/bin to the PATH environment variable i.e. export PATH=$PATH:/usr/local/arm/3.3.2/bin
You can now compile using the arm-linux-gcc command
Extract ncurses-5.6.tar.gz anywhere. NOTE: This is needed for MNAV versions 1.3+
Navigate into the new extracted folder then run the following command(s):
./configure --host=arm-linux --target=arm-linux --build=i686-pc-linux (or i686-pc-cygwin)
--without-ada --prefix=/usr/local/arm/3.3.2/
make
make install
Copy the ncurses libraries in /usr/local/arm/3.3.2/lib to /usr/local/arm/3.3.2/arm-linux/lib
cp /usr/local/arm/3.3.2/lib/libncurse* /usr/local/arm/3.3.2/arm-linux/lib
All these steps are very time and resource consuming. For more information, read the INSTALL file in the ncurses-5.6 folder. But this is needed for the auto-pilot "GUI" on the Stargate.


Windows Installation


This method I have yet to personally test but should be some what similar to that of the Linux installation. The difference is you will be using cygwin as your command line tool. The cross compiler will be different since you are using Windows.
You will need the following files:


Cygwin
Cross Compiler: arm-cygwin-gcc-3.3.2
NCurses: ncurses-5.6


The installation process is the same as above for the Linux version but instead of using the Linux Bash Terminal you will using cygwin. Therefore, cygwin will have to be installed first before you can install the other components.
Follow the ncurses library files as instructed above but during the configure stage set the build to i686-pc-cygwin.
The installation process will be very time consuming, be patient. If the make or make install process fails, just retry if you are getting a random Win32 error.
Before compiling the files, you will need to make sure the ncurse libraries are in the right place. To do so run the following command cp /usr/local/arm/3.3.2/lib/libnc* /usr/local/arm/3.3.2/arm-linux/lib


Writing & Compiling Files
Compiling files for the Stargate cannot be done onboard. You must compile the files from your PC using the toolchain described above.
You can find an example "Hello World" program and compile instructions are found here.
For the MNAV auto-pilot, you will only have to use the included makefile
Use the make command to compile and build avionics and decoder executable files.
NOTE: This will only work if you have make package and toolchain installed.
The command make clean removes all the objective files that were created during the last compilation and the avionics executable.


Upload Files to the Stargate

After compliling and building the executable avionics file, you can then upload it to the Stargate.
The first step is to establish a wired communication with the Stargate using HyperTerminal or Minicom. The instructions to do that is in the "Configure Hardware" section listed above.
The Zmodem protocol is used to transfer files to the Stargate. The method copies file to the current directory on the Stargate. NOTE: It does NOT overwrite existing files.
After logging into the Stargate, make sure navigate to the directory where you want the files to be copied to then do the following:


For HyperTerminal:


Select the "Transfer" menu
Select the "Send File" menu item.
Set the protocol to Zmodem
Browse for the file of interest
Press the "Send" button


For Minicom:


<ctrl> A
s -- send command
<return> -- select Zmodem
<up/down arrow keys> -- to move the cursor up and down
<space><space> -- to move into the directory at the cursor
<space> -- selects the file at the cursor
<return> -- starts the transfer
-- wait until it completes
<any key> -- exit


After uploading the avionics file, you will have to make sure it is executable by running this command in the same folder chmod +x avionics


Executing the MNAV Auto-Pilot on the Stargate
To use the MNAV auto-pilot, just run the avionics executable.
There are a few options that you can use with the avionics code, you can list them all using
avionics -help
./avionics -option1 -option2 ...
-wifi on/off : enable or disable WiFi communication with GS
-save on/off : enable or disable datalogging in /mnt/cf1/
-screen on/off : enable or disable dumping data to screen
-ip xxx.xxx.xxx.xxx : set GS i.p. address for WiFi comm.
-help : display the help messages

To use the new GUI that uses ncurses also needs you to do the following:
cp proper terminal to the stargate /usr/local/arm/3.3.2/share/terminfo

The stargate already has /terminfo in /etc directory.
The reason that /terminfo needs to be installed in /usr/local/arm/3.3.2/share/terminfo is simply because of --prefix=/usr/local/arm/3.3.2

If you used a different --prefix directory, then you need to install /terminfo to the corresponding directory.

vt100, cp vt100 to /usr/local/arm/3.3.2/share/terminfo/v/.

cygwin, cp cygwin to /usr/local/arm/3.3.2/share/terminfo/c/.

Unterhausen
Nov 04, 2007, 07:02 PM
did you install ncurses? If you didn't, there is a define in the makefile that you need to change. If you did, there is some strangeness with the directories with ncurses that I don't exactly remember. If you read the error messages you get, they should give you the hints that you need.

Ben H
Nov 05, 2007, 02:06 AM
did you install ncurses? If you didn't, there is a define in the makefile that you need to change. If you did, there is some strangeness with the directories with ncurses that I don't exactly remember. If you read the error messages you get, they should give you the hints that you need.

I Extracted ncurses to the / folder. the makefile is listed in the new /ncurses-5.6 folder but it wont make (FATAL: unable to open makefile). How do I open the makefile to edit the define?

clolson
Nov 05, 2007, 06:26 AM
I Extracted ncurses to the / folder. the makefile is listed in the new /ncurses-5.6 folder but it wont make (FATAL: unable to open makefile). How do I open the makefile to edit the define?

I ignored all the ncurses stuff in my own work here, but I think to install the ncurses libs in your cygwin environment there might be a "configure" script you have to run first. If ncurses uses automake/autoconf (many open-source software packages do) then the first step is to run ./configure and that will create the makefiles for you.

Although you do say the makefile is listed. Are you sure what you are seeing isn't a makefile.am or makefile.in file? If the makefile is actually there with that name, then you shouldn't be getting the error you are getting.

Curt.

Unterhausen
Nov 05, 2007, 09:45 AM
good catch Curt. Ben, is there a "Makefile" with a capital M?

You could skip the ncurses for now, there is a define in the xbow makefile, iirc. It complicates the setup on the Stargate, and all it gets you is that the printouts to the screen stay steady.

Ben H
Nov 05, 2007, 03:02 PM
good catch Curt. Ben, is there a "Makefile" with a capital M?

Although you do say the makefile is listed. Are you sure what you are seeing isn't a makefile.am or makefile.in file? If the makefile is actually there with that name, then you shouldn't be getting the error you are getting.

Curt.

The makefile in the /ncurses-5.6 folder are Makefile.in and Makefile.os2. Both have capital M, but I still get the unable to open error.
Are either of these the correct makefiles? I ran the following configure first which I think worked without errors ./configure --host=arm-linux --target=arm-linux --build=i686-pc-cygwin --without-ada --prefix=/usr/local/arm/3.3.2/

Curt,

I've been watching with interest your site about your code for Mnav and Gumstix. It sounds real cool :cool: !! Is your code likely to be available as open source or to purchase? If so when and where?

Thanks for all the help guys :)

Unterhausen
Nov 05, 2007, 04:13 PM
you need a file called "Makefile" no extension

you might wanna follow the directions from someone who has built on cygwin


Anyway, if you just want to build without ncurses, the changes you need to make are in the MNAV code, forget about ncurses.
You have to change globaldefs.h
there is a line that says #define NCURSE_DISPLAY_OPTION, which you can simply comment out. You might have to change that makefile which has a -lncurses, but I think that's ok

pmurray80027
Nov 05, 2007, 11:52 PM
Here is a very complete tutorial I found on the Stargate board:

http://www.pages.drexel.edu/~ttl28/tutorials/stargate-tutorial.html#config_software

pmurray

Ben H
Nov 06, 2007, 02:11 PM
I'll take your advise and leave the ncurses for now.

I'm not sure the cross compiler is working right. I tried to MAKE avionics, there was a pause for half a second before returning to the command prompt, no errors but I cant find an executable file anywhere??

I think I'll get another removable drive for my laptop, install Linux and try again from there.

I've noticed that the Stargate has been discontinued by xbow!

so it looks like i'll have to use a gumstix now. Does anyone know if I have to use the PXA255 gumstix, or will the later PXA270 Gumstix work with the code?

Unterhausen
Nov 06, 2007, 03:37 PM
executable is just called avionics with no extension -- you should get error messages if it really didn't build

The verdex gumstix should work fine. Nice thing about it is that it has a usb host port, so you can use usb peripherals.