the only way to NOT become like your mother (i'm guessing that your mother and grandmother may have had some emotional problems?), is to consciously NOT be like them.
i always said i would never treat my children the way my mother treated me (and the way my grandmother treated her), and one day i realized, holy cow!, i'm just like my mom. it took conscious effort to NOT do the same things my mom did to me, to my own children.