In ladder, I have a few build orders down that get my second factory comfortably up-and-running. Between my second factory and my first t2 pgen, however, I seem to always either overbuild or underbuild power, or build the right amount, but too fast or too slow. When I watch replays where I lose, it is almost always power-related (too much power = not enough mass in tanks; too little power = can't build things fast enough).
I know the basic maths like a t1 land factory needs 1 t1 pgen, a t1 air factory needs 3 t2 pgens (building a transport needs 5), 1 engineer building needs 1 t1 pgen, and so on. However, even counting in my head ("okay, I'm going to end up with 5 land factories and two air factories, that's 11 t1 pgens"), it still doesn't work out. I often don't assign the right amount of engies at the right time, then end up stalling while trying to catch up on pgens, then end up with too many pgens.
Any advice on how to get it just right (besides "practice")? Is it really just something the pros have a feel for after their second factory, or is there some way to count or plan it out that I'm missing?