I wrote firmware (~20kLocs) for a power (electrical) supply that's part of one such power train. This kind of development is very demanding, because you can't afford to leave any bugs in your program but at the same time you're always shipping late because of tight schedules and often blurry specifications. On top of that hardware and software development cycles are concurrent, so no target hardware available when yo…
Can you do an AMA? I would love to hear more!
If you'd like to read more about this kind of systems, this document could be a starting point: http://www.ti.com/lit/ml/slup232/slup232.pdf
It sums up pretty well the stakes and technical challenges with digital power supplies.