Cascade PI control of an inverted pendulum using C# with knowledge base