mirror of
https://gitlab.com/Anson-Projects/projects.git
synced 2025-06-16 06:56:46 +00:00
47 lines
15 KiB
JSON
47 lines
15 KiB
JSON
[
|
||
{
|
||
"path": "posts/2021-04-14-iss-eclipse-determination/",
|
||
"title": "ISS Eclipse Determination",
|
||
"description": "Determining how much sunlight a body orbiting a planet is receiving.",
|
||
"author": [
|
||
{
|
||
"name": "Anson Biggs",
|
||
"url": "https://ansonbiggs.com"
|
||
}
|
||
],
|
||
"date": "2021-05-01",
|
||
"categories": [
|
||
"Julia",
|
||
"Astrodynamics"
|
||
],
|
||
"contents": "\nDetermining the eclipses a satellite will encounter is a major driving factor when designing a mission in space. Thermal and power budgets have to be made with the fact that a satellite will periodically be in the complete darkness of space with no solar radiation to power the solar panels and keep the spacecraft from freezing.\nWhat is an Eclipse\nGeometry of an EclipseThe above image is a simple representation of what an eclipse is. You’ll notice there is the Umbra which is complete darkness, then the Penumbra which is a shadow of varying darkness, and then the rest of the orbit is in complete sunlight. For this example I will be using the ISS which has a very low orbit so the Penumbra isn’t much of a problem. You can tell by looking at the diagram that higher altitude orbits would spend more time in the Penumbra.\nBody Radius’s and Position VectorsHere is a more detailed view of the eclipse that will make it easier to explain the code. There are 2 Position vectors and 2 radius’s that need to be known for simple eclipse determination. There are more advanced cases where the atmosphere of the body your orbiting can greatly affect the Umbra and Penumbra, and other bodies could also potentially block the Sun, but for this example we will keep it simple since those have very little affect for the ISS’s orbit. Rsun and Rbody are the radius’s of the Sun and Body (In this case Earth) respectively. r_sun_body is a vector from the center of the Sun to the center of the target body. For this example I will only be using one vector, but for more rigorous eclipse determination its important to calculate this at least once a day since it does significantly change over the course of a year. The reason that I am ignoring it at the moment is because there is currently no good way to calculate Ephemerides in Julia but the package is being worked on so I may revisit this and do a more rigorous analysis in the future. r_body_sc is a position vector from the center of the body being orbitted, to the center of our spacecraft.\nThe Code\n\n\nShow code\nusing Unitful\nusing LinearAlgebra\nusing SatelliteToolbox\nusing Plots\nusing Colors\ntheme(:ggplot2)\n\nIn order to get the orbit for the ISS I used a Two-Line Element which is a data format for explaining orbits. the US Joint Space Operations Center makes these widely available, but https://live.ariss.org/tle/ makes the TLE for the ISS way more accessible (“ARISS TLE,” n.d.). The Julia Package SatelliteToolbox.jl makes it super easy to turn a TLE into an orbit that can be propagated. Simply putting the TLE in a string and using the tle string macro like below and now we have access to the information to start making our ISS orbit.\n\nISS = tle\"\"\"\nISS (ZARYA)\n1 25544U 98067A 21103.84943184 .00000176 00000-0 11381-4 0 9990\n2 25544 51.6434 300.9481 0002858 223.8443 263.8789 15.48881793278621\n\"\"\"\n1-element Vector{TLE}:\n TLE: ISS (ZARYA) (Epoch = 2021-04-13T20:23:10.911)\n\nNow that we have the TLE we can pass that into SatelliteToolbox’s orbit propagator. Before we can propagate the orbit we need to have a range of time steps to pass into the propagator. The TLE gives the mean motion, n, which is the revolutions per day so using that we can calculate the amount of time required for one orbit which is all that were worried about for this analysis. The propagator returns a tuple containing the Orbital elements, a position vector with units meters, and a velocity vector with units meters per second. For this analysis were only worried about the position vector.\n\nISS[1].n\n\n\norbit = init_orbit_propagator(Val(:twobody), ISS[1]);\ntime = 0:0.1:((24 / ISS[1].n) .* 60 * 60); # ISS[1].n gives the mean motion, or orbits per day.\no, r, v = propagate!(orbit, time);\n\nNow we just need way to use the radii and vectors discussed earlier to determine if the ISS is in the penumbra or umbra. This is a lot of pretty basic trigonometry and vector math.\nadd more discussion about the math\n\nfunction sunlight(Rbody, r_sun_body, r_body_sc)\n Rsun = 695_700u\"km\"\n \n hu = Rbody * norm(r_sun_body) / (Rsun - Rbody)\n \n θe = acos((r_sun_body ⋅ r_body_sc) / (norm(r_sun_body) * norm(r_body_sc)))\n\n θu = atan(Rbody / hu)\n du = hu * sin(θu) / sin(θe + θu)\n\n θp = π - atan(norm(r_sun_body) / (Rsun + Rbody))\n dp = Rbody * sin(θp) / cos(θe - θp)\n\n S = 1\n if (θe < π / 2) && (norm(r_body_sc) < du)\n S = 0\n end\n if (θe < π / 2) && ((du < norm(r_body_sc)) && (norm(r_body_sc) < dp))\n S = (norm(r_body_sc .|> u\"km\") - du) / (dp - du) |> ustrip\n end\n\n return S\nend\n\nThen we can pass all the values we’ve gathered into the function we just made.\n\nS = r .|> R -> sunlight(6371u\"km\", [0.5370, 1.2606, 0.5466] .* 1e8u\"km\", R .* u\"m\");\n\nPlotting the Results\nThe sunlight function returns values from 0 to 1, 0 being complete darkness, 1 being complete sunlight, and anything between being the fraction of light being received. Again since the ISS has a very low orbit, the amount of time spend in the penumbra is almost insignificant.\n\n\nShow code\n# Get fancy with the line color. \nlight_range = range(colorant\"black\", stop = colorant\"orange\", length = 101);\nlight_colors = [light_range[unique(round(Int, 1 + s * 100))][1] for s in S];\n\nplot(\n LinRange(0, 24, length(S)),\n S .* 100,\n linewidth = 5,\n legend = false,\n color = light_colors,\n);\n\nxlabel!(\"Time (hr)\");\nylabel!(\"Sunlight (%)\");\ntitle!(\"ISS Sunlight Over a Day\")\n\n\nFigure 1: ISS Sunlight\n\n\n\nLooking at the plot its pretty easy to see by the vertical transition from 0% to 100% that the time in the penumbra is limited, but almost counterintutively it also looks like the ISS gets more sunlight than it does darkness. Using the raw sunlight data we can actually calculate almost exactly how much time is spent in each region.\nTime in Sun:\n\nsun = length(S[S.==1])/length(S) * 100\n62.03323593209401\n\nTime in Darkness:\n\numbra = length(S[S.==0])/length(S) * 100\n37.64408511553699\n\nTime in Penumbra:\n\npenumbra = 100 - umbra - sun\n0.322678952369003\n\nThe ISS spends about 62% of its time in the sun, this is because if you go back and reference the diagram at the beginning of this post you can see that the umbra is actually a cone. This is mainly due to the fact that the Sun is massive compared to the Earth, but this effect is also stronger with orbits of higher altitudes.\n\n\n\n“ARISS TLE.” n.d. Amateur Radio on the International Space Station. https://live.ariss.org/tle/.\n\n\n\n\n",
|
||
"preview": "posts/2021-04-14-iss-eclipse-determination/preview.png",
|
||
"last_modified": "2021-05-03T21:23:45-07:00",
|
||
"input_file": {},
|
||
"preview_width": 1292,
|
||
"preview_height": 703
|
||
},
|
||
{
|
||
"path": "posts/2021-04-01-air-propulsion-simulation/",
|
||
"title": "Air Propulsion Simulation",
|
||
"description": "Simulating the performance of an air propulsion system as an alternative to solid rocket motors.",
|
||
"author": [
|
||
{
|
||
"name": "Anson Biggs",
|
||
"url": "https://ansonbiggs.com"
|
||
}
|
||
],
|
||
"date": "2021-04-01",
|
||
"categories": [
|
||
"Julia",
|
||
"Capstone"
|
||
],
|
||
"contents": "\nFor Capstone my team was tasked with designing a system capable of moving mining equipment and materials around the surface of the Moon using a propulsive landing. The system had to be tested on Earth with something feasible for our team to build in 2 semesters. One of the first considerations my capstone advisor wanted was to test the feasibility of an air propulsion system instead of the obvious solution that of using solid rocket motors. This document is just napkin math to determine if the system is even feasibly and is not meant to be a rigorous study of an air propulsion system that would easily keep a capstone team busy by itself.\n\n\nShow code\nusing Plots\ntheme(:ggplot2); # In true R spirit\n\nusing Unitful\nusing DataFrames\nusing Measurements\nusing Measurements: value, uncertainty\nusing CSV\n\nThe Simulation\nI chose an off-the-shelf paintball gun tank for the pressure vessel. The primary consideration was the incredible pressure to weight ratio, and the fact that it is designed to be bumped around would be necessary for proving the safety of the system further into the project.\n\n# Tank https://www.amazon.com/Empire-Paintball-BASICS-Pressure-Compressed/dp/B07B6M48SR/\nV = (85 ± 5)u\"inch^3\"\nP0 = (4200.0 ± 300)u\"psi\"\nWtank = (2.3 ± 0.2)u\"lb\"\nPmax = (250 ± 50)u\"psi\" # Max Pressure that can come out the nozzle\n\nThe nozzle diameter was changed until the air prop system had a burn time similar to a G18ST rocket motor. The propulsion system’s total impulse is not dependant on the nozzle diameter, so this was just done to make it plot nicely with the rest of the rocket motors since, at this time, it is unknown what the optimal thrust profile is.\n\n# Params\nd_nozzle = ((1 // 18) ± 0.001)u\"inch\"\na_nozzle = (pi / 4) * d_nozzle^2\n\nThese are just universal values for what a typical day would look like during the summer in Northern Arizona. (Çengel and Boles 2015)\n\n# Universal Stuff\nP_amb = (1 ± 0.2)u\"atm\"\nγ = 1.4 ± 0.05\nR = 287.05u\"J/(kg * K)\"\nT = (300 ± 20)u\"K\"\n\nThe actual simulation is quite simple. The basic idea is that using the current pressure, you can calculate \\(\\dot{m}\\), which allows calculating the Thrust, and then you can subtract the current mass of air in the tank by \\(\\dot{m}\\) and recalculate pressure using the new mass then repeat the whole process.\nThe bulk of the equations in the simulation came from (Çengel and Boles 2015), while the Thrust and \\(v_e\\) equations came from (Sutton and Biblarz 2001, eq: 2-14).\n\\[ T = \\dot{m} \\cdot v_\\text{Exit} + A_\\text{Nozzle} \\cdot (P - P_\\text{Ambient}) \\]\nThe initial pressure difference is 4190.0 ± 300.0 psi, which is massive, so the area of the nozzle significantly alters the thrust profile. The paintball tanks come with pressure regulators, in our case, 800 psi which is still a huge number compared to atmospheric pressure. While the total impulse of the system doesn’t change with different nozzle areas, the peak thrust and burn time vary greatly. One of the benefits of doing air propulsion and the reason it was even considered so seriously is that it should be possible to change the nozzle diameter in flight, allowing thrust to be throttled, making controlled landing easier to control.\n\ndf = let\nt = 0.0u\"s\"\nP = P0 |> u\"Pa\"\nM = V * (P / (R * T)) |> u\"kg\"\nts = 1u\"ms\"\ndf = DataFrame(Thrust=(0 ± 0)u\"N\", Pressure=P0, Time=0.0u\"s\", Mass=M)\n while M > 0.005u\"kg\"\n # Calculate what is leaving tank\n P = minimum([P, Pmax])\n ve = sqrt((2 * γ / (γ - 1)) * R * T * (1 - P_amb / P)^((γ - 1) / γ)) |> u\"m/s\"\n ρ = P / (R * T) |> u\"kg/m^3\"\n ṁ = ρ * a_nozzle * ve |> u\"kg/s\"\n \n Thrust = ṁ * ve + a_nozzle * (P - P_amb) |> u\"N\"\n \n # Calculate what is still in the tank\n M = M - ṁ * ts |> u\"kg\"\n P = (M * R * T) / V |> u\"Pa\"\n t = t + ts\n \n df_step = DataFrame(Thrust=Thrust, Pressure=P, Time=t, Mass=M)\n append!(df, df_step)\n end\n df\nend\n\nAnalysis\nBelow in figure 1, the result of the simulation is plotted. Notice the massive error once the tank starts running low. This is because the calculation for pressure has a lot of very uncertain variables. This is primarily due to air being a compressible fluid, making this simulation challenging to do accurately. The thrust being below 0 N might not make intuitive sense, but it’s technically possible for the pressure to compress, leaving the inside of the rocket nozzle with a pressure that’s actually below atmospheric pressure. The effect would likely last a fraction of a second, but the point stands that this simulation is wildly inaccurate and only meant to get an idea of what an air propulsion system is capable of.\n\n\nShow code\n\nthrust_values = df.Thrust .|> ustrip .|> value;\nthrust_uncertainties = df.Thrust .|> ustrip .|> uncertainty;\n\nair = DataFrame(Thrust=thrust_values, Uncertainty=thrust_uncertainties, Time=df.Time .|> u\"s\" .|> ustrip);\n\n\nplot(df.Time .|> ustrip, thrust_values, \n title=\"Thrust Over Time\", \n ribbon=(thrust_uncertainties, thrust_uncertainties), \n fillalpha=.2,label=\"Thrust\",\n xlabel=\"Time (s)\", \n ylabel=\"Thrust (N)\",\n size = (1200, 800),\n )\n\n\nFigure 1: Air Proplsion Simulation\n\n\n\nIn Figure 2, the air propulsion simulation is compared to commercially available rocket motors. This early in the project, we have no idea whether short burns or longer burns are ideal for a propulsive landing, so the air propulsion system was compared to a variety of different motors with unique profiles.\n\n\nShow code\n\nf10 = CSV.read(\"AeroTech_F10.csv\", DataFrame);\nf15 = CSV.read(\"Estes_F15.csv\", DataFrame);\ng8 = CSV.read(\"AeroTech_G8ST.csv\", DataFrame);\n\n\nplot(air.Time, air.Thrust, label=\"Air Propulsion\", fillalpha=.1, legend=:topleft, size = (1200, 800));\n\nfor (d, l) in [(f10, \"F10\"), (f15, \"F15\"), (g8, \"G8ST\")]\n plot!(d[!,\"Time (s)\"], d[!, \"Thrust (N)\"], label=l);\nend\n\ntitle!(\"Propulsion Comparison\");\nxlabel!(\"Time (s)\");\nylabel!(\"Thrust (N)\")\n\n\nFigure 2: Rocket Motor Data: (Coker, n.d.)\n\n\n\nIn the end, the air propulsion system’s performance has a very impressive total impulse and, with more time and resources, could be a serious option for a propulsive landing on Earth. One of the largest abstractions from the Moon mission that the mission here on Earth will have to deal with is the lack of Throttling engines since any propulsion system outside of model rocket motors is well beyond the scope of this Capstone.\nFuture Work\nAfter determining that solid model rocket motors are the best option for the current mission scope, the next step is determining what motor to use. There are many great options, and deciding what thrust profile is ideal may have to wait until a Simulink simulation of the landing can be built so that the metrics of each motor can be constrained more. Instead of throttling motors, the current working idea is that thrust vector control may be a way to squeeze a little more control out of a solid rocket motor. Thrust Vector Control will undoubtedly be challenging to control, so another essential piece that needs exploring is whether an LQR controller is feasible or if a PID controller is accurate enough to control our system.\n\n\n\nCoker, John. n.d. “Rocket Motor Data.” https://www.thrustcurve.org/.\n\n\nÇengel, Yunus A., and Michael A. Boles. 2015. Thermodynamics: An Engineering Approach. Eighth edition. New York: McGraw-Hill Education.\n\n\nSutton, George P., and Oscar Biblarz. 2001. Rocket Propulsion Elements. 7th ed. New York: John Wiley & Sons.\n\n\n\n\n",
|
||
"preview": "posts/2021-04-01-air-propulsion-simulation/air-propulsion-simulation_files/figure-html5/unnamed-chunk-6-J1.png",
|
||
"last_modified": "2021-05-03T19:31:26-07:00",
|
||
"input_file": {},
|
||
"preview_width": 1200,
|
||
"preview_height": 800
|
||
}
|
||
]
|