PDA

View Full Version : Xbow MicroNav


clolson
Oct 26, 2005, 10:41 AM
Well I got my micronav + stargate all plugged together and running last night. The stargate runs linux so that is very cool. I connected it to my laptop via a serial cable, but I could have just as easily configured a net connection or even wireless. The stargate support CD comes with an ARM cross compiler for the stargate which is all setup to run under linux. Since I'm running linux on my laptop, that is perfect. I was able to make trivial modifications to their avionics code, upload it to the stargate and verify that the new version runs correctly. These are all *very* small victories, but it's all the stuff you have to figure out before you can do anythinig useful. With the supplied passive gps antenna hanging out my window I was able to get a gps fix.

For anyone considering this product: know that the supplied autopilot code is hardwired to fly a zagi (electric powered flying wing.) You should be able to rewire it for other aircraft (and they have a mechanism for tuning gains in the air) but you'll need to set yourself up to do some coding to make use of this device. Don't expect to be up and flying 5 minutes after the FedEx guy drops the box off at your door.

My current plan is to dump their autopilot and groundstation in the trash immediately. What's there is a quick hack job. if you know anything about graphics, they redraw their ground station display using "single buffering" so it's almost impossible to look at for more than about 2 screen repaints (i.e. about 1/5th of a second.) However, they are trying to do the software end of this device as "open-source" so there is great hope for better community developed software as we move forward. But that always takes time.

All in all I see tremendous potential in this device. But I have the engineer's vision of what it will look like in the end (obscuring my view of what it looks like now). Right now my wife sees a couple circuit boards with blinking lights taking up room on her kitchen table. It will remain to be seen how long it takes for my wife to also see a really cool autonomously flying vehicle ... not that she is all that anxious anyway ...

Curt.

Unterhausen
Oct 27, 2005, 03:12 PM
Do you know how to configure the network between the windows code and the stargate code? I know the windows program uses the network, but I didn't see any address info anywhere. If it's a server, then the stargate needs to know the address of the windows machine. I know you say you're not using the windows part, but I'd like to make it work before I start modifying it. It does look like a lot of the good software is already written for linux.

Does the avionics code have a command line interface? How did you see that the gps was running?

I spent the morning trying to download the avionics software into the stargate. Ouch. Turns out the wireless network wants an explicit "rate" command, at least with our network.

The stargate doesn't run an sftp server so I had to use scp, which didn't work either (windows software). So I still didn't get the avionics software on the stargate. I probably should fix up the network on the linux side of my laptop. Maybe I'll get the avionics loaded this weekend.

I have to load the latest version of the firmware onto the uNav, hopefully that will work ok.

clolson
Oct 27, 2005, 05:47 PM
Do you know how to configure the network between the windows code and the stargate code? I know the windows program uses the network, but I didn't see any address info anywhere. If it's a server, then the stargate needs to know the address of the windows machine. I know you say you're not using the windows part, but I'd like to make it work before I start modifying it. It does look like a lot of the good software is already written for linux.

Does the avionics code have a command line interface? How did you see that the gps was running?

I spent the morning trying to download the avionics software into the stargate. Ouch. Turns out the wireless network wants an explicit "rate" command, at least with our network.

The stargate doesn't run an sftp server so I had to use scp, which didn't work either (windows software). So I still didn't get the avionics software on the stargate. I probably should fix up the network on the linux side of my laptop. Maybe I'll get the avionics loaded this weekend.

I have to load the latest version of the firmware onto the uNav, hopefully that will work ok.


I don't want to sound like I'm any sort of expert here, but let me try to answer your questions as best as I can.

It looks like in avionics.c you have to hard code the IP address of your ground station. I don't have windows running at the moment, but I think the ground station must have had some gui option for setting the IP address of the stargate. If you are asking about how to configure the basic networking on the stargate or on windows then that is an entirely different discussion. I could probably rummage around the /etc directory on the stargate and refresh my memory on that side. I won't offer any advice on windows lest I inadvertantly invite more windows questions. :-)

