I would limit the time you spend with your dm if you want to break the cycle. I fear she will undermine all your efforts and will continue to hurt you.
I have a toxic family, and it is difficult, but I am raising my dc well, I don't expect perfection but I consider everything I do/say so that I don't slip into old habits that I notice if I am tired/stressed/ill
I have my first counselling session on Monday, I don't know why after all these years, maybe it is worth a try for you?
Leaning how to parent well, I practice simplicity parenting, but there are a huge choice of parenting ideas.
I am affectionate, kind, calm and I listen to them carefully. I try to avoid being critical and I watch my inner critic like a hawk. I make them laugh, I do discipline and not feel bad (this is good parenting in my book) and we stick to boundaries. No violence and keep shouting to a minimum.
Everyone's view is listened to.
I am sure I am making other mistakes, I look out for those.
I am closer to my dc than my dc ever was. I take that as guidance that I am doing okay. If dd is upset I try not to think I am failing, just it is a bad day.
Your dh/dp will have his own input. Schools, friends, their childhood does not start and end with just you, so although you are their main carer, there will be other people that contribute to their lives positively. I am not sure your dm is one of them, be careful she is not the same to them.
Good luck, you sound great as you are.