I'm trying to design a compensator for a pendulum type plant with arduino mega. As you can see from the picture, the system bandwidth is 9 rad/sec.
I calculated the sampling time as ws=10*wb=90, so, max Ts=2*pi/90 = 0.07 sec. and I select Ts=0.1s.
Then I discretize my continuous compensator with this sampling time. I setup arduino with 0.1s sampling time and feedback my controller with a sensor which has 0.1s sampling time.
But it does not stabilize the system.
The plant's transfer function is OK but Im not sure with the system delay time, code execution time and I do not know how to experimentally measure them.
what kinds of improvements do I need to make?