main() is located in avionics.c and that shows evidence of a piss poor command line processing loop. But I keep telling myself that these guys are "inertial" engineers, not software engineers. The guy who wrote this code knows all about kalman filtering and I'm not sure if the human brain is capable of understanding kalman filter and software engineering both at the same time. I know my brain can't do kalman filtering at all. :-) You will know that the gps is working when the avionics program starts dumping out gps positions and altitudes. I hung my antenna out my window for a while and eventually it took off and started working. I assume I'd get a position quicker out in the field where I'm clear of obstacles.

I had no problem running scp from cygwin (I think.) Now I can't remember how I originally got the avionics program over. I know ssh-ing into the stargate works fine from both windows and linux.

Remember your old dial up bulliten board days? You can run hyperterminal or something similar (they gave us something called SecureTTY (or Secure-something or other) that does serial communication to talk to the stargate) it also seemed to support ssh and other connection schemes. But connect up and over the serial line, login as "root/rootme". Then type "rz" at the stargate root prompt. Finally, escape back to on your modem program you can upload a file with the "zmodem" protocol. Ahhh, that brings back fond memories of cycling through my 100 number local bulliten board list in the evenings trying to find one with an open phone line ... :-)

Firmware loading worked great for me, but That was with Jung Soon Jang @ Xbow looking over my shoulder. I think we were plugged into the unav directly and hadn't powered up the stargate yet. I'm not sure if it's possible to upload new firmware to the unav via the stargate???? That would be a useful thing though ...

I don't know why scp wouldn't work for you ... perhaps you could try the cygwin ssh package and see if you have better luck with that?

Hope that helps,

Curt.

Unterhausen
Oct 28, 2005, 10:00 AM
I think the network must be hardcoded on both ends. I know when I write networking software, that's always the way it starts out, then I add configurability later. I'd fix the windows code for them, but the darn thing doesn't run when I recompile under my system. Fortunately, they were too lazy to clean the package before they zipped them up, so the executable is still in there.

I think I just had trouble with the particular version of scp I was using. We did get it working from another computer with cygwin, but of course the code wasn't on that computer. I'll either install cygwin or find another program that works.

There is a program called uisp (sp?) which the AVR guys use for programming the chips. That should work from the stargate. I know you can program the xbow sensor nodes from the stargate.

Unterhausen
Nov 01, 2005, 02:25 PM
I got my laptop talking to the stargate over wireless. I didn't upgrade the micrnav firmware. It worked with the ground station software. I didn't take it outside, so I didn't see the effect of gps. The ground station software does need double buffering pretty badly, my eyes are screaming for mercy. There was a fairly significant oscillation in the yaw direction, don't know if that's going to go away in an airplane and with a firmware update or not.

I was glad to see that the stargate daughter board does work with the micronav. I'm going to see if I can get the webcam working next.

clolson
Nov 01, 2005, 02:42 PM
Yaw is typically really hard to do well in the lab. There are much more expensive devices that need 30-60 seconds of substantial motion before the yaw values will be locked in and fairly close. For our UAV project which is currently using something called a MIDG which is in the $6000 range, the takeoffs have a 30-45 degree yaw error which slowly goes away after the climbout and first turn.

So if you are seeing weird yaw values in the lab where it's hard to get good magnetometer readings and there's no motion and no gps, I wouldn't count that as too big of a strike against the device. It's really tough to calibrate yaw in any meaningful way under these circumstances.

Unterhausen
Nov 01, 2005, 03:37 PM
It's possible that some excursions are as big as 30 degrees, but I think it's more like +/- 5 degrees. I'm probably missing something here, but why would yaw be a problem? The device was sitting next to a monster computer, but it has an lcd screen so I don't know how bad the emi really would effect the magnetometers.

clolson
Nov 01, 2005, 04:25 PM
Again, I'm no expert in this area, but the mems gyros and accelerometers on this class device and even devices up to or exceeding several additional thousands of $$$ have a lot of noise, drift, random walk, etc.

These devices sense acceleration, so to get velocity (rotational and translational) you need to integrate the noisy acceleration data. Then to get positions and rotations you need to integrate again. Those non-trivial errors in the raw sensor output get magnified very quickly.

