Well, the main problem is that towards the end of his reign, Dom Pedro II became very withdrawn and stopped caring about whether he ruled, which is why he was reckless in pushing through the slavery ban. Perhaps you could have him die earlier, resulting in a stable transition to his son, and thus a more proactive monarch. This would probably eventually evolve into a constitutional monarchy.