|
AM263x Motor Control SDK
09.02.00
|
|
Go to the documentation of this file.
59 #include "math_types.h"
61 #include "ti_drivers_config.h"
80 #define CAL_BUF_NUM 13
86 typedef struct _HALL_Obj_
96 uint32_t timeCount[2];
111 uint16_t hallPrev[7];
118 uint32_t hallIndexNow;
119 uint16_t hallIndexPre;
120 uint16_t hallIndexBuf[CAL_BUF_NUM];
121 uint16_t hallIndexFlag;
194 const uint32_t gpioHallV,
const uint32_t gpioHallW,
195 const uint32_t gpioHallUBase,
const uint32_t gpioHallVBase,
196 const uint32_t gpioHallWBase)
233 uint32_t hallState = 0;
239 return(hallState & 0x0007);
317 if(obj->hallIndexNow != obj->hallIndexPre)
319 obj->hallIndexPre = obj->hallIndexNow;
321 if(obj->hallIndexFlag == 0)
323 obj->thetaIndexBuff[obj->hallIndexNow] = angle;
324 obj->hallIndexBuf[obj->hallIndexNow] = obj->hallIndexNow;
326 if(obj->hallIndexNow == 0x01)
328 obj->hallIndexFlag = 1;
333 obj->thetaIndexBuff[6 + obj->hallIndexNow] = angle;
334 obj->hallIndexBuf[6 + obj->hallIndexNow] = obj->hallIndexNow;
336 if(obj->hallIndexNow == 0x01)
338 obj->hallIndexFlag = 0;
342 obj->thetaCalBuff[obj->hallIndexNow] = 0.5f *
343 (obj->thetaIndexBuff[obj->hallIndexNow] +
344 obj->thetaIndexBuff[6 + obj->hallIndexNow]);
397 #define HALL_calcAngle HALL_run
399 static __attribute__((always_inline))
496 #endif //end of _HALL_H_ definition
void HALL_setAngleBuf(HALL_Handle handle, const float32_t *ptrAngleBuf)
Sets the angle buffer value for hall estimator.
uint32_t timeCountPWM
Definition: hall.h:95
float32_t speedPWM_Hz
Definition: hall.h:91
@ HALL_CALIBRATION
Definition: hall.h:75
Defines the HALL controller object.
Definition: hall.h:87
float32_t speedSwitch_Hz
Definition: hall.h:93
static float32_t HALL_getAngle_rad(HALL_Handle handle)
Gets the angle from the hall estimator, rad.
Definition: hall.h:216
uint16_t hallIndexPrev
Definition: hall.h:110
uint32_t gpioHallWBase
Definition: hall.h:108
struct _HALL_Obj_ * HALL_Handle
Defines the HALL handle.
Definition: hall.h:128
float32_t speedCAP_Hz
Definition: hall.h:90
static uint16_t HALL_getInputState(HALL_Handle handle)
Gets the hall sensors input GPIO state.
Definition: hall.h:229
uint32_t gpioHallW
Definition: hall.h:105
uint32_t gpioHallVBase
Definition: hall.h:107
float32_t capScaler
Definition: hall.h:88
static void HALL_setAngleDelta_rad(HALL_Handle handle, const float32_t thetaDelta_rad)
Sets a value to the theta offset for the hall estimator.
Definition: hall.h:279
HALL_Status_e
Definition: hall.h:72
Defines a structure for the user parameters.
Definition: userParams.h:75
uint32_t gpioHallU
Definition: hall.h:103
uint16_t hallPrev[7]
Definition: hall.h:111
void HALL_setParams(HALL_Handle handle, const USER_Params *pUserParams)
Sets the hall estimator parameters.
static void HALL_setSpeed_Hz(HALL_Handle handle, const float32_t speedHall_Hz)
Sets a value to the speed for the hall estimator.
Definition: hall.h:262
@ HALL_IDLE
Definition: hall.h:73
HALL_Handle HALL_init(void *pMemory, const size_t numBytes)
Initializes the HALL controller.
static float32_t HALL_getSpeed_Hz(HALL_Handle handle)
Gets the feedback speed from hall estimator.
Definition: hall.h:248
static void HALL_run(HALL_Handle handle, float32_t speedRef)
Definition: hall.h:400
HALL_Status_e hallStatus
Definition: hall.h:113
@ HALL_ALIGNMENT
Definition: hall.h:74
static void HALL_setForceAngleAndIndex(HALL_Handle handle, float32_t speedRef)
Sets the force angle and index for next step of the hall estimator.
Definition: hall.h:358
float32_t thetaHall_pu
Definition: hall.h:102
static void HALL_resetParams(HALL_Handle handle)
Resets the hall estimator parameters.
Definition: hall.h:167
@ HALL_RUN
Definition: hall.h:76
float32_t thetaBuff[7]
Definition: hall.h:99
float32_t thetaDelta_rad
Definition: hall.h:101
Contains the public interface for the HAL and EST modules.
uint32_t timeCount[2]
Definition: hall.h:96
uint32_t timeCountMax
Definition: hall.h:97
uint16_t hallIndex
Definition: hall.h:109
float32_t speedHall_Hz
Definition: hall.h:92
uint32_t gpioHallUBase
Definition: hall.h:106
uint16_t hallDirection
Definition: hall.h:112
uint32_t gpioHallV
Definition: hall.h:104
float float32_t
Definition: dcl_common.h:58
float32_t thetaHall_rad
Definition: hall.h:100
float32_t pwmScaler
Definition: hall.h:89
static void HALL_setGPIOs(HALL_Handle handle, const uint32_t gpioHallU, const uint32_t gpioHallV, const uint32_t gpioHallW, const uint32_t gpioHallUBase, const uint32_t gpioHallVBase, const uint32_t gpioHallWBase)
Sets GPIO for hall sensors input.
Definition: hall.h:193
static void HALL_setTimeStamp(HALL_Handle handle, const uint32_t timeStamp)
Sets a value to the time stamp for the hall estimator.
Definition: hall.h:295
uint32_t timeStampCAP
Definition: hall.h:94