Error Covariance

41 views
Skip to first unread message

Cory Gillette

unread,
Sep 16, 2019, 10:50:24 PM9/16/19
to OpenStartracker
Hello,

My name is Cory Gillette. I'm volunteering at the Portland State Aerospace Society, working on our CubeSat project. We're implementing openstartracker in our attitude determination system, and I had a question for you.

I'm pretty new to this still, but I'm working on constructing a Kalman filter for attitude estimation that uses your program for its observations. However, I'll need to provide a covariance matrix for attitude error angles, based on star tracker measurements. To be clear, by 'attitude error angles', I mean a rotation vector encoding the deviation of estimated attitude from true attitude.

For posterity's sake, that process is detailed in section 6.2.1.1 on page 242 of Fundamentals of Spacecraft Attitude Determination and Control by Markely and Crassidis, or more rigorously (but equivalently) in "Attitude Error Representations for Kalman Filtering" by Markely on page 5.

I didn't see anything obvious in your paper or the front-end that might provide this information. I've started trying to parse the back-end, but not knowing C makes it a little difficult. It seems to be the case that estimating covariance from computations of attitude is both possible and has been done before, but it's not immediately clear to me how to proceed. Hence, my post here, to see if you have given this question thought before and whether it is a simpler matter than I'm currently thinking it might be.

Thanks,
Cory

Andrew Tennenbaum

unread,
Sep 16, 2019, 11:17:02 PM9/16/19
to OpenStartracker

Hi!

The startracker outputs a list of stars in the body frame and the celestial frame.
For the kalman filter, this is a great place to start:


The unscented filter is, in my opinion, the easiest to use - you generate a set of 2N+1 points, with the same covariance as your measurement, centered around the measurement itself. Example:

(I apologize for the notation - I have been using matlab a lot recently and it has rotted my brain)

sigma=sqrt(POS_VARIANCE)*PIXSCALE*pi/(3600*180) %values are in calibration.txt
v=[s.x s.y s.z] %measurment
k=[eye(3)*sigma;0 0 0;-eye(3)*sigma]*sqrt(3)+repmat(v,[7,1])
k=k./sqrt(sum(k.^2,2)) %normalize
P_meas=cov(k)+eps*eye(3) %note: eps is a builtin that gives you a very small number - it's good to add this along the diagonal of the covariance matrix to account for rounding error and help with numerical stability

If you'd rather just have an attitude + an attitude covariance matrix, you can try this:


I have also put together a reference  guide on the kalman filter - mainly for my own reference, but perhaps it will be useful to you:


If there is anything that still doesn't make sense, let me know!
Reply all
Reply to author
Forward
0 new messages