Implementing PID on a Microcontroller: Important Considerations and Tips

implementing pid on a microcontroller n.w
1 / 25
Embed
Share

Explore the essential aspects of implementing PID control on a microcontroller, including the PID equation, sample time considerations, handling derivative kick, on-the-fly tuning changes, and mitigating integrator windup. Learn how to address common challenges efficiently in your mechatronics engineering projects.

  • Microcontroller
  • PID Control
  • Mechatronics
  • Engineering Design

Uploaded on | 0 Views


Download Presentation

Please find below an Image/Link to download the presentation.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.

You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.

The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.

E N D

Presentation Transcript


  1. Implementing PID on a microcontroller BJ Furman ME 190 Mechatronics Engineering Design 11NOV2015 (adapted from: http://brettbeauregard.com/blog/2011/04/improving-the-beginners-pid-introduction/)

  2. PID equation Figure from Matlab Help (Designing PID Controllers with the PID Tuner) Parallel form u= = r(t) y(t) Standard form ??=? let ??= ? ??= ??? ?? ? ?????? = ? ? ? +1 ??(?) ?? u= ? ? ?? +?? ?? 0

  3. Important considerations o Sample Time o Derivative Kick o On-The-Fly Tuning Changes o Reset Windup Mitigation o On/Off (Auto/Manual) o Initialization (bump-less transfer) o Controller Direction

  4. (Way too) simple algorithm

  5. Sample Time o Need to call at a regular interval o Use millis() or an interrupt (cont.)

  6. Sample Time, cont.

  7. Derivative Kick The problem ? ?????? = ? ? ? +1 ??(?) ?? ? ? ?? +?? ?? 0 t ( ) t ( ) t ( ) de dr dy = dt r(t) dt dt if constant is t ( ) t ( ) de dy = 0 dt dt Derivative Spikes t ( ) t ( ) de dy = dt dt

  8. Derivative Kick, cont.

  9. Derivative Kick, cont.

  10. On-the-fly tuning changes When things go bump

  11. On-the-fly tuning changes, cont. Calculate the contribution for the integral term differently: Before After

  12. On-the-fly tuning changes, cont.

  13. Integrator windup The problem

  14. Integrator windup, cont.

  15. Integrator windup, cont. (same as before)

  16. Integrator windup, cont. The result

  17. On/Off (automatic or manual) The problem

  18. On/Off, cont.

  19. On/Off, cont. (same as before)

  20. Initialization The problem

  21. Initialization, cont. (same as before)

  22. Initialization, cont. Bumpless transfer

  23. Direction The problem: should an increase in y (the output) lead to an increase or a decrease in the manipulating variable (u, the output of the controller)? Direct acting (Kp, Ki, Kd should be positive) Reverse acting (Kp, Ki, Kd should be negative)

  24. Direction, cont.

  25. Direction, cont. (same as before)

More Related Content