3.8 KiB
Digital Control Library (DCL)
[TOC]
Introduction
The Sitara™ Digital Control Library (DCL) provides a suite of robust software functions for developers of digital control applications using the Texas Instruments Sitara MCU. DCL is a header-only library, and all functions in the library are provided in the form of C source-code.
The DCL contains PI,PID and "Direct Form" controller types. The former are typically used to tune properties of a transient response, while the latter are typically used to shape the open loop frequency response.
In addintion, DCL contains functions to convert controller parameters from one type to the other. As well as functions to parameterize the controller given a transfer function.
Several utility modules such as error handling, data logging are also included as a supporting module.
Features Supported
Supported controller modules (floating-point)
- Linear PI
- Linear PID
- Linear PI with double integrator
- Direct Form 1 (first order)
- Direct Form 1 (third order)
- Direct Form 2 (second order)
- Direct Form 2 (third order)
Other utility modules:
- Error Handling
- Testpoints
- Data Logging
Features Not Supported
(Compared with C2000Ware's DCL)
- Fix-point controller modules
- Non-linear PID controller
- Reference Generator and performance index
- Multi-channel data logs
Benchmark Results
A benchmark on R5F core has been conducted to observe the following results when running controller arithmetic:
| Controller Function | Cpu Cycles |
|---|---|
| PI Controller | |
| DCL_runPISeries | 49 |
| DCL_runPIParallel | 50 |
| DCL_runPISeriesTustin | 56 |
| DCL_runPIParallelEnhanced | 62 |
| PI2 Controller | |
| DCL_runPI2Series | 74 |
| PID Controller | |
| DCL_runPIDSeries | 65 |
| DCL_runPIDParallel | 65 |
| DF11 Controller | |
| DCL_runDF11 | 24 |
| DF13 Controller | |
| DCL_runDF13 | 43 |
| DCL_runDF13Clamp | 53 |
| DF22 Controller | |
| DCL_runDF22 | 27 |
| DCL_runDF22Clamp | 41 |
| DF23 Controller | |
| DCL_runDF23 | 29 |
| DCL_runDF23Clamp | 45 |
| PID 64bit Controller | |
| DCL_runPIDF64Series | 185 |
| DCL_runPIDF64Parallel | 174 |
- Ran with TI Clang Compiler v2.1.3.LTS, with -Os flag and all DCL functions inlined, obtained the average result from 600 consecutive reading of running the controller with DPL CycleCountP.
- Simulated inputs are based on arbitrary sinusoidal waves and saturation condition that roughly clamps ~50% of the time. For functions with clamp (PI,PI2,PID and DF Clamps), clock cycle varies depending on clamping condition and provided inputs.
- Actual result may vary depending on provided datasets and memory configuration. For R5F, it is recommended for users to map control loops to TCM for the best performance.
Provided Examples
The following examples has been provided to demonstrate the DCL library:
- \ref EXAMPLES_DCL_PI
- \ref EXAMPLES_DCL_DF22
Additional References
N/A
API
\ref DCL_API_MODULE