Skip to main content

Active Disturbance Rejection Control (ADRC) with Tracking Differentiator

Project description

Active Disturbance Rejection Control (ADRC)

This repository contains Python, C++, MATLAB, and Simulink implementation of Active Disturbance Rejection Control with Extended State Observer (ESO), Tracking Differentiator (TD), input delay compensation, control saturation, and support for optional use of the cascaded structure.

I've summarized a comprehensive note on the theoretical background of actve disturbance rejection controller and tracking differentiators. You can find it in here (I'll add the cascaded ADRC documentation as soon as possible).

Note: The Python version on Pypi (which can be installed with pip install adrc) is currently not the latest version. This is because access to the global internet has been cut off in Iran for the past two months! I'll update that as soon as possible. For now, I highly recommend using the implementation available on Github.

Note: Important notes for the Python, C++, Matlab, and Simulink implementations are given after the introduction!

New: Cascaded ADRC is now supported for all the environments as well.


Demo

Here are some figures showing the controller in action, in presence of time-varying referece signal, input delay, input saturation, etc.

alt text

alt text

alt text

alt text


Please pay attention to the following:

Python

Note: Good news! You can install the Python implementation using

pip install adrc

You can look at the project page on Pypi for more information. (Note: I recommend using the version on Github for now until I update the Pypi version)

Note: To be able to use all the Python codes, especially the demo script, you need to have the following packages installed:

  • numpy
  • scipy (only needed for the demo)
  • matplotlib (only needed for the demo)
  • python-control (only needed for the demo)

Simulink

Discrete controller implementations are available for first and second-order systems in simulink. There is also a continuous-time implementation for second-order systems. Continuous-time first-order systems will be added as well. Please pay attention to the following:

  • The model settings in all cases is set to variable step solver. I do encourage using this option, unless there is a specfic system you are working with and you know what you are doing.
  • In discrete-time simulations, it is necessary that you change the sample time not only where you pass it to the controller, but also in the two or three (depending on the system order) delay blocks that are present in the observer block. I am looking into a way to circumvent this, but for now, you have to change them manually.
  • I have added support for first-order and second-order cascaded ADRC as well. You can compare their performance against the standard ADRC in the two simulink files.
  • The Simulink files are generated using MATLAB 2025b. If you have an older version and need the files, you can contact me to export them for you. I will add automatic support for older versions as well in the future. You can caontact me via email at mrgilak02@gmail.com, but I might not be able to respond quickly due to frequent internet shutdowns in Iran :)

MATLAB

You can take a look at this file to see how the code works.

Note: I have tried to use the same names in MATLAB, Python, and C++; however, I still feel it's necessary to add proper documentation for each. This is in the TODOs.

  1. Sample Time: Controller sample time dT can differ from simulation time step dt. The controller should be called at rate dT.
  2. Delay Compensation: Input delay is specified in seconds and internally converted to discrete steps. Delay buffer maintains control history.
  3. Initialization: Always call initialize() before step(). The controller will throw an error if used uninitialized.
  4. TD Integration: When TD is enabled, it is automatically updated within step(). Manual reference derivatives can still be provided via varargin to override TD estimates.
  5. State Estimation: Access estimated states via getEstimatedStates() for monitoring or additional processing.

TODOs

  • add proper documentation for the Python and C++ versions as well
  • add theoretical background for cascaded ADRC
  • update Pypi
  • add a script to compare MATLAB and Simulink's output for any possible differences
  • add support for multiple generations of older Simulink versions (distant future!)
  • update the project website

This repo is maintained by me. Contributions are welcome as well.

References

  1. Han, J. (2009). "From PID to Active Disturbance Rejection Control". IEEE Transactions on Industrial Electronics.
  2. Gao, Z. (2006). "Active Disturbance Rejection Control: A Paradigm Shift in Feedback Control System Design". American Control Conference.
  3. Herbst, G. (2013). "A Simulative Study on Active Disturbance Rejection Control (ADRC) as a Control Tool for Practitioners". Electronics.
  4. Zheng, Q., Gao, Z. (2010). "On Practical Applications of Active Disturbance Rejection Control". Chinese Control Conference.
  5. Madoński, R., & Herman, P. (2015). Survey on methods of increasing the efficiency of extended state disturbance observers. ISA transactions, 56, 18-27.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

adrc-1.0.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

adrc-1.0.2-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

Details for the file adrc-1.0.2.tar.gz.

File metadata

  • Download URL: adrc-1.0.2.tar.gz
  • Upload date:
  • Size: 13.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for adrc-1.0.2.tar.gz
Algorithm Hash digest
SHA256 6755d6f3febf28fd6cd672c6cba80c7d4aa224f0ef102a0c766def33ba2ee19e
MD5 11776c814c150ab8446d6f1d0d86afa0
BLAKE2b-256 cb4bfd46b4c41a0c52537ec441106e42f2192439a6b83617a91a9a7f1b6ec45c

See more details on using hashes here.

File details

Details for the file adrc-1.0.2-py3-none-any.whl.

File metadata

  • Download URL: adrc-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for adrc-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 bdbe12ab0c930f3a594c620013fba23e8fa80f4d80be83d0ddb844577a3aba53
MD5 c2bf77e25f5349bba6b80003c6876823
BLAKE2b-256 a7566b2b6522c64a46ac87464999f5a2fbfbb9b645657482c77f522d2bf64a5e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page