Successful flight testing of MatrixNav is complete. MatrixNav is open source C firmware for the UAV DevBoard that provides pitch stabilization and return to launch functions for inherently stable aircraft that are controlled by rudder and elevator. MatrixNav is built on top of a method for integrating gyro signals into orientation information called direction-cosine-matrix (DCM). Flight tested firmware and documentation are available.

A dozen test flights were made with an electric powered Gentle Lady under the following conditions:

1. Both calm and windy conditions.
2. Powered and gliding.
3. Return to launch with the plane pointing away, toward, or perpendicular to me.
4. Circling behavior under RTL control after the plane crosses the launch point.
5. Hand launch in both manual and pitch stabilized modes.
6. Landings with pitch stabilization turned on.

MatrixNav completely solves an issue that I wrestled with in previous versions of my firmware: gyro cross coupling during a banked turn. If you attempt to use a pitch gyro signal to stabilize the pitch of a plane, it will measure a portion of the turn rate of the plane during a banked turn, and will cause the plane to dive into a turn if the bank angle is too great. The use of direction cosines eliminates the cross coupling and makes it simple to achieve a level turn at any bank angle.

Furthermore, since MatrixNav relies mostly on gyros, not accelerometers, I was finally able to turn on pitch stabilization during hand launch.

I added a feature to give the plane a kick during return to launch: you can program in the return to launch pitch angle. By deliberately pitching the nose down a bit, you can increase the return speed to better penetrate the wind.

MatrixNav is intended for you to either use as-is, or to serve as the starting point for your own projects. So if you have a UAV DevBoard and want to use it to do some flying of an inherently stable plane, you will definitely want to try out MatrixNav.

By the way, the MatrixNav documentation is not up-to-date about what the LEDs will do. Sorry about that, I really don't look at the LEDs anymore, they are usually hidden in my plane. Here is what they do:

1. The LED on the EM406 will go out entirely, because MatrixNav puts the GPS communications in binary mode.
2. Both LEDs on the the dev board will come on briefly during power up, to self test them.
3. After power up, the green LED, stat2, will indicate whether or not MatrixNav is receiving valid pulses. It will be on continuously if there are valid pulses, otherwise it will go out.
4. After power up, the red LED, stat1, will flash a few times, and then go out until the GPS is locked, and then it will resume flashing.

After power up, MatrixNav goes through an initialization process that waits for both GPS lock and valid radio pulses. When pulses are received and when there is GPS lock, the rudder will wag a few times. When it stops wagging, MatrixNav records the present location as the return to launch point and you are cleared for takeoff.

Bill Premerlani

Views: 987


3D Robotics
Comment by Chris Anderson on April 12, 2009 at 10:55am
Congrats, Bill! That's a big milestone crossed. I'd say you have a real working IMU-based autopilot now, which is a real accomplishment. Are waypoints coming next?
Comment by William Premerlani on April 12, 2009 at 11:36am
Chris,

Thanks.

My main interest is in IMU based "copilots" to make flying easier and safer for those of us, like me, with poor hand-eye coordination.

The next thing for me, after I document the theory behind direction-cosine-matrix (DCM), is to meet a challenge that seems to have been raised recently: to accomplish a tight, continuous, banked turn in the horizontal plane, with my board in a neutral stability aircraft.

I also plan to work with Matt Chang to make his Harrier Jump Jet more stable, and with the helicopter community to make helicopters easier to fly.

Regarding waypoints, that is on the back burner as far as I am concerned, though they would be easy to add to MatrixNav. For now, I leave that to anyone else who would like to do it, I would be willing to coach them. What I would like to see eventually happen is for you and Jordi to port the direction-cosine-matrix algorithm to ArduPilot, since you have accomplished so much already in the way of autopilots, and since you have more interest in them than I do. Your ground station is very impressive. I think that DCM would be perfect for an IMU-shield for the ArduPilot, and I would like to work with you and Jordi to bring out its fullest performance potential.
Comment by OlivierD. on April 12, 2009 at 12:49pm
Congratulations Bill, all this is very exciting news. Do you have any videos of the test flights to share?
Looking forward to the marriage made in heaven, UAVDevBoard and Ardupilot together!
Comment by William Premerlani on April 12, 2009 at 1:17pm
OlivierD.,

