I don't have direct knowledge of how the SpaceX flight control software works, but it's almost certainly classical. A descending rocket is essentially an inverted pendulum [1] with two-axis control via gimbals in the engines, which is a pretty well-studied and solved problem in robotics (just search for "inverted pendulum robot"). Hover-slam timing is probably empirically derived and then computed based on velocity, position, and mass (again classically). High-accuracy rocket positioning systems date back to the cold war (or maybe earlier) and are definitely not ML, either. As for why it wasn't done before, the answer is mostly lack of incentive/competition. There really wasn't any reason for the launch companies to make reusable rockets when the government and commercial customers were willing to pay for non-reusable and no one else in the market showed any interest at all in developing their own.
I wouldn't say that. There were many projects with reusable stages, e.g. Space Shuttle boosters were partially reusable and the Energia rocket had a variant in development with first stage boosters landing like airplanes.
And there were number of practical problems at the time as well:
- Computers were relatively big and heavy.
- Rocket development was mostly focused on improving efficiency via higher chamber pressure, meaning that engines worked on the edge of their capabilities, which is not a great fit for reusability. It's one of a good reasons why Falcon 9's Merlin engines have the simplest open-cycle design with a relatively low chamber pressure.
- Number of launches was too small to make reusable designs economically viable (i.e. your production line would be idle for too long). Even today this number is not high enough, this is why Musk focuses on projects like Starlink to create an additional "artificial" demand for launches.
I guess the control is pretty wall tuned classical control loops but I've seen a paper on the trajectory optimisation to get down to earth while experiencing perturbation and land using minimal fuel and achieving zero velocity in 6DoF etc. Can't find the paper now unfortunately.
They understandably don't publish much. The best clues I have found are in their lead landing engineer's pre-spacex publications. This one a good one for example: http://www.larsblackmore.com/BlackmoreEtAlJGCD10.pdf
The tldr is that they find a convex approximation to the problem and use standard convex solvers to find the right inputs.
This paper[1] says that they use cvxgen[2] to generate the on-board solver code.
[1] https://en.wikipedia.org/wiki/Inverted_pendulum