Pull request #35: am243x/am263x: rtlibs: Update documentation
Merge in PINDSW/motor_control_sdk from PINDSW-6566_update_dcl to next * commit '422e7e0522da64b4b1dbe930d62f7a37582c4ebe': am243x/am263x: rtlibs: Update documentation
This commit is contained in:
commit
af246e93a6
@ -54,79 +54,80 @@ A benchmark on R5F core has been conducted to observe the following results when
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> PI Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runPISeries</td>
|
||||
<td>49.15</td>
|
||||
<td>49</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runPIParallel</td>
|
||||
<td>50.00</td>
|
||||
<td>50</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runPISeriesTustin</td>
|
||||
<td>56.35</td>
|
||||
<td>56</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runPIParallelEnhanced</td>
|
||||
<td>62.57</td>
|
||||
<td>62</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> PI2 Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runPI2Series</td>
|
||||
<td>74.00</td>
|
||||
<td>74</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> PID Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runPIDSeries</td>
|
||||
<td>64.68</td>
|
||||
<td>65</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runPIDParallel</td>
|
||||
<td>64.84</td>
|
||||
<td>65</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> DF11 Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runDF11</td>
|
||||
<td>24.00</td>
|
||||
<td>24</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> DF13 Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runDF13</td>
|
||||
<td>43.00</td>
|
||||
<td>43</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runDF13Clamp</td>
|
||||
<td>53.00</td>
|
||||
<td>53</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> DF22 Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runDF22</td>
|
||||
<td>27.00</td>
|
||||
<td>27</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runDF22Clamp</td>
|
||||
<td>41.00</td>
|
||||
<td>41</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> DF23 Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runDF23</td>
|
||||
<td>29.00</td>
|
||||
<td>29</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runDF23Clamp</td>
|
||||
<td>45.00</td>
|
||||
<td>45</td>
|
||||
</tr>
|
||||
<tr><td colspan="2" bgcolor=#F0F0F0> PID 64bit Controller </td></tr>
|
||||
<tr>
|
||||
<td>DCL_runPIDF64Series</td>
|
||||
<td>185.14</td>
|
||||
<td>185</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>DCL_runPIDF64Parallel</td>
|
||||
<td>173.63</td>
|
||||
<td>174</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
- Ran with TI Clang Compiler v2.1.3.LTS, with -Os flag and functions in ram, obtained the average result from 600 consecutive reading of running the controller with DPL CycleCountP.
|
||||
- Actual result may vary depending on provided datasets and memory configuration.
|
||||
- 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
|
||||
|
||||
|
||||
@ -84,7 +84,6 @@ extern "C" {
|
||||
//! \code
|
||||
//! float32_t s = DCL_rand(1.0f);
|
||||
//! \endcode
|
||||
//!
|
||||
#define DCL_rand(a) (a * ((float32_t) rand() / (float32_t) (RAND_MAX >> 1) - 1.0f))
|
||||
#define DCL_randF64(a) (a * ((float64_t) rand() / (float64_t) (RAND_MAX >> 1) - 1.0L))
|
||||
|
||||
@ -94,7 +93,7 @@ extern "C" {
|
||||
#define DCL_c2Limit ((2.0f - CONST_PI) / (2.0f + CONST_PI))
|
||||
#define DCL_c2LimitF64 ((2.0L - CONST_PI_F64) / (2.0L + CONST_PI_F64))
|
||||
|
||||
/** @} */
|
||||
/** @} */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@ -86,10 +86,10 @@ typedef struct dcl_css64 {
|
||||
//! CSS pointer must be configured first
|
||||
//!
|
||||
//! \param[in] p Pointer to the controller structure
|
||||
//! \param[in] a Sample period in seconds
|
||||
//! \param[in] T Sample period in seconds
|
||||
//! \return None
|
||||
//!
|
||||
#define DCL_setControllerPeriod(p,a) ((p)->css->T = a)
|
||||
#define DCL_setControllerPeriod(p,T) ((p)->css->t_sec = T)
|
||||
|
||||
//--- Status word ------------------------------------------------------------
|
||||
|
||||
|
||||
@ -56,7 +56,7 @@ extern "C" {
|
||||
//! \details Allows controllers to be defined in terms of complex pole
|
||||
//! and zero frequencies. The common structure consists of
|
||||
//! three complex zeros, three complex poles, and a real gain.
|
||||
//! All frequencies must be specified in radians/sec. <--- TODO: Conflicting units compared with the documentation,rad/s or hz?
|
||||
//! All frequencies must be specified in radians/sec.
|
||||
//!
|
||||
typedef struct dcl_zpk3
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
|
||||
//--- Direct Form 1 - 1st order ----------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_DF11 shadow parameter set
|
||||
//! \brief Defines DCL_DF11 shadow parameter set
|
||||
//! used for updating compensator parameter
|
||||
//!
|
||||
typedef struct dcl_df11_sps
|
||||
@ -63,7 +63,7 @@ typedef struct dcl_df11_sps
|
||||
|
||||
#define DF11_SPS_DEFAULTS { 0.5f, 0.5f, 1.0f }
|
||||
|
||||
//! \brief DF11 object for storing df11 specific parameters
|
||||
//! \brief DCL_DF11 object for storing df11 specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_df11
|
||||
{
|
||||
|
||||
@ -66,7 +66,7 @@ typedef struct dcl_df13_sps {
|
||||
|
||||
#define DF13_SPS_DEFAULTS { 0.25f, 0.25f, 0.25f, 0.25f, 0.0f, 0.0f, 0.0f }
|
||||
|
||||
//! \brief DF13 object for storing df13 specific parameters
|
||||
//! \brief DCL_DF13 object for storing df13 specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_df13
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
|
||||
//--- Direct Form 2 - 2nd order ----------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_DF22 shadow parameter set
|
||||
//! \brief Defines DCL_DF22 shadow parameter set
|
||||
//! used for updating compensator parameter
|
||||
//!
|
||||
typedef struct dcl_df22_sps
|
||||
@ -65,7 +65,7 @@ typedef struct dcl_df22_sps
|
||||
|
||||
#define DF22_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f }
|
||||
|
||||
//! \brief DF22 object for storing df22 specific parameters
|
||||
//! \brief DCL_DF22 object for storing df22 specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_df22
|
||||
{
|
||||
|
||||
@ -51,7 +51,7 @@ extern "C" {
|
||||
|
||||
//--- Direct Form 2 - 3rd order ----------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_DF23 shadow parameter set
|
||||
//! \brief Defines DCL_DF23 shadow parameter set
|
||||
//! used for updating compensator parameter
|
||||
//!
|
||||
typedef struct dcl_df23_sps
|
||||
@ -67,7 +67,7 @@ typedef struct dcl_df23_sps
|
||||
|
||||
#define DF23_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f }
|
||||
|
||||
//! \brief DF23 object for storing df23 specific parameters
|
||||
//! \brief DCL_DF23 object for storing df23 specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_df23
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
|
||||
//--- Error handling ---------------------------------------------------------
|
||||
|
||||
//! \brief Defines the library enumerated error codes
|
||||
//! \brief Defines the library enumerated error codes.
|
||||
//! These will be applied as bit masks in the error handler
|
||||
//!
|
||||
typedef enum
|
||||
|
||||
@ -69,6 +69,8 @@ extern "C" {
|
||||
|
||||
#include "../dcl_common.h"
|
||||
|
||||
//! \brief Defines the data logger strcture for 32-bit float
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_fdlog
|
||||
{
|
||||
float32_t *fptr; //!< Pointer to first buffer element
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
|
||||
//--- Linear PI controller ---------------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_PI shadow parameter set
|
||||
//! \brief Defines DCL_PI shadow parameter set
|
||||
//! used for updating controller parameter
|
||||
//!
|
||||
typedef struct dcl_pi_sps
|
||||
@ -64,7 +64,7 @@ typedef struct dcl_pi_sps
|
||||
//!
|
||||
#define PI_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.0f }
|
||||
|
||||
//! \brief PI object for storing PI specific parameters
|
||||
//! \brief DCL_PI object for storing PI specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_pi
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
|
||||
//--- Linear PI2 controller --------------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_PI2 shadow parameter set
|
||||
//! \brief Defines DCL_PI2 shadow parameter set
|
||||
//! used for updating controller parameter
|
||||
//!
|
||||
typedef struct dcl_pi2_sps
|
||||
@ -64,7 +64,7 @@ typedef struct dcl_pi2_sps
|
||||
//!
|
||||
#define PI2_SPS_DEFAULTS { 1.0f, 0.0f, 1.0f, -1.0f }
|
||||
|
||||
//! \brief PI2 object for storing PI2 specific parameters
|
||||
//! \brief DCL_PI2 object for storing PI2 specific parameters
|
||||
//! PI2 - PI controller with double integrators
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_pi2
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
|
||||
//--- Linear PID controller --------------------------------------------------
|
||||
|
||||
//! \brief Defines the DCL_PID shadow parameter set
|
||||
//! \brief Defines DCL_PID shadow parameter set
|
||||
//! used for updating controller parameter
|
||||
//!
|
||||
typedef struct dcl_pid_sps
|
||||
@ -68,7 +68,7 @@ typedef struct dcl_pid_sps
|
||||
//!
|
||||
#define PID_SPS_DEFAULTS { 1.0f, 0.0f, 0.0f, 1.0f, 1.0f, 0.0f, 1.0f, -1.0f }
|
||||
|
||||
//! \brief PID object for storing PID specific parameters
|
||||
//! \brief DCL_PID object for storing PID specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_pid
|
||||
{
|
||||
|
||||
@ -49,7 +49,7 @@ extern "C" {
|
||||
|
||||
//--- Linear PID 64bit controller --------------------------------------------------
|
||||
|
||||
//! \brief Defines the shadow PID64 controller structure
|
||||
//! \brief Defines DCL_PIDF64 shadow PID64 controller structure
|
||||
//! used for updating controller parameter
|
||||
//!
|
||||
typedef struct dcl_pid64_sps {
|
||||
@ -67,7 +67,7 @@ typedef struct dcl_pid64_sps {
|
||||
//!
|
||||
#define PIDF64_SPS_DEFAULTS { 1.0L, 0.0L, 0.0L, 1.0L, 1.0L, 0.0L, 1.0L, -1.0L }
|
||||
|
||||
//! \brief PID 64bit object for storing PID specific 64bit parameters
|
||||
//! \brief DCL_PIDF64 object for storing 64bit PID specific parameters
|
||||
//!
|
||||
typedef _DCL_VOLATILE struct dcl_pidf64 {
|
||||
/* controller parameter */
|
||||
|
||||
Loading…
Reference in New Issue
Block a user