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?

enter image description here

  • $\begingroup$ what happens if you run your arduino 'continuous' ? as in either don't run it discrete at all and just like the arduino power through as fast as it can, or run in microseconds...does it stablize then? $\endgroup$
    – morbo
    Aug 12 '19 at 21:58

I would change the sampling period to 0.05 sec to make sure the system is below the max period. But otherwise your analysis seems correct.

Did you notice that the system is showing underdamped behavior?

Next is to choose the type of compensator you will implement. Are you trying to place poles? Or use PD or PID? You’ve got to find a compensator that lets you add controller damping to the overall system, then conduct its analysis and implementation.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.