tl;dr Learn analog control theory, then digital control theory. Then you will be very qualified to write software for safety systems.
Control theory is the best place to start (analog) before digital control theory, but it is a lot of math.
Digital controls is a way of building discrete (sampled rather than continuous) models and systems. Almost all control systems these days are digital—-but even modern equipment like aircraft still have some analog control systems.
To write software for safety systems such as power grid control, you should understand the fundamentals and applications of digital control theory so that your requirements, design and software will be effective.