![Logo](ti_logo.svg) |
AM263x Motor Control SDK
09.02.00
|
|
Go to the documentation of this file.
50 #include "../dcl_common.h"
66 #define TCM_DEFAULTS { FDLOG_DEFAULTS, FDLOG_DEFAULTS, FDLOG_DEFAULTS, 0.1, -0.1, 0, 10 }
70 typedef enum dcl_tcm_states
94 q->captFrame.dptr = q->captFrame.fptr + lead;
98 DCL_initLog(&(q->moniFrame), q->captFrame.lptr - lead + 1, lead);
115 q->captFrame.dptr = q->captFrame.fptr + q->lead - 1;
157 if ((data > q->trigMax) || (data < q->trigMin))
174 if (q->captFrame.dptr > q->captFrame.fptr)
180 if (q->leadFrame.dptr > q->leadFrame.fptr)
189 q->captFrame.fptr = q->leadFrame.fptr;
190 q->captFrame.dptr = q->captFrame.fptr;
218 rlt += fabs(*(elog->dptr++)) * tim;
243 rlt += fabs(*(elog->dptr++));
268 err = *(elog->dptr++);
284 #endif // _DCL_TCM_H_
DCL_FDLOG captFrame
Capture data frame.
Definition: dcl_tcm.h:57
@ TCM_COMPLETE
Full data frame captured and available for read-out.
Definition: dcl_tcm.h:76
DCL_tcm_states
Enumerated TCM operating modes.
Definition: dcl_tcm.h:71
DCL_FDLOG leadFrame
Lead data frame.
Definition: dcl_tcm.h:56
float32_t trigMax
Upper trigger threshold.
Definition: dcl_tcm.h:58
@ TCM_INVALID
Buffer pointers not initialized.
Definition: dcl_tcm.h:72
float32_t trigMin
Lower trigger threshold.
Definition: dcl_tcm.h:59
_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:89
_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:183
_DCL_CODE_ACCESS void DCL_resetLog(DCL_FDLOG *buf)
Resets the data index pointer to start of buffer.
Definition: dcl_fdlog.h:135
_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:165
_DCL_CODE_ACCESS float32_t DCL_runIES(DCL_FDLOG *elog)
Computes IES performance index from a log of servo error.
Definition: dcl_tcm.h:256
_DCL_CODE_ACCESS float32_t DCL_runIAE(DCL_FDLOG *elog)
Computes IAE performance index from a log of servo error.
Definition: dcl_tcm.h:232
#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:92
_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:204
DCL_FDLOG moniFrame
Monitor data frame.
Definition: dcl_tcm.h:55
Defines the TCM structure.
Definition: dcl_tcm.h:54
#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:155
_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:112
_DCL_CODE_ACCESS uint16_t DCL_runTCM(DCL_TCM *q, float32_t data)
Runs the TCM module.
Definition: dcl_tcm.h:141
@ TCM_IDLE
Memory initialized but module not armed.
Definition: dcl_tcm.h:73
_DCL_VOLATILE struct dcl_tcm TCM
_DCL_CODE_ACCESS uint16_t DCL_armTCM(DCL_TCM *q)
Changes the TCM mode to "TCM_ARMED".
Definition: dcl_tcm.h:128
_DCL_VOLATILE struct dcl_fdlog DCL_FDLOG
@ TCM_CAPTURE
Triggered: logging data into capture frame and un-winding monitor frame.
Definition: dcl_tcm.h:75
#define _DCL_VOLATILE
Defines volatile for DCL strctures.
Definition: dcl_common.h:79
_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:60
uint32_t lead
Lead frame size in 32-bit words = trigger crossing index.
Definition: dcl_tcm.h:61
_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:206
@ TCM_ARMED
Armed: capturing monitor frame data and waiting for trigger.
Definition: dcl_tcm.h:74