Now what saves you with these devices is having other observables to calibrate against. For instance, let's say that with pure accelerometer data and integrating, over the course of 10 minutes you find your self 100 miles off in position. That's bad. But let's say you have a gps that is giving you a new position every second. You can recalibrate your acclerometer error every second and hope that within the next second you don't drift too much and your computations are pretty accurate.

So sitting motionless in a lab environment with noise and probably poor magnetometer sensing, how do you recalibrate yaw? You don't have any accelerometer data other than noise. You don't have any gyro data, again other than noise. You don't have gps. And your magnetometer data is suspicious at best. For roll and pitch you can sense the force of the table pushing up on your sensors. This gives you a relative gravity vector and allows you to calibrate roll/pitch. But you can't do the same thing with yaw.

I will just assert that you could spend $6000 on a midg sensor and have even screwier yaw values in the lab. In fact, even in the field, when the midg powers on, you see the yaw spinning slowly and aimlessly. It's not until you start seeing substantial movement ... i.e. 30-60 seconds of flight before the yaw really starts to zero in on the true value. I would suggest that you take the unit outside in a real environment, get a gps fix, and move around a bit before worrying too much about the yaw value. If you ultimate application is indoor, then you might be stuck with yaw damping as the best you can do.

I'm probably not answering your question very well, but if you aren't satisfied with my answer, I'd suggest you pick up the phone and talk to an expert at crossbow. They were really nice to me (at least when I was shopping for a unit.) :-) They could probably explain much better the underlying reasons for the performance you are seeing.

Regards,

Curt.

Unterhausen
Nov 02, 2005, 03:05 PM
I see what you are saying. Yaw would be more problematic than pitch or roll because there are no redundant sensors. Pitch and roll gyros and magnetometers have accelerometer readings to keep them honest. In flight, the GPS and other sensors should help the yaw reading.

I know one of the magnetometers was a lot more noisy than the others. Don't know which one.

I wasn't disappointed.

Vindication
Nov 02, 2005, 05:29 PM
Just thought I'd throw this in here as a note-- the GPS readings cannot really keep the yaw gyro "honest" because gps shows groundtrack whereas the actually direction of the nose/heading of the airplane may be different...

Vind

Unterhausen
Nov 03, 2005, 12:41 PM
Depending on how the Kalman filter is set up, the gps heading should bleed back into the yaw measurement. Or else you have to do some hard-over banked turns to figure out what the yaw really is, woo-hoo!

I was looking at the control code. I was concerned when Curt mentioned that they had a flying wing and mixed elevators and ailerons, but they do the mixing in two lines of code just before they send the command, so it's easy to undo. Most of the adaptation for a different airframe needs to be done in Control.c.

The nav functions use the Magnetic Declination of Stanford in a few places. guess I have to figure out what that is around here, or live with the inaccuracies.

Vindication
Nov 03, 2005, 03:22 PM
Yeah, it does bleed back in. But this is not really a true "yaw" measurement. Rather it is your ground track. If you are "crabbing" into the wind, it will not reflect this at all. Thus your heading is not how the plane is facing, but where it is traveling...

Unterhausen
Nov 03, 2005, 03:59 PM
I was just looking up the magnetic declination for State College Pa. it's 10 degrees instead of the 15 degrees for Stanford. But fortunately, it's not moving. http://www.ngdc.noaa.gov/seg/geomag/jsp/struts/calcDeclination

Vindy, the autopilot doesn't crab, so I win! I understand what you're saying, and you're right, the GPS heading only reflects your ground track.

Vindication
Nov 03, 2005, 04:24 PM
Unter-- perhaps calling it crabbing was not quite right... You see the airplane heading is always pointed DIRECTLY at the Waypoint. Now if there is a crosswind then the airplane is blown off course. THIS MEANS THAT THE HEADING WAS TOWARDS THE WAYPOINT, BUT THE GROUND TRACK WAS AFFECTED BY THE WIND AND WAS NOT ENTIRELY TOWARDS THE WAYPOINT.

