In Revenge of the Sith, how could Palpatine be sure that Anakin would show up at the right moment? Did he have a plan to save himself in case Anakin didn't show up? He had let Windu disarm him, so how did he plan to defeat Mace Windu without a lightsaber? And even if Palpatine did manage to somehow kill Mace, then how would he have completed Anakin's transformation?
Not only was Palpatine expecting an attack by the Jedi, he was practically inviting it by telling Anakin his true identity in the full knowledge that he'd almost certainly tell Windu and the Council. That all being said, there's no special indication that he was expecting Anakin to be involved in the attack, nor was he expecting to be able to immediately turn him to the Dark Side when the attack occurred.
If anything, Palpatine dramatically overestimated the threat posed by the Jedi masters (killing them easily) and dramatically underestimated the threat posed by Windu (who nearly killed him). In the final analysis, it seems most likely that Palpatine's plan was to provoke a fight with the Jedi Councillors, then shield Anakin from Order 66. The fact that Windu's 'vaapad' fighting style was so unexpectedly strong was a near-fatal setback but the fact that Anakin then killed Windu was a major boost.
At no point in the script or novelisation do we get any indication that Palpatine was anything other than cheerfully surprised when Anakin showed up.
Palpatine predicted that Anakin would arrive during his fight with Windu. Palpatine waited to allow himself to be disarmed until just as Anakin arrived so that Anakin would be faced with the choice between killing Windu or letting Palpatine die with the knowledge to save Padme (or so Anakin thought). An answer to a related question quotes the Revenge of the Sith novelization to indicate that even Mace Windu realized that Palpatine trusted Anakin to save him:
The key to final victory. Palpatine's shatterpoint. The absolute shatter-point of the Sith. The shatterpoint of the dark side itself. Mace thought, blankly astonished, Palpatine trusts Anakin Skywalker...
Palpatine trusted Anakin to kill Windu for him because Palpatine had long been working on seducing Anakin to the dark side (e.g. by telling Anakin the story of Darth Plagueis). That's why Palpatine freely revealed his Sith identity to Anakin, which precipitated the fight between Palpatine and the Jedi in the first place.
But how do we really know Palpatine had predicted Anakin's arrival ahead of time? Because he did it before, when Palpatine arranged for his "kidnapping" by Dooku. Another answer quotes the Revenge of the Sith novelization in explaining why Dooku went along with the kidnapping:
"It will be," [Dooku] said slowly, meditatively, as though he spoke only to himself, "an embarrassment to be captured by him."
The voice that answered him was so familiar that sometimes his very thoughts spoke in it, instead of in his own.
"An embarrassment you can survive, Lord Tyranus. After all, [Anakin] is the greatest Jedi alive, is he not? And have we not ensured that all the galaxy shares this opinion?"
"Quite so, my Master. Quite so."
Still, though, Dooku had some reservations. This had all come about too quickly; had Sidious thought through all the implications of this operation?
"But I must ask, my Master: is Skywalker truly the man we want?"
Palpatine predicted Anakin in particular -- not just any Jedi -- would "save" him from Dooku. This was all an elaborate ruse on Palpatine's part to tempt Anakin to the dark side by having Anakin execute Dooku, which is "not the Jedi way". But this ruse only made sense if Palpatine knew Anakin himself would defeat Dooku -- any other Jedi killing Dooku would accomplish nothing, and if Dooku was victorious Palpatine would be indefinitely "kidnapped" with no way to escape without revealing his true identity.
In much the same way, Palpatine initiated the showdown between himself and the four Jedi Masters who tried to arrest him, and he predicted that Anakin would not only arrive for the fight but save him. Palpatine did not plan to kill Windu himself -- he wanted Anakin to do it just as Anakin murdered Dooku for him. As you correctly point out, Palpatine would not have been able to turn Anakin to the dark side if Palpatine killed Windu himself -- Anakin just would have attacked Palpatine and Palpatine would have had to kill Anakin himself (or die by Anakin's hands). Palpatine needed to force Anakin to make the decision between killing Windu or losing the knowledge to save Padme -- and Palpatine correctly predicted that Anakin would do just that.