how to go from NED to ECI frame?

Hello! I am wondering how do you go from NED frame to ECI frame?
I got a NED frame from the WMM block but it say that the dimention of matrix multiplication is not complete.
also I got an error say that the built in fuction ecef2eci does't exist
function ECI = NEDtoECI(mu, l, NED)
DCM = [-sin(mu)*cos(l) -sin(mu)*sin(l) cos(mu) ; -sin(l) cos(l) 0 ; -cos(mu)*cos(l) -cos(mu)*sin(l) -sin(mu)];
dcmtran = DCM.';
ECEF = NED*dcmtran;
utc = [2019 1 4 12 0 0];
ECI = ecef2eci(utc,ECEF);
end

7 comentarios

Hi! did you solved it?
Khang Nguyen
Khang Nguyen el 19 de Abr. de 2023
Editada: Khang Nguyen el 19 de Abr. de 2023
Hi @Jonathan Gadiel Ramírez Martínez! I haven't touch the project for a while. But when I look back at the simulink, I had this. I remember my advisor took a look at this and say ok! so not sure if it's 100% correct. Please let me know what you think.
function ECI = NEDtoECI(mu, l, NED)
DCM = [-sin(mu)*cos(l) -sin(mu)*sin(l) cos(mu) ; -sin(l) cos(l) 0 ; -cos(mu)*cos(l) -cos(mu)*sin(l) -sin(mu)];
dcmtran = DCM.';
ned =NED.';
ECEF = ned*dcmtran;
DCM2 = [ cos(mu) sin(mu) 0; -sin(mu) cos(mu) 0; 0 0 1];
dcmtran2 = DCM.';
eci = ECEF*dcmtran2;
ECI = eci.';
end
Thanks Khang! We faced the same problem, I will look into your code, I'm trying to get the magnetic field vector for a TRIAD algorithm simulation, but I'm having problems converting from NED to an ECI, you'll see, in a playlist videos from a professor, he makes the rotation with a simple rotation matrix, but I'm not sure. If you want to check it out, here's the link to the video. https://www.youtube.com/watch?v=H1quaWy_onc&list=PL_D7_GvGz-v3mDQ9iR-cfjXsQf4DeR1_H&index=11&ab_channel=MonteCarlos from min 16:00
Hello Khang, another question, what does mu and l means in your code? latitude and longitude?
Khang Nguyen
Khang Nguyen el 20 de Abr. de 2023
Editada: Khang Nguyen el 20 de Abr. de 2023
Probally, since this project wes too long ago, I can't remember much! (I wrote this in my first year at University)
But I belive NED (North East Down frame) is a local frame which define by a possition vector in the Geocentric Coordinate. We will need to convert it into the ECEF (Earth Center Earth Fixed frame) frame and then again to the ECI (Earth Center Inertial frame).
Since ECI frame x-direction point torward the vernal equinox and ECEF x-direction point torward the Prime Meridian. Therefore, there is a time dependent component. Since the ECEF is a non-inertial reference frame and ECI is an "Inertial Frame", you will need to do some dynamic math to convert between ECEF and ECI. The code is currently assume that ECI and ECEF at a certain time, and rotate about the ECEF z-axis. This is a good approx, but to be more accurate, the z axis of both frame are slightly not align, therefore you have to rotate the y-axis by a little bit. I am happy to rewrite and update the code after my exam season.
IDK what is your background in dynamic, hope that this make sense.
Oh I see, that makes sense Khang, thank you very much!
Mehmet Ogulcan
Mehmet Ogulcan el 17 de Dic. de 2024
Hello Jonathan,
Did you solved problem ? Do you have working code for transformation NED frame to ECI frame ?
Best regards,

Iniciar sesión para comentar.

Respuestas (1)

Alan Moses
Alan Moses el 25 de Feb. de 2021

0 votos

Hi Khang,
The “ecef2eci” is part of the set of functions that require the ‘Aerospace Blockset CubeSat Simulation Library’ Add-on support package. You could download this from the Add-ons manager.
Alternatively, you may also check out the function here in the MathWorks File Exchange.
Hope it helps!

Categorías

Más información sobre View and Analyze Simulation Results en Centro de ayuda y File Exchange.

Preguntada:

el 21 de Feb. de 2021

Comentada:

el 17 de Dic. de 2024

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by