 |
AM261x Motor Control SDK
10.02.00
|
|
Go to the documentation of this file.
48 #include "../dcl_common.h"
64 #define TCM_DEFAULTS { FDLOG_DEFAULTS, FDLOG_DEFAULTS, FDLOG_DEFAULTS, 0.1f, -0.1f, 0, 10 }
68 typedef enum dcl_tcm_states
92 q->captFrame.dptr = q->captFrame.fptr + lead;
96 DCL_initLog(&(q->moniFrame), q->captFrame.lptr - lead + 1, lead);
113 q->captFrame.dptr = q->captFrame.fptr + q->lead - 1;
155 if ((data > q->trigMax) || (data < q->trigMin))
172 if (q->captFrame.dptr > q->captFrame.fptr)
178 if (q->leadFrame.dptr > q->leadFrame.fptr)
187 q->captFrame.fptr = q->leadFrame.fptr;
188 q->captFrame.dptr = q->captFrame.fptr;
216 rlt += fabsf(*(elog->dptr++)) * tim;
241 rlt += fabsf(*(elog->dptr++));
266 err = *(elog->dptr++);
282 #endif // _DCL_TCM_H_
DCL_FDLOG captFrame
Capture data frame.
Definition: dcl_tcm.h:55
@ TCM_COMPLETE
Full data frame captured and available for read-out.
Definition: dcl_tcm.h:74
DCL_tcm_states
Enumerated TCM operating modes.
Definition: dcl_tcm.h:69
DCL_FDLOG leadFrame
Lead data frame.
Definition: dcl_tcm.h:54
float32_t trigMax
Upper trigger threshold.
Definition: dcl_tcm.h:56
@ TCM_INVALID
Buffer pointers not initialized.
Definition: dcl_tcm.h:70
float32_t trigMin
Lower trigger threshold.
Definition: dcl_tcm.h:57
_DCL_CODE_ACCESS void DCL_initTCM(DCL_TCM *q, float32_t *addr, uint32_t size, uint32_t lead, float32_t tmin, float32_t tmax)
Resets the TCM module: clears buffers and sets idle mode.
Definition: dcl_tcm.h:87
_DCL_CODE_ACCESS float32_t DCL_writeLog(DCL_FDLOG *buf, float32_t data)
Writes a data point into the buffer and advances the indexing pointer, wrapping if necessary....
Definition: dcl_fdlog.h:182
_DCL_CODE_ACCESS void DCL_resetLog(DCL_FDLOG *buf)
Resets the data index pointer to start of buffer.
Definition: dcl_fdlog.h:134
_DCL_CODE_ACCESS void DCL_initLog(DCL_FDLOG *buf, float32_t *addr, uint32_t size)
Assigns the buffer pointers to a memory block or array and sets the data index pointer to the first a...
Definition: dcl_fdlog.h:164
_DCL_CODE_ACCESS float32_t DCL_runIES(DCL_FDLOG *elog)
Computes IES performance index from a log of servo error.
Definition: dcl_tcm.h:254
_DCL_CODE_ACCESS float32_t DCL_runIAE(DCL_FDLOG *elog)
Computes IAE performance index from a log of servo error.
Definition: dcl_tcm.h:230
#define _DCL_CODE_ACCESS
Defines the scope of dcl functions.
Definition: dcl_common.h:63
#define DCL_getLogSize(buf)
Obtain the total size of buffer.
Definition: dcl_fdlog.h:91
_DCL_CODE_ACCESS float32_t DCL_readLog(DCL_FDLOG *buf)
Reads a data point from the buffer and then advances the indexing pointer, wrapping if necessary.
Definition: dcl_fdlog.h:203
DCL_FDLOG moniFrame
Monitor data frame.
Definition: dcl_tcm.h:53
Defines the TCM structure.
Definition: dcl_tcm.h:52
#define DCL_clearLog(buf)
Clears the buffer contents by writing 0 to all elements and resets the data index pointer to the star...
Definition: dcl_fdlog.h:154
_DCL_CODE_ACCESS void DCL_resetTCM(DCL_TCM *q)
Resets the TCM module: clears all frame buffers and sets idle mode.
Definition: dcl_tcm.h:110
_DCL_CODE_ACCESS uint16_t DCL_runTCM(DCL_TCM *q, float32_t data)
Runs the TCM module.
Definition: dcl_tcm.h:139
@ TCM_IDLE
Memory initialized but module not armed.
Definition: dcl_tcm.h:71
_DCL_CODE_ACCESS uint16_t DCL_armTCM(DCL_TCM *q)
Changes the TCM mode to "TCM_ARMED".
Definition: dcl_tcm.h:126
_DCL_VOLATILE struct dcl_fdlog DCL_FDLOG
@ TCM_CAPTURE
Triggered: logging data into capture frame and un-winding monitor frame.
Definition: dcl_tcm.h:73
#define _DCL_VOLATILE
Defines volatile for DCL strctures Flags can be defined in dcl.h or user files before including DCL l...
Definition: dcl_common.h:75
_DCL_VOLATILE struct dcl_tcm DCL_TCM
Defines a 32-bit floating-point data logger strcture and related functions.
float float32_t
Definition: dcl_common.h:58
uint32_t mode
Operating mode.
Definition: dcl_tcm.h:58
uint32_t lead
Lead frame size in 32-bit words = trigger crossing index.
Definition: dcl_tcm.h:59
_DCL_CODE_ACCESS float32_t DCL_runITAE(DCL_FDLOG *elog, float32_t prd)
Computes ITAE performance index from a log of servo error.
Definition: dcl_tcm.h:204
@ TCM_ARMED
Armed: capturing monitor frame data and waiting for trigger.
Definition: dcl_tcm.h:72