Now if you correct the Heading w/ the GPS groundtrack heading than the "heading" on the airplane is towards the waypoint AND so is the groundtrack, but this heading is not the true heading of the airplane.

So in other words, using accel, gyros, and gps there is no way to keep your heading "honest". Now magnetometers probably have the ability to correct all this. However, they are pretty noise sensors aren't they?

Dunno if I explained that very well...

-Vind

Unterhausen
Nov 03, 2005, 05:13 PM
Like I said somewhere, two axes of the magnetometers are very stable, the other one is a little noisy. If I was designing a imu, I'd definitely put them in, particularly since you can get a 3 axis module. They are affected by local magnetic fields, so I'd probably want to accomodate that somehow.

It looks like I'll be getting some parts from sparkfun, turns out they accept purchase orders, but only for $1000 or more, gotta buy everything in sight.

AeroJDK
Mar 10, 2006, 03:08 PM
I'm considering puchasing one of these units...does anyone who has one have any more feedback on it? I'm definitely into the coding side of things, so I think this unit would be perfect for the control system that I'm looking to create since it drives servos directly from the system.

AeroJDK

clolson
Mar 10, 2006, 03:41 PM
I'm considering puchasing one of these units...does anyone who has one have any more feedback on it? I'm definitely into the coding side of things, so I think this unit would be perfect for the control system that I'm looking to create since it drives servos directly from the system.
AeroJDK

I haven't flown our micronav/stargate yet, but I'm hoping to get it in the air this spring. So I can answer a few questions, but don't consider me any kind of an expert. That said, I'm happy to share my opinions on any question you may have with the device.

Curt.

MattChave
Mar 12, 2006, 09:32 AM
Now magnetometers probably have the ability to correct all this. However, they are pretty noise sensors aren't they?

In short NO. You guys seem to be having a lot of trouble with magnetometers. What are you using?
remember your looking for an update frequencey of 20Hz so a sampling frequencey around 40Hz, And if you remember that c=freq*lamba you'll see that there arn't many good antennas out there to cause your noise, also I'd be pointing out the obvious when I say the average of an oscillating signal is zero of course.

We primarily use magnetometers for attitude control. Actually our current control system, as far as we have tested up too, only uses 3 magnetometers and thats all. This gives us heading and pitch which is very accurate (less than 1 degree). We use a roll stabalised plane, that way we dont need ailerons. It has no drift and is instantly ready to go, also if you calibrate it inside a building and at your lab desk then it will work perfectly, just as if you were outside (which really helps debugging).
If your interested you might like to look at http://uav.bravehost.com
I'd really like to know if anyone else is using a similar technique?

Unterhausen
Mar 13, 2006, 10:27 AM
buying a receiver that works with the micronav has taken months due to the bureaucracy. Hopefully we'll have ours working soon.

The thing about magnetometers is that there can be local perturbations of the readings. But I guess that wouldn't affect pitch as much as heading.

MattChave
Mar 17, 2006, 10:39 PM
The thing about magnetometers is that there can be local perturbations of the readings. But I guess that wouldn't affect pitch as much as heading.

Local anomalies are actually quite well mapped using the worlds 12th order spherical harmonic model of the main field.
small anomalies are not a problem becuase provided we have some altitude above them their magnitude is going to drop of with 1/(r^2) and their direction difference drops off with 1/(r^3) from memory.
Not sure about heading being more influenced than pitch - could be dependant on the shape of the perturbation, what we're talking about of course is large iron deposits so it depends how well these are mapped or the altutude that you fly i guess.

Unterhausen
Mar 23, 2006, 04:17 PM
Matt,
I suppose walking around in the lab with a magnetometer may have given me the wrong idea. From doing that, it certainly looks like you could get wacky results, but then again, I'm not flying in the lab.

MattChave
Mar 24, 2006, 07:07 AM
seems noone else uses them for more than one axis.
Yep the magnetic fields inside can get a little hectic. When I sit at my desk and measure the fields it changes by 90 degrees over 1m, I havent really tracked down the source, but it is the physics deptartment, and theres sometimes some whiring electric engine noise 1 floor above me so wouldnt be too surprised if its that.
try going out into the open field and see how you go.