Sorry, I do not have any videos. I do not have the right equipment for the quality videos that we have come to expect on the diydrones website. I will look into getting something.

Regarding the "marriage made in heaven", I want to be clear, it will be a firmware marriage, not a hardware marriage. I know that Chris has some plans for an "IMU shield", I will let him describe what they are, if he wants. The DCM algorithm will work with just about any accelerometers and gyros. It will achieve complete cancellation of drift. The only thing that really matters is the maximum range of the gyros, it should be large enough to cover the maximum expected rotation rate. The 75 degrees per second gyros on my UAV DevBoard limit the rotation rate that you can track, so MatrixNav uses gyro rate feedback to limit the rotation rate. My next board will have 300 degrees per second gyros, and I would expect that Chris would use gyros with at least that range on his IMU shield.

If Chris and Jordi port DCM firmware to ArduPilot, I will help them. It is my understanding the next generation ArduPilot will have even more processing power, so it should be possible for it to do the DCM calculations along with everything else that it is doing. With DCM integrated with all of the great features that ArduPilot already has, it could be a first-rate IMU based autopilot.

But I do not speak for Chris Anderson, so I invite him to give us his thoughts on the subject.

Chris?
Comment by Jack Crossfire on April 12, 2009 at 2:12pm
What advantage does the DCM have over integrating quaternions?
Comment by William Premerlani on April 12, 2009 at 2:50pm
Jack,

DCM and integrating quaternions produce the same results. The Mahony paper gives them parallel treatment. The advantage of DCM is that the direction cosines are easier to use when you want to transform position, velocity, acceleration, or rotation rate vectors between plane and earth frames of reference. Also, diirection cosines can be used directly for all control and navigation computations. For example, there are two elements in the direction cosine matrix that can be used directly as inputs to pitch and roll leveling. Also, IMO, direction cosines make it easier to do the drift compensation corrections.

One of the objections often raised for DCM is that they require a renormalization step. I have discovered a simple, elegant, effective way to do the renormalization step.

Both DCM and quaternions fully respect the nonlinearities of the rotation group, and give correct answers for all orientations, and are superior to most Kalman filter approaches.

At the end of the day, whether you use DCM or quaternions is a matter of personal preference, I think they are pretty close. I have a personal preference for DCM.
Comment by JC on April 12, 2009 at 2:53pm
Nice work Bill.

How are gyro bias removed. Have you tried integrating a kalman filter, how does the DCM method compare to the kalman.
Comment by William Premerlani on April 12, 2009 at 3:04pm
JC,

DCM and quaternions are nonlinear methods that fully respect the nonlinearities of the rotation group, whereas Kalman filter approaches generally do not. Results with DCM have been spectacular. I have not made any side by side comparison of Kalman and DCM, but the performance of my demos and flights so far have astounding.

Perhaps Jack Crossfire will comment on how quaternions compare with Kalman. DCM and quaternions are equivalent.

With DCM, removing gyro bias is trivial. The bias is detected by taking the cross products of measured and reference vectors. GPS and centrifugal compensated accelerometers are used for reference vectors. The DCM coefficients are used to do any reference frame transformations that are needed. The cross products produce rotations that would be needed to bring the measured and reference vectors into alignment. They are feed back through a PI controller to the input of the DCM nonlinear integration. The gyro bias is exactly canceled out. Details of the gyro bias removal are given in Mahony's paper.
Comment by William Premerlani on April 12, 2009 at 3:29pm
JC,
One more thing: The Mahony paper claims that DCM and quaternions are both superior to Kalman filtering for converting gyro signals into orientation information. IMO, DCM and quaternions will eventually supercede Kalman filtering for implementing IMUs.
Comment by Xander on April 12, 2009 at 8:00pm
Looks very interesting. Once you have the positional info, are PID loops used to actually perform the stabilization or or is there some more direct method of doing so that comes out of DCM?

Comment

You need to be a member of DIY Drones to add comments!

Join DIY Drones

Social Networking

Contests

Season Two of the Trust Time Trial (T3) Contest has now begun. The fourth round is an accuracy round for multicopters, which requires contestants to fly a cube. The deadline is April 14th.

A list of all T3 contests is here

Groups

Advertisement

© 2013   Created by Chris Anderson.   Powered by

Badges  |  Report an Issue  |  Terms of Service