Best video ever. Do you think it is possible to do for a lunar orbit? Simulate a simple satellite orbit on the moon? Without perturbations, only kepler's law? Thanks man
Lunar orbit would be simple. Just change the radius of the planet you're orbiting and the mass and finally get rid of aerodynamics and the magnetic field.
Great video, I was trying to follow your code, but I have a problem with the H = I*pqr, its like it doesnt recognize pqr, very weird. Error using * Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows in the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication. Error in Satelite (line 68) H = I * pqr;
That's weird. the inertia matrix (I) is a 3x3 and pqr is the angular velocity vector at a size of 3x1 so the inner product dimensions line up just fine. You might need to run the code in debug mode to see what's going on.
How did the graph of Bx,By,Bz vs tout change (when compared to last video) ? There is no change when populating BI matrix right ? It is same as that in the IGRF video right ? I was coding these by myself after watching the playlist. And at this stage the mag field graph is not the same as the one in this video but instead same as that of previous video. Please help
I think it is because in this video the satellite can rotate which means that the body frame is changing and thus the decomposition of the magnetic field vector in that frame.
@@ganesh2516822 The inertial frame magnetic field vector will stay the same but if the angular velocity is non zero the attitude will change and thus the body frame components will change.
Hey, I'm trying to model a 3DOF (along angular axes) tetrahedral ADCS system for a CubeSat on Simulink using quaternions. To start I successfully simulated a 1DOF model but I'm struggling to generalize to 3D especially using quaternions, could you please suggest some resources regarding the same?
@@CarlosMontalvo251 No, I meant that your videos cover magnetorquer control, but I am using reaction wheels. It would be tremendously helpful if you could expand this series to include reaction wheels as well. Also, could you direct me to any similar resources where they have done what you did in this series but using reaction wheels as the actuators?
@@aryaashutoshpathak4849 Ahh. I have had numerous requests for Reaction Wheels. I am on holiday for the season so I will add this to my winter to-do list and will try and get to this asap.
Why are the magnetic field plots different from the previous video? The only thing magnetic field depends on is x, y, z coordinates, the satellite spinning shouldn't change that in any way right? even if it does, in the first case at least (where all angular velocities were 0) shouldn't it match last vid's sim? Especially at 3:03 nothing new has been added that affects the mag field sim, but it's different from last time
Not quite. In this simulation the satellite is rotating. The magnetic field you are seeing is in the body frame of the satellite. Since the satellite is rotating the reference frame changes and thus the magnetic field in that reference frame also changes.
@@CarlosMontalvo251 Just to be clear, what exactly is "magnetic field" referring to here? I assumed that it means the strength of magnetic field at the point where the centre of mass of the satellite is located at that instant, is that correct or something else?
@@CarlosMontalvo251 also, in the NED frame is the origin situated at the center of the satellite? If so how does a simple rotation matrix suffice to convert between ECi and NED? and what is the difference between NED and body frame?
@@aryaashutoshpathak4849 The ECI frame is centered at the origina of a non rotating planet. The z axis points north and the x-axis points through the equator at the prime meridian. See Figure 2 of my book github.com/cmontalvo251/LaTeX/blob/master/Aerospace_Mechanics/aerospace_mechanics.pdf The NED frame is similar to a polar coordinate frame where the NED frame is fixed to the origin of the satellite but always points north (x-axis) and the D points towards the center of the planet. Again see Figure 2. The body frame is fixed to the satellite but rotates with the satellite which means the x-axis is always pointing towards a specific face on the satellite. Transformation matrices are dicussed in Section 5 of my book. Hope that helps
I need to write down quaternion dynamics simulation using matlab script for my research as a student. Can you provide the file Satellite.m so I can use it as a reference? Thank you.
Hey man, I'm learning a lot from your videos, thanks for sharing!! I was wondering if you could help me out, I'm trying to implement a CubeSat in single axis rotational dynamics from this paper: www.malcolmdshuster.com/Pub_1992a_C_Flatland_MDS.pdf The idea is to use reaction wheels as actuator and linearize the quaternions equations to use LQG control, but I'm having a hard time trying to solve this. Later on I want to build a physical system. Any advices or other materials I can look? It would be awesome if you could make a video about this as well if you don't have another about this topic.
Hey Lucas, sorry for the late reply. If you're wanting to do single axis dynamics you really just have a 1DOF second order problem where angular acceleration = total moments / inertia in this case total moments is going to equal the torque applied from the reaction wheels. I discuss a bit about reaction wheels in my SpaceFlight mechanics text github.com/cmontalvo251/LaTeX/blob/master/SpaceFlight_Mechanics_Montalvo/space_flight_mechanics.pdf And I think I have a quick 1DOF reaction wheel example here github.com/cmontalvo251/MATLAB/tree/master/CubeLAB/Reaction_Wheels Not sure if it works. It's been a while since I coded that in MATLAB
Just passed by to say thanks for the vids helped me out wrapping my brain around the whole Q-angle transforms
Best video ever. Do you think it is possible to do for a lunar orbit?
Simulate a simple satellite orbit on the moon? Without perturbations, only kepler's law?
Thanks man
Lunar orbit would be simple. Just change the radius of the planet you're orbiting and the mass and finally get rid of aerodynamics and the magnetic field.
Great Man!! Can you share the pdf file ??
github.com/cmontalvo251/MATLAB/blob/master/SpaceFlight_Mechanics_Montalvo/space_flight_mechanics.pdf
It's in here now github.com/cmontalvo251/LaTeX
Great video, I was trying to follow your code, but I have a problem with the H = I*pqr, its like it doesnt recognize pqr, very weird.
Error using *
Incorrect dimensions for matrix multiplication. Check that the number of columns in the first matrix matches the number of rows
in the second matrix. To operate on each element of the matrix individually, use TIMES (.*) for elementwise multiplication.
Error in Satelite (line 68)
H = I * pqr;
That's weird. the inertia matrix (I) is a 3x3 and pqr is the angular velocity vector at a size of 3x1 so the inner product dimensions line up just fine. You might need to run the code in debug mode to see what's going on.
@@CarlosMontalvo251 Will do, ty!
How did the graph of Bx,By,Bz vs tout change (when compared to last video) ? There is no change when populating BI matrix right ? It is same as that in the IGRF video right ? I was coding these by myself after watching the playlist. And at this stage the mag field graph is not the same as the one in this video but instead same as that of previous video. Please help
I think it is because in this video the satellite can rotate which means that the body frame is changing and thus the decomposition of the magnetic field vector in that frame.
@@CarlosMontalvo251 But BI is taken with respect to inertial frame so, the change in angular velocity is not supposed to affect BI. Isn't it ?
@@ganesh2516822 The inertial frame magnetic field vector will stay the same but if the angular velocity is non zero the attitude will change and thus the body frame components will change.
@@CarlosMontalvo251 Ok thank you for your reply sir
can you please show how you gave the earth image to the sphere in the matlab? Many thanks.
ruclips.net/video/djYowG_ITwk/видео.html
@@CarlosMontalvo251 Thank you so much Sir.
Hey, I'm trying to model a 3DOF (along angular axes) tetrahedral ADCS system for a CubeSat on Simulink using quaternions. To start I successfully simulated a 1DOF model but I'm struggling to generalize to 3D especially using quaternions, could you please suggest some resources regarding the same?
What do you mean? Is the software I explained above not suitable for what you're doing?
@@CarlosMontalvo251 No, I meant that your videos cover magnetorquer control, but I am using reaction wheels. It would be tremendously helpful if you could expand this series to include reaction wheels as well. Also, could you direct me to any similar resources where they have done what you did in this series but using reaction wheels as the actuators?
@@aryaashutoshpathak4849 Ahh. I have had numerous requests for Reaction Wheels. I am on holiday for the season so I will add this to my winter to-do list and will try and get to this asap.
@@CarlosMontalvo251 I cannot overstate how amazing that would be. Will be looking forward eagerly. Thanks a ton.
Why are the magnetic field plots different from the previous video? The only thing magnetic field depends on is x, y, z coordinates, the satellite spinning shouldn't change that in any way right? even if it does, in the first case at least (where all angular velocities were 0) shouldn't it match last vid's sim?
Especially at 3:03 nothing new has been added that affects the mag field sim, but it's different from last time
Not quite. In this simulation the satellite is rotating. The magnetic field you are seeing is in the body frame of the satellite. Since the satellite is rotating the reference frame changes and thus the magnetic field in that reference frame also changes.
@@CarlosMontalvo251 Just to be clear, what exactly is "magnetic field" referring to here? I assumed that it means the strength of magnetic field at the point where the centre of mass of the satellite is located at that instant, is that correct or something else?
@@CarlosMontalvo251 also, in the NED frame is the origin situated at the center of the satellite? If so how does a simple rotation matrix suffice to convert between ECi and NED?
and what is the difference between NED and body frame?
@@aryaashutoshpathak4849 The ECI frame is centered at the origina of a non rotating planet. The z axis points north and the x-axis points through the equator at the prime meridian. See Figure 2 of my book github.com/cmontalvo251/LaTeX/blob/master/Aerospace_Mechanics/aerospace_mechanics.pdf
The NED frame is similar to a polar coordinate frame where the NED frame is fixed to the origin of the satellite but always points north (x-axis) and the D points towards the center of the planet. Again see Figure 2.
The body frame is fixed to the satellite but rotates with the satellite which means the x-axis is always pointing towards a specific face on the satellite.
Transformation matrices are dicussed in Section 5 of my book. Hope that helps
@@CarlosMontalvo251 understood now. Thank you!!
I need to write down quaternion dynamics simulation using matlab script for my research as a student. Can you provide the file Satellite.m so I can use it as a reference? Thank you.
Absolutely. It's all in here. github.com/cmontalvo251/MATLAB/tree/master/ADCS_Seminar_Series
@@CarlosMontalvo251 page not found :/
@@aryaashutoshpathak4849 Terribly sorry! I moved all my repos. github.com/cmontalvo251/aerospace/tree/main/adcs_seminar_series
If orbiting in 1 year, how to write code?
Just increase the time to 1 year *365 days * 24 hours * 3600 seconds
@@CarlosMontalvo251 And I have a short question where is increase time to orbit for year?
@@aphisarathammachak9536 It's lines 56-60
period = 2*pi/sqrt(mu)*semi_major^(3/2);
number_of_orbits = 12;
tfinal = period*number_of_orbits;
timestep = 1;
tout = 0:timestep:tfinal;
change tfinal to whatever you want in seconds
Thank you very much
Hey man, I'm learning a lot from your videos, thanks for sharing!! I was wondering if you could help me out, I'm trying to implement a CubeSat in single axis rotational dynamics from this paper: www.malcolmdshuster.com/Pub_1992a_C_Flatland_MDS.pdf
The idea is to use reaction wheels as actuator and linearize the quaternions equations to use LQG control, but I'm having a hard time trying to solve this. Later on I want to build a physical system. Any advices or other materials I can look? It would be awesome if you could make a video about this as well if you don't have another about this topic.
Hey Lucas, sorry for the late reply. If you're wanting to do single axis dynamics you really just have a 1DOF second order problem where
angular acceleration = total moments / inertia
in this case total moments is going to equal the torque applied from the reaction wheels.
I discuss a bit about reaction wheels in my SpaceFlight mechanics text
github.com/cmontalvo251/LaTeX/blob/master/SpaceFlight_Mechanics_Montalvo/space_flight_mechanics.pdf
And I think I have a quick 1DOF reaction wheel example here github.com/cmontalvo251/MATLAB/tree/master/CubeLAB/Reaction_Wheels
Not sure if it works. It's been a while since I coded that in MATLAB
@@CarlosMontalvo251 Hello Carlos,
I will take a look in the materials, I'm sure it will be a great help. Thanks for your reply.
Regards
@@CarlosMontalvo251 what is the difference for 1DOF and what you have above?
@@hafizuddinmohdlowhim8426 1DOF is only 1 degree of freedom. This is a full 6DOF simulation of a satellite in orbit around the Earth