Live data from Hacker News

Exploring the software that flies SpaceX rockets and starships

stackoverflow.blog

51–60 of 118 posts

Re: Exploring the software that flies SpaceX rockets and starships

#51
post #36

Earlier quoted context omitted.

Makes sense from a financial standpoint too since game devs are known to be passionate enough to accept lower salaries if they can work on cool stuff. Not necessarily knocking it (not my preference), but it matches exactly what I hear from people that work there. The recruiters even say the pay is low, but you'll have "SpaceX" on your resume so it's worth it.

Also it's world changing work. The best you can do at other faang companies is click ads.

I mean...Amazon has AWS which has to be fascinating to work on (though the impression I get is not a pleasant place to work).

Re: Exploring the software that flies SpaceX rockets and starships

#52

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

That's the number of times per second the main update code runs and it has nothing to do with the number of clock cycles or instructions per second the CPU can run (other than the fact that the chip needs to be fast enough to have the update code finish before the next time it needs to start).

Re: Exploring the software that flies SpaceX rockets and starships

#53

Earlier quoted context omitted.

Unlikely, they talk about 50hz and 10hz tasks. Real time OS often allow you to create threads that run at a given rate and must comolete. Like the 50hz task would have 20ms to complete.

Very likely: while(true) { ...[50hz tick tasks] if(tick%5==0) { ...[10hz tick tasks] } wait_for_next_tick(); tick++; }

Nope, more likely there are internal CPU timers which emits hardware interrupts on which the tasks are performed

Re: Exploring the software that flies SpaceX rockets and starships

#54
post #33

Is it possible for a programmer with the relevant experience to apply for a role at spacex? Maybe as a consultant/contractor on non sensitive software ?

If your mention of "non sensitive software" means you're looking for a position that isn't covered by ITAR, that's not possible. Even the people working in the SpaceX cafeteria are covered by ITAR.

Re: Exploring the software that flies SpaceX rockets and starships

#55

Earlier quoted context omitted.

Unlikely, they talk about 50hz and 10hz tasks. Real time OS often allow you to create threads that run at a given rate and must comolete. Like the 50hz task would have 20ms to complete.

Very likely: while(true) { ...[50hz tick tasks] if(tick%5==0) { ...[10hz tick tasks] } wait_for_next_tick(); tick++; }

If they are rolling their own os or are using microcontrollers sure, but if they are using a safety critical rtos like vxworks or integrity then it has rate monotonic scheduling built in using os threads.

Re: Exploring the software that flies SpaceX rockets and starships

#56
post #52

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

That's the number of times per second the main update code runs and it has nothing to do with the number of clock cycles or instructions per second the CPU can run (other than the fact that the chip needs to be fast enough to have the update code finish before the next time it needs to start).

Exactly this. A chip running at 50hz would never be able to run a task 50 times per second when it's only executing 50 instructions per second.

Re: Exploring the software that flies SpaceX rockets and starships

#57

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

If I understood it correctly, they’re not talking about a chip literally running at 50Mhz. They’re talking about polling a sensor in a loop running on a 50Mhz timer. The processor doing that is certainly running at a much higher clock frequency

Re: Exploring the software that flies SpaceX rockets and starships

#58

are the 50hz chips manufactured at 50hz ? or are they downclocked to 50hz. why cant you use higher clocked speeds ? like even 500 mhz, etc ? is there something special about 10 and 50hz ?

Chips have internal timers which can be configured programmatically so they emit hardware interrupt in specified time intervals. When the interrupt is emitted, CPU jumps to the method which executes the certain program. After that it goes idle, waiting for the next cycle.

Re: Exploring the software that flies SpaceX rockets and starships

#59

Earlier quoted context omitted.

Very likely: while(true) { ...[50hz tick tasks] if(tick%5==0) { ...[10hz tick tasks] } wait_for_next_tick(); tick++; }

Nope, more likely there are internal CPU timers which emits hardware interrupts on which the tasks are performed

I guess I should also say at the bottom of those while loops there’s always some wait function attached to a timer

Re: Exploring the software that flies SpaceX rockets and starships

#60
post #2

The article is a bit light on technical details, but the following is noteworthy: > Flight software for rockets at SpaceX is structured around the concept of a control cycle. “You read all of your inputs: sensors that we read in through an ADC, packets from the network, data from an IMU, updates from a star tracker or guidance sensor, commands from the ground,” explains Gerding. “You do some processing of those to de…

> Wow, sounds an awful lot like a typical event loop from a game engine.

I coulda sworn I recall John Carmack making a similar comparison when he was working on Armadillo Aerospace, but implying that rockets were actually a bit simpler.

Apparently I misrecalled...

https://twitter.com/id_aa_carmack/status/557223985977765890?...

Post reply on HN